##// END OF EJS Templates
integrations: don't use code-review type icons for enabled/disable state.
ergo -
r3753:7d5ebbbb new-ui
parent child Browse files
Show More
@@ -1,222 +1,220 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="base.mako"/>
3 3
4 4 <%def name="breadcrumbs_links()">
5 5 %if c.repo:
6 6 ${h.link_to('Settings',h.route_path('edit_repo', repo_name=c.repo.repo_name))}
7 7 %elif c.repo_group:
8 8 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
9 9 &raquo;
10 10 ${h.link_to(_('Repository Groups'),h.route_path('repo_groups'))}
11 11 &raquo;
12 12 ${h.link_to(c.repo_group.group_name,h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name))}
13 13 %else:
14 14 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
15 15 &raquo;
16 16 ${h.link_to(_('Settings'),h.route_path('admin_settings'))}
17 17 %endif
18 18 %if c.current_IntegrationType:
19 19 &raquo;
20 20 %if c.repo:
21 21 ${h.link_to(_('Integrations'),
22 22 request.route_path(route_name='repo_integrations_home',
23 23 repo_name=c.repo.repo_name))}
24 24 %elif c.repo_group:
25 25 ${h.link_to(_('Integrations'),
26 26 request.route_path(route_name='repo_group_integrations_home',
27 27 repo_group_name=c.repo_group.group_name))}
28 28 %else:
29 29 ${h.link_to(_('Integrations'),
30 30 request.route_path(route_name='global_integrations_home'))}
31 31 %endif
32 32 &raquo;
33 33 ${c.current_IntegrationType.display_name}
34 34 %else:
35 35 &raquo;
36 36 ${_('Integrations')}
37 37 %endif
38 38 </%def>
39 39
40 40 <div class="panel panel-default">
41 41 <div class="panel-heading">
42 42 <h3 class="panel-title">
43 43 %if c.repo:
44 44 ${_('Current Integrations for Repository: {repo_name}').format(repo_name=c.repo.repo_name)}
45 45 %elif c.repo_group:
46 46 ${_('Repository Group Integrations: {}').format(c.repo_group.group_name)}</h3>
47 47 %else:
48 48 ${_('Current Integrations')}
49 49 %endif
50 50 </h3>
51 51 </div>
52 52 <div class="panel-body">
53 53
54 54 <%
55 55 integration_type = c.current_IntegrationType and c.current_IntegrationType.display_name or ''
56 56
57 57 if c.repo:
58 58 create_url = h.route_path('repo_integrations_new', repo_name=c.repo.repo_name)
59 59 elif c.repo_group:
60 60 create_url = h.route_path('repo_group_integrations_new', repo_group_name=c.repo_group.group_name)
61 61 else:
62 62 create_url = h.route_path('global_integrations_new')
63 63 %>
64 64 <p class="pull-right">
65 65 <a href="${create_url}" class="btn btn-small btn-success">${_(u'Create new integration')}</a>
66 66 </p>
67 67
68 68 <table class="rctable integrations">
69 69 <thead>
70 70 <tr>
71 71 <th><a href="?sort=enabled:${c.rev_sort_dir}">${_('Enabled')}</a></th>
72 72 <th><a href="?sort=name:${c.rev_sort_dir}">${_('Name')}</a></th>
73 73 <th colspan="2"><a href="?sort=integration_type:${c.rev_sort_dir}">${_('Type')}</a></th>
74 74 <th><a href="?sort=scope:${c.rev_sort_dir}">${_('Scope')}</a></th>
75 75 <th>${_('Actions')}</th>
76 76 <th></th>
77 77 </tr>
78 78 </thead>
79 79 <tbody>
80 80 %if not c.integrations_list:
81 81 <tr>
82 82 <td colspan="7">
83 83
84 84 %if c.repo:
85 85 ${_('No {type} integrations for repo {repo} exist yet.').format(type=integration_type, repo=c.repo.repo_name)}
86 86 %elif c.repo_group:
87 87 ${_('No {type} integrations for repogroup {repogroup} exist yet.').format(type=integration_type, repogroup=c.repo_group.group_name)}
88 88 %else:
89 89 ${_('No {type} integrations exist yet.').format(type=integration_type)}
90 90 %endif
91 91
92 92 %if c.current_IntegrationType:
93 93 <%
94 94 if c.repo:
95 95 create_url = h.route_path('repo_integrations_create', repo_name=c.repo.repo_name, integration=c.current_IntegrationType.key)
96 96 elif c.repo_group:
97 97 create_url = h.route_path('repo_group_integrations_create', repo_group_name=c.repo_group.group_name, integration=c.current_IntegrationType.key)
98 98 else:
99 99 create_url = h.route_path('global_integrations_create', integration=c.current_IntegrationType.key)
100 100 %>
101 101 %endif
102 102
103 103 <a href="${create_url}">${_(u'Create one')}</a>
104 104 </td>
105 105 </tr>
106 106 %endif
107 107 %for IntegrationType, integration in c.integrations_list:
108 108 <tr id="integration_${integration.integration_id}">
109 109 <td class="td-enabled">
110 %if integration.enabled:
111 <div class="flag_status approved pull-left"></div>
112 %else:
113 <div class="flag_status rejected pull-left"></div>
114 %endif
110 <div class="pull-left">
111 ${h.bool2icon(integration.enabled)}
112 </div>
115 113 </td>
116 114 <td class="td-description">
117 115 ${integration.name}
118 116 </td>
119 117 <td class="td-icon">
120 118 %if integration.integration_type in c.available_integrations:
121 119 <div class="integration-icon">
122 120 ${c.available_integrations[integration.integration_type].icon()|n}
123 121 </div>
124 122 %else:
125 123 ?
126 124 %endif
127 125 </td>
128 126 <td class="td-type">
129 127 ${integration.integration_type}
130 128 </td>
131 129 <td class="td-scope">
132 130 %if integration.repo:
133 131 <a href="${h.route_path('repo_summary', repo_name=integration.repo.repo_name)}">
134 132 ${_('repo')}:${integration.repo.repo_name}
135 133 </a>
136 134 %elif integration.repo_group:
137 135 <a href="${h.route_path('repo_group_home', repo_group_name=integration.repo_group.group_name)}">
138 136 ${_('repogroup')}:${integration.repo_group.group_name}
139 137 %if integration.child_repos_only:
140 138 ${_('child repos only')}
141 139 %else:
142 140 ${_('cascade to all')}
143 141 %endif
144 142 </a>
145 143 %else:
146 144 %if integration.child_repos_only:
147 145 ${_('top level repos only')}
148 146 %else:
149 147 ${_('global')}
150 148 %endif
151 149 </td>
152 150 %endif
153 151 <td class="td-action">
154 152 %if not IntegrationType:
155 153 ${_('unknown integration')}
156 154 %else:
157 155 <%
158 156 if c.repo:
159 157 edit_url = request.route_path('repo_integrations_edit',
160 158 repo_name=c.repo.repo_name,
161 159 integration=integration.integration_type,
162 160 integration_id=integration.integration_id)
163 161 elif c.repo_group:
164 162 edit_url = request.route_path('repo_group_integrations_edit',
165 163 repo_group_name=c.repo_group.group_name,
166 164 integration=integration.integration_type,
167 165 integration_id=integration.integration_id)
168 166 else:
169 167 edit_url = request.route_path('global_integrations_edit',
170 168 integration=integration.integration_type,
171 169 integration_id=integration.integration_id)
172 170 %>
173 171 <div class="grid_edit">
174 172 <a href="${edit_url}">${_('Edit')}</a>
175 173 </div>
176 174 <div class="grid_delete">
177 175 <a href="${edit_url}"
178 176 class="btn btn-link btn-danger delete_integration_entry"
179 177 data-desc="${integration.name}"
180 178 data-uid="${integration.integration_id}">
181 179 ${_('Delete')}
182 180 </a>
183 181 </div>
184 182 %endif
185 183 </td>
186 184 </tr>
187 185 %endfor
188 186 <tr id="last-row"></tr>
189 187 </tbody>
190 188 </table>
191 189 <div class="integrations-paginator">
192 190 <div class="pagination-wh pagination-left">
193 191 ${c.integrations_list.pager('$link_previous ~2~ $link_next')}
194 192 </div>
195 193 </div>
196 194 </div>
197 195 </div>
198 196 <script type="text/javascript">
199 197 var delete_integration = function(entry) {
200 198 if (confirm("Confirm to remove this integration: "+$(entry).data('desc'))) {
201 199 var request = $.ajax({
202 200 type: "POST",
203 201 url: $(entry).attr('href'),
204 202 data: {
205 203 'delete': 'delete',
206 204 'csrf_token': CSRF_TOKEN
207 205 },
208 206 success: function(){
209 207 location.reload();
210 208 },
211 209 error: function(data, textStatus, errorThrown){
212 210 alert("Error while deleting entry.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(entry)[0].url));
213 211 }
214 212 });
215 213 };
216 214 };
217 215
218 216 $('.delete_integration_entry').on('click', function(e){
219 217 e.preventDefault();
220 218 delete_integration(this);
221 219 });
222 220 </script> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now