source: multipleworkflowplugin/branches/multipleworkflow-1.3/multipleworkflow/templates/multipleworkflowadmin.html

Last change on this file was 16593, checked in by Ryan J Ollos, 6 years ago

MultipleWorkflowPlugin 1.3.3: Fix regression in r15137

get_workflow_config_default was removed without
replacing all uses.

Tidy up codebase and require Trac >= 1.0.

Refs #12570, Fixes #12665.

File size: 5.5 KB
Line 
1<!DOCTYPE html
2    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml"
5      xmlns:xi="http://www.w3.org/2001/XInclude"
6      xmlns:py="http://genshi.edgewall.org/">
7
8<xi:include href="admin.html"/>
9
10<head>
11  <title>Workflow Admin</title>
12  <script py:if="view == 'detail'" type="text/javascript">
13    jQuery(document).ready(function ($) {
14      $("#workflow-actions").autoPreviewWorkflow("${href()}/multipleworkflow/workflow_render", "",
15          function (textarea, text, rendered) {
16            if (rendered) {
17              $('#workflow-graph').html(rendered['html']);
18              var graphdiv = $('.multiple-workflow-graph');
19              var data = rendered['graph_data'];
20              window.drawWorkflows(data, graphdiv);
21            }
22          });
23      $('#name').bind('input', function () {
24        /* trac_types holds all the known ticket types */
25        if ($.inArray($(this).val(), trac_types) == -1) {
26          $('#trac-type-hint').show();
27        }
28        else {
29          $('#trac-type-hint').hide();
30        }
31        ;
32      });
33    });
34  </script>
35
36</head>
37<body>
38<h2>Manage Workflows</h2>
39<div id="content">
40  <py:choose test="view">
41    <py:when test="'detail'">
42
43      <form class="mod" id="modworkflow" method="post" action="">
44        <fieldset>
45          <legend>Modify Workflow:</legend>
46          <div class="field">
47            <label>Name:<br/>
48              <input name="name" value="$name" type="text" id="name"
49                     disabled="${name == 'default' or None}"/>
50            </label>
51          </div>
52          <div class="field">
53                            <textarea id="workflow-actions"
54                                      name="workflow-actions"
55                                      class="wikitext trac-resizable" rows="15"
56                                      cols="78">$workflow</textarea>
57          </div>
58          <p style='${(name in trac_types or name == "default") and "display: none" or None}'
59             class="help" id="trac-type-hint">
60            There is currently no ticket type matching this workflow.
61          </p>
62          <div class="buttons">
63            <input type="submit" name="cancel" value="${_('Cancel')}"/>
64            <input type="submit" name="save" value="${_('Save')}"/>
65          </div>
66
67          <h3>Workflow Graph</h3>
68          <div id="workflow-graph">
69            $workflowgraph
70          </div>
71        </fieldset>
72      </form>
73    </py:when>
74    <py:otherwise>
75      <form class="addnew" id="addworkflow" method="post" action="">
76        <fieldset>
77          <legend>Add Workflow:</legend>
78          <div class="field">
79            <label>Name:<br/><input type="text" name="name"/></label>
80          </div>
81          <label>Copy from:<br/>
82            <select name="type" id="tkt-types" style="margin-left: 1em;">
83              <option value="default">Default workflow</option>
84              <option py:for="tkt_type in types" value="$tkt_type"
85                      selected="${tkt_type == selected and 'selected' or None}">
86                $tkt_type
87              </option>
88            </select>
89          </label>
90
91          <div class="buttons">
92            <input type="submit" name="add" value="${_('Add')}"/>
93          </div>
94        </fieldset>
95      </form>
96
97
98      <form id="workflow_table" method="post" action="">
99        <table class="listing" id="workflowlist">
100          <thead>
101          <tr>
102            <th class="sel">&nbsp;</th>
103            <th>Ticket Workflow</th>
104            <th>Description</th>
105          </tr>
106          </thead>
107          <tbody>
108          <tr>
109            <td class="sel"></td>
110            <td class="name">
111              <a href="${panel_href('default')}">default</a>
112            </td>
113            <td>
114              Trac default workflow. It is used for ticket types without any
115              specific workflow.
116            </td>
117          </tr>
118          <tr py:for="tkt_type in types">
119            <td class="sel"><input type="checkbox" name="sel"
120                                   value="$tkt_type"/></td>
121            <td class="name">
122              <a href="${panel_href(tkt_type)}">$tkt_type</a>
123            </td>
124            <td>
125              Workflow for tickets of type <strong>$tkt_type</strong>.
126              <p py:if="tkt_type not in trac_types" class="help">
127                There is currently no ticket type matching this workflow.
128              </p>
129            </td>
130          </tr>
131          </tbody>
132        </table>
133        <div class="buttons">
134          <input type="submit" name="remove"
135                 value="${_('Remove selected items')}"/>
136        </div>
137        <p class="help">
138          You can't remove the default workflow.
139        </p>
140      </form>
141    </py:otherwise>
142  </py:choose>
143
144
145</div>
146
147<!--
148    <form action="${panel_href()}" method="post">
149        <select name="type" id="tkt-types" style="margin-left: 1em;">
150            <option value="default">Default workflow</option>
151            <option py:for="type in types" value="$type" selected="${type==selected and 'selected' or None}">$type</option>
152        </select>
153        <div class="field">
154            <textarea id="workflow-actions" name="workflow-actions"
155                      class="wikitext trac-resizable" rows="10" cols="78">$workflow</textarea>
156        </div>
157        <div class="buttons">
158            <input type="submit" id="wf-submit" name="wf-save" value="Save changes"/>
159        </div>
160    </form>
161    <hr />
162
163    <h3>Workflow Graph</h3>
164
165    <div id="workflow-graph">
166        $workflowgraph
167    </div>
168    -->
169</body>
170</html>
171
Note: See TracBrowser for help on using the repository browser.