ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 自定Bugzilla 页面模板(转载)

自定Bugzilla 页面模板(转载)

Linux操作系统 作者:leixue0906 时间:2015-08-28 13:37:55 0 删除 编辑

转载地址:http://blog.sina.com.cn/s/blog_7d2224110101hbhd.html



自定Bugzilla 页面模板

 

因公司需要, 将bugzilla 定制成一个任务管理平台, 要求将所有的bugzilla字段替换成别的字段,将页面上多余的字段去掉,尽量简洁,跟汉化操作差不多, 如下图:

自定Bugzilla <wbr>页面模板





主要修改如下几个文件:
template/en/default/index.html.tmpl

全局更改
template/en/default/global/variables.none.tmpl

[% terms = {
  "bug" => "task",
  "Bug" => "Task",
  "abug" => "a task",
  "Abug" => "A task",
  "aBug" => "a Task",
  "ABug" => "A Task",
  "bugs" => "tasks",
  "Bugs" => "Tasks",
  "zeroSearchResults" => "No task found",
  "Bugzilla" => "GeneralServicePlatform"
  }
%]

修改以下文件后,需重新运行 checksetup.pl, 重新编译模板。
template/en/default/global/field-descs.none.tmpl

     "component_id"            => "Component ID",
     "component"               => "Sub Category",
     "content"                 => "Content",
     "creation_ts"             => "Creation date",
     "deadline"                => "Deadline",
     "delta_ts"                => "Changed",
     "dependson"               => "Depends on",
     "dup_id"                  => "Duplicate",
     "estimated_time"          => "Orig. Est.",
     "everconfirmed"           => "Ever confirmed",
     "flagtypes.name"          => "Flags",
     "keywords"                => "Keywords",
     "longdesc"                => "Comment",
     "longdescs.isprivate"     => "Comment is private",
     "newcc"                   => "CC",
     "op_sys"                  => "OS",
     "opendate"                => "Opened",
     "owner_idle_time"         => "Time Since Assignee Touched",
     "percentage_complete"     => "%Complete",
     "priority"                => "Priority",
     "product_id"              => "Category ID",
     "product"                 => "Category",
     "qa_contact"              => "Department Manager",
     "remaining_time"          => "Hours Left",
     "rep_platform"            => "Hardware",
     "reporter"                => "Reporter",
     "reporter_accessible"     => "Reporter accessible",
     "requestees.login_name"   => "Flag Requestee",
     "resolution"              => "Resolution",
     "see_also"                => "See Also",
     "setters.login_name"      => "Flag Setter",
     "setting"                 => "Setting",
     "settings"                => "Settings",
     "short_desc"              => "Summary",
     "status_whiteboard"       => "Whiteboard",
     "target_milestone"        => "Target Milestone",
     "version"                 => "Request From",
     "votes"                   => "Votes"
     "work_time"               => "Hours Worked",

以下就是对各页面局部进行修改,不需的进行注释, 主要以 <!-- --> 和 [%#  #%]为主
template/en/default/global/choose-product.html.tmpl

修改创建及修改Bug的页面
template/en/default/bug/create/create.html.tmpl
  <tr>
    <th rowspan="3">Request From:</th>
    <td rowspan="3">
      <select name="version" size="1">
        [%- FOREACH v = version %]
          <option value="[% v FILTER html %]"
            [% ' selected="selected"' IF v == default.version %]>[% v FILTER html -%]
          </option>
        [%- END %]
      </select>
    </td>

# 取消Severity

   [%# INCLUDE bug/field.html.tmpl
      bug = default, field = select_fields.bug_severity, editable = 1,
      value = default.bug_severity #%]
  </tr>

# 取消Platform
  <tr>
    [%# INCLUDE bug/field.html.tmpl
      bug = default, field = select_fields.rep_platform, editable = 1,
      value = default.rep_platform #%]
  </tr>
  <tr>
<!--
    [% INCLUDE bug/field.html.tmpl
       bug = default, field = select_fields.op_sys, editable = 1,
       value = default.op_sys %]
  </tr>
<!--
</tbody>
-->
<!--
<tbody class="expert_fields">
-->
  <tr>
    [% IF Param('usetargetmilestone') && Param('letsubmitterchoosemilestone') %]
      [% sel = { description => 'Target Milestone', name => 'target_milestone' } %]
      [% INCLUDE select %]
    [% ELSE %]
<!--
      <td colspan="2">&nbsp;</td>
-->
    [% END %]

    [% IF Param('letsubmitterchoosepriority') %]
      [% INCLUDE bug/field.html.tmpl
        bug = default, field = select_fields.priority, editable = 1,
        value = default.priority %]
    [% ELSE %]
<!--
      <td colspan="2">&nbsp;</td>
-->


template/en/default/bug/edit.html.tmpl
template/en/default/search/search-advanced.html.tmpl
template/en/default/search/search-specific.html.tmpl

比如在而面去掉Severity和Hardware:
template/en/default/search/form.html.tmpl

<!--
      <table>
        <tr>
          <th align="left">
            <label for="bug_severity">Severity</label>:
          </th>
        </tr>
        <tr valign="top">
          [% PROCESS select sel = { name => 'bug_severity',
                                    size => 7 }%]
        </tr>
      </table>
-->

<!--
      <table>
        <tr>
          <th align="left">
            <label for="rep_platform" accesskey="h"><u>H</u>ardware</label>:
          </th>
        </tr>
        <tr valign="top">
          [% PROCESS select sel = { name => 'rep_platform',
                                    size => 7 } %]
        </tr>
      </table>
-->

最后,极个别的页面用 grep -r "关键字" ./template/en/default

定制Title 的背景色和字体大小

/var/www/html/bugzilla_hw/skins/standard/global.css

    #titles {
        width: 100%;
        background-color: #404D6C; // Title 背景色
        color: #fff;
        -moz-border-radius-topleft: 5px;
        -moz-border-radius-topright: 5px;
        font-size: 110%;
        margin: 0;
        padding: 0.5em;
        vertical-align: bottom;
    }

    #titles a {
        color: #fff;
    }

    #titles p {
        margin: 0;
        padding: 0;
    }

    #titles #title {
        font-weight: bold;
        font-size: 150%; // Title 字体大小
        white-space: nowrap;
    }

    #titles #subtitle {
        font-weight: normal;
        width: 100%;
        text-align: center;
    }


//定制顶部及底部菜单背景色
/var/www/html/bugzilla_hw/skins/contrib/Dusk/global.css



#titles {
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-topright: 5px;
}

#header .links, #footer {
    background-color: #4f4747; //定制顶部及底部菜单背景色
    color: #ddd;
}

#header {
    -moz-border-radius-bottomleft: 5px;
    -moz-border-radius-bottomright: 5px;
    border: none;
}



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26845409/viewspace-1784931/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 配置ftp服务
下一篇: bugzilla安装配置
请登录后发表评论 登录
全部评论

注册时间:2012-07-26

  • 博文量
    90
  • 访问量
    389074