File: customfieldadmin_genshi.html

package info (click to toggle)
trac-customfieldadmin 0.4.0%2Bsvn18456-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 196 kB
  • sloc: python: 524; javascript: 55; makefile: 4
file content (181 lines) | stat: -rw-r--r-- 6,271 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:i18n="http://genshi.edgewall.org/i18n"
      i18n:domain="customfieldadmin">
  <xi:include href="admin.html" />
  <head>
    <title>Custom Fields Admin</title>
  </head>

  <body>

    <h2>Manage Custom Fields</h2>

    <!--! Detail view -->
    <form py:if="cf_display=='detail'" class="mod" id="addcf" method="POST">
      <fieldset>
        <legend>Modify Custom Field:</legend>
        <div class="field">
          <label>Name (cannot modify): <strong>${cfield.name}</strong></label>
        </div>
        <input name="name" value="${cfield.name}" type="hidden" />
        <input name="order" value="${cfield.order}" type="hidden" />
        <div class="field">
          <label>Type:<br />
            <select name="type" id="type">
              <option py:for="value in field_types"
                  value="${value}"
                  selected="${cfield.type==value and 'selected' or None}">
                ${value.capitalize()}</option>
            </select>
          </label>
        </div>
        <div class="field">
          <label>Label:<br />
            <input type="text" name="label" value="${cfield.label}" />
          </label>
        </div>
        <div class="field">
          <label>Default value
                  (regular text for Text, Textarea, Radio or Select):<br />
            <input type="text" name="value" value="${cfield.value}" />
          </label>
        </div>
        <div class="field">
          <label>Format (Text or Textarea):<br />
            <select name="format" id="format"></select>
          </label>
        </div>
        <div class="field">
          <fieldset class="iefix">
            <label for="options">
              Options for Radio or Select
                  (for Select, empty first line makes field optional):
            </label>
            <p>
              <textarea id="options" name="options"
                        rows="5" cols="30">${cfield.options}</textarea>
            </p>
          </fieldset>
        </div>
        <div class="field">
          <label>
            Rows: <input type="text" size="5" name="rows" id="rows" value="${cfield.rows}" />
          </label>
        </div>
        <div class="buttons">
          <input type="submit" name="save" value="${_('Save')}" />
          <input type="submit" name="cancel" value="${_('Cancel')}" />
        </div>
      </fieldset>
    </form>

    <form py:if="cf_display=='list'" class="addnew" id="addcf" method="POST">
      <fieldset>
        <legend>Add Custom Field:</legend>
        <div class="field">
          <label>Name:<br />
            <input type="text" name="name" id="name" />
          </label>
        </div>
        <div class="field">
          <label>Type:<br />
            <select name="type" id="type">
              <option py:for="value in field_types"
                  value="${value}">${value.capitalize()}</option>
            </select>
          </label>
        </div>
        <div class="field">
          <label>Label:<br />
            <input type="text" name="label" id="label" />
          </label>
        </div>
        <div class="field">
          <label for="value">Default value:<br />
            <input type="text" name="value" id="value" />
          </label>
        </div>
        <div class="field">
          <label>Format:<br />
            <select name="format" id="format">
            </select>
          </label>
        </div>
        <div class="field">
          <fieldset class="iefix">
            <label for="options">Options:</label>
            <p>
              <textarea id="options" name="options"
                        rows="4" cols="17"></textarea>
            </p>
          </fieldset>
        </div>
        <div class="field">
          <label for="rows">
            Rows: <input type="text" size="2" name="rows" id="rows" />
          </label>
        </div>
        <div class="buttons">
          <input type="submit" name="add" value="${_('Add')}" />
        </div>
      </fieldset>
    </form>

    <div py:if="cf_display=='list'" py:strip="">
      <p py:if="not len(cfields)" class="help">
        No Custom Fields defined for this project.
      </p>
      <form py:if="len(cfields)" method="POST">
        <table class="listing" id="cflist">
          <thead>
            <tr>
              <th class="sel">&nbsp;</th>
              <th>Name</th>
              <th>Type</th>
              <th>Label</th>
              <th>Order</th>
            </tr>
          </thead>
          <tbody>
            <tr py:for="cf in cfields">
              <td py:if="not cf.registry"><input type="checkbox" name="sel"
                value="${cf.name}"/></td>
              <td py:if="cf.registry"
                title="Field cannot be deleted (declared in source code)"/>
              <td><a href="${cf.href}">${cf.name}</a></td>
              <td>${cf.type}</td>
              <td>${cf.label}</td>
              <td class="default">
                <select name="order_${cf.name}" py:with="count = len(cfields)">
                  <option py:for="num in range(1, count+1)"
                      selected="${num==cf.order and 'selected' or None}">
                      ${num}
                  </option>
                  <!--! Extra option in case value is outside regular range -->
                  <py:if test="cf.order not in range(1, count+1)">
                    <option disabled="disabled">&mdash;</option>
                    <option title="Currently outside regular range"
                            selected="selected">${cf.order}</option>
                  </py:if>
                </select>
              </td>
            </tr>
          </tbody>
        </table>
        <div class="buttons">
          <input class="trac-disable-on-submit" type="submit" name="remove"
                 value="${_('Remove selected items')}" />
          <input type="submit" name="apply" value="${_('Apply changes')}" />
        </div>
      </form>
    </div>

  </body>

</html>