comparison rhodecode/templates/admin/repos/repo_edit.html @ 3600:727119201a42 beta

repository: cleanup and alignment of repository editing templates Too much duplicated code.
author Mads Kiilerich <madski@unity3d.com>
date Tue, 26 Mar 2013 17:16:04 +0100
parents 1f334a68d057
children bb1eecda3172
comparison
equal deleted inserted replaced
3599:8087731920d8 3600:727119201a42
1 ## -*- coding: utf-8 -*- 1 ## -*- coding: utf-8 -*-
2 ##
3 ## See also repo_settings.html
4 ##
2 <%inherit file="/base/base.html"/> 5 <%inherit file="/base/base.html"/>
3 6
4 <%def name="title()"> 7 <%def name="title()">
5 ${_('Edit repository')} ${c.repo_info.repo_name} &middot; ${c.rhodecode_name} 8 ${_('Edit repository')} ${c.repo_info.repo_name} &middot; ${c.rhodecode_name}
6 </%def> 9 </%def>
150 <label for="input">${_('Permissions')}:</label> 153 <label for="input">${_('Permissions')}:</label>
151 </div> 154 </div>
152 <div class="input"> 155 <div class="input">
153 <%include file="repo_edit_perms.html"/> 156 <%include file="repo_edit_perms.html"/>
154 </div> 157 </div>
155 158 </div>
156 <div class="buttons"> 159
157 ${h.submit('save',_('Save'),class_="ui-btn large")} 160 <div class="buttons">
158 ${h.reset('reset',_('Reset'),class_="ui-btn large")} 161 ${h.submit('save',_('Save'),class_="ui-btn large")}
159 </div> 162 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
160 </div> 163 </div>
161 </div> 164 </div>
162 </div> 165 </div>
163 ${h.end_form()} 166 ${h.end_form()}
164 </div> 167 </div>
165 168
166 <div class="box box-right"> 169 <div class="box box-right">
167 <div class="title"> 170 <div class="title">
168 <h5>${_('Advanced settings')}</h5> 171 <h5>${_('Advanced settings')}</h5>
169 </div> 172 </div>
170 173
171 <h3>${_('Statistics')}</h3> 174 <h3>${_('Statistics')}</h3>
172 ${h.form(url('repo_stats', repo_name=c.repo_info.repo_name),method='delete')} 175 ${h.form(url('repo_stats', repo_name=c.repo_info.repo_name),method='delete')}
173 <div class="form"> 176 <div class="form">
174 <div class="fields"> 177 <div class="fields">
175 ${h.submit('reset_stats_%s' % c.repo_info.repo_name,_('Reset current statistics'),class_="ui-btn",onclick="return confirm('"+_('Confirm to remove current statistics')+"');")} 178 ${h.submit('reset_stats_%s' % c.repo_info.repo_name,_('Reset current statistics'),class_="ui-btn",onclick="return confirm('"+_('Confirm to remove current statistics')+"');")}
176 <div class="field" style="border:none;color:#888">
177 <ul>
178 <li>${_('Fetched to rev')}: ${c.stats_revision}/${c.repo_last_rev}</li>
179 <li>${_('Stats gathered')}: ${c.stats_percentage}%</li>
180 </ul>
181 </div>
182 </div>
183 </div>
184 ${h.end_form()}
185
186 %if c.repo_info.clone_uri:
187 <h3>${_('Remote')}</h3>
188 ${h.form(url('repo_pull', repo_name=c.repo_info.repo_name),method='put')}
189 <div class="form">
190 <div class="fields">
191 ${h.submit('remote_pull_%s' % c.repo_info.repo_name,_('Pull changes from remote location'),class_="ui-btn",onclick="return confirm('"+_('Confirm to pull changes from remote side')+"');")}
192 <div class="field" style="border:none">
193 <ul>
194 <li><a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri}</a></li>
195 </ul>
196 </div>
197 </div>
198 </div>
199 ${h.end_form()}
200 %endif
201
202 <h3>${_('Cache')}</h3>
203 ${h.form(url('repo_cache', repo_name=c.repo_info.repo_name),method='delete')}
204 <div class="form">
205 <div class="fields">
206 ${h.submit('reset_cache_%s' % c.repo_info.repo_name,_('Invalidate repository cache'),class_="ui-btn",onclick="return confirm('"+_('Confirm to invalidate repository cache')+"');")}
207 <div class="field" style="border:none;color:#888">
208 <ul>
209 <li>${_('Manually invalidate cache for this repository. On first access repository will be cached again')}
210 </li>
211 </ul>
212 </div>
213 <div class="field" style="border:none;">
214 ${_('List of cached values')}
215 <table>
216 <tr>
217 <th>${_('Prefix')}</th>
218 <th>${_('Key')}</th>
219 <th>${_('Active')}</th>
220 </tr>
221 %for cache in c.repo_info.cache_keys:
222 <tr>
223 <td>${cache.prefix or '-'}</td>
224 <td>${cache.cache_key}</td>
225 <td>${h.bool2icon(cache.cache_active)}</td>
226 </tr>
227 %endfor
228 </table>
229 </div>
230 </div>
231 </div>
232 ${h.end_form()}
233
234 <h3>${_('Public journal')}</h3>
235 ${h.form(url('repo_public_journal', repo_name=c.repo_info.repo_name),method='put')}
236 <div class="form">
237 ${h.hidden('auth_token',str(h.get_token()))}
238 <div class="field">
239 %if c.in_public_journal:
240 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Remove from public journal'),class_="ui-btn")}
241 %else:
242 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Add to public journal'),class_="ui-btn")}
243 %endif
244 </div>
245 <div class="field" style="border:none;color:#888">
246 <ul>
247 <li>${_('All actions made on this repository will be accessible to everyone in public journal')}
248 </li>
249 </ul>
250 </div>
251 </div>
252 ${h.end_form()}
253
254 <h3>${_('Locking')}</h3>
255 ${h.form(url('repo_locking', repo_name=c.repo_info.repo_name),method='put')}
256 <div class="form">
257 <div class="fields">
258 %if c.repo_info.locked[0]:
259 ${h.submit('set_unlock' ,_('Unlock locked repo'),class_="ui-btn",onclick="return confirm('"+_('Confirm to unlock repository')+"');")}
260 ${'Locked by %s on %s' % (h.person_by_id(c.repo_info.locked[0]),h.fmt_date(h.time_to_datetime(c.repo_info.locked[1])))}
261 %else:
262 ${h.submit('set_lock',_('lock repo'),class_="ui-btn",onclick="return confirm('"+_('Confirm to lock repository')+"');")}
263 ${_('Repository is not locked')}
264 %endif
265 </div>
266 <div class="field" style="border:none;color:#888"> 179 <div class="field" style="border:none;color:#888">
267 <ul> 180 <ul>
268 <li>${_('Force locking on repository. Works only when anonymous access is disabled')} 181 <li>${_('Fetched to rev')}: ${c.stats_revision}/${c.repo_last_rev}</li>
269 </li> 182 <li>${_('Stats gathered')}: ${c.stats_percentage}%</li>
270 </ul> 183 </ul>
271 </div> 184 </div>
272 </div> 185 </div>
273 ${h.end_form()} 186 </div>
274 187 ${h.end_form()}
275 <h3>${_('Set as fork of')}</h3> 188
276 ${h.form(url('repo_as_fork', repo_name=c.repo_info.repo_name),method='put')} 189 %if c.repo_info.clone_uri:
277 <div class="form"> 190 <h3>${_('Remote')}</h3>
278 <div class="fields"> 191 ${h.form(url('repo_pull', repo_name=c.repo_info.repo_name),method='put')}
279 ${h.select('id_fork_of','',c.repos_list,class_="medium")} 192 <div class="form">
280 ${h.submit('set_as_fork_%s' % c.repo_info.repo_name,_('set'),class_="ui-btn",)} 193 <div class="fields">
194 ${h.submit('remote_pull_%s' % c.repo_info.repo_name,_('Pull changes from remote location'),class_="ui-btn",onclick="return confirm('"+_('Confirm to pull changes from remote side')+"');")}
195 <div class="field" style="border:none">
196 <ul>
197 <li><a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri}</a></li>
198 </ul>
281 </div> 199 </div>
282 <div class="field" style="border:none;color:#888"> 200 </div>
283 <ul> 201 </div>
284 <li>${_('''Manually set this repository as a fork of another from the list''')}</li> 202 ${h.end_form()}
285 </ul> 203 %endif
286 </div> 204
287 </div> 205 <h3>${_('Cache')}</h3>
288 ${h.end_form()} 206 ${h.form(url('repo_cache', repo_name=c.repo_info.repo_name),method='delete')}
289 207 <div class="form">
290 <h3>${_('Delete')}</h3> 208 <div class="fields">
291 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='delete')} 209 ${h.submit('reset_cache_%s' % c.repo_info.repo_name,_('Invalidate repository cache'),class_="ui-btn",onclick="return confirm('"+_('Confirm to invalidate repository cache')+"');")}
292 <div class="form"> 210 <div class="field" style="border:none;color:#888">
293 <div class="fields"> 211 <ul>
294 ${h.submit('remove_%s' % c.repo_info.repo_name,_('Remove this repository'),class_="ui-btn red",onclick="return confirm('"+_('Confirm to delete this repository')+"');")} 212 <li>${_('Manually invalidate cache for this repository. On first access repository will be cached again')}
295 %if c.repo_info.forks.count(): 213 </li>
296 - ${ungettext('this repository has %s fork', 'this repository has %s forks', c.repo_info.forks.count()) % c.repo_info.forks.count()} 214 </ul>
297 <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label> 215 </div>
298 <input type="radio" name="forks" value="delete_forks" /> <label for="forks">${_('Delete forks')}</label> 216 <div class="field" style="border:none;">
299 %endif 217 ${_('List of cached values')}
300 </div> 218 <table>
219 <tr>
220 <th>${_('Prefix')}</th>
221 <th>${_('Key')}</th>
222 <th>${_('Active')}</th>
223 </tr>
224 %for cache in c.repo_info.cache_keys:
225 <tr>
226 <td>${cache.prefix or '-'}</td>
227 <td>${cache.cache_key}</td>
228 <td>${h.bool2icon(cache.cache_active)}</td>
229 </tr>
230 %endfor
231 </table>
232 </div>
233 </div>
234 </div>
235 ${h.end_form()}
236
237 <h3>${_('Public journal')}</h3>
238 ${h.form(url('repo_public_journal', repo_name=c.repo_info.repo_name),method='put')}
239 <div class="form">
240 ${h.hidden('auth_token',str(h.get_token()))}
241 <div class="field">
242 %if c.in_public_journal:
243 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Remove from public journal'),class_="ui-btn")}
244 %else:
245 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Add to public journal'),class_="ui-btn")}
246 %endif
247 </div>
248 <div class="field" style="border:none;color:#888">
249 <ul>
250 <li>${_('All actions made on this repository will be accessible to everyone in public journal')}
251 </li>
252 </ul>
253 </div>
254 </div>
255 ${h.end_form()}
256
257 <h3>${_('Locking')}</h3>
258 ${h.form(url('repo_locking', repo_name=c.repo_info.repo_name),method='put')}
259 <div class="form">
260 <div class="fields">
261 %if c.repo_info.locked[0]:
262 ${h.submit('set_unlock' ,_('Unlock locked repo'),class_="ui-btn",onclick="return confirm('"+_('Confirm to unlock repository')+"');")}
263 ${'Locked by %s on %s' % (h.person_by_id(c.repo_info.locked[0]),h.fmt_date(h.time_to_datetime(c.repo_info.locked[1])))}
264 %else:
265 ${h.submit('set_lock',_('lock repo'),class_="ui-btn",onclick="return confirm('"+_('Confirm to lock repository')+"');")}
266 ${_('Repository is not locked')}
267 %endif
268 </div>
269 <div class="field" style="border:none;color:#888">
270 <ul>
271 <li>${_('Force locking on repository. Works only when anonymous access is disabled')}
272 </li>
273 </ul>
274 </div>
275 </div>
276 ${h.end_form()}
277
278 <h3>${_('Set as fork of')}</h3>
279 ${h.form(url('repo_as_fork', repo_name=c.repo_info.repo_name),method='put')}
280 <div class="form">
281 <div class="fields">
282 ${h.select('id_fork_of','',c.repos_list,class_="medium")}
283 ${h.submit('set_as_fork_%s' % c.repo_info.repo_name,_('set'),class_="ui-btn",)}
284 </div>
301 <div class="field" style="border:none;color:#888"> 285 <div class="field" style="border:none;color:#888">
302 <ul> 286 <ul>
303 <li>${_('This repository will be renamed in a special way in order to be unaccesible for RhodeCode and VCS systems. If you need to fully delete it from file system please do it manually')}</li> 287 <li>${_('''Manually set this repository as a fork of another from the list''')}</li>
304 </ul> 288 </ul>
305 </div> 289 </div>
290 </div>
291 ${h.end_form()}
292
293 <h3>${_('Delete')}</h3>
294 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='delete')}
295 <div class="form">
296 <div class="fields">
297 <div class="field" style="border:none;color:#888">
298 ## <div class="label">
299 ## <label for="">${_('Remove repository')}:</label>
300 ## </div>
301 <div class="checkboxes">
302 ${h.submit('remove_%s' % c.repo_info.repo_name,_('Remove this repository'),class_="ui-btn red",onclick="return confirm('"+_('Confirm to delete this repository')+"');")}
303 %if c.repo_info.forks.count():
304 - ${ungettext('this repository has %s fork', 'this repository has %s forks', c.repo_info.forks.count()) % c.repo_info.forks.count()}
305 <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label>
306 <input type="radio" name="forks" value="delete_forks" /> <label for="forks">${_('Delete forks')}</label>
307 %endif
308 <ul>
309 <li>${_('This repository will be renamed in a special way in order to be unaccesible for RhodeCode and VCS systems. If you need to fully delete it from file system please do it manually')}</li>
310 </ul>
311 </div>
312 </div>
306 </div> 313 </div>
307 ${h.end_form()} 314 </div>
315 ${h.end_form()}
308 </div> 316 </div>
309 317
310 ##TODO: this should be controlled by the VISUAL setting 318 ##TODO: this should be controlled by the VISUAL setting
311 %if c.visual.repository_fields: 319 %if c.visual.repository_fields:
312 <div class="box box-left" style="clear:left"> 320 <div class="box box-left" style="clear:left">