Show More
@@ -1,260 +1,260 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), method='POST')} |
|
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 | 22 | <p class="help-block">${_('Non-changeable 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.url('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 | ${base.gravatar_with_user(c.rhodecode_db_repo.user.email, show_disabled=not c.rhodecode_db_repo.user.active)} | |
|
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 | <p class="help-block">${_('Keep it short and to the point. Use a README file for longer descriptions.')}</p> |
|
133 | 133 | </div> |
|
134 | 134 | </div> |
|
135 | 135 | |
|
136 | 136 | <div class="field"> |
|
137 | 137 | <div class="label label-checkbox"> |
|
138 | 138 | <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label> |
|
139 | 139 | </div> |
|
140 | 140 | <div class="checkboxes"> |
|
141 | 141 | ${c.form['repo_private'].render(css_class='medium')|n} |
|
142 | 142 | ${c.form.render_error(request, c.form['repo_private'])|n} |
|
143 | 143 | <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span> |
|
144 | 144 | </div> |
|
145 | 145 | </div> |
|
146 | 146 | <div class="field"> |
|
147 | 147 | <div class="label label-checkbox"> |
|
148 | 148 | <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label> |
|
149 | 149 | </div> |
|
150 | 150 | <div class="checkboxes"> |
|
151 | 151 | ${c.form['repo_enable_statistics'].render(css_class='medium')|n} |
|
152 | 152 | ${c.form.render_error(request, c.form['repo_enable_statistics'])|n} |
|
153 | 153 | <span class="help-block">${_('Enable statistics window on summary page.')}</span> |
|
154 | 154 | </div> |
|
155 | 155 | </div> |
|
156 | 156 | <div class="field"> |
|
157 | 157 | <div class="label label-checkbox"> |
|
158 | 158 | <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label> |
|
159 | 159 | </div> |
|
160 | 160 | <div class="checkboxes"> |
|
161 | 161 | ${c.form['repo_enable_downloads'].render(css_class='medium')|n} |
|
162 | 162 | ${c.form.render_error(request, c.form['repo_enable_downloads'])|n} |
|
163 | 163 | <span class="help-block">${_('Enable download menu on summary page.')}</span> |
|
164 | 164 | </div> |
|
165 | 165 | </div> |
|
166 | 166 | <div class="field"> |
|
167 | 167 | <div class="label label-checkbox"> |
|
168 | 168 | <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label> |
|
169 | 169 | </div> |
|
170 | 170 | <div class="checkboxes"> |
|
171 | 171 | ${c.form['repo_enable_locking'].render(css_class='medium')|n} |
|
172 | 172 | ${c.form.render_error(request, c.form['repo_enable_locking'])|n} |
|
173 | 173 | <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> |
|
174 | 174 | </div> |
|
175 | 175 | </div> |
|
176 | 176 | |
|
177 | 177 | %if c.visual.repository_fields: |
|
178 | 178 | ## EXTRA FIELDS |
|
179 | 179 | %for field in c.repo_fields: |
|
180 | 180 | <div class="field"> |
|
181 | 181 | <div class="label"> |
|
182 | 182 | <label for="${field.field_key_prefixed}">${field.field_label} (${field.field_key}):</label> |
|
183 | 183 | </div> |
|
184 | 184 | <div class="input input-medium"> |
|
185 | 185 | ${h.text(field.field_key_prefixed, field.field_value, class_='medium')} |
|
186 | 186 | %if field.field_desc: |
|
187 | 187 | <span class="help-block">${field.field_desc}</span> |
|
188 | 188 | %endif |
|
189 | 189 | </div> |
|
190 | 190 | </div> |
|
191 | 191 | %endfor |
|
192 | 192 | %endif |
|
193 | 193 | <div class="buttons"> |
|
194 | 194 | ${h.submit('save',_('Save'),class_="btn")} |
|
195 | 195 | ${h.reset('reset',_('Reset'),class_="btn")} |
|
196 | 196 | </div> |
|
197 | 197 | </div> |
|
198 | 198 | </div> |
|
199 | 199 | ${h.end_form()} |
|
200 | 200 | </div> |
|
201 | 201 | </div> |
|
202 | 202 | |
|
203 | 203 | <script> |
|
204 | 204 | $(document).ready(function(){ |
|
205 | 205 | var cloneUrl = function() { |
|
206 | 206 | var alterButton = $('#alter_clone_uri'); |
|
207 | 207 | var editButton = $('#edit_clone_uri'); |
|
208 | 208 | var cancelEditButton = $('#cancel_edit_clone_uri'); |
|
209 | 209 | var hiddenUrl = $('#clone_uri_hidden'); |
|
210 | 210 | var hiddenUrlValue = $('#clone_uri_hidden_value'); |
|
211 | 211 | var input = $('#clone_uri'); |
|
212 | 212 | var helpBlock = $('#alter_clone_uri_help_block'); |
|
213 | 213 | var changedFlag = $('#repo_clone_uri_change'); |
|
214 | 214 | var originalText = helpBlock.html(); |
|
215 | 215 | var obfuscatedUrl = hiddenUrlValue.html(); |
|
216 | 216 | |
|
217 | 217 | var edit = function(e) { |
|
218 | 218 | alterButton.show(); |
|
219 | 219 | editButton.hide(); |
|
220 | 220 | hiddenUrl.hide(); |
|
221 | 221 | |
|
222 | 222 | //add the old value next to input for verification |
|
223 | 223 | helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText); |
|
224 | 224 | changedFlag.val('MOD'); |
|
225 | 225 | }; |
|
226 | 226 | |
|
227 | 227 | var cancelEdit = function(e) { |
|
228 | 228 | alterButton.hide(); |
|
229 | 229 | editButton.show(); |
|
230 | 230 | hiddenUrl.show(); |
|
231 | 231 | |
|
232 | 232 | helpBlock.html(originalText); |
|
233 | 233 | changedFlag.val('OLD'); |
|
234 | 234 | input.val(''); |
|
235 | 235 | }; |
|
236 | 236 | |
|
237 | 237 | var initEvents = function() { |
|
238 | 238 | editButton.on('click', edit); |
|
239 | 239 | cancelEditButton.on('click', cancelEdit); |
|
240 | 240 | }; |
|
241 | 241 | |
|
242 | 242 | var setInitialState = function() { |
|
243 | 243 | if (input.hasClass('error')) { |
|
244 | 244 | alterButton.show(); |
|
245 | 245 | editButton.hide(); |
|
246 | 246 | hiddenUrl.hide(); |
|
247 | 247 | } |
|
248 | 248 | }; |
|
249 | 249 | |
|
250 | 250 | setInitialState(); |
|
251 | 251 | initEvents(); |
|
252 | 252 | }(); |
|
253 | 253 | |
|
254 | 254 | selectMyGroup = function(element) { |
|
255 | 255 | $("#repo_group").val($(element).data('personalGroupId')).trigger("change"); |
|
256 | 256 | }; |
|
257 | 257 | |
|
258 | 258 | UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}'); |
|
259 | 259 | }); |
|
260 | 260 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now