Trac

来自Gea-Suan Lin's Wiki
Gslin讨论 | 贡献2018年2月28日 (三) 02:20的版本 →‎以前有安裝的
跳到导航 跳到搜索

Trac是一套问题追踪系统英语:Issue tracking system)。

简介

优点

  • 简单,专住在事情的记录上,而不是限制行为上。

缺点

  • 目前还是不支援Python 3。

安装

目前有安装的

除了基本安装外,还会安装这些套件:

以前有安装的

以前会安装,但现在因为自己用而没有装上:

看到的

看过但还没用过的:

设定

trac.ini

让系统吃code.jquery.com所提供的jQuery以及jQuery UI[1],稍微降低服务器的负载,另外也有机会与外部网站共用cache:

[trac]
jquery_location = https://code.jquery.com/jquery-1.12.4.min.js
jquery_ui_location = https://code.jquery.com/ui/1.12.1/jquery-ui.min.js
jquery_ui_theme_location = https://code.jquery.com/ui/1.12.1/themes/start/jquery-ui.css

site.html

templates/site.html里做了一些事情进行客制化。

CSS

  • 全部使用sans-serif字型。
  • 修正button因为CSS效果而有时会按不到的问题。
  • 针对今天到期与过期的票用不同的标示标出。
  • 将已经关掉的票变淡。
  • 让编辑区域使用等宽字型。
  • 让可用范围变宽。
    <style type="text/css">
    <!--
    body, th, tr {
        font-family: sans-serif;
    }
    input[type=button]:active, input[type=submit]:active,
    input[type=reset]:active {
        position: relative;
        top: 0;
        left: 0;
    }
    table.tickets tr.duedate_overdue {
        font-weight: bold;
    }
    table.tickets tr.duedate_today {
        border: 2px solid;
    }
    table.subtickets tr.ticket_closed, .closed.ticket {
        opacity: 0.5;
    }
    textarea {
        font-family: monospace;
    }
    #content.ticket {
        width: 78em;
    }
    -->
    </style>

JavaScript

  • 用JavaScript针对今天到期以及过期的票增加CSS。
  • 将新票里的Due Date改为零点零分零秒。
  • 将票里的attachments与modify内容展开。
  • 将日历选择器中,每周的第一天设为星期天[2]。另外允许选择其他月份的日期[2]
    <script>
    <!--
    // Run immediately.
    (function() {
        // Due date css handling
        var d = new Date();
        var today = (new Date(d.getTime() - d.getTimezoneOffset() * 60000)).toISOString().slice(0, 10);
        document.querySelectorAll('table.tickets td.due_date').forEach(function(el) {
            var due = el.innerText.trim();
            if (due < today) {
                el.parentElement.classList.add('duedate_overdue');
            } else if (due === today) {
                el.parentElement.classList.add('duedate_today');
            }
        });

        // Due date (newticket) set to 00:00:00
        if ('/newticket' === document.location.pathname) {
            var el = jQuery('#field-due_date');
            el.val(el.val().replace(/T.+Z/, 'T00:00:00Z'));
        }

        // Closed tickets handling
        jQuery('tr:has(a.closed)').addClass('ticket_closed');

        // Datepicker
        jQuery.datepicker.setDefaults({firstDay: 0, selectOtherMonths: true, showOtherMonths: true});
    })();

    // Run after content loaded.
    jQuery(function() {
        // Layout
        jQuery('#attachments').removeClass('collapsed');
        jQuery('#modify').parent().removeClass('collapsed');
    });
    //-->
    </script>

参考资料

外部链接