Show More
@@ -1,266 +1,266 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%namespace name="base" file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | <div class="panel panel-default"> |
|
5 | 5 | <div class="panel-heading"> |
|
6 | 6 | <h3 class="panel-title">${_('Settings for Repository: %s') % c.rhodecode_db_repo.repo_name}</h3> |
|
7 | 7 | </div> |
|
8 | 8 | <div class="panel-body"> |
|
9 | 9 | ${h.secure_form(h.route_path('edit_repo', repo_name=c.rhodecode_db_repo.repo_name), request=request)} |
|
10 | 10 | <div class="form"> |
|
11 | 11 | <!-- fields --> |
|
12 | 12 | <div class="fields"> |
|
13 | 13 | |
|
14 | 14 | <div class="field"> |
|
15 | 15 | <div class="label"> |
|
16 | 16 | <label for="repo_name">${_('Name')}:</label> |
|
17 | 17 | </div> |
|
18 | 18 | <div class="input"> |
|
19 | 19 | ${c.form['repo_name'].render(css_class='medium', oid='repo_name')|n} |
|
20 | 20 | ${c.form.render_error(request, c.form['repo_name'])|n} |
|
21 | 21 | |
|
22 |
<p class="help-block">${_(' |
|
|
22 | <p class="help-block">${_('permalink id')}: `_${c.rhodecode_db_repo.repo_id}` <span><a href="#" onclick="$('#clone_id').toggle();return false">${_('what is that ?')}</a></span></p> | |
|
23 | 23 | <p id="clone_id" style="display:none;"> |
|
24 | 24 | ${_('URL by id')}: `${c.rhodecode_db_repo.clone_url(with_id=True)}` <br/> |
|
25 | 25 | ${_('''In case this repository is renamed or moved into another group the repository url changes. |
|
26 | 26 | Using above url guarantees that this repository will always be accessible under such url. |
|
27 | 27 | Useful for CI systems, or any other cases that you need to hardcode the url into 3rd party service.''')}</p> |
|
28 | 28 | </div> |
|
29 | 29 | </div> |
|
30 | 30 | |
|
31 | 31 | <div class="field"> |
|
32 | 32 | <div class="label"> |
|
33 | 33 | <label for="repo_group">${_('Repository group')}:</label> |
|
34 | 34 | </div> |
|
35 | 35 | <div class="select"> |
|
36 | 36 | ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n} |
|
37 | 37 | ${c.form.render_error(request, c.form['repo_group'])|n} |
|
38 | 38 | |
|
39 | 39 | % if c.personal_repo_group: |
|
40 | 40 | <a class="btn" href="#" data-personal-group-name="${c.personal_repo_group.group_name}" data-personal-group-id="${c.personal_repo_group.group_id}" onclick="selectMyGroup(this); return false"> |
|
41 | 41 | ${_('Select my personal group (`%(repo_group_name)s`)') % {'repo_group_name': c.personal_repo_group.group_name}} |
|
42 | 42 | </a> |
|
43 | 43 | % endif |
|
44 | 44 | <p class="help-block">${_('Optional select a group to put this repository into.')}</p> |
|
45 | 45 | </div> |
|
46 | 46 | </div> |
|
47 | 47 | |
|
48 | 48 | % if c.rhodecode_db_repo.repo_type != 'svn': |
|
49 | 49 | <div class="field"> |
|
50 | 50 | <div class="label"> |
|
51 | 51 | <label for="clone_uri">${_('Remote uri')}:</label> |
|
52 | 52 | </div> |
|
53 | 53 | <div class="input"> |
|
54 | 54 | %if c.rhodecode_db_repo.clone_uri: |
|
55 | 55 | ## display, if we don't have any errors |
|
56 | 56 | % if not c.form['repo_clone_uri'].error: |
|
57 | 57 | <div id="clone_uri_hidden" class='text-as-placeholder'> |
|
58 | 58 | <span id="clone_uri_hidden_value">${c.rhodecode_db_repo.clone_uri_hidden}</span> |
|
59 | 59 | <span class="link" id="edit_clone_uri"><i class="icon-edit"></i>${_('edit')}</span> |
|
60 | 60 | </div> |
|
61 | 61 | % endif |
|
62 | 62 | |
|
63 | 63 | ## alter field |
|
64 | 64 | <div id="alter_clone_uri" style="${'' if c.form['repo_clone_uri'].error else 'display: none'}"> |
|
65 | 65 | ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri', placeholder=_('enter new value, or leave empty to remove'))|n} |
|
66 | 66 | ${c.form.render_error(request, c.form['repo_clone_uri'])|n} |
|
67 | 67 | % if c.form['repo_clone_uri'].error: |
|
68 | 68 | ## we got error from form subit, means we modify the url |
|
69 | 69 | ${h.hidden('repo_clone_uri_change', 'MOD')} |
|
70 | 70 | % else: |
|
71 | 71 | ${h.hidden('repo_clone_uri_change', 'OLD')} |
|
72 | 72 | % endif |
|
73 | 73 | |
|
74 | 74 | % if not c.form['repo_clone_uri'].error: |
|
75 | 75 | <span class="link" id="cancel_edit_clone_uri">${_('cancel')}</span> |
|
76 | 76 | % endif |
|
77 | 77 | |
|
78 | 78 | </div> |
|
79 | 79 | %else: |
|
80 | 80 | ## not set yet, display form to set it |
|
81 | 81 | ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri')|n} |
|
82 | 82 | ${c.form.render_error(request, c.form['repo_clone_uri'])|n} |
|
83 | 83 | ${h.hidden('repo_clone_uri_change', 'NEW')} |
|
84 | 84 | %endif |
|
85 | 85 | <p id="alter_clone_uri_help_block" class="help-block"> |
|
86 | 86 | <% pull_link = h.literal(h.link_to('remote sync', h.route_path('edit_repo_remote', repo_name=c.repo_name))) %> |
|
87 | 87 | ${_('http[s] url where from repository was imported, this field can used for doing {pull_link}.').format(pull_link=pull_link)|n} <br/> |
|
88 | 88 | ${_('This field is stored encrypted inside Database, a format of http://user:password@server.com/repo_name can be used and will be hidden from display.')} |
|
89 | 89 | </p> |
|
90 | 90 | </div> |
|
91 | 91 | </div> |
|
92 | 92 | % else: |
|
93 | 93 | ${h.hidden('repo_clone_uri', '')} |
|
94 | 94 | % endif |
|
95 | 95 | |
|
96 | 96 | <div class="field"> |
|
97 | 97 | <div class="label"> |
|
98 | 98 | <label for="repo_landing_commit_ref">${_('Landing commit')}:</label> |
|
99 | 99 | </div> |
|
100 | 100 | <div class="select"> |
|
101 | 101 | ${c.form['repo_landing_commit_ref'].render(css_class='medium', oid='repo_landing_commit_ref')|n} |
|
102 | 102 | ${c.form.render_error(request, c.form['repo_landing_commit_ref'])|n} |
|
103 | 103 | <p class="help-block">${_('Default commit for files page, downloads, full text search index and readme')}</p> |
|
104 | 104 | </div> |
|
105 | 105 | </div> |
|
106 | 106 | |
|
107 | 107 | <div class="field badged-field"> |
|
108 | 108 | <div class="label"> |
|
109 | 109 | <label for="repo_owner">${_('Owner')}:</label> |
|
110 | 110 | </div> |
|
111 | 111 | <div class="input"> |
|
112 | 112 | <div class="badge-input-container"> |
|
113 | 113 | <div class="user-badge"> |
|
114 | 114 | ${base.gravatar_with_user(c.rhodecode_db_repo.user.email or c.rhodecode_db_repo.user.username, show_disabled=not c.rhodecode_db_repo.user.active)} |
|
115 | 115 | </div> |
|
116 | 116 | <div class="badge-input-wrap"> |
|
117 | 117 | ${c.form['repo_owner'].render(css_class='medium', oid='repo_owner')|n} |
|
118 | 118 | </div> |
|
119 | 119 | </div> |
|
120 | 120 | ${c.form.render_error(request, c.form['repo_owner'])|n} |
|
121 | 121 | <p class="help-block">${_('Change owner of this repository.')}</p> |
|
122 | 122 | </div> |
|
123 | 123 | </div> |
|
124 | 124 | |
|
125 | 125 | <div class="field"> |
|
126 | 126 | <div class="label label-textarea"> |
|
127 | 127 | <label for="repo_description">${_('Description')}:</label> |
|
128 | 128 | </div> |
|
129 | 129 | <div class="textarea text-area editor"> |
|
130 | 130 | ${c.form['repo_description'].render(css_class='medium', oid='repo_description')|n} |
|
131 | 131 | ${c.form.render_error(request, c.form['repo_description'])|n} |
|
132 | 132 | |
|
133 | 133 | <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %> |
|
134 | 134 | <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span> |
|
135 | 135 | <span id="meta-tags-desc" style="display: none"> |
|
136 | 136 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
137 | 137 | ${dt.metatags_help()} |
|
138 | 138 | </span> |
|
139 | 139 | </div> |
|
140 | 140 | </div> |
|
141 | 141 | |
|
142 | 142 | <div class="field"> |
|
143 | 143 | <div class="label label-checkbox"> |
|
144 | 144 | <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label> |
|
145 | 145 | </div> |
|
146 | 146 | <div class="checkboxes"> |
|
147 | 147 | ${c.form['repo_private'].render(css_class='medium')|n} |
|
148 | 148 | ${c.form.render_error(request, c.form['repo_private'])|n} |
|
149 | 149 | <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span> |
|
150 | 150 | </div> |
|
151 | 151 | </div> |
|
152 | 152 | <div class="field"> |
|
153 | 153 | <div class="label label-checkbox"> |
|
154 | 154 | <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label> |
|
155 | 155 | </div> |
|
156 | 156 | <div class="checkboxes"> |
|
157 | 157 | ${c.form['repo_enable_statistics'].render(css_class='medium')|n} |
|
158 | 158 | ${c.form.render_error(request, c.form['repo_enable_statistics'])|n} |
|
159 | 159 | <span class="help-block">${_('Enable statistics window on summary page.')}</span> |
|
160 | 160 | </div> |
|
161 | 161 | </div> |
|
162 | 162 | <div class="field"> |
|
163 | 163 | <div class="label label-checkbox"> |
|
164 | 164 | <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label> |
|
165 | 165 | </div> |
|
166 | 166 | <div class="checkboxes"> |
|
167 | 167 | ${c.form['repo_enable_downloads'].render(css_class='medium')|n} |
|
168 | 168 | ${c.form.render_error(request, c.form['repo_enable_downloads'])|n} |
|
169 | 169 | <span class="help-block">${_('Enable download menu on summary page.')}</span> |
|
170 | 170 | </div> |
|
171 | 171 | </div> |
|
172 | 172 | <div class="field"> |
|
173 | 173 | <div class="label label-checkbox"> |
|
174 | 174 | <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label> |
|
175 | 175 | </div> |
|
176 | 176 | <div class="checkboxes"> |
|
177 | 177 | ${c.form['repo_enable_locking'].render(css_class='medium')|n} |
|
178 | 178 | ${c.form.render_error(request, c.form['repo_enable_locking'])|n} |
|
179 | 179 | <span class="help-block">${_('Enable automatic locking on repository. Pulling from this repository creates a lock that can be released by pushing back by the same user')}</span> |
|
180 | 180 | </div> |
|
181 | 181 | </div> |
|
182 | 182 | |
|
183 | 183 | %if c.visual.repository_fields: |
|
184 | 184 | ## EXTRA FIELDS |
|
185 | 185 | %for field in c.repo_fields: |
|
186 | 186 | <div class="field"> |
|
187 | 187 | <div class="label"> |
|
188 | 188 | <label for="${field.field_key_prefixed}">${field.field_label} (${field.field_key}):</label> |
|
189 | 189 | </div> |
|
190 | 190 | <div class="input input-medium"> |
|
191 | 191 | ${h.text(field.field_key_prefixed, field.field_value, class_='medium')} |
|
192 | 192 | %if field.field_desc: |
|
193 | 193 | <span class="help-block">${field.field_desc}</span> |
|
194 | 194 | %endif |
|
195 | 195 | </div> |
|
196 | 196 | </div> |
|
197 | 197 | %endfor |
|
198 | 198 | %endif |
|
199 | 199 | <div class="buttons"> |
|
200 | 200 | ${h.submit('save',_('Save'),class_="btn")} |
|
201 | 201 | ${h.reset('reset',_('Reset'),class_="btn")} |
|
202 | 202 | </div> |
|
203 | 203 | </div> |
|
204 | 204 | </div> |
|
205 | 205 | ${h.end_form()} |
|
206 | 206 | </div> |
|
207 | 207 | </div> |
|
208 | 208 | |
|
209 | 209 | <script> |
|
210 | 210 | $(document).ready(function(){ |
|
211 | 211 | var cloneUrl = function() { |
|
212 | 212 | var alterButton = $('#alter_clone_uri'); |
|
213 | 213 | var editButton = $('#edit_clone_uri'); |
|
214 | 214 | var cancelEditButton = $('#cancel_edit_clone_uri'); |
|
215 | 215 | var hiddenUrl = $('#clone_uri_hidden'); |
|
216 | 216 | var hiddenUrlValue = $('#clone_uri_hidden_value'); |
|
217 | 217 | var input = $('#clone_uri'); |
|
218 | 218 | var helpBlock = $('#alter_clone_uri_help_block'); |
|
219 | 219 | var changedFlag = $('#repo_clone_uri_change'); |
|
220 | 220 | var originalText = helpBlock.html(); |
|
221 | 221 | var obfuscatedUrl = hiddenUrlValue.html(); |
|
222 | 222 | |
|
223 | 223 | var edit = function(e) { |
|
224 | 224 | alterButton.show(); |
|
225 | 225 | editButton.hide(); |
|
226 | 226 | hiddenUrl.hide(); |
|
227 | 227 | |
|
228 | 228 | //add the old value next to input for verification |
|
229 | 229 | helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText); |
|
230 | 230 | changedFlag.val('MOD'); |
|
231 | 231 | }; |
|
232 | 232 | |
|
233 | 233 | var cancelEdit = function(e) { |
|
234 | 234 | alterButton.hide(); |
|
235 | 235 | editButton.show(); |
|
236 | 236 | hiddenUrl.show(); |
|
237 | 237 | |
|
238 | 238 | helpBlock.html(originalText); |
|
239 | 239 | changedFlag.val('OLD'); |
|
240 | 240 | input.val(''); |
|
241 | 241 | }; |
|
242 | 242 | |
|
243 | 243 | var initEvents = function() { |
|
244 | 244 | editButton.on('click', edit); |
|
245 | 245 | cancelEditButton.on('click', cancelEdit); |
|
246 | 246 | }; |
|
247 | 247 | |
|
248 | 248 | var setInitialState = function() { |
|
249 | 249 | if (input.hasClass('error')) { |
|
250 | 250 | alterButton.show(); |
|
251 | 251 | editButton.hide(); |
|
252 | 252 | hiddenUrl.hide(); |
|
253 | 253 | } |
|
254 | 254 | }; |
|
255 | 255 | |
|
256 | 256 | setInitialState(); |
|
257 | 257 | initEvents(); |
|
258 | 258 | }(); |
|
259 | 259 | |
|
260 | 260 | selectMyGroup = function(element) { |
|
261 | 261 | $("#repo_group").val($(element).data('personalGroupId')).trigger("change"); |
|
262 | 262 | }; |
|
263 | 263 | |
|
264 | 264 | UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}'); |
|
265 | 265 | }); |
|
266 | 266 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now