comment.html.tmpl 2.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

[% INCLUDE global/header.html.tmpl
   title = "Правила для комментариев при изменении состояния"
   style_urls = ['skins/standard/admin.css']
%]

<script type="text/javascript">
<!--
  function toggle_cell(cell) {
    if (cell.checked)
18
      cell.parentNode.className = "checked";
19
    else
20
      cell.parentNode.className = "";
21 22 23 24 25 26 27 28 29 30
  }
//-->
</script>

<p>
  Определение переходов между состояниями, требующих от пользователя 
  обязательного указания комментария.
</p>

<form id="workflow_form" method="POST" action="editworkflow.cgi">
31
<table id="workflow">
32 33 34 35 36 37 38 39 40
  <tr>
    <th colspan="2">&nbsp;</th>
    <th colspan="[% statuses.size FILTER html %]" class="title">В</th>
  </tr>

  <tr>
    <th rowspan="[% statuses.size + 2 FILTER html %]" class="title">Из</th>
    <th>&nbsp;</th>
    [% FOREACH status = statuses %]
41
      <th class="[% status.is_open ? "open-status" : "closed-status" %] center">
42 43 44 45 46 47 48 49 50
        [% display_value("bug_status", status.name) FILTER html %]
      </th>
    [% END %]
  </tr>

  [%# This defines the entry point in the workflow %]
  [% p = [{id => 0, name => "{Начальное}", is_open => 1}] %]
  [% FOREACH status = p.merge(statuses) %]
    <tr class="highlight">
51
      <th class="[% status.is_open ? "open-status" : "closed-status" %]">
52 53 54 55 56
        [% display_value("bug_status", status.name) FILTER html %]
      </th>

      [% FOREACH new_status = statuses %]
        [% IF workflow.${status.id}.${new_status.id}.defined %]
57
          <td class="[% "checked" IF workflow.${status.id}.${new_status.id} %]"
58 59 60 61 62 63
              title="[% status.name FILTER html %] -&gt; [% new_status.name FILTER html %]">
            <input type="checkbox" name="c_[% status.id %]_[% new_status.id %]"
                   id="c_[% status.id %]_[% new_status.id %]" onclick="toggle_cell(this)"
              [% " checked='checked'" IF workflow.${status.id}.${new_status.id} %]>
          </td>
        [% ELSE %]
64
          <td class="forbidden">&nbsp;</td>
65 66 67 68 69 70
        [% END %]
      [% END %]
    </tr>
  [% END %]
</table>

71
<p class="center">
72 73 74 75 76 77 78 79 80 81
  <input type="hidden" name="action" value="update_comment">
  <input type="hidden" name="token" value="[% token FILTER html %]">
  <input type="submit" id="update_comment" value="Сохранить изменения"> -
  <a href="editworkflow.cgi?action=edit_comment">Отменить изменения</a> -
  <a href="editworkflow.cgi">Переходы между состояниями</a>
</p>

</form>

[% INCLUDE global/footer.html.tmpl %]