Parent: [5106f8] (diff)

Child: [afb10b] (diff)

Download this file

admin.html    147 lines (142 with data), 6.2 kB

  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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<?python from pyforge.lib.security import has_artifact_access ?>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
<title>Admin for $c.project._id $app.config.options.mount_point</title>
</head>
<body>
<div id="app_admin_tabs">
<ul>
<li><a href="#app-acl"
py:if="app.permissions and allow_config">Permissions</a></li>
<li><a href="#app-status">Statuses</a></li>
<li><a href="#app-milestone">Milestones</a></li>
<li><a href="#app-custom-fields">Custom Fields</a></li>
</ul>
<div id="app-acl" py:if="app.permissions and allow_config">
<h3>Permissions</h3>
<div id="acl-admin">
<py:for each="p in app.permissions" >
<h3><a href="#">$p</a></h3>
<div>
<table>
<thead>
<tr>
<th>Role</th>
<th/>
</tr>
</thead>
<tbody>
<tr py:for="role in h.make_roles(app.config.acl[p])">
<td>${role.display()}</td>
<td>
<form method="POST" action="del_perm" style="display:inline">
<input type="hidden" name="permission" value="$p"/>
<input type="hidden" name="role" value="${role._id}"/>
<input type="submit" value="Remove" py:if="role.display() != '*user-'+c.user.username"
class="ui-state-default ui-button ui-button-text"/>
</form>
</td>
</tr>
<tr>
<form method="POST" action="add_perm">
<td>
<select name="role">
<option py:for="role in c.project.roles"
value="$role._id"
>${role.display()}</option>
</select>
</td>
<td>
<input type="hidden" name="permission" value="$p"/>
<input type="submit" value="Add Permission" class="ui-state-default ui-button ui-button-text"/>
</td>
</form>
</tr>
</tbody>
</table>
</div>
</py:for>
</div>
</div>
<div id="app-status" style="overflow: auto">
<h3>Statuses</h3>
<div>
<form method="POST" action="set_status_names">
<div class="span-3 clear"><label>Names:</label></div>
<div class="span-13 last">
<input type="text" name="status_names" value="${globals.status_names}"
py:if="allow_config" class="title wide"/>
<span py:if="not allow_config">${globals.status_names}</span>
</div>
<div class="push-3 span-13 last"><input type="submit" value="Save" class="ui-state-default ui-button ui-button-text"/></div>
</form>
</div>
</div>
<div id="app-milestone" style="overflow: auto">
<h3>Milestones</h3>
<div>
<form method="POST" action="set_milestone_names">
<div class="span-3 clear"><label>Names:</label></div>
<div class="span-13 last">
<input type="text" name="milestone_names" value="${globals.milestone_names}"
py:if="allow_config" class="title wide"/>
<span py:if="not allow_config">${globals.milestone_names}</span>
</div>
<div class="push-3 span-13 last"><input type="submit" value="Save" class="ui-state-default ui-button ui-button-text"/></div>
</form>
</div>
</div>
<div id="app-custom-fields">
<h3>Custom Fields</h3>
<div>
<p id="has_fields_message">Drag and drop the fields to re-order.</p>
<p id="no_fields_message">No custom fields have been created.</p>
<div id="custom-field-list">
<py:for each="field in globals.custom_fields">
<div style="display:none" class="custom-field-stub"
data-label="${field.label}" data-type="${field.type}" data-options="${getattr(field, 'options', '')}"
py:if="allow_config"/>
<py:if test="not allow_config">
<div class="span-3"><label>Label: </label></div><div class="span-15 last">${field.label}</div>
<div class="span-3"><label>Type: </label></div><div class="span-15 last">${field.type}</div>
<span class="options-wrapper" py:if="field.options"><div class="span-3"><label>Options: </label></div><div class="span-15 last">${getattr(field, 'options', '')}</div></span>
</py:if>
</py:for>
</div>
<input type="button" onclick="add_field()" class="ui-state-default ui-button ui-button-text"
py:if="allow_config" value="Add Field"/>
<input type="button" onclick="save_fields()" class="ui-state-default ui-button ui-button-text"
py:if="allow_config" value="Save"/>
<div class="clear clearfix"/>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$("#app_admin_tabs").tabs();
});
$(function() {
$("#acl-admin").accordion({
autoHeight: false,
navigation: true
});
});
</script>
</body>
<style type="text/css">
div.custom-field {
cursor: move;
border:1px solid #ccc;
margin:2px;
padding:2px;
}
</style>
<script type="text/javascript" src="/static/Tickets/js/custom-fields.js"
py:if="allow_config"/>
</html>