Show More
The requested changes are too big and content was truncated. Show full diff
@@ -1,444 +1,444 b'' | |||
|
1 | 1 | |
|
2 | 2 | |
|
3 | 3 | //BUTTONS |
|
4 | 4 | button, |
|
5 | 5 | .btn, |
|
6 | 6 | input[type="button"] { |
|
7 | 7 | -webkit-appearance: none; |
|
8 | 8 | display: inline-block; |
|
9 | 9 | margin: 0 @padding/3 0 0; |
|
10 | 10 | padding: @button-padding; |
|
11 | 11 | text-align: center; |
|
12 | 12 | font-size: @basefontsize; |
|
13 | 13 | line-height: 1em; |
|
14 | 14 | font-family: @text-light; |
|
15 | 15 | text-decoration: none; |
|
16 | 16 | text-shadow: none; |
|
17 | 17 | color: @grey2; |
|
18 | 18 | background-color: white; |
|
19 | 19 | background-image: none; |
|
20 | 20 | border: none; |
|
21 | 21 | .border ( @border-thickness-buttons, @grey5 ); |
|
22 | 22 | .border-radius (@border-radius); |
|
23 | 23 | cursor: pointer; |
|
24 | 24 | white-space: nowrap; |
|
25 | 25 | -webkit-transition: background .3s,color .3s; |
|
26 | 26 | -moz-transition: background .3s,color .3s; |
|
27 | 27 | -o-transition: background .3s,color .3s; |
|
28 | 28 | transition: background .3s,color .3s; |
|
29 | 29 | box-shadow: @button-shadow; |
|
30 | 30 | -webkit-box-shadow: @button-shadow; |
|
31 | 31 | |
|
32 | 32 | |
|
33 | 33 | |
|
34 | 34 | a { |
|
35 | 35 | display: block; |
|
36 | 36 | margin: 0; |
|
37 | 37 | padding: 0; |
|
38 | 38 | color: inherit; |
|
39 | 39 | text-decoration: none; |
|
40 | 40 | |
|
41 | 41 | &:hover { |
|
42 | 42 | text-decoration: none; |
|
43 | 43 | } |
|
44 | 44 | } |
|
45 | 45 | |
|
46 | 46 | &:focus, |
|
47 | 47 | &:active { |
|
48 | 48 | outline:none; |
|
49 | 49 | } |
|
50 | 50 | &:hover { |
|
51 | 51 | color: @rcdarkblue; |
|
52 | 52 | background-color: @white; |
|
53 | 53 | .border ( @border-thickness, @grey4 ); |
|
54 | 54 | } |
|
55 | 55 | |
|
56 |
.icon-remove |
|
|
56 | .icon-remove { | |
|
57 | 57 | display: none; |
|
58 | 58 | } |
|
59 | 59 | |
|
60 | 60 | //disabled buttons |
|
61 | 61 | //last; overrides any other styles |
|
62 | 62 | &:disabled { |
|
63 | 63 | opacity: .7; |
|
64 | 64 | cursor: auto; |
|
65 | 65 | background-color: white; |
|
66 | 66 | color: @grey4; |
|
67 | 67 | text-shadow: none; |
|
68 | 68 | } |
|
69 | 69 | |
|
70 | 70 | &.no-margin { |
|
71 | 71 | margin: 0 0 0 0; |
|
72 | 72 | } |
|
73 | 73 | |
|
74 | 74 | } |
|
75 | 75 | |
|
76 | 76 | |
|
77 | 77 | .btn-default { |
|
78 | 78 | border: @border-thickness solid @grey5; |
|
79 | 79 | background-image: none; |
|
80 | 80 | color: @grey2; |
|
81 | 81 | |
|
82 | 82 | a { |
|
83 | 83 | color: @grey2; |
|
84 | 84 | } |
|
85 | 85 | |
|
86 | 86 | &:hover, |
|
87 | 87 | &.active { |
|
88 | 88 | color: @rcdarkblue; |
|
89 | 89 | background-color: @white; |
|
90 | 90 | .border ( @border-thickness, @grey4 ); |
|
91 | 91 | |
|
92 | 92 | a { |
|
93 | 93 | color: @grey2; |
|
94 | 94 | } |
|
95 | 95 | } |
|
96 | 96 | &:disabled { |
|
97 | 97 | .border ( @border-thickness-buttons, @grey5 ); |
|
98 | 98 | background-color: transparent; |
|
99 | 99 | } |
|
100 | 100 | } |
|
101 | 101 | |
|
102 | 102 | .btn-primary, |
|
103 | 103 | .btn-small, /* TODO: anderson: remove .btn-small to not mix with the new btn-sm */ |
|
104 | 104 | .btn-success { |
|
105 | 105 | .border ( @border-thickness, @rcblue ); |
|
106 | 106 | background-color: @rcblue; |
|
107 | 107 | color: white; |
|
108 | 108 | |
|
109 | 109 | a { |
|
110 | 110 | color: white; |
|
111 | 111 | } |
|
112 | 112 | |
|
113 | 113 | &:hover, |
|
114 | 114 | &.active { |
|
115 | 115 | .border ( @border-thickness, @rcdarkblue ); |
|
116 | 116 | color: white; |
|
117 | 117 | background-color: @rcdarkblue; |
|
118 | 118 | |
|
119 | 119 | a { |
|
120 | 120 | color: white; |
|
121 | 121 | } |
|
122 | 122 | } |
|
123 | 123 | &:disabled { |
|
124 | 124 | background-color: @rcblue; |
|
125 | 125 | } |
|
126 | 126 | } |
|
127 | 127 | |
|
128 | 128 | .btn-secondary { |
|
129 | 129 | &:extend(.btn-default); |
|
130 | 130 | |
|
131 | 131 | background-color: white; |
|
132 | 132 | |
|
133 | 133 | &:focus { |
|
134 | 134 | outline: 0; |
|
135 | 135 | } |
|
136 | 136 | |
|
137 | 137 | &:hover { |
|
138 | 138 | &:extend(.btn-default:hover); |
|
139 | 139 | } |
|
140 | 140 | |
|
141 | 141 | &.btn-link { |
|
142 | 142 | &:extend(.btn-link); |
|
143 | 143 | color: @rcblue; |
|
144 | 144 | } |
|
145 | 145 | |
|
146 | 146 | &:disabled { |
|
147 | 147 | color: @rcblue; |
|
148 | 148 | background-color: white; |
|
149 | 149 | } |
|
150 | 150 | } |
|
151 | 151 | |
|
152 | 152 | .btn-warning, |
|
153 | 153 | .btn-danger, |
|
154 | 154 | .revoke_perm, |
|
155 | 155 | .btn-x, |
|
156 | 156 | .form .action_button.btn-x { |
|
157 | 157 | .border ( @border-thickness, @alert2 ); |
|
158 | 158 | background-color: white; |
|
159 | 159 | color: @alert2; |
|
160 | 160 | |
|
161 | 161 | a { |
|
162 | 162 | color: @alert2; |
|
163 | 163 | } |
|
164 | 164 | |
|
165 | 165 | &:hover, |
|
166 | 166 | &.active { |
|
167 | 167 | .border ( @border-thickness, @alert2 ); |
|
168 | 168 | color: white; |
|
169 | 169 | background-color: @alert2; |
|
170 | 170 | |
|
171 | 171 | a { |
|
172 | 172 | color: white; |
|
173 | 173 | } |
|
174 | 174 | } |
|
175 | 175 | |
|
176 | 176 | i { |
|
177 | 177 | display:none; |
|
178 | 178 | } |
|
179 | 179 | |
|
180 | 180 | &:disabled { |
|
181 | 181 | background-color: white; |
|
182 | 182 | color: @alert2; |
|
183 | 183 | } |
|
184 | 184 | } |
|
185 | 185 | |
|
186 | 186 | .btn-approved-status { |
|
187 | 187 | .border ( @border-thickness, @alert1 ); |
|
188 | 188 | background-color: white; |
|
189 | 189 | color: @alert1; |
|
190 | 190 | |
|
191 | 191 | } |
|
192 | 192 | |
|
193 | 193 | .btn-rejected-status { |
|
194 | 194 | .border ( @border-thickness, @alert2 ); |
|
195 | 195 | background-color: white; |
|
196 | 196 | color: @alert2; |
|
197 | 197 | } |
|
198 | 198 | |
|
199 | 199 | .btn-sm, |
|
200 | 200 | .btn-mini, |
|
201 | 201 | .field-sm .btn { |
|
202 | 202 | padding: @padding/3; |
|
203 | 203 | } |
|
204 | 204 | |
|
205 | 205 | .btn-xs { |
|
206 | 206 | padding: @padding/4; |
|
207 | 207 | } |
|
208 | 208 | |
|
209 | 209 | .btn-lg { |
|
210 | 210 | padding: @padding * 1.2; |
|
211 | 211 | } |
|
212 | 212 | |
|
213 | 213 | .btn-group { |
|
214 | 214 | display: inline-block; |
|
215 | 215 | .btn { |
|
216 | 216 | float: left; |
|
217 | 217 | margin: 0 0 0 -1px; |
|
218 | 218 | } |
|
219 | 219 | } |
|
220 | 220 | |
|
221 | 221 | .btn-link { |
|
222 | 222 | background: transparent; |
|
223 | 223 | border: none; |
|
224 | 224 | padding: 0; |
|
225 | 225 | color: @rcblue; |
|
226 | 226 | |
|
227 | 227 | &:hover { |
|
228 | 228 | background: transparent; |
|
229 | 229 | border: none; |
|
230 | 230 | color: @rcdarkblue; |
|
231 | 231 | } |
|
232 | 232 | |
|
233 | 233 | //disabled buttons |
|
234 | 234 | //last; overrides any other styles |
|
235 | 235 | &:disabled { |
|
236 | 236 | opacity: .7; |
|
237 | 237 | cursor: auto; |
|
238 | 238 | background-color: white; |
|
239 | 239 | color: @grey4; |
|
240 | 240 | text-shadow: none; |
|
241 | 241 | } |
|
242 | 242 | |
|
243 | 243 | // TODO: johbo: Check if we can avoid this, indicates that the structure |
|
244 | 244 | // is not yet good. |
|
245 | 245 | // lisa: The button CSS reflects the button HTML; both need a cleanup. |
|
246 | 246 | &.btn-danger { |
|
247 | 247 | color: @alert2; |
|
248 | 248 | |
|
249 | 249 | &:hover { |
|
250 | 250 | color: darken(@alert2,30%); |
|
251 | 251 | } |
|
252 | 252 | |
|
253 | 253 | &:disabled { |
|
254 | 254 | color: @alert2; |
|
255 | 255 | } |
|
256 | 256 | } |
|
257 | 257 | } |
|
258 | 258 | |
|
259 | 259 | .btn-social { |
|
260 | 260 | &:extend(.btn-default); |
|
261 | 261 | margin: 5px 5px 5px 0px; |
|
262 | 262 | min-width: 160px; |
|
263 | 263 | } |
|
264 | 264 | |
|
265 | 265 | // TODO: johbo: check these exceptions |
|
266 | 266 | |
|
267 | 267 | .links { |
|
268 | 268 | |
|
269 | 269 | .btn + .btn { |
|
270 | 270 | margin-top: @padding; |
|
271 | 271 | } |
|
272 | 272 | } |
|
273 | 273 | |
|
274 | 274 | |
|
275 | 275 | .action_button { |
|
276 | 276 | display:inline; |
|
277 | 277 | margin: 0; |
|
278 | 278 | padding: 0 1em 0 0; |
|
279 | 279 | font-size: inherit; |
|
280 | 280 | color: @rcblue; |
|
281 | 281 | border: none; |
|
282 | 282 | border-radius: 0; |
|
283 | 283 | background-color: transparent; |
|
284 | 284 | |
|
285 | 285 | &.last-item { |
|
286 | 286 | border: none; |
|
287 | 287 | padding: 0 0 0 0; |
|
288 | 288 | } |
|
289 | 289 | |
|
290 | 290 | &:last-child { |
|
291 | 291 | border: none; |
|
292 | 292 | padding: 0 0 0 0; |
|
293 | 293 | } |
|
294 | 294 | |
|
295 | 295 | &:hover { |
|
296 | 296 | color: @rcdarkblue; |
|
297 | 297 | background-color: transparent; |
|
298 | 298 | border: none; |
|
299 | 299 | } |
|
300 | 300 | } |
|
301 | 301 | .grid_delete { |
|
302 | 302 | .action_button { |
|
303 | 303 | border: none; |
|
304 | 304 | } |
|
305 | 305 | } |
|
306 | 306 | |
|
307 | 307 | |
|
308 | 308 | // TODO: johbo: Form button tweaks, check if we can use the classes instead |
|
309 | 309 | input[type="submit"] { |
|
310 | 310 | &:extend(.btn-primary); |
|
311 | 311 | |
|
312 | 312 | &:focus { |
|
313 | 313 | outline: 0; |
|
314 | 314 | } |
|
315 | 315 | |
|
316 | 316 | &:hover { |
|
317 | 317 | &:extend(.btn-primary:hover); |
|
318 | 318 | } |
|
319 | 319 | |
|
320 | 320 | &.btn-link { |
|
321 | 321 | &:extend(.btn-link); |
|
322 | 322 | color: @rcblue; |
|
323 | 323 | |
|
324 | 324 | &:disabled { |
|
325 | 325 | color: @rcblue; |
|
326 | 326 | background-color: transparent; |
|
327 | 327 | } |
|
328 | 328 | } |
|
329 | 329 | |
|
330 | 330 | &:disabled { |
|
331 | 331 | .border ( @border-thickness-buttons, @rcblue ); |
|
332 | 332 | background-color: @rcblue; |
|
333 | 333 | color: white; |
|
334 | 334 | opacity: 0.5; |
|
335 | 335 | } |
|
336 | 336 | } |
|
337 | 337 | |
|
338 | 338 | input[type="reset"] { |
|
339 | 339 | &:extend(.btn-default); |
|
340 | 340 | |
|
341 | 341 | // TODO: johbo: Check if this tweak can be avoided. |
|
342 | 342 | background: transparent; |
|
343 | 343 | |
|
344 | 344 | &:focus { |
|
345 | 345 | outline: 0; |
|
346 | 346 | } |
|
347 | 347 | |
|
348 | 348 | &:hover { |
|
349 | 349 | &:extend(.btn-default:hover); |
|
350 | 350 | } |
|
351 | 351 | |
|
352 | 352 | &.btn-link { |
|
353 | 353 | &:extend(.btn-link); |
|
354 | 354 | color: @rcblue; |
|
355 | 355 | |
|
356 | 356 | &:disabled { |
|
357 | 357 | border: none; |
|
358 | 358 | } |
|
359 | 359 | } |
|
360 | 360 | |
|
361 | 361 | &:disabled { |
|
362 | 362 | .border ( @border-thickness-buttons, @rcblue ); |
|
363 | 363 | background-color: white; |
|
364 | 364 | color: @rcblue; |
|
365 | 365 | } |
|
366 | 366 | } |
|
367 | 367 | |
|
368 | 368 | input[type="submit"], |
|
369 | 369 | input[type="reset"] { |
|
370 | 370 | &.btn-danger { |
|
371 | 371 | &:extend(.btn-danger); |
|
372 | 372 | |
|
373 | 373 | &:focus { |
|
374 | 374 | outline: 0; |
|
375 | 375 | } |
|
376 | 376 | |
|
377 | 377 | &:hover { |
|
378 | 378 | &:extend(.btn-danger:hover); |
|
379 | 379 | } |
|
380 | 380 | |
|
381 | 381 | &.btn-link { |
|
382 | 382 | &:extend(.btn-link); |
|
383 | 383 | color: @alert2; |
|
384 | 384 | |
|
385 | 385 | &:hover { |
|
386 | 386 | color: darken(@alert2,30%); |
|
387 | 387 | } |
|
388 | 388 | } |
|
389 | 389 | |
|
390 | 390 | &:disabled { |
|
391 | 391 | color: @alert2; |
|
392 | 392 | background-color: white; |
|
393 | 393 | } |
|
394 | 394 | } |
|
395 | 395 | &.btn-danger-action { |
|
396 | 396 | .border ( @border-thickness, @alert2 ); |
|
397 | 397 | background-color: @alert2; |
|
398 | 398 | color: white; |
|
399 | 399 | |
|
400 | 400 | a { |
|
401 | 401 | color: white; |
|
402 | 402 | } |
|
403 | 403 | |
|
404 | 404 | &:hover { |
|
405 | 405 | background-color: darken(@alert2,20%); |
|
406 | 406 | } |
|
407 | 407 | |
|
408 | 408 | &.active { |
|
409 | 409 | .border ( @border-thickness, @alert2 ); |
|
410 | 410 | color: white; |
|
411 | 411 | background-color: @alert2; |
|
412 | 412 | |
|
413 | 413 | a { |
|
414 | 414 | color: white; |
|
415 | 415 | } |
|
416 | 416 | } |
|
417 | 417 | |
|
418 | 418 | &:disabled { |
|
419 | 419 | background-color: white; |
|
420 | 420 | color: @alert2; |
|
421 | 421 | } |
|
422 | 422 | } |
|
423 | 423 | } |
|
424 | 424 | |
|
425 | 425 | |
|
426 | 426 | .button-links { |
|
427 | 427 | float: left; |
|
428 | 428 | display: inline; |
|
429 | 429 | margin: 0; |
|
430 | 430 | padding-left: 0; |
|
431 | 431 | list-style: none; |
|
432 | 432 | text-align: right; |
|
433 | 433 | |
|
434 | 434 | li { |
|
435 | 435 | |
|
436 | 436 | |
|
437 | 437 | } |
|
438 | 438 | |
|
439 | 439 | li.active { |
|
440 | 440 | background-color: @grey6; |
|
441 | 441 | .border ( @border-thickness, @grey4 ); |
|
442 | 442 | } |
|
443 | 443 | |
|
444 | 444 | } |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
@@ -1,164 +1,164 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | ${h.secure_form(h.route_path('repo_create'), request=request)} |
|
4 | 4 | <div class="form"> |
|
5 | 5 | <!-- fields --> |
|
6 | 6 | <div class="fields"> |
|
7 | 7 | <div class="field"> |
|
8 | 8 | <div class="label"> |
|
9 | 9 | <label for="repo_name">${_('Repository name')}:</label> |
|
10 | 10 | </div> |
|
11 | 11 | <div class="input"> |
|
12 | 12 | ${h.text('repo_name', class_="medium")} |
|
13 | 13 | <div class="info-block"> |
|
14 |
<a id="remote_clone_toggle" href="#"> |
|
|
14 | <a id="remote_clone_toggle" href="#">${_('Import Existing Repository ?')}</a> | |
|
15 | 15 | </div> |
|
16 | 16 | %if not c.rhodecode_user.is_admin: |
|
17 | 17 | ${h.hidden('user_created',True)} |
|
18 | 18 | %endif |
|
19 | 19 | </div> |
|
20 | 20 | </div> |
|
21 | 21 | <div id="remote_clone" class="field" style="display: none;"> |
|
22 | 22 | <div class="label"> |
|
23 | 23 | <label for="clone_uri">${_('Clone from')}:</label> |
|
24 | 24 | </div> |
|
25 | 25 | <div class="input"> |
|
26 | 26 | ${h.text('clone_uri', class_="medium")} |
|
27 | 27 | <span class="help-block"> |
|
28 | 28 | <pre> |
|
29 | 29 | - The repository must be accessible over http:// or https:// |
|
30 | 30 | - For Git projects it's recommended appending .git to the end of clone url. |
|
31 | 31 | - Make sure to select proper repository type from the below selector before importing it. |
|
32 | 32 | - If your HTTP[S] repository is not publicly accessible, |
|
33 | 33 | add authentication information to the URL: https://username:password@server.company.com/repo-name. |
|
34 | 34 | - The Git LFS/Mercurial Largefiles objects will not be imported. |
|
35 | 35 | - For very large repositories, it's recommended to manually copy them into the |
|
36 | 36 | RhodeCode <a href="${h.route_path('admin_settings_vcs', _anchor='vcs-storage-options')}">storage location</a> and run <a href="${h.route_path('admin_settings_mapping')}">Remap and Rescan</a>. |
|
37 | 37 | </pre> |
|
38 | 38 | </span> |
|
39 | 39 | </div> |
|
40 | 40 | </div> |
|
41 | 41 | <div class="field"> |
|
42 | 42 | <div class="label"> |
|
43 | 43 | <label for="repo_type">${_('Type')}:</label> |
|
44 | 44 | </div> |
|
45 | 45 | <div class="select"> |
|
46 | 46 | ${h.select('repo_type','hg',c.backends)} |
|
47 | 47 | <span class="help-block">${_('Set the type of repository to create.')}</span> |
|
48 | 48 | </div> |
|
49 | 49 | </div> |
|
50 | 50 | <div class="field"> |
|
51 | 51 | <div class="label"> |
|
52 | 52 | <label for="repo_group">${_('Repository group')}:</label> |
|
53 | 53 | </div> |
|
54 | 54 | <div class="select"> |
|
55 | 55 | ${h.select('repo_group',request.GET.get('parent_group'),c.repo_groups,class_="medium")} |
|
56 | 56 | % if c.personal_repo_group: |
|
57 | 57 | <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}"> |
|
58 | 58 | ${_('Select my personal group (%(repo_group_name)s)') % {'repo_group_name': c.personal_repo_group.group_name}} |
|
59 | 59 | </a> |
|
60 | 60 | % endif |
|
61 | 61 | <span class="help-block">${_('Optionally select a group to put this repository into.')}</span> |
|
62 | 62 | </div> |
|
63 | 63 | </div> |
|
64 | 64 | <div class="field"> |
|
65 | 65 | <div class="label"> |
|
66 | 66 | <label for="repo_description">${_('Description')}:</label> |
|
67 | 67 | </div> |
|
68 | 68 | <div class="textarea editor"> |
|
69 | 69 | ${h.textarea('repo_description',cols=23,rows=5,class_="medium")} |
|
70 | 70 | <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %> |
|
71 | 71 | <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span> |
|
72 | 72 | <span id="meta-tags-desc" style="display: none"> |
|
73 | 73 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
74 | 74 | ${dt.metatags_help()} |
|
75 | 75 | </span> |
|
76 | 76 | </div> |
|
77 | 77 | </div> |
|
78 | 78 | <div class="field"> |
|
79 | 79 | <div class="label"> |
|
80 | 80 | <label for="repo_landing_rev">${_('Landing commit')}:</label> |
|
81 | 81 | </div> |
|
82 | 82 | <div class="select"> |
|
83 | 83 | ${h.select('repo_landing_rev','',c.landing_revs,class_="medium")} |
|
84 | 84 | <span class="help-block">${_('The default commit for file pages, downloads, full text search index, and README generation.')}</span> |
|
85 | 85 | </div> |
|
86 | 86 | </div> |
|
87 | 87 | <div id="copy_perms" class="field"> |
|
88 | 88 | <div class="label label-checkbox"> |
|
89 | 89 | <label for="repo_copy_permissions">${_('Copy Parent Group Permissions')}:</label> |
|
90 | 90 | </div> |
|
91 | 91 | <div class="checkboxes"> |
|
92 | 92 | ${h.checkbox('repo_copy_permissions', value="True", checked="checked")} |
|
93 | 93 | <span class="help-block">${_('Copy permissions from parent repository group.')}</span> |
|
94 | 94 | </div> |
|
95 | 95 | </div> |
|
96 | 96 | <div class="field"> |
|
97 | 97 | <div class="label label-checkbox"> |
|
98 | 98 | <label for="repo_private">${_('Private Repository')}:</label> |
|
99 | 99 | </div> |
|
100 | 100 | <div class="checkboxes"> |
|
101 | 101 | ${h.checkbox('repo_private',value="True")} |
|
102 | 102 | <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span> |
|
103 | 103 | </div> |
|
104 | 104 | </div> |
|
105 | 105 | <div class="buttons"> |
|
106 | 106 | ${h.submit('save',_('Save'),class_="btn")} |
|
107 | 107 | </div> |
|
108 | 108 | </div> |
|
109 | 109 | </div> |
|
110 | 110 | <script> |
|
111 | 111 | $(document).ready(function(){ |
|
112 | 112 | var setCopyPermsOption = function(group_val){ |
|
113 | 113 | if(group_val != "-1"){ |
|
114 | 114 | $('#copy_perms').show() |
|
115 | 115 | } |
|
116 | 116 | else{ |
|
117 | 117 | $('#copy_perms').hide(); |
|
118 | 118 | } |
|
119 | 119 | }; |
|
120 | 120 | |
|
121 | 121 | $('#remote_clone_toggle').on('click', function(e){ |
|
122 | 122 | $('#remote_clone').show(); |
|
123 | 123 | e.preventDefault(); |
|
124 | 124 | }); |
|
125 | 125 | |
|
126 | 126 | if($('#remote_clone input').hasClass('error')){ |
|
127 | 127 | $('#remote_clone').show(); |
|
128 | 128 | } |
|
129 | 129 | if($('#remote_clone input').val()){ |
|
130 | 130 | $('#remote_clone').show(); |
|
131 | 131 | } |
|
132 | 132 | |
|
133 | 133 | $("#repo_group").select2({ |
|
134 | 134 | 'containerCssClass': "drop-menu", |
|
135 | 135 | 'dropdownCssClass': "drop-menu-dropdown", |
|
136 | 136 | 'dropdownAutoWidth': true, |
|
137 | 137 | 'width': "resolve" |
|
138 | 138 | }); |
|
139 | 139 | |
|
140 | 140 | setCopyPermsOption($('#repo_group').val()); |
|
141 | 141 | $("#repo_group").on("change", function(e) { |
|
142 | 142 | setCopyPermsOption(e.val) |
|
143 | 143 | }); |
|
144 | 144 | |
|
145 | 145 | $("#repo_type").select2({ |
|
146 | 146 | 'containerCssClass': "drop-menu", |
|
147 | 147 | 'dropdownCssClass': "drop-menu-dropdown", |
|
148 | 148 | 'minimumResultsForSearch': -1, |
|
149 | 149 | }); |
|
150 | 150 | $("#repo_landing_rev").select2({ |
|
151 | 151 | 'containerCssClass': "drop-menu", |
|
152 | 152 | 'dropdownCssClass': "drop-menu-dropdown", |
|
153 | 153 | 'minimumResultsForSearch': -1, |
|
154 | 154 | }); |
|
155 | 155 | $('#repo_name').focus(); |
|
156 | 156 | |
|
157 | 157 | $('#select_my_group').on('click', function(e){ |
|
158 | 158 | e.preventDefault(); |
|
159 | 159 | $("#repo_group").val($(this).data('personalGroupId')).trigger("change"); |
|
160 | 160 | }) |
|
161 | 161 | |
|
162 | 162 | }) |
|
163 | 163 | </script> |
|
164 | 164 | ${h.end_form()} |
@@ -1,291 +1,291 b'' | |||
|
1 | 1 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | 2 | |
|
3 | 3 | <% |
|
4 | 4 | elems = [ |
|
5 | 5 | (_('Repository ID'), c.rhodecode_db_repo.repo_id, '', ''), |
|
6 | 6 | (_('Owner'), lambda:base.gravatar_with_user(c.rhodecode_db_repo.user.email), '', ''), |
|
7 | 7 | (_('Created on'), h.format_date(c.rhodecode_db_repo.created_on), '', ''), |
|
8 | 8 | (_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''), |
|
9 | 9 | (_('Cached Commit id'), lambda: h.link_to(c.rhodecode_db_repo.changeset_cache.get('short_id'), h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.changeset_cache.get('raw_id'))), '', ''), |
|
10 | 10 | (_('Cached Commit date'), c.rhodecode_db_repo.changeset_cache.get('date'), '', ''), |
|
11 | 11 | (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]), |
|
12 | 12 | (_('Pull requests source'), len(c.rhodecode_db_repo.pull_requests_source), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.source_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_source]), |
|
13 | 13 | (_('Pull requests target'), len(c.rhodecode_db_repo.pull_requests_target), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.target_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_target]), |
|
14 | 14 | (_('Attached Artifacts'), len(c.rhodecode_db_repo.artifacts), '', ''), |
|
15 | 15 | ] |
|
16 | 16 | %> |
|
17 | 17 | |
|
18 | 18 | <div class="panel panel-default"> |
|
19 | 19 | <div class="panel-heading" id="advanced-info" > |
|
20 | 20 | <h3 class="panel-title">${_('Repository: %s') % c.rhodecode_db_repo.repo_name} <a class="permalink" href="#advanced-info"> ¶</a></h3> |
|
21 | 21 | </div> |
|
22 | 22 | <div class="panel-body"> |
|
23 | 23 | ${base.dt_info_panel(elems)} |
|
24 | 24 | </div> |
|
25 | 25 | </div> |
|
26 | 26 | |
|
27 | 27 | |
|
28 | 28 | <div class="panel panel-default"> |
|
29 | 29 | <div class="panel-heading" id="advanced-fork"> |
|
30 | 30 | <h3 class="panel-title">${_('Fork Reference')} <a class="permalink" href="#advanced-fork"> ¶</a></h3> |
|
31 | 31 | </div> |
|
32 | 32 | <div class="panel-body"> |
|
33 | 33 | ${h.secure_form(h.route_path('edit_repo_advanced_fork', repo_name=c.rhodecode_db_repo.repo_name), request=request)} |
|
34 | 34 | |
|
35 | 35 | % if c.rhodecode_db_repo.fork: |
|
36 | 36 | <div class="panel-body-title-text">${h.literal(_('This repository is a fork of %(repo_link)s') % {'repo_link': h.link_to_if(c.has_origin_repo_read_perm,c.rhodecode_db_repo.fork.repo_name, h.route_path('repo_summary', repo_name=c.rhodecode_db_repo.fork.repo_name))})} |
|
37 | 37 | | <button class="btn btn-link btn-danger" type="submit">Remove fork reference</button></div> |
|
38 | 38 | % endif |
|
39 | 39 | |
|
40 | 40 | <div class="field"> |
|
41 | 41 | ${h.hidden('id_fork_of')} |
|
42 | 42 | ${h.submit('set_as_fork_%s' % c.rhodecode_db_repo.repo_name,_('Set'),class_="btn btn-small",)} |
|
43 | 43 | </div> |
|
44 | 44 | <div class="field"> |
|
45 | 45 | <span class="help-block">${_('Manually set this repository as a fork of another from the list')}</span> |
|
46 | 46 | </div> |
|
47 | 47 | ${h.end_form()} |
|
48 | 48 | </div> |
|
49 | 49 | </div> |
|
50 | 50 | |
|
51 | 51 | |
|
52 | 52 | <div class="panel panel-default"> |
|
53 | 53 | <div class="panel-heading" id="advanced-journal"> |
|
54 | 54 | <h3 class="panel-title">${_('Public Journal Visibility')} <a class="permalink" href="#advanced-journal"> ¶</a></h3> |
|
55 | 55 | </div> |
|
56 | 56 | <div class="panel-body"> |
|
57 | 57 | ${h.secure_form(h.route_path('edit_repo_advanced_journal', repo_name=c.rhodecode_db_repo.repo_name), request=request)} |
|
58 | 58 | <div class="field"> |
|
59 | 59 | %if c.in_public_journal: |
|
60 | 60 | <button class="btn btn-small" type="submit"> |
|
61 | 61 | ${_('Remove from Public Journal')} |
|
62 | 62 | </button> |
|
63 | 63 | %else: |
|
64 | 64 | <button class="btn btn-small" type="submit"> |
|
65 | 65 | ${_('Add to Public Journal')} |
|
66 | 66 | </button> |
|
67 | 67 | %endif |
|
68 | 68 | </div> |
|
69 | 69 | <div class="field" > |
|
70 | 70 | <span class="help-block">${_('All actions made on this repository will be visible to everyone following the public journal.')}</span> |
|
71 | 71 | </div> |
|
72 | 72 | ${h.end_form()} |
|
73 | 73 | </div> |
|
74 | 74 | </div> |
|
75 | 75 | |
|
76 | 76 | |
|
77 | 77 | <div class="panel panel-default"> |
|
78 | 78 | <div class="panel-heading" id="advanced-locking"> |
|
79 | 79 | <h3 class="panel-title">${_('Locking state')} <a class="permalink" href="#advanced-locking"> ¶</a></h3> |
|
80 | 80 | </div> |
|
81 | 81 | <div class="panel-body"> |
|
82 | 82 | ${h.secure_form(h.route_path('edit_repo_advanced_locking', repo_name=c.rhodecode_db_repo.repo_name), request=request)} |
|
83 | 83 | |
|
84 | 84 | %if c.rhodecode_db_repo.locked[0]: |
|
85 | 85 | <div class="panel-body-title-text">${'Locked by %s on %s. Lock reason: %s' % (h.person_by_id(c.rhodecode_db_repo.locked[0]), |
|
86 | 86 | h.format_date(h. time_to_datetime(c.rhodecode_db_repo.locked[1])), c.rhodecode_db_repo.locked[2])}</div> |
|
87 | 87 | %else: |
|
88 | 88 | <div class="panel-body-title-text">${_('This Repository is not currently locked.')}</div> |
|
89 | 89 | %endif |
|
90 | 90 | |
|
91 | 91 | <div class="field" > |
|
92 | 92 | %if c.rhodecode_db_repo.locked[0]: |
|
93 | 93 | ${h.hidden('set_unlock', '1')} |
|
94 | 94 | <button class="btn btn-small" type="submit" |
|
95 | 95 | onclick="return confirm('${_('Confirm to unlock repository.')}');"> |
|
96 | 96 | <i class="icon-unlock"></i> |
|
97 | 97 | ${_('Unlock repository')} |
|
98 | 98 | </button> |
|
99 | 99 | %else: |
|
100 | 100 | ${h.hidden('set_lock', '1')} |
|
101 | 101 | <button class="btn btn-small" type="submit" |
|
102 | 102 | onclick="return confirm('${_('Confirm to lock repository.')}');"> |
|
103 | 103 | <i class="icon-lock"></i> |
|
104 | 104 | ${_('Lock repository')} |
|
105 | 105 | </button> |
|
106 | 106 | %endif |
|
107 | 107 | </div> |
|
108 | 108 | <div class="field" > |
|
109 | 109 | <span class="help-block"> |
|
110 | 110 | ${_('Force repository locking. This only works when anonymous access is disabled. Pulling from the repository locks the repository to that user until the same user pushes to that repository again.')} |
|
111 | 111 | </span> |
|
112 | 112 | </div> |
|
113 | 113 | ${h.end_form()} |
|
114 | 114 | </div> |
|
115 | 115 | </div> |
|
116 | 116 | |
|
117 | 117 | |
|
118 | 118 | <div class="panel panel-default"> |
|
119 | 119 | <div class="panel-heading" id="advanced-hooks"> |
|
120 | 120 | <h3 class="panel-title">${_('Hooks')} <a class="permalink" href="#advanced-hooks"> ¶</a></h3> |
|
121 | 121 | </div> |
|
122 | 122 | <div class="panel-body"> |
|
123 | 123 | <table class="rctable"> |
|
124 | 124 | <th>${_('Hook type')}</th> |
|
125 | 125 | <th>${_('Hook version')}</th> |
|
126 | 126 | <th>${_('Current version')}</th> |
|
127 | 127 | % if c.ver_info_dict: |
|
128 | 128 | <tr> |
|
129 | 129 | <td>${_('PRE HOOK')}</td> |
|
130 | 130 | <td>${c.ver_info_dict['pre_version']}</td> |
|
131 | 131 | <td>${c.rhodecode_version}</td> |
|
132 | 132 | </tr> |
|
133 | 133 | <tr> |
|
134 | 134 | <td>${_('POST HOOK')}</td> |
|
135 | 135 | <td>${c.ver_info_dict['post_version']}</td> |
|
136 | 136 | <td>${c.rhodecode_version}</td> |
|
137 | 137 | </tr> |
|
138 | 138 | % else: |
|
139 | 139 | <tr> |
|
140 | 140 | <td>${_('Unable to read hook information from VCS Server')}</td> |
|
141 | 141 | </tr> |
|
142 | 142 | % endif |
|
143 | 143 | </table> |
|
144 | 144 | |
|
145 | 145 | <a href="${h.route_path('edit_repo_advanced_hooks', repo_name=c.repo_name)}" |
|
146 | 146 | onclick="return confirm('${_('Confirm to reinstall hooks for this repository.')}');"> |
|
147 | 147 | ${_('Update Hooks')} |
|
148 | 148 | </a> |
|
149 | 149 | </div> |
|
150 | 150 | </div> |
|
151 | 151 | |
|
152 | 152 | <div class="panel panel-warning"> |
|
153 | 153 | <div class="panel-heading" id="advanced-archive"> |
|
154 | 154 | <h3 class="panel-title">${_('Archive repository')} <a class="permalink" href="#advanced-archive"> ¶</a></h3> |
|
155 | 155 | </div> |
|
156 | 156 | <div class="panel-body"> |
|
157 | 157 | ${h.secure_form(h.route_path('edit_repo_advanced_archive', repo_name=c.repo_name), request=request)} |
|
158 | 158 | |
|
159 | 159 | <div style="margin: 0 0 20px 0" class="fake-space"></div> |
|
160 | 160 | |
|
161 | 161 | <div class="field"> |
|
162 | 162 | <button class="btn btn-small btn-danger" type="submit" |
|
163 | 163 | onclick="return confirm('${_('Confirm to archive this repository: %s') % c.repo_name}');"> |
|
164 |
<i class="icon-remove |
|
|
164 | <i class="icon-remove"></i> | |
|
165 | 165 | ${_('Archive this repository')} |
|
166 | 166 | </button> |
|
167 | 167 | </div> |
|
168 | 168 | <div class="field"> |
|
169 | 169 | <span class="help-block"> |
|
170 | 170 | ${_('Archiving the repository will make it entirely read-only. The repository cannot be committed to.' |
|
171 | 171 | 'It is hidden from the search results and dashboard. ')} |
|
172 | 172 | </span> |
|
173 | 173 | </div> |
|
174 | 174 | |
|
175 | 175 | ${h.end_form()} |
|
176 | 176 | </div> |
|
177 | 177 | </div> |
|
178 | 178 | |
|
179 | 179 | |
|
180 | 180 | <div class="panel panel-danger"> |
|
181 | 181 | <div class="panel-heading" id="advanced-delete"> |
|
182 | 182 | <h3 class="panel-title">${_('Delete repository')} <a class="permalink" href="#advanced-delete"> ¶</a></h3> |
|
183 | 183 | </div> |
|
184 | 184 | <div class="panel-body"> |
|
185 | 185 | ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=c.repo_name), request=request)} |
|
186 | 186 | <table class="display"> |
|
187 | 187 | <tr> |
|
188 | 188 | <td> |
|
189 | 189 | ${_ungettext('This repository has %s fork.', 'This repository has %s forks.', c.rhodecode_db_repo.forks.count()) % c.rhodecode_db_repo.forks.count()} |
|
190 | 190 | </td> |
|
191 | 191 | <td> |
|
192 | 192 | %if c.rhodecode_db_repo.forks.count(): |
|
193 | 193 | <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label> |
|
194 | 194 | %endif |
|
195 | 195 | </td> |
|
196 | 196 | <td> |
|
197 | 197 | %if c.rhodecode_db_repo.forks.count(): |
|
198 | 198 | <input type="radio" name="forks" value="delete_forks"/> <label for="forks">${_('Delete forks')}</label> |
|
199 | 199 | %endif |
|
200 | 200 | </td> |
|
201 | 201 | </tr> |
|
202 | 202 | <% attached_prs = len(c.rhodecode_db_repo.pull_requests_source + c.rhodecode_db_repo.pull_requests_target) %> |
|
203 | 203 | % if c.rhodecode_db_repo.pull_requests_source or c.rhodecode_db_repo.pull_requests_target: |
|
204 | 204 | <tr> |
|
205 | 205 | <td> |
|
206 | 206 | ${_ungettext('This repository has %s attached pull request.', 'This repository has %s attached pull requests.', attached_prs) % attached_prs} |
|
207 | 207 | <br/> |
|
208 | 208 | ${_('Consider to archive this repository instead.')} |
|
209 | 209 | </td> |
|
210 | 210 | <td></td> |
|
211 | 211 | <td></td> |
|
212 | 212 | </tr> |
|
213 | 213 | % endif |
|
214 | 214 | </table> |
|
215 | 215 | <div style="margin: 0 0 20px 0" class="fake-space"></div> |
|
216 | 216 | |
|
217 | 217 | <div class="field"> |
|
218 | 218 | <button class="btn btn-small btn-danger" type="submit" |
|
219 | 219 | onclick="return confirm('${_('Confirm to delete this repository: %s') % c.repo_name}');"> |
|
220 |
<i class="icon-remove |
|
|
220 | <i class="icon-remove"></i> | |
|
221 | 221 | ${_('Delete this repository')} |
|
222 | 222 | </button> |
|
223 | 223 | </div> |
|
224 | 224 | <div class="field"> |
|
225 | 225 | <span class="help-block"> |
|
226 | 226 | ${_('This repository will be renamed in a special way in order to make it inaccessible to RhodeCode Enterprise and its VCS systems. If you need to fully delete it from the file system, please do it manually, or with rhodecode-cleanup-repos command available in rhodecode-tools.')} |
|
227 | 227 | </span> |
|
228 | 228 | </div> |
|
229 | 229 | |
|
230 | 230 | ${h.end_form()} |
|
231 | 231 | </div> |
|
232 | 232 | </div> |
|
233 | 233 | |
|
234 | 234 | |
|
235 | 235 | <script> |
|
236 | 236 | |
|
237 | 237 | var currentRepoId = ${c.rhodecode_db_repo.repo_id}; |
|
238 | 238 | |
|
239 | 239 | var repoTypeFilter = function(data) { |
|
240 | 240 | var results = []; |
|
241 | 241 | |
|
242 | 242 | if (!data.results[0]) { |
|
243 | 243 | return data |
|
244 | 244 | } |
|
245 | 245 | |
|
246 | 246 | $.each(data.results[0].children, function() { |
|
247 | 247 | // filter out the SAME repo, it cannot be used as fork of itself |
|
248 | 248 | if (this.repo_id != currentRepoId) { |
|
249 | 249 | this.id = this.repo_id; |
|
250 | 250 | results.push(this) |
|
251 | 251 | } |
|
252 | 252 | }); |
|
253 | 253 | data.results[0].children = results; |
|
254 | 254 | return data; |
|
255 | 255 | }; |
|
256 | 256 | |
|
257 | 257 | $("#id_fork_of").select2({ |
|
258 | 258 | cachedDataSource: {}, |
|
259 | 259 | minimumInputLength: 2, |
|
260 | 260 | placeholder: "${_('Change repository') if c.rhodecode_db_repo.fork else _('Pick repository')}", |
|
261 | 261 | dropdownAutoWidth: true, |
|
262 | 262 | containerCssClass: "drop-menu", |
|
263 | 263 | dropdownCssClass: "drop-menu-dropdown", |
|
264 | 264 | formatResult: formatRepoResult, |
|
265 | 265 | query: $.debounce(250, function(query){ |
|
266 | 266 | self = this; |
|
267 | 267 | var cacheKey = query.term; |
|
268 | 268 | var cachedData = self.cachedDataSource[cacheKey]; |
|
269 | 269 | |
|
270 | 270 | if (cachedData) { |
|
271 | 271 | query.callback({results: cachedData.results}); |
|
272 | 272 | } else { |
|
273 | 273 | $.ajax({ |
|
274 | 274 | url: pyroutes.url('repo_list_data'), |
|
275 | 275 | data: {'query': query.term, repo_type: '${c.rhodecode_db_repo.repo_type}'}, |
|
276 | 276 | dataType: 'json', |
|
277 | 277 | type: 'GET', |
|
278 | 278 | success: function(data) { |
|
279 | 279 | data = repoTypeFilter(data); |
|
280 | 280 | self.cachedDataSource[cacheKey] = data; |
|
281 | 281 | query.callback({results: data.results}); |
|
282 | 282 | }, |
|
283 | 283 | error: function(data, textStatus, errorThrown) { |
|
284 | 284 | alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText)); |
|
285 | 285 | } |
|
286 | 286 | }) |
|
287 | 287 | } |
|
288 | 288 | }) |
|
289 | 289 | }); |
|
290 | 290 | </script> |
|
291 | 291 |
@@ -1,329 +1,329 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 | 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 | <% sync_link = h.literal(h.link_to('remote sync', h.route_path('edit_repo_remote', repo_name=c.repo_name))) %> |
|
50 | 50 | <div class="field"> |
|
51 | 51 | <div class="label"> |
|
52 | 52 | <label for="clone_uri">${_('Remote pull uri')}:</label> |
|
53 | 53 | </div> |
|
54 | 54 | <div class="input"> |
|
55 | 55 | %if c.rhodecode_db_repo.clone_uri: |
|
56 | 56 | ## display, if we don't have any errors |
|
57 | 57 | % if not c.form['repo_clone_uri'].error: |
|
58 | 58 | <div id="clone_uri_hidden" class='text-as-placeholder'> |
|
59 | 59 | <span id="clone_uri_hidden_value">${c.rhodecode_db_repo.clone_uri_hidden}</span> |
|
60 |
<span class="link" id="edit_clone_uri" |
|
|
60 | <span class="link" id="edit_clone_uri">${_('edit')}</span> | |
|
61 | 61 | </div> |
|
62 | 62 | % endif |
|
63 | 63 | |
|
64 | 64 | ## alter field |
|
65 | 65 | <div id="alter_clone_uri" style="${'' if c.form['repo_clone_uri'].error else 'display: none'}"> |
|
66 | 66 | ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri', placeholder=_('enter new value, or leave empty to remove'))|n} |
|
67 | 67 | ${c.form.render_error(request, c.form['repo_clone_uri'])|n} |
|
68 | 68 | % if c.form['repo_clone_uri'].error: |
|
69 | 69 | ## we got error from form subit, means we modify the url |
|
70 | 70 | ${h.hidden('repo_clone_uri_change', 'MOD')} |
|
71 | 71 | % else: |
|
72 | 72 | ${h.hidden('repo_clone_uri_change', 'OLD')} |
|
73 | 73 | % endif |
|
74 | 74 | |
|
75 | 75 | % if not c.form['repo_clone_uri'].error: |
|
76 | 76 | <span class="link" id="cancel_edit_clone_uri">${_('cancel')}</span> |
|
77 | 77 | % endif |
|
78 | 78 | |
|
79 | 79 | </div> |
|
80 | 80 | %else: |
|
81 | 81 | ## not set yet, display form to set it |
|
82 | 82 | ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri')|n} |
|
83 | 83 | ${c.form.render_error(request, c.form['repo_clone_uri'])|n} |
|
84 | 84 | ${h.hidden('repo_clone_uri_change', 'NEW')} |
|
85 | 85 | %endif |
|
86 | 86 | <p id="alter_clone_uri_help_block" class="help-block"> |
|
87 | 87 | ${_('http[s] url where from repository was imported. This field can used for doing {sync_link}.').format(sync_link=sync_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 | <div class="field"> |
|
93 | 93 | <div class="label"> |
|
94 | 94 | <label for="push_uri">${_('Remote push uri')}:</label> |
|
95 | 95 | </div> |
|
96 | 96 | <div class="input"> |
|
97 | 97 | %if c.rhodecode_db_repo.push_uri: |
|
98 | 98 | ## display, if we don't have any errors |
|
99 | 99 | % if not c.form['repo_push_uri'].error: |
|
100 | 100 | <div id="push_uri_hidden" class='text-as-placeholder'> |
|
101 | 101 | <span id="push_uri_hidden_value">${c.rhodecode_db_repo.push_uri_hidden}</span> |
|
102 |
<span class="link" id="edit_push_uri" |
|
|
102 | <span class="link" id="edit_push_uri">${_('edit')}</span> | |
|
103 | 103 | </div> |
|
104 | 104 | % endif |
|
105 | 105 | |
|
106 | 106 | ## alter field |
|
107 | 107 | <div id="alter_push_uri" style="${'' if c.form['repo_push_uri'].error else 'display: none'}"> |
|
108 | 108 | ${c.form['repo_push_uri'].render(css_class='medium', oid='push_uri', placeholder=_('enter new value, or leave empty to remove'))|n} |
|
109 | 109 | ${c.form.render_error(request, c.form['repo_push_uri'])|n} |
|
110 | 110 | % if c.form['repo_push_uri'].error: |
|
111 | 111 | ## we got error from form subit, means we modify the url |
|
112 | 112 | ${h.hidden('repo_push_uri_change', 'MOD')} |
|
113 | 113 | % else: |
|
114 | 114 | ${h.hidden('repo_push_uri_change', 'OLD')} |
|
115 | 115 | % endif |
|
116 | 116 | |
|
117 | 117 | % if not c.form['repo_push_uri'].error: |
|
118 | 118 | <span class="link" id="cancel_edit_push_uri">${_('cancel')}</span> |
|
119 | 119 | % endif |
|
120 | 120 | |
|
121 | 121 | </div> |
|
122 | 122 | %else: |
|
123 | 123 | ## not set yet, display form to set it |
|
124 | 124 | ${c.form['repo_push_uri'].render(css_class='medium', oid='push_uri')|n} |
|
125 | 125 | ${c.form.render_error(request, c.form['repo_push_uri'])|n} |
|
126 | 126 | ${h.hidden('repo_push_uri_change', 'NEW')} |
|
127 | 127 | %endif |
|
128 | 128 | <p id="alter_push_uri_help_block" class="help-block"> |
|
129 | 129 | ${_('http[s] url to sync data back. This field can used for doing {sync_link}.').format(sync_link=sync_link)|n} <br/> |
|
130 | 130 | ${_('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.')} |
|
131 | 131 | </p> |
|
132 | 132 | </div> |
|
133 | 133 | </div> |
|
134 | 134 | % else: |
|
135 | 135 | ${h.hidden('repo_clone_uri', '')} |
|
136 | 136 | ${h.hidden('repo_push_uri', '')} |
|
137 | 137 | % endif |
|
138 | 138 | |
|
139 | 139 | <div class="field"> |
|
140 | 140 | <div class="label"> |
|
141 | 141 | <label for="repo_landing_commit_ref">${_('Landing commit')}:</label> |
|
142 | 142 | </div> |
|
143 | 143 | <div class="select"> |
|
144 | 144 | ${c.form['repo_landing_commit_ref'].render(css_class='medium', oid='repo_landing_commit_ref')|n} |
|
145 | 145 | ${c.form.render_error(request, c.form['repo_landing_commit_ref'])|n} |
|
146 | 146 | <p class="help-block">${_('The default commit for file pages, downloads, full text search index, and README generation.')}</p> |
|
147 | 147 | </div> |
|
148 | 148 | </div> |
|
149 | 149 | |
|
150 | 150 | <div class="field badged-field"> |
|
151 | 151 | <div class="label"> |
|
152 | 152 | <label for="repo_owner">${_('Owner')}:</label> |
|
153 | 153 | </div> |
|
154 | 154 | <div class="input"> |
|
155 | 155 | <div class="badge-input-container"> |
|
156 | 156 | <div class="user-badge"> |
|
157 | 157 | ${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)} |
|
158 | 158 | </div> |
|
159 | 159 | <div class="badge-input-wrap"> |
|
160 | 160 | ${c.form['repo_owner'].render(css_class='medium', oid='repo_owner')|n} |
|
161 | 161 | </div> |
|
162 | 162 | </div> |
|
163 | 163 | ${c.form.render_error(request, c.form['repo_owner'])|n} |
|
164 | 164 | <p class="help-block">${_('Change owner of this repository.')}</p> |
|
165 | 165 | </div> |
|
166 | 166 | </div> |
|
167 | 167 | |
|
168 | 168 | <div class="field"> |
|
169 | 169 | <div class="label label-textarea"> |
|
170 | 170 | <label for="repo_description">${_('Description')}:</label> |
|
171 | 171 | </div> |
|
172 | 172 | <div class="textarea text-area editor"> |
|
173 | 173 | ${c.form['repo_description'].render(css_class='medium', oid='repo_description')|n} |
|
174 | 174 | ${c.form.render_error(request, c.form['repo_description'])|n} |
|
175 | 175 | |
|
176 | 176 | <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %> |
|
177 | 177 | <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span> |
|
178 | 178 | <span id="meta-tags-desc" style="display: none"> |
|
179 | 179 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
180 | 180 | ${dt.metatags_help()} |
|
181 | 181 | </span> |
|
182 | 182 | </div> |
|
183 | 183 | </div> |
|
184 | 184 | |
|
185 | 185 | <div class="field"> |
|
186 | 186 | <div class="label label-checkbox"> |
|
187 | 187 | <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label> |
|
188 | 188 | </div> |
|
189 | 189 | <div class="checkboxes"> |
|
190 | 190 | ${c.form['repo_private'].render(css_class='medium')|n} |
|
191 | 191 | ${c.form.render_error(request, c.form['repo_private'])|n} |
|
192 | 192 | <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span> |
|
193 | 193 | </div> |
|
194 | 194 | </div> |
|
195 | 195 | <div class="field"> |
|
196 | 196 | <div class="label label-checkbox"> |
|
197 | 197 | <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label> |
|
198 | 198 | </div> |
|
199 | 199 | <div class="checkboxes"> |
|
200 | 200 | ${c.form['repo_enable_statistics'].render(css_class='medium')|n} |
|
201 | 201 | ${c.form.render_error(request, c.form['repo_enable_statistics'])|n} |
|
202 | 202 | <span class="help-block">${_('Enable statistics window on summary page.')}</span> |
|
203 | 203 | </div> |
|
204 | 204 | </div> |
|
205 | 205 | <div class="field"> |
|
206 | 206 | <div class="label label-checkbox"> |
|
207 | 207 | <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label> |
|
208 | 208 | </div> |
|
209 | 209 | <div class="checkboxes"> |
|
210 | 210 | ${c.form['repo_enable_downloads'].render(css_class='medium')|n} |
|
211 | 211 | ${c.form.render_error(request, c.form['repo_enable_downloads'])|n} |
|
212 | 212 | <span class="help-block">${_('Enable download menu on summary page.')}</span> |
|
213 | 213 | </div> |
|
214 | 214 | </div> |
|
215 | 215 | <div class="field"> |
|
216 | 216 | <div class="label label-checkbox"> |
|
217 | 217 | <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label> |
|
218 | 218 | </div> |
|
219 | 219 | <div class="checkboxes"> |
|
220 | 220 | ${c.form['repo_enable_locking'].render(css_class='medium')|n} |
|
221 | 221 | ${c.form.render_error(request, c.form['repo_enable_locking'])|n} |
|
222 | 222 | <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> |
|
223 | 223 | </div> |
|
224 | 224 | </div> |
|
225 | 225 | |
|
226 | 226 | %if c.visual.repository_fields: |
|
227 | 227 | ## EXTRA FIELDS |
|
228 | 228 | %for field in c.repo_fields: |
|
229 | 229 | <div class="field"> |
|
230 | 230 | <div class="label"> |
|
231 | 231 | <label for="${field.field_key_prefixed}">${field.field_label} (${field.field_key}):</label> |
|
232 | 232 | </div> |
|
233 | 233 | <div class="input input-medium"> |
|
234 | 234 | ${h.text(field.field_key_prefixed, field.field_value, class_='medium')} |
|
235 | 235 | %if field.field_desc: |
|
236 | 236 | <span class="help-block">${field.field_desc}</span> |
|
237 | 237 | %endif |
|
238 | 238 | </div> |
|
239 | 239 | </div> |
|
240 | 240 | %endfor |
|
241 | 241 | %endif |
|
242 | 242 | <div class="buttons"> |
|
243 | 243 | ${h.submit('save',_('Save'),class_="btn")} |
|
244 | 244 | ${h.reset('reset',_('Reset'),class_="btn")} |
|
245 | 245 | </div> |
|
246 | 246 | </div> |
|
247 | 247 | </div> |
|
248 | 248 | ${h.end_form()} |
|
249 | 249 | </div> |
|
250 | 250 | </div> |
|
251 | 251 | |
|
252 | 252 | <script> |
|
253 | 253 | $(document).ready(function () { |
|
254 | 254 | var cloneUrl = function ( |
|
255 | 255 | alterButton, editButton, cancelEditButton, |
|
256 | 256 | hiddenUrl, hiddenUrlValue, input, helpBlock, changedFlag) { |
|
257 | 257 | |
|
258 | 258 | var originalText = helpBlock.html(); |
|
259 | 259 | var obfuscatedUrl = hiddenUrlValue.html(); |
|
260 | 260 | |
|
261 | 261 | var edit = function(e) { |
|
262 | 262 | alterButton.show(); |
|
263 | 263 | editButton.hide(); |
|
264 | 264 | hiddenUrl.hide(); |
|
265 | 265 | |
|
266 | 266 | //add the old value next to input for verification |
|
267 | 267 | helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText); |
|
268 | 268 | changedFlag.val('MOD'); |
|
269 | 269 | }; |
|
270 | 270 | |
|
271 | 271 | var cancelEdit = function(e) { |
|
272 | 272 | alterButton.hide(); |
|
273 | 273 | editButton.show(); |
|
274 | 274 | hiddenUrl.show(); |
|
275 | 275 | |
|
276 | 276 | helpBlock.html(originalText); |
|
277 | 277 | changedFlag.val('OLD'); |
|
278 | 278 | input.val(''); |
|
279 | 279 | }; |
|
280 | 280 | |
|
281 | 281 | var initEvents = function() { |
|
282 | 282 | editButton.on('click', edit); |
|
283 | 283 | cancelEditButton.on('click', cancelEdit); |
|
284 | 284 | }; |
|
285 | 285 | |
|
286 | 286 | var setInitialState = function() { |
|
287 | 287 | if (input.hasClass('error')) { |
|
288 | 288 | alterButton.show(); |
|
289 | 289 | editButton.hide(); |
|
290 | 290 | hiddenUrl.hide(); |
|
291 | 291 | } |
|
292 | 292 | }; |
|
293 | 293 | |
|
294 | 294 | setInitialState(); |
|
295 | 295 | initEvents(); |
|
296 | 296 | }; |
|
297 | 297 | |
|
298 | 298 | |
|
299 | 299 | var alterButton = $('#alter_clone_uri'); |
|
300 | 300 | var editButton = $('#edit_clone_uri'); |
|
301 | 301 | var cancelEditButton = $('#cancel_edit_clone_uri'); |
|
302 | 302 | var hiddenUrl = $('#clone_uri_hidden'); |
|
303 | 303 | var hiddenUrlValue = $('#clone_uri_hidden_value'); |
|
304 | 304 | var input = $('#clone_uri'); |
|
305 | 305 | var helpBlock = $('#alter_clone_uri_help_block'); |
|
306 | 306 | var changedFlag = $('#repo_clone_uri_change'); |
|
307 | 307 | cloneUrl( |
|
308 | 308 | alterButton, editButton, cancelEditButton, hiddenUrl, |
|
309 | 309 | hiddenUrlValue, input, helpBlock, changedFlag); |
|
310 | 310 | |
|
311 | 311 | var alterButton = $('#alter_push_uri'); |
|
312 | 312 | var editButton = $('#edit_push_uri'); |
|
313 | 313 | var cancelEditButton = $('#cancel_edit_push_uri'); |
|
314 | 314 | var hiddenUrl = $('#push_uri_hidden'); |
|
315 | 315 | var hiddenUrlValue = $('#push_uri_hidden_value'); |
|
316 | 316 | var input = $('#push_uri'); |
|
317 | 317 | var helpBlock = $('#alter_push_uri_help_block'); |
|
318 | 318 | var changedFlag = $('#repo_push_uri_change'); |
|
319 | 319 | cloneUrl( |
|
320 | 320 | alterButton, editButton, cancelEditButton, hiddenUrl, |
|
321 | 321 | hiddenUrlValue, input, helpBlock, changedFlag); |
|
322 | 322 | |
|
323 | 323 | selectMyGroup = function(element) { |
|
324 | 324 | $("#repo_group").val($(element).data('personalGroupId')).trigger("change"); |
|
325 | 325 | }; |
|
326 | 326 | |
|
327 | 327 | UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}'); |
|
328 | 328 | }); |
|
329 | 329 | </script> |
@@ -1,38 +1,38 b'' | |||
|
1 | 1 | <div class="panel panel-default"> |
|
2 | 2 | <div class="panel-heading"> |
|
3 | 3 | <h3 class="panel-title">${_('Exceptions Tracker - Exception ID')}: ${c.exception_id}</h3> |
|
4 | 4 | </div> |
|
5 | 5 | <div class="panel-body"> |
|
6 | 6 | % if c.traceback: |
|
7 | 7 | |
|
8 | 8 | <h4>${_('Exception `{}` generated on UTC date: {}').format(c.traceback.get('exc_type', 'NO_TYPE'), c.traceback.get('exc_utc_date', 'NO_DATE'))}</h4> |
|
9 | 9 | <pre>${c.traceback.get('exc_message', 'NO_MESSAGE')}</pre> |
|
10 | 10 | |
|
11 | 11 | % else: |
|
12 | 12 | ${_('Unable to Read Exception. It might be removed or non-existing.')} |
|
13 | 13 | % endif |
|
14 | 14 | </div> |
|
15 | 15 | </div> |
|
16 | 16 | |
|
17 | 17 | |
|
18 | 18 | % if c.traceback: |
|
19 | 19 | <div class="panel panel-danger"> |
|
20 | 20 | <div class="panel-heading" id="advanced-delete"> |
|
21 | 21 | <h3 class="panel-title">${_('Delete this Exception')}</h3> |
|
22 | 22 | </div> |
|
23 | 23 | <div class="panel-body"> |
|
24 | 24 | ${h.secure_form(h.route_path('admin_settings_exception_tracker_delete', exception_id=c.exception_id), request=request)} |
|
25 | 25 | <div style="margin: 0 0 20px 0" class="fake-space"></div> |
|
26 | 26 | |
|
27 | 27 | <div class="field"> |
|
28 | 28 | <button class="btn btn-small btn-danger" type="submit" |
|
29 | 29 | onclick="return confirm('${_('Confirm to delete this exception')}');"> |
|
30 |
<i class="icon-remove |
|
|
30 | <i class="icon-remove"></i> | |
|
31 | 31 | ${_('Delete This Exception')} |
|
32 | 32 | </button> |
|
33 | 33 | </div> |
|
34 | 34 | |
|
35 | 35 | ${h.end_form()} |
|
36 | 36 | </div> |
|
37 | 37 | </div> |
|
38 | 38 | % endif |
@@ -1,65 +1,65 b'' | |||
|
1 | 1 | <div class="panel panel-default"> |
|
2 | 2 | <div class="panel-heading"> |
|
3 | 3 | <h3 class="panel-title">${_('Exceptions Tracker ')}</h3> |
|
4 | 4 | </div> |
|
5 | 5 | <div class="panel-body"> |
|
6 | 6 | % if c.exception_list_count == 1: |
|
7 | 7 | ${_('There is {} stored exception.').format(c.exception_list_count)} |
|
8 | 8 | % else: |
|
9 | 9 | ${_('There are total {} stored exceptions.').format(c.exception_list_count)} |
|
10 | 10 | % endif |
|
11 | 11 | <br/> |
|
12 | 12 | ${_('Store directory')}: ${c.exception_store_dir} |
|
13 | 13 | |
|
14 | 14 | ${h.secure_form(h.route_path('admin_settings_exception_tracker_delete_all'), request=request)} |
|
15 | 15 | <div style="margin: 0 0 20px 0" class="fake-space"></div> |
|
16 | 16 | <input type="hidden" name="type_filter", value="${c.type_filter}"> |
|
17 | 17 | <div class="field"> |
|
18 | 18 | <button class="btn btn-small btn-danger" type="submit" |
|
19 | 19 | onclick="return confirm('${_('Confirm to delete all exceptions')}');"> |
|
20 |
<i class="icon-remove |
|
|
20 | <i class="icon-remove"></i> | |
|
21 | 21 | % if c.type_filter: |
|
22 | 22 | ${_('Delete All `{}`').format(c.type_filter)} |
|
23 | 23 | % else: |
|
24 | 24 | ${_('Delete All')} |
|
25 | 25 | % endif |
|
26 | 26 | |
|
27 | 27 | </button> |
|
28 | 28 | </div> |
|
29 | 29 | |
|
30 | 30 | ${h.end_form()} |
|
31 | 31 | |
|
32 | 32 | </div> |
|
33 | 33 | </div> |
|
34 | 34 | |
|
35 | 35 | |
|
36 | 36 | <div class="panel panel-default"> |
|
37 | 37 | <div class="panel-heading"> |
|
38 | 38 | <h3 class="panel-title">${_('Exceptions Tracker - Showing the last {} Exceptions').format(c.limit)}.</h3> |
|
39 | 39 | <a class="panel-edit" href="${h.current_route_path(request, limit=c.next_limit)}">${_('Show more')}</a> |
|
40 | 40 | </div> |
|
41 | 41 | <div class="panel-body"> |
|
42 | 42 | <table class="rctable"> |
|
43 | 43 | <tr> |
|
44 | 44 | <th>#</th> |
|
45 | 45 | <th>Exception ID</th> |
|
46 | 46 | <th>Date</th> |
|
47 | 47 | <th>App Type</th> |
|
48 | 48 | <th>Exc Type</th> |
|
49 | 49 | </tr> |
|
50 | 50 | <% cnt = len(c.exception_list)%> |
|
51 | 51 | % for tb in c.exception_list: |
|
52 | 52 | <tr> |
|
53 | 53 | <td>${cnt}</td> |
|
54 | 54 | <td><a href="${h.route_path('admin_settings_exception_tracker_show', exception_id=tb['exc_id'])}"><code>${tb['exc_id']}</code></a></td> |
|
55 | 55 | <td>${h.format_date(tb['exc_utc_date'])}</td> |
|
56 | 56 | <td>${tb['app_type']}</td> |
|
57 | 57 | <td> |
|
58 | 58 | <a href="${h.current_route_path(request, type_filter=tb['exc_type'])}">${tb['exc_type']}</a> |
|
59 | 59 | </td> |
|
60 | 60 | </tr> |
|
61 | 61 | <% cnt -=1 %> |
|
62 | 62 | % endfor |
|
63 | 63 | </table> |
|
64 | 64 | </div> |
|
65 | 65 | </div> |
@@ -1,85 +1,85 b'' | |||
|
1 | 1 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | 2 | |
|
3 | 3 | <% |
|
4 | 4 | elems = [ |
|
5 | 5 | (_('User Group ID'), c.user_group.users_group_id, '', ''), |
|
6 | 6 | (_('Owner'), lambda:base.gravatar_with_user(c.user_group.user.email), '', ''), |
|
7 | 7 | (_('Created on'), h.format_date(c.user_group.created_on), '', '',), |
|
8 | 8 | |
|
9 | 9 | (_('Members'), len(c.group_members_obj),'', [x for x in c.group_members_obj]), |
|
10 | 10 | (_('Automatic member sync'), 'Yes' if c.user_group.group_data.get('extern_type') else 'No', '', '',), |
|
11 | 11 | |
|
12 | 12 | (_('Assigned to repositories'), len(c.group_to_repos),'', [x for x in c.group_to_repos]), |
|
13 | 13 | (_('Assigned to repo groups'), len(c.group_to_repo_groups), '', [x for x in c.group_to_repo_groups]), |
|
14 | 14 | |
|
15 | 15 | (_('Assigned to review rules'), len(c.group_to_review_rules), '', [x for x in c.group_to_review_rules]), |
|
16 | 16 | ] |
|
17 | 17 | %> |
|
18 | 18 | |
|
19 | 19 | <div class="panel panel-default"> |
|
20 | 20 | <div class="panel-heading"> |
|
21 | 21 | <h3 class="panel-title">${_('User Group: %s') % c.user_group.users_group_name}</h3> |
|
22 | 22 | </div> |
|
23 | 23 | <div class="panel-body"> |
|
24 | 24 | ${base.dt_info_panel(elems)} |
|
25 | 25 | </div> |
|
26 | 26 | |
|
27 | 27 | </div> |
|
28 | 28 | |
|
29 | 29 | <div class="panel panel-default"> |
|
30 | 30 | <div class="panel-heading"> |
|
31 | 31 | <h3 class="panel-title">${_('Group members sync')}</h3> |
|
32 | 32 | </div> |
|
33 | 33 | <div class="panel-body"> |
|
34 | 34 | <% sync_type = c.user_group.group_data.get('extern_type') %> |
|
35 | 35 | |
|
36 | 36 | % if sync_type: |
|
37 | 37 | <p> |
|
38 | 38 | ${_('This group is set to be automatically synchronised.')}<br/> |
|
39 | 39 | ${_('This group synchronization was set by')}: <strong>${sync_type}</strong> |
|
40 | 40 | </p> |
|
41 | 41 | % else: |
|
42 | 42 | <p> |
|
43 | 43 | ${_('This group is not set to be automatically synchronised')} |
|
44 | 44 | </p> |
|
45 | 45 | % endif |
|
46 | 46 | |
|
47 | 47 | <div> |
|
48 | 48 | ${h.secure_form(h.route_path('edit_user_group_advanced_sync', user_group_id=c.user_group.users_group_id), request=request)} |
|
49 | 49 | <div class="field"> |
|
50 | 50 | <button class="btn btn-default" type="submit"> |
|
51 | 51 | %if sync_type: |
|
52 | 52 | ${_('Disable synchronization')} |
|
53 | 53 | %else: |
|
54 | 54 | ${_('Enable synchronization')} |
|
55 | 55 | %endif |
|
56 | 56 | </button> |
|
57 | 57 | </div> |
|
58 | 58 | <div class="field"> |
|
59 | 59 | <span class="help-block"> |
|
60 | 60 | ${_('Users will be added or removed from this group when they authenticate with RhodeCode system, based on LDAP group membership. ' |
|
61 | 61 | 'This requires `LDAP+User group` authentication plugin to be configured and enabled. (EE only feature)')} |
|
62 | 62 | </span> |
|
63 | 63 | </div> |
|
64 | 64 | ${h.end_form()} |
|
65 | 65 | </div> |
|
66 | 66 | |
|
67 | 67 | </div> |
|
68 | 68 | </div> |
|
69 | 69 | |
|
70 | 70 | |
|
71 | 71 | <div class="panel panel-danger"> |
|
72 | 72 | <div class="panel-heading"> |
|
73 | 73 | <h3 class="panel-title">${_('Delete User Group')}</h3> |
|
74 | 74 | </div> |
|
75 | 75 | <div class="panel-body"> |
|
76 | 76 | ${h.secure_form(h.route_path('user_groups_delete', user_group_id=c.user_group.users_group_id), request=request)} |
|
77 | 77 | ${h.hidden('force', 1)} |
|
78 | 78 | <button class="btn btn-small btn-danger" type="submit" |
|
79 | 79 | onclick="return confirm('${_('Confirm to delete user group `%(ugroup)s` with all permission assignments') % {'ugroup': c.user_group.users_group_name}}');"> |
|
80 |
<i class="icon-remove |
|
|
80 | <i class="icon-remove"></i> | |
|
81 | 81 | ${_('Delete This User Group')} |
|
82 | 82 | </button> |
|
83 | 83 | ${h.end_form()} |
|
84 | 84 | </div> |
|
85 | 85 | </div> |
@@ -1,186 +1,186 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">${_('User Group: %s') % c.user_group.users_group_name}</h3> |
|
7 | 7 | </div> |
|
8 | 8 | <div class="panel-body"> |
|
9 | 9 | ${h.secure_form(h.route_path('user_groups_update', user_group_id=c.user_group.users_group_id), id='edit_user_group', request=request)} |
|
10 | 10 | <div class="form"> |
|
11 | 11 | <!-- fields --> |
|
12 | 12 | <div class="fields"> |
|
13 | 13 | <div class="field"> |
|
14 | 14 | <div class="label"> |
|
15 | 15 | <label for="users_group_name">${_('Group name')}:</label> |
|
16 | 16 | </div> |
|
17 | 17 | <div class="input"> |
|
18 | 18 | ${h.text('users_group_name',class_='medium')} |
|
19 | 19 | </div> |
|
20 | 20 | </div> |
|
21 | 21 | |
|
22 | 22 | <div class="field badged-field"> |
|
23 | 23 | <div class="label"> |
|
24 | 24 | <label for="user">${_('Owner')}:</label> |
|
25 | 25 | </div> |
|
26 | 26 | <div class="input"> |
|
27 | 27 | <div class="badge-input-container"> |
|
28 | 28 | <div class="user-badge"> |
|
29 | 29 | ${base.gravatar_with_user(c.user_group.user.email, show_disabled=not c.user_group.user.active)} |
|
30 | 30 | </div> |
|
31 | 31 | <div class="badge-input-wrap"> |
|
32 | 32 | ${h.text('user', class_="medium", autocomplete="off")} |
|
33 | 33 | </div> |
|
34 | 34 | </div> |
|
35 | 35 | <form:error name="user"/> |
|
36 | 36 | <p class="help-block">${_('Change owner of this user group.')}</p> |
|
37 | 37 | </div> |
|
38 | 38 | </div> |
|
39 | 39 | |
|
40 | 40 | <div class="field"> |
|
41 | 41 | <div class="label label-textarea"> |
|
42 | 42 | <label for="user_group_description">${_('Description')}:</label> |
|
43 | 43 | </div> |
|
44 | 44 | <div class="textarea textarea-small editor"> |
|
45 | 45 | ${h.textarea('user_group_description',cols=23,rows=5,class_="medium")} |
|
46 | 46 | <span class="help-block">${_('Short, optional description for this user group.')}</span> |
|
47 | 47 | </div> |
|
48 | 48 | </div> |
|
49 | 49 | <div class="field"> |
|
50 | 50 | <div class="label label-checkbox"> |
|
51 | 51 | <label for="users_group_active">${_('Active')}:</label> |
|
52 | 52 | </div> |
|
53 | 53 | <div class="checkboxes"> |
|
54 | 54 | ${h.checkbox('users_group_active',value=True)} |
|
55 | 55 | </div> |
|
56 | 56 | </div> |
|
57 | 57 | |
|
58 | 58 | <div class="field"> |
|
59 | 59 | <div class="label label-checkbox"> |
|
60 | 60 | <label for="users_group_active">${_('Add members')}:</label> |
|
61 | 61 | </div> |
|
62 | 62 | <div class="input"> |
|
63 | 63 | ${h.text('user_group_add_members', placeholder="user/usergroup", class_="medium")} |
|
64 | 64 | </div> |
|
65 | 65 | </div> |
|
66 | 66 | |
|
67 | 67 | <input type="hidden" name="__start__" value="user_group_members:sequence"/> |
|
68 | 68 | <table id="group_members_placeholder" class="rctable group_members"> |
|
69 | 69 | <tr> |
|
70 | 70 | <th>${_('Username')}</th> |
|
71 | 71 | <th>${_('Action')}</th> |
|
72 | 72 | </tr> |
|
73 | 73 | |
|
74 | 74 | % if c.group_members_obj: |
|
75 | 75 | % for user in c.group_members_obj: |
|
76 | 76 | <tr> |
|
77 | 77 | <td id="member_user_${user.user_id}" class="td-author"> |
|
78 | 78 | <div class="group_member"> |
|
79 | 79 | ${base.gravatar(user.email, 16)} |
|
80 | 80 | <span class="username user">${h.link_to(h.person(user), h.route_path('user_edit',user_id=user.user_id))}</span> |
|
81 | 81 | <input type="hidden" name="__start__" value="member:mapping"> |
|
82 | 82 | <input type="hidden" name="member_user_id" value="${user.user_id}"> |
|
83 | 83 | <input type="hidden" name="type" value="existing" id="member_${user.user_id}"> |
|
84 | 84 | <input type="hidden" name="__end__" value="member:mapping"> |
|
85 | 85 | </div> |
|
86 | 86 | </td> |
|
87 | 87 | <td class=""> |
|
88 | 88 | <div class="usergroup_member_remove action_button" onclick="removeUserGroupMember(${user.user_id}, true)" style="visibility: visible;"> |
|
89 |
<i class="icon-remove |
|
|
89 | <i class="icon-remove"></i> | |
|
90 | 90 | </div> |
|
91 | 91 | </td> |
|
92 | 92 | </tr> |
|
93 | 93 | % endfor |
|
94 | 94 | |
|
95 | 95 | % else: |
|
96 | 96 | <tr><td colspan="2">${_('No members yet')}</td></tr> |
|
97 | 97 | % endif |
|
98 | 98 | </table> |
|
99 | 99 | <input type="hidden" name="__end__" value="user_group_members:sequence"/> |
|
100 | 100 | |
|
101 | 101 | <div class="buttons"> |
|
102 | 102 | ${h.submit('Save',_('Save'),class_="btn")} |
|
103 | 103 | </div> |
|
104 | 104 | </div> |
|
105 | 105 | </div> |
|
106 | 106 | ${h.end_form()} |
|
107 | 107 | </div> |
|
108 | 108 | </div> |
|
109 | 109 | <script> |
|
110 | 110 | $(document).ready(function(){ |
|
111 | 111 | $("#group_parent_id").select2({ |
|
112 | 112 | 'containerCssClass': "drop-menu", |
|
113 | 113 | 'dropdownCssClass': "drop-menu-dropdown", |
|
114 | 114 | 'dropdownAutoWidth': true |
|
115 | 115 | }); |
|
116 | 116 | |
|
117 | 117 | removeUserGroupMember = function(userId){ |
|
118 | 118 | $('#member_'+userId).val('remove'); |
|
119 | 119 | $('#member_user_'+userId).addClass('to-delete'); |
|
120 | 120 | }; |
|
121 | 121 | |
|
122 | 122 | $('#user_group_add_members').autocomplete({ |
|
123 | 123 | serviceUrl: pyroutes.url('user_autocomplete_data'), |
|
124 | 124 | minChars:2, |
|
125 | 125 | maxHeight:400, |
|
126 | 126 | width:300, |
|
127 | 127 | deferRequestBy: 300, //miliseconds |
|
128 | 128 | showNoSuggestionNotice: true, |
|
129 | 129 | params: { user_groups:true }, |
|
130 | 130 | formatResult: autocompleteFormatResult, |
|
131 | 131 | lookupFilter: autocompleteFilterResult, |
|
132 | 132 | onSelect: function(element, suggestion){ |
|
133 | 133 | |
|
134 | 134 | function addMember(user, fromUserGroup) { |
|
135 | 135 | var gravatar = user.icon_link; |
|
136 | 136 | var username = user.value_display; |
|
137 | 137 | var userLink = pyroutes.url('user_edit', {"user_id": user.id}); |
|
138 | 138 | var uid = user.id; |
|
139 | 139 | |
|
140 | 140 | if (fromUserGroup) { |
|
141 | 141 | username = username +" "+ _gettext('(from usergroup {0})'.format(fromUserGroup)) |
|
142 | 142 | } |
|
143 | 143 | |
|
144 | 144 | var elem = $( |
|
145 | 145 | ('<tr>'+ |
|
146 | 146 | '<td id="member_user_{6}" class="td-author td-author-new-entry">'+ |
|
147 | 147 | '<div class="group_member">'+ |
|
148 | 148 | '<img class="gravatar" src="{0}" height="16" width="16">'+ |
|
149 | 149 | '<span class="username user"><a href="{1}">{2}</a></span>'+ |
|
150 | 150 | '<input type="hidden" name="__start__" value="member:mapping">'+ |
|
151 | 151 | '<input type="hidden" name="member_user_id" value="{3}">'+ |
|
152 | 152 | '<input type="hidden" name="type" value="new" id="member_{4}">'+ |
|
153 | 153 | '<input type="hidden" name="__end__" value="member:mapping">'+ |
|
154 | 154 | '</div>'+ |
|
155 | 155 | '</td>'+ |
|
156 | 156 | '<td class="td-author-new-entry">'+ |
|
157 | 157 | '<div class="usergroup_member_remove action_button" onclick="removeUserGroupMember({5}, true)" style="visibility: visible;">'+ |
|
158 |
'<i class="icon-remove |
|
|
158 | '<i class="icon-remove"></i>'+ | |
|
159 | 159 | '</div>'+ |
|
160 | 160 | '</td>'+ |
|
161 | 161 | '</tr>').format(gravatar, userLink, username, |
|
162 | 162 | uid, uid, uid, uid) |
|
163 | 163 | ); |
|
164 | 164 | $('#group_members_placeholder').append(elem) |
|
165 | 165 | } |
|
166 | 166 | |
|
167 | 167 | if (suggestion.value_type == 'user_group') { |
|
168 | 168 | $.getJSON( |
|
169 | 169 | pyroutes.url('user_group_members_data', |
|
170 | 170 | {'user_group_id': suggestion.id}), |
|
171 | 171 | function(data) { |
|
172 | 172 | $.each(data.members, function(idx, user) { |
|
173 | 173 | addMember(user, suggestion.value) |
|
174 | 174 | }); |
|
175 | 175 | } |
|
176 | 176 | ); |
|
177 | 177 | } else if (suggestion.value_type == 'user') { |
|
178 | 178 | addMember(suggestion, null); |
|
179 | 179 | } |
|
180 | 180 | } |
|
181 | 181 | }); |
|
182 | 182 | |
|
183 | 183 | |
|
184 | 184 | UsersAutoComplete('user', '${c.rhodecode_user.user_id}'); |
|
185 | 185 | }) |
|
186 | 186 | </script> |
@@ -1,1031 +1,1031 b'' | |||
|
1 | 1 | <%namespace name="commentblock" file="/changeset/changeset_file_comment.mako"/> |
|
2 | 2 | |
|
3 | 3 | <%def name="diff_line_anchor(commit, filename, line, type)"><% |
|
4 | 4 | return '%s_%s_%i' % (h.md5_safe(commit+filename), type, line) |
|
5 | 5 | %></%def> |
|
6 | 6 | |
|
7 | 7 | <%def name="action_class(action)"> |
|
8 | 8 | <% |
|
9 | 9 | return { |
|
10 | 10 | '-': 'cb-deletion', |
|
11 | 11 | '+': 'cb-addition', |
|
12 | 12 | ' ': 'cb-context', |
|
13 | 13 | }.get(action, 'cb-empty') |
|
14 | 14 | %> |
|
15 | 15 | </%def> |
|
16 | 16 | |
|
17 | 17 | <%def name="op_class(op_id)"> |
|
18 | 18 | <% |
|
19 | 19 | return { |
|
20 | 20 | DEL_FILENODE: 'deletion', # file deleted |
|
21 | 21 | BIN_FILENODE: 'warning' # binary diff hidden |
|
22 | 22 | }.get(op_id, 'addition') |
|
23 | 23 | %> |
|
24 | 24 | </%def> |
|
25 | 25 | |
|
26 | 26 | |
|
27 | 27 | |
|
28 | 28 | <%def name="render_diffset(diffset, commit=None, |
|
29 | 29 | |
|
30 | 30 | # collapse all file diff entries when there are more than this amount of files in the diff |
|
31 | 31 | collapse_when_files_over=20, |
|
32 | 32 | |
|
33 | 33 | # collapse lines in the diff when more than this amount of lines changed in the file diff |
|
34 | 34 | lines_changed_limit=500, |
|
35 | 35 | |
|
36 | 36 | # add a ruler at to the output |
|
37 | 37 | ruler_at_chars=0, |
|
38 | 38 | |
|
39 | 39 | # show inline comments |
|
40 | 40 | use_comments=False, |
|
41 | 41 | |
|
42 | 42 | # disable new comments |
|
43 | 43 | disable_new_comments=False, |
|
44 | 44 | |
|
45 | 45 | # special file-comments that were deleted in previous versions |
|
46 | 46 | # it's used for showing outdated comments for deleted files in a PR |
|
47 | 47 | deleted_files_comments=None, |
|
48 | 48 | |
|
49 | 49 | # for cache purpose |
|
50 | 50 | inline_comments=None, |
|
51 | 51 | |
|
52 | 52 | )"> |
|
53 | 53 | %if use_comments: |
|
54 | 54 | <div id="cb-comments-inline-container-template" class="js-template"> |
|
55 | 55 | ${inline_comments_container([], inline_comments)} |
|
56 | 56 | </div> |
|
57 | 57 | <div class="js-template" id="cb-comment-inline-form-template"> |
|
58 | 58 | <div class="comment-inline-form ac"> |
|
59 | 59 | |
|
60 | 60 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
61 | 61 | ## render template for inline comments |
|
62 | 62 | ${commentblock.comment_form(form_type='inline')} |
|
63 | 63 | %else: |
|
64 | 64 | ${h.form('', class_='inline-form comment-form-login', method='get')} |
|
65 | 65 | <div class="pull-left"> |
|
66 | 66 | <div class="comment-help pull-right"> |
|
67 | 67 | ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a> |
|
68 | 68 | </div> |
|
69 | 69 | </div> |
|
70 | 70 | <div class="comment-button pull-right"> |
|
71 | 71 | <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);"> |
|
72 | 72 | ${_('Cancel')} |
|
73 | 73 | </button> |
|
74 | 74 | </div> |
|
75 | 75 | <div class="clearfix"></div> |
|
76 | 76 | ${h.end_form()} |
|
77 | 77 | %endif |
|
78 | 78 | </div> |
|
79 | 79 | </div> |
|
80 | 80 | |
|
81 | 81 | %endif |
|
82 | 82 | <% |
|
83 | 83 | collapse_all = len(diffset.files) > collapse_when_files_over |
|
84 | 84 | %> |
|
85 | 85 | |
|
86 | 86 | %if c.user_session_attrs["diffmode"] == 'sideside': |
|
87 | 87 | <style> |
|
88 | 88 | .wrapper { |
|
89 | 89 | max-width: 1600px !important; |
|
90 | 90 | } |
|
91 | 91 | </style> |
|
92 | 92 | %endif |
|
93 | 93 | |
|
94 | 94 | %if ruler_at_chars: |
|
95 | 95 | <style> |
|
96 | 96 | .diff table.cb .cb-content:after { |
|
97 | 97 | content: ""; |
|
98 | 98 | border-left: 1px solid blue; |
|
99 | 99 | position: absolute; |
|
100 | 100 | top: 0; |
|
101 | 101 | height: 18px; |
|
102 | 102 | opacity: .2; |
|
103 | 103 | z-index: 10; |
|
104 | 104 | //## +5 to account for diff action (+/-) |
|
105 | 105 | left: ${ruler_at_chars + 5}ch; |
|
106 | 106 | </style> |
|
107 | 107 | %endif |
|
108 | 108 | |
|
109 | 109 | <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}"> |
|
110 | 110 | <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}"> |
|
111 | 111 | %if commit: |
|
112 | 112 | <div class="pull-right"> |
|
113 | 113 | <a class="btn tooltip" title="${h.tooltip(_('Browse Files at revision {}').format(commit.raw_id))}" href="${h.route_path('repo_files',repo_name=diffset.repo_name, commit_id=commit.raw_id, f_path='')}"> |
|
114 | 114 | ${_('Browse Files')} |
|
115 | 115 | </a> |
|
116 | 116 | </div> |
|
117 | 117 | %endif |
|
118 | 118 | <h2 class="clearinner"> |
|
119 | 119 | ## invidual commit |
|
120 | 120 | % if commit: |
|
121 | 121 | <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=diffset.repo_name,commit_id=commit.raw_id)}">${('r%s:%s' % (commit.idx,h.short_id(commit.raw_id)))}</a> - |
|
122 | 122 | ${h.age_component(commit.date)} |
|
123 | 123 | % if diffset.limited_diff: |
|
124 | 124 | - ${_('The requested changes are too big and content was truncated.')} |
|
125 | 125 | ${_ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}} |
|
126 | 126 | <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> |
|
127 | 127 | % elif hasattr(c, 'commit_ranges') and len(c.commit_ranges) > 1: |
|
128 | 128 | ## compare diff, has no file-selector and we want to show stats anyway |
|
129 | 129 | ${_ungettext('{num} file changed: {linesadd} inserted, ''{linesdel} deleted', |
|
130 | 130 | '{num} files changed: {linesadd} inserted, {linesdel} deleted', diffset.changed_files) \ |
|
131 | 131 | .format(num=diffset.changed_files, linesadd=diffset.lines_added, linesdel=diffset.lines_deleted)} |
|
132 | 132 | % endif |
|
133 | 133 | % else: |
|
134 | 134 | ## pull requests/compare |
|
135 | 135 | ${_('File Changes')} |
|
136 | 136 | % endif |
|
137 | 137 | |
|
138 | 138 | </h2> |
|
139 | 139 | </div> |
|
140 | 140 | |
|
141 | 141 | %if diffset.has_hidden_changes: |
|
142 | 142 | <p class="empty_data">${_('Some changes may be hidden')}</p> |
|
143 | 143 | %elif not diffset.files: |
|
144 | 144 | <p class="empty_data">${_('No files')}</p> |
|
145 | 145 | %endif |
|
146 | 146 | |
|
147 | 147 | <div class="filediffs"> |
|
148 | 148 | |
|
149 | 149 | ## initial value could be marked as False later on |
|
150 | 150 | <% over_lines_changed_limit = False %> |
|
151 | 151 | %for i, filediff in enumerate(diffset.files): |
|
152 | 152 | |
|
153 | 153 | <% |
|
154 | 154 | lines_changed = filediff.patch['stats']['added'] + filediff.patch['stats']['deleted'] |
|
155 | 155 | over_lines_changed_limit = lines_changed > lines_changed_limit |
|
156 | 156 | %> |
|
157 | 157 | ## anchor with support of sticky header |
|
158 | 158 | <div class="anchor" id="a_${h.FID(filediff.raw_id, filediff.patch['filename'])}"></div> |
|
159 | 159 | |
|
160 | 160 | <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox" onchange="updateSticky();"> |
|
161 | 161 | <div |
|
162 | 162 | class="filediff" |
|
163 | 163 | data-f-path="${filediff.patch['filename']}" |
|
164 | 164 | data-anchor-id="${h.FID(filediff.raw_id, filediff.patch['filename'])}" |
|
165 | 165 | > |
|
166 | 166 | <label for="filediff-collapse-${id(filediff)}" class="filediff-heading"> |
|
167 | 167 | <div class="filediff-collapse-indicator"></div> |
|
168 | 168 | ${diff_ops(filediff)} |
|
169 | 169 | </label> |
|
170 | 170 | |
|
171 | 171 | ${diff_menu(filediff, use_comments=use_comments)} |
|
172 | 172 | <table data-f-path="${filediff.patch['filename']}" data-anchor-id="${h.FID(filediff.raw_id, filediff.patch['filename'])}" class="code-visible-block cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}"> |
|
173 | 173 | |
|
174 | 174 | ## new/deleted/empty content case |
|
175 | 175 | % if not filediff.hunks: |
|
176 | 176 | ## Comment container, on "fakes" hunk that contains all data to render comments |
|
177 | 177 | ${render_hunk_lines(filediff, c.user_session_attrs["diffmode"], filediff.hunk_ops, use_comments=use_comments, inline_comments=inline_comments)} |
|
178 | 178 | % endif |
|
179 | 179 | |
|
180 | 180 | %if filediff.limited_diff: |
|
181 | 181 | <tr class="cb-warning cb-collapser"> |
|
182 | 182 | <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}> |
|
183 | 183 | ${_('The requested commit or file is too big and content was truncated.')} <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> |
|
184 | 184 | </td> |
|
185 | 185 | </tr> |
|
186 | 186 | %else: |
|
187 | 187 | %if over_lines_changed_limit: |
|
188 | 188 | <tr class="cb-warning cb-collapser"> |
|
189 | 189 | <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}> |
|
190 | 190 | ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)} |
|
191 | 191 | <a href="#" class="cb-expand" |
|
192 | 192 | onclick="$(this).closest('table').removeClass('cb-collapsed'); updateSticky(); return false;">${_('Show them')} |
|
193 | 193 | </a> |
|
194 | 194 | <a href="#" class="cb-collapse" |
|
195 | 195 | onclick="$(this).closest('table').addClass('cb-collapsed'); updateSticky(); return false;">${_('Hide them')} |
|
196 | 196 | </a> |
|
197 | 197 | </td> |
|
198 | 198 | </tr> |
|
199 | 199 | %endif |
|
200 | 200 | %endif |
|
201 | 201 | |
|
202 | 202 | % for hunk in filediff.hunks: |
|
203 | 203 | <tr class="cb-hunk"> |
|
204 | 204 | <td ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=3' or '')}> |
|
205 | 205 | ## TODO: dan: add ajax loading of more context here |
|
206 | 206 | ## <a href="#"> |
|
207 | 207 | <i class="icon-more"></i> |
|
208 | 208 | ## </a> |
|
209 | 209 | </td> |
|
210 | 210 | <td ${(c.user_session_attrs["diffmode"] == 'sideside' and 'colspan=5' or '')}> |
|
211 | 211 | @@ |
|
212 | 212 | -${hunk.source_start},${hunk.source_length} |
|
213 | 213 | +${hunk.target_start},${hunk.target_length} |
|
214 | 214 | ${hunk.section_header} |
|
215 | 215 | </td> |
|
216 | 216 | </tr> |
|
217 | 217 | ${render_hunk_lines(filediff, c.user_session_attrs["diffmode"], hunk, use_comments=use_comments, inline_comments=inline_comments)} |
|
218 | 218 | % endfor |
|
219 | 219 | |
|
220 | 220 | <% unmatched_comments = (inline_comments or {}).get(filediff.patch['filename'], {}) %> |
|
221 | 221 | |
|
222 | 222 | ## outdated comments that do not fit into currently displayed lines |
|
223 | 223 | % for lineno, comments in unmatched_comments.items(): |
|
224 | 224 | |
|
225 | 225 | %if c.user_session_attrs["diffmode"] == 'unified': |
|
226 | 226 | % if loop.index == 0: |
|
227 | 227 | <tr class="cb-hunk"> |
|
228 | 228 | <td colspan="3"></td> |
|
229 | 229 | <td> |
|
230 | 230 | <div> |
|
231 | 231 | ${_('Unmatched inline comments below')} |
|
232 | 232 | </div> |
|
233 | 233 | </td> |
|
234 | 234 | </tr> |
|
235 | 235 | % endif |
|
236 | 236 | <tr class="cb-line"> |
|
237 | 237 | <td class="cb-data cb-context"></td> |
|
238 | 238 | <td class="cb-lineno cb-context"></td> |
|
239 | 239 | <td class="cb-lineno cb-context"></td> |
|
240 | 240 | <td class="cb-content cb-context"> |
|
241 | 241 | ${inline_comments_container(comments, inline_comments)} |
|
242 | 242 | </td> |
|
243 | 243 | </tr> |
|
244 | 244 | %elif c.user_session_attrs["diffmode"] == 'sideside': |
|
245 | 245 | % if loop.index == 0: |
|
246 | 246 | <tr class="cb-comment-info"> |
|
247 | 247 | <td colspan="2"></td> |
|
248 | 248 | <td class="cb-line"> |
|
249 | 249 | <div> |
|
250 | 250 | ${_('Unmatched inline comments below')} |
|
251 | 251 | </div> |
|
252 | 252 | </td> |
|
253 | 253 | <td colspan="2"></td> |
|
254 | 254 | <td class="cb-line"> |
|
255 | 255 | <div> |
|
256 | 256 | ${_('Unmatched comments below')} |
|
257 | 257 | </div> |
|
258 | 258 | </td> |
|
259 | 259 | </tr> |
|
260 | 260 | % endif |
|
261 | 261 | <tr class="cb-line"> |
|
262 | 262 | <td class="cb-data cb-context"></td> |
|
263 | 263 | <td class="cb-lineno cb-context"></td> |
|
264 | 264 | <td class="cb-content cb-context"> |
|
265 | 265 | % if lineno.startswith('o'): |
|
266 | 266 | ${inline_comments_container(comments, inline_comments)} |
|
267 | 267 | % endif |
|
268 | 268 | </td> |
|
269 | 269 | |
|
270 | 270 | <td class="cb-data cb-context"></td> |
|
271 | 271 | <td class="cb-lineno cb-context"></td> |
|
272 | 272 | <td class="cb-content cb-context"> |
|
273 | 273 | % if lineno.startswith('n'): |
|
274 | 274 | ${inline_comments_container(comments, inline_comments)} |
|
275 | 275 | % endif |
|
276 | 276 | </td> |
|
277 | 277 | </tr> |
|
278 | 278 | %endif |
|
279 | 279 | |
|
280 | 280 | % endfor |
|
281 | 281 | |
|
282 | 282 | </table> |
|
283 | 283 | </div> |
|
284 | 284 | %endfor |
|
285 | 285 | |
|
286 | 286 | ## outdated comments that are made for a file that has been deleted |
|
287 | 287 | % for filename, comments_dict in (deleted_files_comments or {}).items(): |
|
288 | 288 | <% |
|
289 | 289 | display_state = 'display: none' |
|
290 | 290 | open_comments_in_file = [x for x in comments_dict['comments'] if x.outdated is False] |
|
291 | 291 | if open_comments_in_file: |
|
292 | 292 | display_state = '' |
|
293 | 293 | %> |
|
294 | 294 | <div class="filediffs filediff-outdated" style="${display_state}"> |
|
295 | 295 | <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox" onchange="updateSticky();"> |
|
296 | 296 | <div class="filediff" data-f-path="${filename}" id="a_${h.FID(filediff.raw_id, filename)}"> |
|
297 | 297 | <label for="filediff-collapse-${id(filename)}" class="filediff-heading"> |
|
298 | 298 | <div class="filediff-collapse-indicator"></div> |
|
299 | 299 | <span class="pill"> |
|
300 | 300 | ## file was deleted |
|
301 | 301 | <strong>${filename}</strong> |
|
302 | 302 | </span> |
|
303 | 303 | <span class="pill-group" style="float: left"> |
|
304 | 304 | ## file op, doesn't need translation |
|
305 | 305 | <span class="pill" op="removed">removed in this version</span> |
|
306 | 306 | </span> |
|
307 | 307 | <a class="pill filediff-anchor" href="#a_${h.FID(filediff.raw_id, filename)}">¶</a> |
|
308 | 308 | <span class="pill-group" style="float: right"> |
|
309 | 309 | <span class="pill" op="deleted">-${comments_dict['stats']}</span> |
|
310 | 310 | </span> |
|
311 | 311 | </label> |
|
312 | 312 | |
|
313 | 313 | <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}"> |
|
314 | 314 | <tr> |
|
315 | 315 | % if c.user_session_attrs["diffmode"] == 'unified': |
|
316 | 316 | <td></td> |
|
317 | 317 | %endif |
|
318 | 318 | |
|
319 | 319 | <td></td> |
|
320 | 320 | <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=5')}> |
|
321 | 321 | ${_('File was deleted in this version. There are still outdated/unresolved comments attached to it.')} |
|
322 | 322 | </td> |
|
323 | 323 | </tr> |
|
324 | 324 | %if c.user_session_attrs["diffmode"] == 'unified': |
|
325 | 325 | <tr class="cb-line"> |
|
326 | 326 | <td class="cb-data cb-context"></td> |
|
327 | 327 | <td class="cb-lineno cb-context"></td> |
|
328 | 328 | <td class="cb-lineno cb-context"></td> |
|
329 | 329 | <td class="cb-content cb-context"> |
|
330 | 330 | ${inline_comments_container(comments_dict['comments'], inline_comments)} |
|
331 | 331 | </td> |
|
332 | 332 | </tr> |
|
333 | 333 | %elif c.user_session_attrs["diffmode"] == 'sideside': |
|
334 | 334 | <tr class="cb-line"> |
|
335 | 335 | <td class="cb-data cb-context"></td> |
|
336 | 336 | <td class="cb-lineno cb-context"></td> |
|
337 | 337 | <td class="cb-content cb-context"></td> |
|
338 | 338 | |
|
339 | 339 | <td class="cb-data cb-context"></td> |
|
340 | 340 | <td class="cb-lineno cb-context"></td> |
|
341 | 341 | <td class="cb-content cb-context"> |
|
342 | 342 | ${inline_comments_container(comments_dict['comments'], inline_comments)} |
|
343 | 343 | </td> |
|
344 | 344 | </tr> |
|
345 | 345 | %endif |
|
346 | 346 | </table> |
|
347 | 347 | </div> |
|
348 | 348 | </div> |
|
349 | 349 | % endfor |
|
350 | 350 | |
|
351 | 351 | </div> |
|
352 | 352 | </div> |
|
353 | 353 | </%def> |
|
354 | 354 | |
|
355 | 355 | <%def name="diff_ops(filediff)"> |
|
356 | 356 | <% |
|
357 | 357 | from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \ |
|
358 | 358 | MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE |
|
359 | 359 | %> |
|
360 | 360 | <span class="pill"> |
|
361 | 361 | %if filediff.source_file_path and filediff.target_file_path: |
|
362 | 362 | %if filediff.source_file_path != filediff.target_file_path: |
|
363 | 363 | ## file was renamed, or copied |
|
364 | 364 | %if RENAMED_FILENODE in filediff.patch['stats']['ops']: |
|
365 | 365 | <strong>${filediff.target_file_path}</strong> ⬅ <del>${filediff.source_file_path}</del> |
|
366 | 366 | <% final_path = filediff.target_file_path %> |
|
367 | 367 | %elif COPIED_FILENODE in filediff.patch['stats']['ops']: |
|
368 | 368 | <strong>${filediff.target_file_path}</strong> ⬅ ${filediff.source_file_path} |
|
369 | 369 | <% final_path = filediff.target_file_path %> |
|
370 | 370 | %endif |
|
371 | 371 | %else: |
|
372 | 372 | ## file was modified |
|
373 | 373 | <strong>${filediff.source_file_path}</strong> |
|
374 | 374 | <% final_path = filediff.source_file_path %> |
|
375 | 375 | %endif |
|
376 | 376 | %else: |
|
377 | 377 | %if filediff.source_file_path: |
|
378 | 378 | ## file was deleted |
|
379 | 379 | <strong>${filediff.source_file_path}</strong> |
|
380 | 380 | <% final_path = filediff.source_file_path %> |
|
381 | 381 | %else: |
|
382 | 382 | ## file was added |
|
383 | 383 | <strong>${filediff.target_file_path}</strong> |
|
384 | 384 | <% final_path = filediff.target_file_path %> |
|
385 | 385 | %endif |
|
386 | 386 | %endif |
|
387 | 387 | <i style="color: #aaa" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${final_path}" title="${_('Copy the full path')}" onclick="return false;"></i> |
|
388 | 388 | </span> |
|
389 | 389 | ## anchor link |
|
390 | 390 | <a class="pill filediff-anchor" href="#a_${h.FID(filediff.raw_id, filediff.patch['filename'])}">¶</a> |
|
391 | 391 | |
|
392 | 392 | <span class="pill-group" style="float: right"> |
|
393 | 393 | |
|
394 | 394 | ## ops pills |
|
395 | 395 | %if filediff.limited_diff: |
|
396 | 396 | <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span> |
|
397 | 397 | %endif |
|
398 | 398 | |
|
399 | 399 | %if NEW_FILENODE in filediff.patch['stats']['ops']: |
|
400 | 400 | <span class="pill" op="created">created</span> |
|
401 | 401 | %if filediff['target_mode'].startswith('120'): |
|
402 | 402 | <span class="pill" op="symlink">symlink</span> |
|
403 | 403 | %else: |
|
404 | 404 | <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span> |
|
405 | 405 | %endif |
|
406 | 406 | %endif |
|
407 | 407 | |
|
408 | 408 | %if RENAMED_FILENODE in filediff.patch['stats']['ops']: |
|
409 | 409 | <span class="pill" op="renamed">renamed</span> |
|
410 | 410 | %endif |
|
411 | 411 | |
|
412 | 412 | %if COPIED_FILENODE in filediff.patch['stats']['ops']: |
|
413 | 413 | <span class="pill" op="copied">copied</span> |
|
414 | 414 | %endif |
|
415 | 415 | |
|
416 | 416 | %if DEL_FILENODE in filediff.patch['stats']['ops']: |
|
417 | 417 | <span class="pill" op="removed">removed</span> |
|
418 | 418 | %endif |
|
419 | 419 | |
|
420 | 420 | %if CHMOD_FILENODE in filediff.patch['stats']['ops']: |
|
421 | 421 | <span class="pill" op="mode"> |
|
422 | 422 | ${nice_mode(filediff['source_mode'])} ➡ ${nice_mode(filediff['target_mode'])} |
|
423 | 423 | </span> |
|
424 | 424 | %endif |
|
425 | 425 | |
|
426 | 426 | %if BIN_FILENODE in filediff.patch['stats']['ops']: |
|
427 | 427 | <span class="pill" op="binary">binary</span> |
|
428 | 428 | %if MOD_FILENODE in filediff.patch['stats']['ops']: |
|
429 | 429 | <span class="pill" op="modified">modified</span> |
|
430 | 430 | %endif |
|
431 | 431 | %endif |
|
432 | 432 | |
|
433 | 433 | <span class="pill" op="added">${('+' if filediff.patch['stats']['added'] else '')}${filediff.patch['stats']['added']}</span> |
|
434 | 434 | <span class="pill" op="deleted">${((h.safe_int(filediff.patch['stats']['deleted']) or 0) * -1)}</span> |
|
435 | 435 | |
|
436 | 436 | </span> |
|
437 | 437 | |
|
438 | 438 | </%def> |
|
439 | 439 | |
|
440 | 440 | <%def name="nice_mode(filemode)"> |
|
441 | 441 | ${(filemode.startswith('100') and filemode[3:] or filemode)} |
|
442 | 442 | </%def> |
|
443 | 443 | |
|
444 | 444 | <%def name="diff_menu(filediff, use_comments=False)"> |
|
445 | 445 | <div class="filediff-menu"> |
|
446 | 446 | |
|
447 | 447 | %if filediff.diffset.source_ref: |
|
448 | 448 | |
|
449 | 449 | ## FILE BEFORE CHANGES |
|
450 | 450 | %if filediff.operation in ['D', 'M']: |
|
451 | 451 | <a |
|
452 | 452 | class="tooltip" |
|
453 | 453 | href="${h.route_path('repo_files',repo_name=filediff.diffset.target_repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}" |
|
454 | 454 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" |
|
455 | 455 | > |
|
456 | 456 | ${_('Show file before')} |
|
457 | 457 | </a> | |
|
458 | 458 | %else: |
|
459 | 459 | <span |
|
460 | 460 | class="tooltip" |
|
461 | 461 | title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" |
|
462 | 462 | > |
|
463 | 463 | ${_('Show file before')} |
|
464 | 464 | </span> | |
|
465 | 465 | %endif |
|
466 | 466 | |
|
467 | 467 | ## FILE AFTER CHANGES |
|
468 | 468 | %if filediff.operation in ['A', 'M']: |
|
469 | 469 | <a |
|
470 | 470 | class="tooltip" |
|
471 | 471 | href="${h.route_path('repo_files',repo_name=filediff.diffset.source_repo_name,commit_id=filediff.diffset.target_ref,f_path=filediff.target_file_path)}" |
|
472 | 472 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" |
|
473 | 473 | > |
|
474 | 474 | ${_('Show file after')} |
|
475 | 475 | </a> |
|
476 | 476 | %else: |
|
477 | 477 | <span |
|
478 | 478 | class="tooltip" |
|
479 | 479 | title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" |
|
480 | 480 | > |
|
481 | 481 | ${_('Show file after')} |
|
482 | 482 | </span> |
|
483 | 483 | %endif |
|
484 | 484 | |
|
485 | 485 | % if use_comments: |
|
486 | 486 | | |
|
487 | 487 | <a href="#" onclick="return Rhodecode.comments.toggleComments(this);"> |
|
488 | 488 | <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span> |
|
489 | 489 | </a> |
|
490 | 490 | % endif |
|
491 | 491 | |
|
492 | 492 | %endif |
|
493 | 493 | |
|
494 | 494 | </div> |
|
495 | 495 | </%def> |
|
496 | 496 | |
|
497 | 497 | |
|
498 | 498 | <%def name="inline_comments_container(comments, inline_comments)"> |
|
499 | 499 | <div class="inline-comments"> |
|
500 | 500 | %for comment in comments: |
|
501 | 501 | ${commentblock.comment_block(comment, inline=True)} |
|
502 | 502 | %endfor |
|
503 | 503 | % if comments and comments[-1].outdated: |
|
504 | 504 | <span class="btn btn-secondary cb-comment-add-button comment-outdated}" |
|
505 | 505 | style="display: none;}"> |
|
506 | 506 | ${_('Add another comment')} |
|
507 | 507 | </span> |
|
508 | 508 | % else: |
|
509 | 509 | <span onclick="return Rhodecode.comments.createComment(this)" |
|
510 | 510 | class="btn btn-secondary cb-comment-add-button"> |
|
511 | 511 | ${_('Add another comment')} |
|
512 | 512 | </span> |
|
513 | 513 | % endif |
|
514 | 514 | |
|
515 | 515 | </div> |
|
516 | 516 | </%def> |
|
517 | 517 | |
|
518 | 518 | <%! |
|
519 | 519 | def get_comments_for(diff_type, comments, filename, line_version, line_number): |
|
520 | 520 | if hasattr(filename, 'unicode_path'): |
|
521 | 521 | filename = filename.unicode_path |
|
522 | 522 | |
|
523 | 523 | if not isinstance(filename, (unicode, str)): |
|
524 | 524 | return None |
|
525 | 525 | |
|
526 | 526 | line_key = '{}{}'.format(line_version, line_number) ## e.g o37, n12 |
|
527 | 527 | |
|
528 | 528 | if comments and filename in comments: |
|
529 | 529 | file_comments = comments[filename] |
|
530 | 530 | if line_key in file_comments: |
|
531 | 531 | data = file_comments.pop(line_key) |
|
532 | 532 | return data |
|
533 | 533 | %> |
|
534 | 534 | |
|
535 | 535 | <%def name="render_hunk_lines_sideside(filediff, hunk, use_comments=False, inline_comments=None)"> |
|
536 | 536 | %for i, line in enumerate(hunk.sideside): |
|
537 | 537 | <% |
|
538 | 538 | old_line_anchor, new_line_anchor = None, None |
|
539 | 539 | |
|
540 | 540 | if line.original.lineno: |
|
541 | 541 | old_line_anchor = diff_line_anchor(filediff.raw_id, hunk.source_file_path, line.original.lineno, 'o') |
|
542 | 542 | if line.modified.lineno: |
|
543 | 543 | new_line_anchor = diff_line_anchor(filediff.raw_id, hunk.target_file_path, line.modified.lineno, 'n') |
|
544 | 544 | %> |
|
545 | 545 | |
|
546 | 546 | <tr class="cb-line"> |
|
547 | 547 | <td class="cb-data ${action_class(line.original.action)}" |
|
548 | 548 | data-line-no="${line.original.lineno}" |
|
549 | 549 | > |
|
550 | 550 | <div> |
|
551 | 551 | |
|
552 | 552 | <% line_old_comments = None %> |
|
553 | 553 | %if line.original.get_comment_args: |
|
554 | 554 | <% line_old_comments = get_comments_for('side-by-side', inline_comments, *line.original.get_comment_args) %> |
|
555 | 555 | %endif |
|
556 | 556 | %if line_old_comments: |
|
557 | 557 | <% has_outdated = any([x.outdated for x in line_old_comments]) %> |
|
558 | 558 | % if has_outdated: |
|
559 |
<i title="${_('comments including outdated')}:${len(line_old_comments)}" class="icon-comment |
|
|
559 | <i title="${_('comments including outdated')}:${len(line_old_comments)}" class="icon-comment-toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> | |
|
560 | 560 | % else: |
|
561 | 561 | <i title="${_('comments')}: ${len(line_old_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
562 | 562 | % endif |
|
563 | 563 | %endif |
|
564 | 564 | </div> |
|
565 | 565 | </td> |
|
566 | 566 | <td class="cb-lineno ${action_class(line.original.action)}" |
|
567 | 567 | data-line-no="${line.original.lineno}" |
|
568 | 568 | %if old_line_anchor: |
|
569 | 569 | id="${old_line_anchor}" |
|
570 | 570 | %endif |
|
571 | 571 | > |
|
572 | 572 | %if line.original.lineno: |
|
573 | 573 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a> |
|
574 | 574 | %endif |
|
575 | 575 | </td> |
|
576 | 576 | <td class="cb-content ${action_class(line.original.action)}" |
|
577 | 577 | data-line-no="o${line.original.lineno}" |
|
578 | 578 | > |
|
579 | 579 | %if use_comments and line.original.lineno: |
|
580 | 580 | ${render_add_comment_button()} |
|
581 | 581 | %endif |
|
582 | 582 | <span class="cb-code"><span class="cb-action ${action_class(line.original.action)}"></span>${line.original.content or '' | n}</span> |
|
583 | 583 | |
|
584 | 584 | %if use_comments and line.original.lineno and line_old_comments: |
|
585 | 585 | ${inline_comments_container(line_old_comments, inline_comments)} |
|
586 | 586 | %endif |
|
587 | 587 | |
|
588 | 588 | </td> |
|
589 | 589 | <td class="cb-data ${action_class(line.modified.action)}" |
|
590 | 590 | data-line-no="${line.modified.lineno}" |
|
591 | 591 | > |
|
592 | 592 | <div> |
|
593 | 593 | |
|
594 | 594 | %if line.modified.get_comment_args: |
|
595 | 595 | <% line_new_comments = get_comments_for('side-by-side', inline_comments, *line.modified.get_comment_args) %> |
|
596 | 596 | %else: |
|
597 | 597 | <% line_new_comments = None%> |
|
598 | 598 | %endif |
|
599 | 599 | %if line_new_comments: |
|
600 | 600 | <% has_outdated = any([x.outdated for x in line_new_comments]) %> |
|
601 | 601 | % if has_outdated: |
|
602 |
<i title="${_('comments including outdated')}:${len(line_new_comments)}" class="icon-comment |
|
|
602 | <i title="${_('comments including outdated')}:${len(line_new_comments)}" class="icon-comment-toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> | |
|
603 | 603 | % else: |
|
604 | 604 | <i title="${_('comments')}: ${len(line_new_comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
605 | 605 | % endif |
|
606 | 606 | %endif |
|
607 | 607 | </div> |
|
608 | 608 | </td> |
|
609 | 609 | <td class="cb-lineno ${action_class(line.modified.action)}" |
|
610 | 610 | data-line-no="${line.modified.lineno}" |
|
611 | 611 | %if new_line_anchor: |
|
612 | 612 | id="${new_line_anchor}" |
|
613 | 613 | %endif |
|
614 | 614 | > |
|
615 | 615 | %if line.modified.lineno: |
|
616 | 616 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a> |
|
617 | 617 | %endif |
|
618 | 618 | </td> |
|
619 | 619 | <td class="cb-content ${action_class(line.modified.action)}" |
|
620 | 620 | data-line-no="n${line.modified.lineno}" |
|
621 | 621 | > |
|
622 | 622 | %if use_comments and line.modified.lineno: |
|
623 | 623 | ${render_add_comment_button()} |
|
624 | 624 | %endif |
|
625 | 625 | <span class="cb-code"><span class="cb-action ${action_class(line.modified.action)}"></span>${line.modified.content or '' | n}</span> |
|
626 | 626 | %if use_comments and line.modified.lineno and line_new_comments: |
|
627 | 627 | ${inline_comments_container(line_new_comments, inline_comments)} |
|
628 | 628 | %endif |
|
629 | 629 | </td> |
|
630 | 630 | </tr> |
|
631 | 631 | %endfor |
|
632 | 632 | </%def> |
|
633 | 633 | |
|
634 | 634 | |
|
635 | 635 | <%def name="render_hunk_lines_unified(filediff, hunk, use_comments=False, inline_comments=None)"> |
|
636 | 636 | %for old_line_no, new_line_no, action, content, comments_args in hunk.unified: |
|
637 | 637 | |
|
638 | 638 | <% |
|
639 | 639 | old_line_anchor, new_line_anchor = None, None |
|
640 | 640 | if old_line_no: |
|
641 | 641 | old_line_anchor = diff_line_anchor(filediff.raw_id, hunk.source_file_path, old_line_no, 'o') |
|
642 | 642 | if new_line_no: |
|
643 | 643 | new_line_anchor = diff_line_anchor(filediff.raw_id, hunk.target_file_path, new_line_no, 'n') |
|
644 | 644 | %> |
|
645 | 645 | <tr class="cb-line"> |
|
646 | 646 | <td class="cb-data ${action_class(action)}"> |
|
647 | 647 | <div> |
|
648 | 648 | |
|
649 | 649 | %if comments_args: |
|
650 | 650 | <% comments = get_comments_for('unified', inline_comments, *comments_args) %> |
|
651 | 651 | %else: |
|
652 | 652 | <% comments = None %> |
|
653 | 653 | %endif |
|
654 | 654 | |
|
655 | 655 | % if comments: |
|
656 | 656 | <% has_outdated = any([x.outdated for x in comments]) %> |
|
657 | 657 | % if has_outdated: |
|
658 |
<i title="${_('comments including outdated')}:${len(comments)}" class="icon-comment |
|
|
658 | <i title="${_('comments including outdated')}:${len(comments)}" class="icon-comment-toggle" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> | |
|
659 | 659 | % else: |
|
660 | 660 | <i title="${_('comments')}: ${len(comments)}" class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i> |
|
661 | 661 | % endif |
|
662 | 662 | % endif |
|
663 | 663 | </div> |
|
664 | 664 | </td> |
|
665 | 665 | <td class="cb-lineno ${action_class(action)}" |
|
666 | 666 | data-line-no="${old_line_no}" |
|
667 | 667 | %if old_line_anchor: |
|
668 | 668 | id="${old_line_anchor}" |
|
669 | 669 | %endif |
|
670 | 670 | > |
|
671 | 671 | %if old_line_anchor: |
|
672 | 672 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a> |
|
673 | 673 | %endif |
|
674 | 674 | </td> |
|
675 | 675 | <td class="cb-lineno ${action_class(action)}" |
|
676 | 676 | data-line-no="${new_line_no}" |
|
677 | 677 | %if new_line_anchor: |
|
678 | 678 | id="${new_line_anchor}" |
|
679 | 679 | %endif |
|
680 | 680 | > |
|
681 | 681 | %if new_line_anchor: |
|
682 | 682 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a> |
|
683 | 683 | %endif |
|
684 | 684 | </td> |
|
685 | 685 | <td class="cb-content ${action_class(action)}" |
|
686 | 686 | data-line-no="${(new_line_no and 'n' or 'o')}${(new_line_no or old_line_no)}" |
|
687 | 687 | > |
|
688 | 688 | %if use_comments: |
|
689 | 689 | ${render_add_comment_button()} |
|
690 | 690 | %endif |
|
691 | 691 | <span class="cb-code"><span class="cb-action ${action_class(action)}"></span> ${content or '' | n}</span> |
|
692 | 692 | %if use_comments and comments: |
|
693 | 693 | ${inline_comments_container(comments, inline_comments)} |
|
694 | 694 | %endif |
|
695 | 695 | </td> |
|
696 | 696 | </tr> |
|
697 | 697 | %endfor |
|
698 | 698 | </%def> |
|
699 | 699 | |
|
700 | 700 | |
|
701 | 701 | <%def name="render_hunk_lines(filediff, diff_mode, hunk, use_comments, inline_comments)"> |
|
702 | 702 | % if diff_mode == 'unified': |
|
703 | 703 | ${render_hunk_lines_unified(filediff, hunk, use_comments=use_comments, inline_comments=inline_comments)} |
|
704 | 704 | % elif diff_mode == 'sideside': |
|
705 | 705 | ${render_hunk_lines_sideside(filediff, hunk, use_comments=use_comments, inline_comments=inline_comments)} |
|
706 | 706 | % else: |
|
707 | 707 | <tr class="cb-line"> |
|
708 | 708 | <td>unknown diff mode</td> |
|
709 | 709 | </tr> |
|
710 | 710 | % endif |
|
711 | 711 | </%def>file changes |
|
712 | 712 | |
|
713 | 713 | |
|
714 | 714 | <%def name="render_add_comment_button()"> |
|
715 | 715 | <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)"> |
|
716 | 716 | <span><i class="icon-comment"></i></span> |
|
717 | 717 | </button> |
|
718 | 718 | </%def> |
|
719 | 719 | |
|
720 | 720 | <%def name="render_diffset_menu(diffset=None, range_diff_on=None)"> |
|
721 | 721 | |
|
722 | 722 | <div id="diff-file-sticky" class="diffset-menu clearinner"> |
|
723 | 723 | ## auto adjustable |
|
724 | 724 | <div class="sidebar__inner"> |
|
725 | 725 | <div class="sidebar__bar"> |
|
726 | 726 | <div class="pull-right"> |
|
727 | 727 | <div class="btn-group"> |
|
728 | 728 | |
|
729 | 729 | ## DIFF OPTIONS via Select2 |
|
730 | 730 | <div class="pull-left"> |
|
731 | 731 | ${h.hidden('diff_menu')} |
|
732 | 732 | </div> |
|
733 | 733 | |
|
734 | 734 | <a |
|
735 | 735 | class="btn ${(c.user_session_attrs["diffmode"] == 'sideside' and 'btn-primary')} tooltip" |
|
736 | 736 | title="${h.tooltip(_('View side by side'))}" |
|
737 | 737 | href="${h.current_route_path(request, diffmode='sideside')}"> |
|
738 | 738 | <span>${_('Side by Side')}</span> |
|
739 | 739 | </a> |
|
740 | 740 | |
|
741 | 741 | <a |
|
742 | 742 | class="btn ${(c.user_session_attrs["diffmode"] == 'unified' and 'btn-primary')} tooltip" |
|
743 | 743 | title="${h.tooltip(_('View unified'))}" href="${h.current_route_path(request, diffmode='unified')}"> |
|
744 | 744 | <span>${_('Unified')}</span> |
|
745 | 745 | </a> |
|
746 | 746 | |
|
747 | 747 | % if range_diff_on is True: |
|
748 | 748 | <a |
|
749 | 749 | title="${_('Turn off: Show the diff as commit range')}" |
|
750 | 750 | class="btn btn-primary" |
|
751 | 751 | href="${h.current_route_path(request, **{"range-diff":"0"})}"> |
|
752 | 752 | <span>${_('Range Diff')}</span> |
|
753 | 753 | </a> |
|
754 | 754 | % elif range_diff_on is False: |
|
755 | 755 | <a |
|
756 | 756 | title="${_('Show the diff as commit range')}" |
|
757 | 757 | class="btn" |
|
758 | 758 | href="${h.current_route_path(request, **{"range-diff":"1"})}"> |
|
759 | 759 | <span>${_('Range Diff')}</span> |
|
760 | 760 | </a> |
|
761 | 761 | % endif |
|
762 | 762 | </div> |
|
763 | 763 | </div> |
|
764 | 764 | <div class="pull-left"> |
|
765 | 765 | <div class="btn-group"> |
|
766 | 766 | <div class="pull-left"> |
|
767 | 767 | ${h.hidden('file_filter')} |
|
768 | 768 | </div> |
|
769 | 769 | <a |
|
770 | 770 | class="btn" |
|
771 | 771 | href="#" |
|
772 | 772 | onclick="$('input[class=filediff-collapse-state]').prop('checked', false); updateSticky(); return false">${_('Expand All Files')}</a> |
|
773 | 773 | <a |
|
774 | 774 | class="btn" |
|
775 | 775 | href="#" |
|
776 | 776 | onclick="$('input[class=filediff-collapse-state]').prop('checked', true); updateSticky(); return false">${_('Collapse All Files')}</a> |
|
777 | 777 | </div> |
|
778 | 778 | </div> |
|
779 | 779 | </div> |
|
780 | 780 | <div class="fpath-placeholder"> |
|
781 | 781 | <i class="icon-file-text"></i> |
|
782 | 782 | <strong class="fpath-placeholder-text"> |
|
783 | 783 | Context file: |
|
784 | 784 | </strong> |
|
785 | 785 | </div> |
|
786 | 786 | <div class="sidebar_inner_shadow"></div> |
|
787 | 787 | </div> |
|
788 | 788 | </div> |
|
789 | 789 | |
|
790 | 790 | % if diffset: |
|
791 | 791 | |
|
792 | 792 | %if diffset.limited_diff: |
|
793 | 793 | <% file_placeholder = _ungettext('%(num)s file changed', '%(num)s files changed', diffset.changed_files) % {'num': diffset.changed_files} %> |
|
794 | 794 | %else: |
|
795 | 795 | <% file_placeholder = _ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}%> |
|
796 | 796 | %endif |
|
797 | 797 | ## case on range-diff placeholder needs to be updated |
|
798 | 798 | % if range_diff_on is True: |
|
799 | 799 | <% file_placeholder = _('Disabled on range diff') %> |
|
800 | 800 | % endif |
|
801 | 801 | |
|
802 | 802 | <script> |
|
803 | 803 | |
|
804 | 804 | var feedFilesOptions = function (query, initialData) { |
|
805 | 805 | var data = {results: []}; |
|
806 | 806 | var isQuery = typeof query.term !== 'undefined'; |
|
807 | 807 | |
|
808 | 808 | var section = _gettext('Changed files'); |
|
809 | 809 | var filteredData = []; |
|
810 | 810 | |
|
811 | 811 | //filter results |
|
812 | 812 | $.each(initialData.results, function (idx, value) { |
|
813 | 813 | |
|
814 | 814 | if (!isQuery || query.term.length === 0 || value.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { |
|
815 | 815 | filteredData.push({ |
|
816 | 816 | 'id': this.id, |
|
817 | 817 | 'text': this.text, |
|
818 | 818 | "ops": this.ops, |
|
819 | 819 | }) |
|
820 | 820 | } |
|
821 | 821 | |
|
822 | 822 | }); |
|
823 | 823 | |
|
824 | 824 | data.results = filteredData; |
|
825 | 825 | |
|
826 | 826 | query.callback(data); |
|
827 | 827 | }; |
|
828 | 828 | |
|
829 | 829 | var formatFileResult = function(result, container, query, escapeMarkup) { |
|
830 | 830 | return function(data, escapeMarkup) { |
|
831 | 831 | var container = '<div class="filelist" style="padding-right:100px">{0}</div>'; |
|
832 | 832 | var tmpl = '<span style="margin-right:-50px"><strong>{0}</strong></span>'.format(escapeMarkup(data['text'])); |
|
833 | 833 | var pill = '<span class="pill-group" style="float: right;margin-right: -100px">' + |
|
834 | 834 | '<span class="pill" op="added">{0}</span>' + |
|
835 | 835 | '<span class="pill" op="deleted">{1}</span>' + |
|
836 | 836 | '</span>' |
|
837 | 837 | ; |
|
838 | 838 | var added = data['ops']['added']; |
|
839 | 839 | if (added === 0) { |
|
840 | 840 | // don't show +0 |
|
841 | 841 | added = 0; |
|
842 | 842 | } else { |
|
843 | 843 | added = '+' + added; |
|
844 | 844 | } |
|
845 | 845 | |
|
846 | 846 | var deleted = -1*data['ops']['deleted']; |
|
847 | 847 | |
|
848 | 848 | tmpl += pill.format(added, deleted); |
|
849 | 849 | return container.format(tmpl); |
|
850 | 850 | |
|
851 | 851 | }(result, escapeMarkup); |
|
852 | 852 | }; |
|
853 | 853 | |
|
854 | 854 | var preloadFileFilterData = { |
|
855 | 855 | results: [ |
|
856 | 856 | % for filediff in diffset.files: |
|
857 | 857 | {id:"a_${h.FID(filediff.raw_id, filediff.patch['filename'])}", |
|
858 | 858 | text:"${filediff.patch['filename']}", |
|
859 | 859 | ops:${h.json.dumps(filediff.patch['stats'])|n}}${('' if loop.last else ',')} |
|
860 | 860 | % endfor |
|
861 | 861 | ] |
|
862 | 862 | }; |
|
863 | 863 | |
|
864 | 864 | $(document).ready(function () { |
|
865 | 865 | |
|
866 | 866 | var fileFilter = $("#file_filter").select2({ |
|
867 | 867 | 'dropdownAutoWidth': true, |
|
868 | 868 | 'width': 'auto', |
|
869 | 869 | 'placeholder': "${file_placeholder}", |
|
870 | 870 | containerCssClass: "drop-menu", |
|
871 | 871 | dropdownCssClass: "drop-menu-dropdown", |
|
872 | 872 | data: preloadFileFilterData, |
|
873 | 873 | query: function(query) { |
|
874 | 874 | feedFilesOptions(query, preloadFileFilterData); |
|
875 | 875 | }, |
|
876 | 876 | formatResult: formatFileResult |
|
877 | 877 | }); |
|
878 | 878 | |
|
879 | 879 | % if range_diff_on is True: |
|
880 | 880 | fileFilter.select2("enable", false); |
|
881 | 881 | % endif |
|
882 | 882 | |
|
883 | 883 | $("#file_filter").on('click', function (e) { |
|
884 | 884 | e.preventDefault(); |
|
885 | 885 | var selected = $('#file_filter').select2('data'); |
|
886 | 886 | var idSelector = "#"+selected.id; |
|
887 | 887 | window.location.hash = idSelector; |
|
888 | 888 | // expand the container if we quick-select the field |
|
889 | 889 | $(idSelector).next().prop('checked', false); |
|
890 | 890 | updateSticky() |
|
891 | 891 | }); |
|
892 | 892 | |
|
893 | 893 | var contextPrefix = _gettext('Context file: '); |
|
894 | 894 | ## sticky sidebar |
|
895 | 895 | var sidebarElement = document.getElementById('diff-file-sticky'); |
|
896 | 896 | sidebar = new StickySidebar(sidebarElement, { |
|
897 | 897 | topSpacing: 0, |
|
898 | 898 | bottomSpacing: 0, |
|
899 | 899 | innerWrapperSelector: '.sidebar__inner' |
|
900 | 900 | }); |
|
901 | 901 | sidebarElement.addEventListener('affixed.static.stickySidebar', function () { |
|
902 | 902 | // reset our file so it's not holding new value |
|
903 | 903 | $('.fpath-placeholder-text').html(contextPrefix) |
|
904 | 904 | }); |
|
905 | 905 | |
|
906 | 906 | updateSticky = function () { |
|
907 | 907 | sidebar.updateSticky(); |
|
908 | 908 | Waypoint.refreshAll(); |
|
909 | 909 | }; |
|
910 | 910 | |
|
911 | 911 | var animateText = $.debounce(100, function(fPath, anchorId) { |
|
912 | 912 | fPath = Select2.util.escapeMarkup(fPath); |
|
913 | 913 | |
|
914 | 914 | // animate setting the text |
|
915 | 915 | var callback = function () { |
|
916 | 916 | $('.fpath-placeholder-text').animate({'opacity': 1.00}, 200) |
|
917 | 917 | $('.fpath-placeholder-text').html(contextPrefix + '<a href="#a_' + anchorId + '">' + fPath + '</a>') |
|
918 | 918 | }; |
|
919 | 919 | $('.fpath-placeholder-text').animate({'opacity': 0.15}, 200, callback); |
|
920 | 920 | }); |
|
921 | 921 | |
|
922 | 922 | ## dynamic file waypoints |
|
923 | 923 | var setFPathInfo = function(fPath, anchorId){ |
|
924 | 924 | animateText(fPath, anchorId) |
|
925 | 925 | }; |
|
926 | 926 | |
|
927 | 927 | var codeBlock = $('.filediff'); |
|
928 | 928 | // forward waypoint |
|
929 | 929 | codeBlock.waypoint( |
|
930 | 930 | function(direction) { |
|
931 | 931 | if (direction === "down"){ |
|
932 | 932 | setFPathInfo($(this.element).data('fPath'), $(this.element).data('anchorId')) |
|
933 | 933 | } |
|
934 | 934 | }, { |
|
935 | 935 | offset: 70, |
|
936 | 936 | context: '.fpath-placeholder' |
|
937 | 937 | } |
|
938 | 938 | ); |
|
939 | 939 | |
|
940 | 940 | // backward waypoint |
|
941 | 941 | codeBlock.waypoint( |
|
942 | 942 | function(direction) { |
|
943 | 943 | if (direction === "up"){ |
|
944 | 944 | setFPathInfo($(this.element).data('fPath'), $(this.element).data('anchorId')) |
|
945 | 945 | } |
|
946 | 946 | }, { |
|
947 | 947 | offset: function () { |
|
948 | 948 | return -this.element.clientHeight + 90 |
|
949 | 949 | }, |
|
950 | 950 | context: '.fpath-placeholder' |
|
951 | 951 | } |
|
952 | 952 | ); |
|
953 | 953 | |
|
954 | 954 | var preloadDiffMenuData = { |
|
955 | 955 | results: [ |
|
956 | 956 | ## Wide diff mode |
|
957 | 957 | { |
|
958 | 958 | id: 1, |
|
959 | 959 | text: _gettext('Toggle Wide Mode diff'), |
|
960 | 960 | action: function () { |
|
961 | 961 | updateSticky(); |
|
962 | 962 | var wide = Rhodecode.comments.toggleWideMode(this); |
|
963 | 963 | storeUserSessionAttr('rc_user_session_attr.wide_diff_mode', wide); |
|
964 | 964 | return null; |
|
965 | 965 | }, |
|
966 | 966 | url: null, |
|
967 | 967 | }, |
|
968 | 968 | |
|
969 | 969 | ## Whitespace change |
|
970 | 970 | % if request.GET.get('ignorews', '') == '1': |
|
971 | 971 | { |
|
972 | 972 | id: 2, |
|
973 | 973 | text: _gettext('Show whitespace changes'), |
|
974 | 974 | action: function () {}, |
|
975 | 975 | url: "${h.current_route_path(request, ignorews=0)|n}" |
|
976 | 976 | }, |
|
977 | 977 | % else: |
|
978 | 978 | { |
|
979 | 979 | id: 2, |
|
980 | 980 | text: _gettext('Hide whitespace changes'), |
|
981 | 981 | action: function () {}, |
|
982 | 982 | url: "${h.current_route_path(request, ignorews=1)|n}" |
|
983 | 983 | }, |
|
984 | 984 | % endif |
|
985 | 985 | |
|
986 | 986 | ## FULL CONTEXT |
|
987 | 987 | % if request.GET.get('fullcontext', '') == '1': |
|
988 | 988 | { |
|
989 | 989 | id: 3, |
|
990 | 990 | text: _gettext('Hide full context diff'), |
|
991 | 991 | action: function () {}, |
|
992 | 992 | url: "${h.current_route_path(request, fullcontext=0)|n}" |
|
993 | 993 | }, |
|
994 | 994 | % else: |
|
995 | 995 | { |
|
996 | 996 | id: 3, |
|
997 | 997 | text: _gettext('Show full context diff'), |
|
998 | 998 | action: function () {}, |
|
999 | 999 | url: "${h.current_route_path(request, fullcontext=1)|n}" |
|
1000 | 1000 | }, |
|
1001 | 1001 | % endif |
|
1002 | 1002 | |
|
1003 | 1003 | ] |
|
1004 | 1004 | }; |
|
1005 | 1005 | |
|
1006 | 1006 | // get stored diff mode and pre-enable it |
|
1007 | 1007 | if (templateContext.session_attrs.wide_diff_mode === "true") { |
|
1008 | 1008 | Rhodecode.comments.toggleWideMode(null); |
|
1009 | 1009 | } |
|
1010 | 1010 | |
|
1011 | 1011 | $("#diff_menu").select2({ |
|
1012 | 1012 | minimumResultsForSearch: -1, |
|
1013 | 1013 | containerCssClass: "drop-menu", |
|
1014 | 1014 | dropdownCssClass: "drop-menu-dropdown", |
|
1015 | 1015 | dropdownAutoWidth: true, |
|
1016 | 1016 | data: preloadDiffMenuData, |
|
1017 | 1017 | placeholder: "${_('Diff Options')}", |
|
1018 | 1018 | }); |
|
1019 | 1019 | $("#diff_menu").on('select2-selecting', function (e) { |
|
1020 | 1020 | e.choice.action(); |
|
1021 | 1021 | if (e.choice.url !== null) { |
|
1022 | 1022 | window.location = e.choice.url |
|
1023 | 1023 | } |
|
1024 | 1024 | }); |
|
1025 | 1025 | |
|
1026 | 1026 | }); |
|
1027 | 1027 | |
|
1028 | 1028 | </script> |
|
1029 | 1029 | % endif |
|
1030 | 1030 | |
|
1031 | 1031 | </%def> |
@@ -1,450 +1,452 b'' | |||
|
1 | 1 | ## DATA TABLE RE USABLE ELEMENTS |
|
2 | 2 | ## usage: |
|
3 | 3 | ## <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
4 | 4 | <%namespace name="base" file="/base/base.mako"/> |
|
5 | 5 | |
|
6 | 6 | <%def name="metatags_help()"> |
|
7 | 7 | <table> |
|
8 | 8 | <% |
|
9 | 9 | example_tags = [ |
|
10 | 10 | ('state','[stable]'), |
|
11 | 11 | ('state','[stale]'), |
|
12 | 12 | ('state','[featured]'), |
|
13 | 13 | ('state','[dev]'), |
|
14 | 14 | ('state','[dead]'), |
|
15 | 15 | ('state','[deprecated]'), |
|
16 | 16 | |
|
17 | 17 | ('label','[personal]'), |
|
18 | 18 | ('generic','[v2.0.0]'), |
|
19 | 19 | |
|
20 | 20 | ('lang','[lang => JavaScript]'), |
|
21 | 21 | ('license','[license => LicenseName]'), |
|
22 | 22 | |
|
23 | 23 | ('ref','[requires => RepoName]'), |
|
24 | 24 | ('ref','[recommends => GroupName]'), |
|
25 | 25 | ('ref','[conflicts => SomeName]'), |
|
26 | 26 | ('ref','[base => SomeName]'), |
|
27 | 27 | ('url','[url => [linkName](https://rhodecode.com)]'), |
|
28 | 28 | ('see','[see => http://rhodecode.com]'), |
|
29 | 29 | ] |
|
30 | 30 | %> |
|
31 | 31 | % for tag_type, tag in example_tags: |
|
32 | 32 | <tr> |
|
33 | 33 | <td>${tag|n}</td> |
|
34 | 34 | <td>${h.style_metatag(tag_type, tag)|n}</td> |
|
35 | 35 | </tr> |
|
36 | 36 | % endfor |
|
37 | 37 | </table> |
|
38 | 38 | </%def> |
|
39 | 39 | |
|
40 | 40 | ## REPOSITORY RENDERERS |
|
41 | 41 | <%def name="quick_menu(repo_name)"> |
|
42 | 42 | <i class="icon-more"></i> |
|
43 | 43 | <div class="menu_items_container hidden"> |
|
44 | 44 | <ul class="menu_items"> |
|
45 | 45 | <li> |
|
46 | 46 | <a title="${_('Summary')}" href="${h.route_path('repo_summary',repo_name=repo_name)}"> |
|
47 | 47 | <span>${_('Summary')}</span> |
|
48 | 48 | </a> |
|
49 | 49 | </li> |
|
50 | 50 | <li> |
|
51 | 51 | <a title="${_('Commits')}" href="${h.route_path('repo_commits',repo_name=repo_name)}"> |
|
52 | 52 | <span>${_('Commits')}</span> |
|
53 | 53 | </a> |
|
54 | 54 | </li> |
|
55 | 55 | <li> |
|
56 | 56 | <a title="${_('Files')}" href="${h.route_path('repo_files:default_commit',repo_name=repo_name)}"> |
|
57 | 57 | <span>${_('Files')}</span> |
|
58 | 58 | </a> |
|
59 | 59 | </li> |
|
60 | 60 | <li> |
|
61 | 61 | <a title="${_('Fork')}" href="${h.route_path('repo_fork_new',repo_name=repo_name)}"> |
|
62 | 62 | <span>${_('Fork')}</span> |
|
63 | 63 | </a> |
|
64 | 64 | </li> |
|
65 | 65 | </ul> |
|
66 | 66 | </div> |
|
67 | 67 | </%def> |
|
68 | 68 | |
|
69 | 69 | <%def name="repo_name(name,rtype,rstate,private,archived,fork_of,short_name=False,admin=False)"> |
|
70 | 70 | <% |
|
71 | 71 | def get_name(name,short_name=short_name): |
|
72 | 72 | if short_name: |
|
73 | 73 | return name.split('/')[-1] |
|
74 | 74 | else: |
|
75 | 75 | return name |
|
76 | 76 | %> |
|
77 | 77 | <div class="${'repo_state_pending' if rstate == 'repo_state_pending' else ''} truncate"> |
|
78 | 78 | ##NAME |
|
79 | 79 | <a href="${h.route_path('edit_repo',repo_name=name) if admin else h.route_path('repo_summary',repo_name=name)}"> |
|
80 | 80 | |
|
81 | 81 | ##TYPE OF REPO |
|
82 | 82 | %if h.is_hg(rtype): |
|
83 | 83 | <span title="${_('Mercurial repository')}"><i class="icon-hg" style="font-size: 14px;"></i></span> |
|
84 | 84 | %elif h.is_git(rtype): |
|
85 | 85 | <span title="${_('Git repository')}"><i class="icon-git" style="font-size: 14px"></i></span> |
|
86 | 86 | %elif h.is_svn(rtype): |
|
87 | 87 | <span title="${_('Subversion repository')}"><i class="icon-svn" style="font-size: 14px"></i></span> |
|
88 | 88 | %endif |
|
89 | 89 | |
|
90 | 90 | ##PRIVATE/PUBLIC |
|
91 | 91 | %if private is True and c.visual.show_private_icon: |
|
92 | 92 | <i class="icon-lock" title="${_('Private repository')}"></i> |
|
93 | 93 | %elif private is False and c.visual.show_public_icon: |
|
94 | 94 | <i class="icon-unlock-alt" title="${_('Public repository')}"></i> |
|
95 | 95 | %else: |
|
96 | 96 | <span></span> |
|
97 | 97 | %endif |
|
98 | 98 | ${get_name(name)} |
|
99 | 99 | </a> |
|
100 | 100 | %if fork_of: |
|
101 | 101 | <a href="${h.route_path('repo_summary',repo_name=fork_of.repo_name)}"><i class="icon-code-fork"></i></a> |
|
102 | 102 | %endif |
|
103 | 103 | %if rstate == 'repo_state_pending': |
|
104 | 104 | <span class="creation_in_progress tooltip" title="${_('This repository is being created in a background task')}"> |
|
105 | 105 | (${_('creating...')}) |
|
106 | 106 | </span> |
|
107 | 107 | %endif |
|
108 | 108 | |
|
109 | 109 | </div> |
|
110 | 110 | </%def> |
|
111 | 111 | |
|
112 | 112 | <%def name="repo_desc(description, stylify_metatags)"> |
|
113 | 113 | <% |
|
114 | 114 | tags, description = h.extract_metatags(description) |
|
115 | 115 | %> |
|
116 | 116 | |
|
117 | 117 | <div class="truncate-wrap"> |
|
118 | 118 | % if stylify_metatags: |
|
119 | 119 | % for tag_type, tag in tags: |
|
120 | 120 | ${h.style_metatag(tag_type, tag)|n} |
|
121 | 121 | % endfor |
|
122 | 122 | % endif |
|
123 | 123 | ${description} |
|
124 | 124 | </div> |
|
125 | 125 | |
|
126 | 126 | </%def> |
|
127 | 127 | |
|
128 | 128 | <%def name="last_change(last_change)"> |
|
129 | 129 | ${h.age_component(last_change, time_is_local=True)} |
|
130 | 130 | </%def> |
|
131 | 131 | |
|
132 | 132 | <%def name="revision(name,rev,tip,author,last_msg, commit_date)"> |
|
133 | 133 | <div> |
|
134 | 134 | %if rev >= 0: |
|
135 | 135 | <code><a title="${h.tooltip('%s\n%s\n\n%s' % (author, commit_date, last_msg))}" class="tooltip" href="${h.route_path('repo_commit',repo_name=name,commit_id=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a></code> |
|
136 | 136 | %else: |
|
137 | 137 | ${_('No commits yet')} |
|
138 | 138 | %endif |
|
139 | 139 | </div> |
|
140 | 140 | </%def> |
|
141 | 141 | |
|
142 | 142 | <%def name="rss(name)"> |
|
143 | 143 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
144 | 144 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.route_path('rss_feed_home', repo_name=name, _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a> |
|
145 | 145 | %else: |
|
146 | 146 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.route_path('rss_feed_home', repo_name=name)}"><i class="icon-rss-sign"></i></a> |
|
147 | 147 | %endif |
|
148 | 148 | </%def> |
|
149 | 149 | |
|
150 | 150 | <%def name="atom(name)"> |
|
151 | 151 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
152 | 152 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.route_path('atom_feed_home', repo_name=name, _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a> |
|
153 | 153 | %else: |
|
154 | 154 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.route_path('atom_feed_home', repo_name=name)}"><i class="icon-rss-sign"></i></a> |
|
155 | 155 | %endif |
|
156 | 156 | </%def> |
|
157 | 157 | |
|
158 | 158 | <%def name="user_gravatar(email, size=16)"> |
|
159 | 159 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> |
|
160 | 160 | ${base.gravatar(email, 16)} |
|
161 | 161 | </div> |
|
162 | 162 | </%def> |
|
163 | 163 | |
|
164 | 164 | <%def name="repo_actions(repo_name, super_user=True)"> |
|
165 | 165 | <div> |
|
166 | 166 | <div class="grid_edit"> |
|
167 | 167 | <a href="${h.route_path('edit_repo',repo_name=repo_name)}" title="${_('Edit')}"> |
|
168 | <i class="icon-pencil"></i>Edit</a> | |
|
168 | Edit | |
|
169 | </a> | |
|
169 | 170 | </div> |
|
170 | 171 | <div class="grid_delete"> |
|
171 | 172 | ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=repo_name), request=request)} |
|
172 | 173 | ${h.submit('remove_%s' % repo_name,_('Delete'),class_="btn btn-link btn-danger", |
|
173 | 174 | onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} |
|
174 | 175 | ${h.end_form()} |
|
175 | 176 | </div> |
|
176 | 177 | </div> |
|
177 | 178 | </%def> |
|
178 | 179 | |
|
179 | 180 | <%def name="repo_state(repo_state)"> |
|
180 | 181 | <div> |
|
181 | 182 | %if repo_state == 'repo_state_pending': |
|
182 | 183 | <div class="tag tag4">${_('Creating')}</div> |
|
183 | 184 | %elif repo_state == 'repo_state_created': |
|
184 | 185 | <div class="tag tag1">${_('Created')}</div> |
|
185 | 186 | %else: |
|
186 | 187 | <div class="tag alert2" title="${h.tooltip(repo_state)}">invalid</div> |
|
187 | 188 | %endif |
|
188 | 189 | </div> |
|
189 | 190 | </%def> |
|
190 | 191 | |
|
191 | 192 | |
|
192 | 193 | ## REPO GROUP RENDERERS |
|
193 | 194 | <%def name="quick_repo_group_menu(repo_group_name)"> |
|
194 | 195 | <i class="icon-more"></i> |
|
195 | 196 | <div class="menu_items_container hidden"> |
|
196 | 197 | <ul class="menu_items"> |
|
197 | 198 | <li> |
|
198 | 199 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}">${_('Summary')}</a> |
|
199 | 200 | </li> |
|
200 | 201 | |
|
201 | 202 | </ul> |
|
202 | 203 | </div> |
|
203 | 204 | </%def> |
|
204 | 205 | |
|
205 | 206 | <%def name="repo_group_name(repo_group_name, children_groups=None)"> |
|
206 | 207 | <div> |
|
207 | 208 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}"> |
|
208 | 209 | <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i> |
|
209 | 210 | %if children_groups: |
|
210 | 211 | ${h.literal(' » '.join(children_groups))} |
|
211 | 212 | %else: |
|
212 | 213 | ${repo_group_name} |
|
213 | 214 | %endif |
|
214 | 215 | </a> |
|
215 | 216 | </div> |
|
216 | 217 | </%def> |
|
217 | 218 | |
|
218 | 219 | <%def name="repo_group_desc(description, personal, stylify_metatags)"> |
|
219 | 220 | |
|
220 | 221 | <% |
|
221 | 222 | tags, description = h.extract_metatags(description) |
|
222 | 223 | %> |
|
223 | 224 | |
|
224 | 225 | <div class="truncate-wrap"> |
|
225 | 226 | % if personal: |
|
226 | 227 | <div class="metatag" tag="personal">${_('personal')}</div> |
|
227 | 228 | % endif |
|
228 | 229 | |
|
229 | 230 | % if stylify_metatags: |
|
230 | 231 | % for tag_type, tag in tags: |
|
231 | 232 | ${h.style_metatag(tag_type, tag)|n} |
|
232 | 233 | % endfor |
|
233 | 234 | % endif |
|
234 | 235 | ${description} |
|
235 | 236 | </div> |
|
236 | 237 | |
|
237 | 238 | </%def> |
|
238 | 239 | |
|
239 | 240 | <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)"> |
|
240 | 241 | <div class="grid_edit"> |
|
241 | 242 | <a href="${h.route_path('edit_repo_group',repo_group_name=repo_group_name)}" title="${_('Edit')}">Edit</a> |
|
242 | 243 | </div> |
|
243 | 244 | <div class="grid_delete"> |
|
244 | 245 | ${h.secure_form(h.route_path('edit_repo_group_advanced_delete', repo_group_name=repo_group_name), request=request)} |
|
245 | 246 | ${h.submit('remove_%s' % repo_group_name,_('Delete'),class_="btn btn-link btn-danger", |
|
246 | 247 | onclick="return confirm('"+_ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)+"');")} |
|
247 | 248 | ${h.end_form()} |
|
248 | 249 | </div> |
|
249 | 250 | </%def> |
|
250 | 251 | |
|
251 | 252 | |
|
252 | 253 | <%def name="user_actions(user_id, username)"> |
|
253 | 254 | <div class="grid_edit"> |
|
254 | 255 | <a href="${h.route_path('user_edit',user_id=user_id)}" title="${_('Edit')}"> |
|
255 | <i class="icon-pencil"></i>${_('Edit')}</a> | |
|
256 | ${_('Edit')} | |
|
257 | </a> | |
|
256 | 258 | </div> |
|
257 | 259 | <div class="grid_delete"> |
|
258 | 260 | ${h.secure_form(h.route_path('user_delete', user_id=user_id), request=request)} |
|
259 | 261 | ${h.submit('remove_',_('Delete'),id="remove_user_%s" % user_id, class_="btn btn-link btn-danger", |
|
260 | 262 | onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")} |
|
261 | 263 | ${h.end_form()} |
|
262 | 264 | </div> |
|
263 | 265 | </%def> |
|
264 | 266 | |
|
265 | 267 | <%def name="user_group_actions(user_group_id, user_group_name)"> |
|
266 | 268 | <div class="grid_edit"> |
|
267 | 269 | <a href="${h.route_path('edit_user_group', user_group_id=user_group_id)}" title="${_('Edit')}">Edit</a> |
|
268 | 270 | </div> |
|
269 | 271 | <div class="grid_delete"> |
|
270 | 272 | ${h.secure_form(h.route_path('user_groups_delete', user_group_id=user_group_id), request=request)} |
|
271 | 273 | ${h.submit('remove_',_('Delete'),id="remove_group_%s" % user_group_id, class_="btn btn-link btn-danger", |
|
272 | 274 | onclick="return confirm('"+_('Confirm to delete this user group: %s') % user_group_name+"');")} |
|
273 | 275 | ${h.end_form()} |
|
274 | 276 | </div> |
|
275 | 277 | </%def> |
|
276 | 278 | |
|
277 | 279 | |
|
278 | 280 | <%def name="user_name(user_id, username)"> |
|
279 | 281 | ${h.link_to(h.person(username, 'username_or_name_or_email'), h.route_path('user_edit', user_id=user_id))} |
|
280 | 282 | </%def> |
|
281 | 283 | |
|
282 | 284 | <%def name="user_profile(username)"> |
|
283 | 285 | ${base.gravatar_with_user(username, 16)} |
|
284 | 286 | </%def> |
|
285 | 287 | |
|
286 | 288 | <%def name="user_group_name(user_group_name)"> |
|
287 | 289 | <div> |
|
288 | 290 | <i class="icon-user-group" title="${_('User group')}"></i> |
|
289 | 291 | ${h.link_to_group(user_group_name)} |
|
290 | 292 | </div> |
|
291 | 293 | </%def> |
|
292 | 294 | |
|
293 | 295 | |
|
294 | 296 | ## GISTS |
|
295 | 297 | |
|
296 | 298 | <%def name="gist_gravatar(full_contact)"> |
|
297 | 299 | <div class="gist_gravatar"> |
|
298 | 300 | ${base.gravatar(full_contact, 30)} |
|
299 | 301 | </div> |
|
300 | 302 | </%def> |
|
301 | 303 | |
|
302 | 304 | <%def name="gist_access_id(gist_access_id, full_contact)"> |
|
303 | 305 | <div> |
|
304 | 306 | <b> |
|
305 | 307 | <a href="${h.route_path('gist_show', gist_id=gist_access_id)}">gist: ${gist_access_id}</a> |
|
306 | 308 | </b> |
|
307 | 309 | </div> |
|
308 | 310 | </%def> |
|
309 | 311 | |
|
310 | 312 | <%def name="gist_author(full_contact, created_on, expires)"> |
|
311 | 313 | ${base.gravatar_with_user(full_contact, 16)} |
|
312 | 314 | </%def> |
|
313 | 315 | |
|
314 | 316 | |
|
315 | 317 | <%def name="gist_created(created_on)"> |
|
316 | 318 | <div class="created"> |
|
317 | 319 | ${h.age_component(created_on, time_is_local=True)} |
|
318 | 320 | </div> |
|
319 | 321 | </%def> |
|
320 | 322 | |
|
321 | 323 | <%def name="gist_expires(expires)"> |
|
322 | 324 | <div class="created"> |
|
323 | 325 | %if expires == -1: |
|
324 | 326 | ${_('never')} |
|
325 | 327 | %else: |
|
326 | 328 | ${h.age_component(h.time_to_utcdatetime(expires))} |
|
327 | 329 | %endif |
|
328 | 330 | </div> |
|
329 | 331 | </%def> |
|
330 | 332 | |
|
331 | 333 | <%def name="gist_type(gist_type)"> |
|
332 | 334 | %if gist_type != 'public': |
|
333 | 335 | <div class="tag">${_('Private')}</div> |
|
334 | 336 | %endif |
|
335 | 337 | </%def> |
|
336 | 338 | |
|
337 | 339 | <%def name="gist_description(gist_description)"> |
|
338 | 340 | ${gist_description} |
|
339 | 341 | </%def> |
|
340 | 342 | |
|
341 | 343 | |
|
342 | 344 | ## PULL REQUESTS GRID RENDERERS |
|
343 | 345 | |
|
344 | 346 | <%def name="pullrequest_target_repo(repo_name)"> |
|
345 | 347 | <div class="truncate"> |
|
346 | 348 | ${h.link_to(repo_name,h.route_path('repo_summary',repo_name=repo_name))} |
|
347 | 349 | </div> |
|
348 | 350 | </%def> |
|
349 | 351 | <%def name="pullrequest_status(status)"> |
|
350 | 352 | <div class="${'flag_status %s' % status} pull-left"></div> |
|
351 | 353 | </%def> |
|
352 | 354 | |
|
353 | 355 | <%def name="pullrequest_title(title, description)"> |
|
354 | 356 | ${title} |
|
355 | 357 | </%def> |
|
356 | 358 | |
|
357 | 359 | <%def name="pullrequest_comments(comments_nr)"> |
|
358 | 360 | <i class="icon-comment"></i> ${comments_nr} |
|
359 | 361 | </%def> |
|
360 | 362 | |
|
361 | 363 | <%def name="pullrequest_name(pull_request_id, target_repo_name, short=False)"> |
|
362 | 364 | <a href="${h.route_path('pullrequest_show',repo_name=target_repo_name,pull_request_id=pull_request_id)}"> |
|
363 | 365 | % if short: |
|
364 | 366 | #${pull_request_id} |
|
365 | 367 | % else: |
|
366 | 368 | ${_('Pull request #%(pr_number)s') % {'pr_number': pull_request_id,}} |
|
367 | 369 | % endif |
|
368 | 370 | </a> |
|
369 | 371 | </%def> |
|
370 | 372 | |
|
371 | 373 | <%def name="pullrequest_updated_on(updated_on)"> |
|
372 | 374 | ${h.age_component(h.time_to_utcdatetime(updated_on))} |
|
373 | 375 | </%def> |
|
374 | 376 | |
|
375 | 377 | <%def name="pullrequest_author(full_contact)"> |
|
376 | 378 | ${base.gravatar_with_user(full_contact, 16)} |
|
377 | 379 | </%def> |
|
378 | 380 | |
|
379 | 381 | |
|
380 | 382 | ## ARTIFACT RENDERERS |
|
381 | 383 | |
|
382 | 384 | <%def name="repo_artifact_uid(repo_name, file_uid)"> |
|
383 | 385 | <code><a href="${h.route_path('repo_artifacts_get', repo_name=repo_name, uid=file_uid)}">${file_uid}</a></code> |
|
384 | 386 | </%def> |
|
385 | 387 | |
|
386 | 388 | <%def name="repo_artifact_uid_action(repo_name, file_uid)"> |
|
387 | 389 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${h.route_url('repo_artifacts_get', repo_name=repo_name, uid=file_uid)}" title="${_('Copy the full url')}"></i> |
|
388 | 390 | </%def> |
|
389 | 391 | |
|
390 | 392 | <%def name="repo_artifact_actions(repo_name, file_store_id, file_uid)"> |
|
391 | 393 | ## <div class="grid_edit"> |
|
392 | 394 | ## <a href="#Edit" title="${_('Edit')}">${_('Edit')}</a> |
|
393 | 395 | ## </div> |
|
394 | 396 | % if h.HasRepoPermissionAny('repository.admin')(c.repo_name): |
|
395 | 397 | <div class="grid_delete"> |
|
396 | 398 | ${h.secure_form(h.route_path('repo_artifacts_delete', repo_name=repo_name, uid=file_store_id), request=request)} |
|
397 | 399 | ${h.submit('remove_',_('Delete'),id="remove_artifact_%s" % file_store_id, class_="btn btn-link btn-danger", |
|
398 | 400 | onclick="return confirm('"+_('Confirm to delete this artifact: %s') % file_uid+"');")} |
|
399 | 401 | ${h.end_form()} |
|
400 | 402 | </div> |
|
401 | 403 | % endif |
|
402 | 404 | </%def> |
|
403 | 405 | |
|
404 | 406 | <%def name="markup_form(form_id, form_text='', help_text=None)"> |
|
405 | 407 | |
|
406 | 408 | <div class="markup-form"> |
|
407 | 409 | <div class="markup-form-area"> |
|
408 | 410 | <div class="markup-form-area-header"> |
|
409 | 411 | <ul class="nav-links clearfix"> |
|
410 | 412 | <li class="active"> |
|
411 | 413 | <a href="#edit-text" tabindex="-1" id="edit-btn_${form_id}">${_('Write')}</a> |
|
412 | 414 | </li> |
|
413 | 415 | <li class=""> |
|
414 | 416 | <a href="#preview-text" tabindex="-1" id="preview-btn_${form_id}">${_('Preview')}</a> |
|
415 | 417 | </li> |
|
416 | 418 | </ul> |
|
417 | 419 | </div> |
|
418 | 420 | |
|
419 | 421 | <div class="markup-form-area-write" style="display: block;"> |
|
420 | 422 | <div id="edit-container_${form_id}"> |
|
421 | 423 | <textarea id="${form_id}" name="${form_id}" class="comment-block-ta ac-input">${form_text if form_text else ''}</textarea> |
|
422 | 424 | </div> |
|
423 | 425 | <div id="preview-container_${form_id}" class="clearfix" style="display: none;"> |
|
424 | 426 | <div id="preview-box_${form_id}" class="preview-box"></div> |
|
425 | 427 | </div> |
|
426 | 428 | </div> |
|
427 | 429 | |
|
428 | 430 | <div class="markup-form-area-footer"> |
|
429 | 431 | <div class="toolbar"> |
|
430 | 432 | <div class="toolbar-text"> |
|
431 | 433 | ${(_('Parsed using %s syntax') % ( |
|
432 | 434 | ('<a href="%s">%s</a>' % (h.route_url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())), |
|
433 | 435 | ) |
|
434 | 436 | )|n} |
|
435 | 437 | </div> |
|
436 | 438 | </div> |
|
437 | 439 | </div> |
|
438 | 440 | </div> |
|
439 | 441 | |
|
440 | 442 | <div class="markup-form-footer"> |
|
441 | 443 | % if help_text: |
|
442 | 444 | <span class="help-block">${help_text}</span> |
|
443 | 445 | % endif |
|
444 | 446 | </div> |
|
445 | 447 | </div> |
|
446 | 448 | <script type="text/javascript"> |
|
447 | 449 | new MarkupForm('${form_id}'); |
|
448 | 450 | </script> |
|
449 | 451 | |
|
450 | 452 | </%def> |
@@ -1,1160 +1,1160 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%namespace name="base" file="/base/base.mako"/> |
|
3 | 3 | <%inherit file="/debug_style/index.html"/> |
|
4 | 4 | |
|
5 | 5 | <%def name="breadcrumbs_links()"> |
|
6 | 6 | ${h.link_to(_('Style'), h.route_path('debug_style_home'))} |
|
7 | 7 | » |
|
8 | 8 | ${c.active} |
|
9 | 9 | </%def> |
|
10 | 10 | |
|
11 | 11 | <%def name="js_extra()"> |
|
12 | 12 | </%def> |
|
13 | 13 | |
|
14 | 14 | <%def name="css_extra()"> |
|
15 | 15 | </%def> |
|
16 | 16 | |
|
17 | 17 | |
|
18 | 18 | <%def name="real_main()"> |
|
19 | 19 | <div class="box"> |
|
20 | 20 | <div class="title"> |
|
21 | 21 | ${self.breadcrumbs()} |
|
22 | 22 | </div> |
|
23 | 23 | |
|
24 | 24 | ##main |
|
25 | 25 | <div class='sidebar-col-wrapper'> |
|
26 | 26 | ${self.sidebar()} |
|
27 | 27 | |
|
28 | 28 | <div class="main-content"> |
|
29 | 29 | |
|
30 | 30 | |
|
31 | 31 | |
|
32 | 32 | <h2>Code Blocks</h2> |
|
33 | 33 | |
|
34 | 34 | <dl class="dl-horizontal"> |
|
35 | 35 | <dt><code>.codeblock</code></dt> |
|
36 | 36 | <dd>Used as a wrapping element around <code>.code-header</code> and |
|
37 | 37 | <code>.code-body</code>. Used to show the content of a file or a |
|
38 | 38 | Gist.</dd> |
|
39 | 39 | |
|
40 | 40 | <dt><code>.diffblock</code></dt> |
|
41 | 41 | <dd>Used as a wrapping element to show a diff in a Commit or Pull |
|
42 | 42 | Request page. Contains usually <code>.code-header</code>, |
|
43 | 43 | <code>.code-body</code> and in the edit case a <code>.message</code>. |
|
44 | 44 | </dd> |
|
45 | 45 | </dl> |
|
46 | 46 | |
|
47 | 47 | |
|
48 | 48 | <p>Code Blocks are used in the following areas:</p> |
|
49 | 49 | |
|
50 | 50 | <ul> |
|
51 | 51 | <li>Commit: Showing the Diff (still called Changeset in a few |
|
52 | 52 | places).</li> |
|
53 | 53 | <li>File: Display a file, annotations, and edit a file.</li> |
|
54 | 54 | <li>Gist: Show the Gist and edit it.</li> |
|
55 | 55 | <li>Pull Request: Display the Diff of a Pull Request.</li> |
|
56 | 56 | </ul> |
|
57 | 57 | |
|
58 | 58 | |
|
59 | 59 | |
|
60 | 60 | <!-- |
|
61 | 61 | Compare Commits |
|
62 | 62 | --> |
|
63 | 63 | <h2>Compare Commits</h2> |
|
64 | 64 | |
|
65 | 65 | <div id="c-e589e34d6be8-5ab783e6d81b" class="diffblock margined comm"> |
|
66 | 66 | <div class="code-header"> |
|
67 | 67 | <div title="Go back to changed files overview"> |
|
68 | 68 | <a href="#changes_box"> |
|
69 | 69 | <i class="icon-circle-arrow-up"></i> |
|
70 | 70 | </a> |
|
71 | 71 | </div> |
|
72 | 72 | <div class="changeset_header"> |
|
73 | 73 | <div class="changeset_file"> |
|
74 | 74 | <i class="icon-file"></i> |
|
75 | 75 | <a href="/example/files/e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d/rhodecode/public/css/code-block.less">rhodecode/public/css/code-block.less</a> |
|
76 | 76 | </div> |
|
77 | 77 | <div class="diff-actions"> |
|
78 | 78 | <a href="/example/diff/rhodecode/public/css/code-block.less?fulldiff=1&diff1=d12301bafcc0aea15c9283d3af018daee2b04cd9&diff=diff&diff2=e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d" class="tooltip" title="Show full diff for this file"> |
|
79 | 79 | <img class="icon" src="/images/icons/page_white_go.png"> |
|
80 | 80 | </a> |
|
81 | 81 | <a href="/example/diff-2way/rhodecode/public/css/code-block.less?fulldiff=1&diff1=d12301bafcc0aea15c9283d3af018daee2b04cd9&diff=diff&diff2=e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d" class="tooltip" title="Show full side-by-side diff for this file"> |
|
82 | 82 | <img class="icon" src="/images/icons/application_double.png"> |
|
83 | 83 | </a> |
|
84 | 84 | <a href="/example/diff/rhodecode/public/css/code-block.less?diff1=d12301bafcc0aea15c9283d3af018daee2b04cd9&diff=raw&diff2=e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d" class="tooltip" title="Raw diff" tt_title="Raw diff"> |
|
85 | 85 | <img class="icon" src="/images/icons/page_white.png"> |
|
86 | 86 | </a> |
|
87 | 87 | <a href="/example/diff/rhodecode/public/css/code-block.less?diff1=d12301bafcc0aea15c9283d3af018daee2b04cd9&diff=download&diff2=e589e34d6be8ec2b44017f6c2e0bbe782f1aba6d" class="tooltip" title="Download diff"> |
|
88 | 88 | <img class="icon" src="/images/icons/page_save.png"> |
|
89 | 89 | </a> |
|
90 | 90 | <a class="tooltip" href="/example/changeset/d12301bafcc0aea15c9283d3af018daee2b04cd9...80ead1899f50a894889e19ffeb49c9cebf5bf045?c-e589e34d6be8-5ab783e6d81b=WS%3A1&c-e589e34d6be8-5ab783e6d81b=C%3A3#c-e589e34d6be8-5ab783e6d81b" title="Ignore white space"><img alt="Ignore white space" class="icon" src="/images/icons/text_strikethrough.png"></a> |
|
91 | 91 | <a class="tooltip" href="/example/changeset/d12301bafcc0aea15c9283d3af018daee2b04cd9...80ead1899f50a894889e19ffeb49c9cebf5bf045?c-e589e34d6be8-5ab783e6d81b=C%3A6#c-e589e34d6be8-5ab783e6d81b" title="increase diff context to 6 lines"><img alt="increase diff context to 6 lines" class="icon" src="/images/icons/table_add.png"></a> |
|
92 | 92 | </div> |
|
93 | 93 | <span> |
|
94 | 94 | <label> |
|
95 | 95 | Show inline comments |
|
96 | 96 | <input checked="checked" class="show-inline-comments" id="" id_for="c-e589e34d6be8-5ab783e6d81b" name="" type="checkbox" value="1"> |
|
97 | 97 | </label> |
|
98 | 98 | </span> |
|
99 | 99 | </div> |
|
100 | 100 | </div> |
|
101 | 101 | <div class="code-body"> |
|
102 | 102 | <div class="full_f_path" path="rhodecode/public/css/code-block.less"></div> |
|
103 | 103 | <table class="code-difftable"> |
|
104 | 104 | <tbody><tr class="line context"> |
|
105 | 105 | <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o...">...</a></td> |
|
106 | 106 | <td class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n...">...</a></td> |
|
107 | 107 | <td class="code no-comment"> |
|
108 | 108 | <pre>@@ -391,7 +391,7 @@ |
|
109 | 109 | </pre> |
|
110 | 110 | </td> |
|
111 | 111 | </tr> |
|
112 | 112 | <tr class="line unmod"> |
|
113 | 113 | <td id="rhodecodepubliccsscode-blockless_o391" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o391">391</a></td> |
|
114 | 114 | <td id="rhodecodepubliccsscode-blockless_n391" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n391">391</a></td> |
|
115 | 115 | <td class="code no-comment"> |
|
116 | 116 | <pre>} /* Existing line, it might have a quite long content actually and in this case we might need some horizontal scrolling. The remaining text here is just used to make this line very long. |
|
117 | 117 | </pre> |
|
118 | 118 | </td> |
|
119 | 119 | </tr> |
|
120 | 120 | <tr class="line unmod"> |
|
121 | 121 | <td id="rhodecodepubliccsscode-blockless_o392" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o392">392</a></td> |
|
122 | 122 | <td id="rhodecodepubliccsscode-blockless_n392" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n392">392</a></td> |
|
123 | 123 | <td class="code no-comment"> |
|
124 | 124 | <pre></pre> |
|
125 | 125 | </td> |
|
126 | 126 | </tr> |
|
127 | 127 | <tr class="line unmod"> |
|
128 | 128 | <td id="rhodecodepubliccsscode-blockless_o393" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o393">393</a></td> |
|
129 | 129 | <td id="rhodecodepubliccsscode-blockless_n393" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n393">393</a></td> |
|
130 | 130 | <td class="code no-comment"> |
|
131 | 131 | <pre>.code-body.textarea.editor, |
|
132 | 132 | </pre> |
|
133 | 133 | </td> |
|
134 | 134 | </tr> |
|
135 | 135 | <tr class="line del"> |
|
136 | 136 | <td id="rhodecodepubliccsscode-blockless_o394" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o394">394</a></td> |
|
137 | 137 | <td class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n"></a></td> |
|
138 | 138 | <td class="code no-comment"> |
|
139 | 139 | <pre>div.code-body{ |
|
140 | 140 | </pre> |
|
141 | 141 | </td> |
|
142 | 142 | </tr> |
|
143 | 143 | <tr class="line add"> |
|
144 | 144 | <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o"></a></td> |
|
145 | 145 | <td id="rhodecodepubliccsscode-blockless_n394" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n394">394</a></td> |
|
146 | 146 | <td class="code no-comment"> |
|
147 | 147 | <pre>div.code-body<ins> </ins>{ |
|
148 | 148 | </pre> |
|
149 | 149 | </td> |
|
150 | 150 | </tr> |
|
151 | 151 | <tr class="line unmod"> |
|
152 | 152 | <td id="rhodecodepubliccsscode-blockless_o395" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o395">395</a></td> |
|
153 | 153 | <td id="rhodecodepubliccsscode-blockless_n395" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n395">395</a></td> |
|
154 | 154 | <td class="code no-comment"> |
|
155 | 155 | <pre> float: left; |
|
156 | 156 | </pre> |
|
157 | 157 | </td> |
|
158 | 158 | </tr> |
|
159 | 159 | <tr class="line unmod"> |
|
160 | 160 | <td id="rhodecodepubliccsscode-blockless_o396" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o396">396</a></td> |
|
161 | 161 | <td id="rhodecodepubliccsscode-blockless_n396" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n396">396</a></td> |
|
162 | 162 | <td class="code no-comment"> |
|
163 | 163 | <pre> position: relative; |
|
164 | 164 | </pre> |
|
165 | 165 | </td> |
|
166 | 166 | </tr> |
|
167 | 167 | <tr class="line unmod"> |
|
168 | 168 | <td id="rhodecodepubliccsscode-blockless_o397" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o397">397</a></td> |
|
169 | 169 | <td id="rhodecodepubliccsscode-blockless_n397" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n397">397</a></td> |
|
170 | 170 | <td class="code no-comment"> |
|
171 | 171 | <pre> max-width: none; |
|
172 | 172 | </pre> |
|
173 | 173 | </td> |
|
174 | 174 | </tr> |
|
175 | 175 | <tr class="line context"> |
|
176 | 176 | <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o...">...</a></td> |
|
177 | 177 | <td class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n...">...</a></td> |
|
178 | 178 | <td class="code no-comment"> |
|
179 | 179 | <pre>@@ -399,3 +399,6 @@ |
|
180 | 180 | </pre> |
|
181 | 181 | </td> |
|
182 | 182 | </tr> |
|
183 | 183 | <tr class="line unmod"> |
|
184 | 184 | <td id="rhodecodepubliccsscode-blockless_o399" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o399">399</a></td> |
|
185 | 185 | <td id="rhodecodepubliccsscode-blockless_n399" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n399">399</a></td> |
|
186 | 186 | <td class="code no-comment"> |
|
187 | 187 | <pre> box-sizing: border-box; |
|
188 | 188 | </pre> |
|
189 | 189 | </td> |
|
190 | 190 | </tr> |
|
191 | 191 | <tr class="line unmod"> |
|
192 | 192 | <td id="rhodecodepubliccsscode-blockless_o400" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o400">400</a></td> |
|
193 | 193 | <td id="rhodecodepubliccsscode-blockless_n400" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n400">400</a></td> |
|
194 | 194 | <td class="code no-comment"> |
|
195 | 195 | <pre>} |
|
196 | 196 | </pre> |
|
197 | 197 | </td> |
|
198 | 198 | </tr> |
|
199 | 199 | <tr class="line unmod"> |
|
200 | 200 | <td id="rhodecodepubliccsscode-blockless_o401" class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o401">401</a></td> |
|
201 | 201 | <td id="rhodecodepubliccsscode-blockless_n401" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n401">401</a></td> |
|
202 | 202 | <td class="code no-comment"> |
|
203 | 203 | <pre></pre> |
|
204 | 204 | </td> |
|
205 | 205 | </tr> |
|
206 | 206 | <tr class="line add"> |
|
207 | 207 | <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o"></a></td> |
|
208 | 208 | <td id="rhodecodepubliccsscode-blockless_n402" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n402">402</a></td> |
|
209 | 209 | <td class="code no-comment"> |
|
210 | 210 | <pre>.code-body td{ |
|
211 | 211 | </pre> |
|
212 | 212 | </td> |
|
213 | 213 | </tr> |
|
214 | 214 | <tr class="line add"> |
|
215 | 215 | <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o"></a></td> |
|
216 | 216 | <td id="rhodecodepubliccsscode-blockless_n403" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n403">403</a></td> |
|
217 | 217 | <td class="code no-comment"> |
|
218 | 218 | <pre> line-height: 1.2em; |
|
219 | 219 | </pre> |
|
220 | 220 | </td> |
|
221 | 221 | </tr> |
|
222 | 222 | <tr class="line add"> |
|
223 | 223 | <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o"></a></td> |
|
224 | 224 | <td id="rhodecodepubliccsscode-blockless_n404" class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n404">404</a></td> |
|
225 | 225 | <td class="code no-comment"> |
|
226 | 226 | <pre>} |
|
227 | 227 | </pre> |
|
228 | 228 | </td> |
|
229 | 229 | </tr> |
|
230 | 230 | <tr class="line context"> |
|
231 | 231 | <td class="lineno old"><a href="#rhodecodepubliccsscode-blockless_o...">...</a></td> |
|
232 | 232 | <td class="lineno new"><a href="#rhodecodepubliccsscode-blockless_n...">...</a></td> |
|
233 | 233 | <td class="code no-comment"> |
|
234 | 234 | <pre> No newline at end of file |
|
235 | 235 | </pre> |
|
236 | 236 | </td> |
|
237 | 237 | </tr> |
|
238 | 238 | </tbody></table> |
|
239 | 239 | </div> |
|
240 | 240 | </div> |
|
241 | 241 | |
|
242 | 242 | |
|
243 | 243 | |
|
244 | 244 | |
|
245 | 245 | |
|
246 | 246 | |
|
247 | 247 | <!-- |
|
248 | 248 | Pull Request |
|
249 | 249 | --> |
|
250 | 250 | |
|
251 | 251 | <h2>Pull Request</h2> |
|
252 | 252 | |
|
253 | 253 | <div class="cs_files"> |
|
254 | 254 | <table class="compare_view_files"> |
|
255 | 255 | |
|
256 | 256 | <tbody><tr class="cs_M collapse_file" fid="c--5f1d017cf13b"> |
|
257 | 257 | <td class="cs_icon_td"> |
|
258 | 258 | <span class="collapse_file_icon" fid="c--5f1d017cf13b"></span> |
|
259 | 259 | </td> |
|
260 | 260 | <td class="cs_icon_td"> |
|
261 | 261 | <div class="flag_status not_reviewed hidden"></div> |
|
262 | 262 | </td> |
|
263 | 263 | <td id="a_c--5f1d017cf13b"> |
|
264 | 264 | <a class="compare_view_filepath" href="#a_c--5f1d017cf13b"> |
|
265 | 265 | rhodecode/public/css/main.less |
|
266 | 266 | </a> |
|
267 | 267 | <span id="diff_c--5f1d017cf13b" class="diff_links" style=""> |
|
268 | 268 | <a href="/example/diff/rhodecode/public/css/main.less?fulldiff=1&diff1=f73e9946825c8a7ef2c1178cd1e67986d5831f8f&diff=diff&diff2=27eb56cf467ca849112536d62decb2ed020b3ebc"> |
|
269 | 269 | Unified Diff |
|
270 | 270 | </a> |
|
271 | 271 | | |
|
272 | 272 | <a href="/example/diff-2way/rhodecode/public/css/main.less?fulldiff=1&diff1=f73e9946825c8a7ef2c1178cd1e67986d5831f8f&diff=diff&diff2=27eb56cf467ca849112536d62decb2ed020b3ebc"> |
|
273 | 273 | Side-by-side Diff |
|
274 | 274 | </a> |
|
275 | 275 | </span> |
|
276 | 276 | </td> |
|
277 | 277 | <td> |
|
278 | 278 | <div class="changes pull-right"><div style="width:100px"><div class="added top-left-rounded-corner-mid bottom-left-rounded-corner-mid" style="width:33.3333333333%">1</div><div class="deleted top-right-rounded-corner-mid bottom-right-rounded-corner-mid" style="width:66.6666666667%">2</div></div></div> |
|
279 | 279 | <div class="comment-bubble pull-right" data-path="rhodecode/public/css/main.less"> |
|
280 | 280 | <i class="icon-comment"></i> |
|
281 | 281 | </div> |
|
282 | 282 | </td> |
|
283 | 283 | </tr> |
|
284 | 284 | <tr id="tr_c--5f1d017cf13b"> |
|
285 | 285 | <td></td> |
|
286 | 286 | <td></td> |
|
287 | 287 | <td class="injected_diff" colspan="2"> |
|
288 | 288 | |
|
289 | 289 | <div class="diff-container" id="diff-container-140360026534904"> |
|
290 | 290 | <div id="c--5f1d017cf13b_target"></div> |
|
291 | 291 | <div id="c--5f1d017cf13b" class="diffblock margined comm"> |
|
292 | 292 | <div class="code-body"> |
|
293 | 293 | <div class="full_f_path" path="rhodecode/public/css/main.less" style="display: none;"></div> |
|
294 | 294 | <table class="code-difftable"> |
|
295 | 295 | <tbody><tr class="line context"> |
|
296 | 296 | <td class="lineno old"><a href="#rhodecodepubliccssmainless_o...">...</a></td> |
|
297 | 297 | <td class="lineno new"><a href="#rhodecodepubliccssmainless_n...">...</a></td> |
|
298 | 298 | <td class="code "> |
|
299 | 299 | <pre>@@ -2110,7 +2110,6 @@ |
|
300 | 300 | </pre> |
|
301 | 301 | </td> |
|
302 | 302 | </tr> |
|
303 | 303 | <tr class="line unmod"> |
|
304 | 304 | <td id="rhodecodepubliccssmainless_o2110" class="lineno old"><a href="#rhodecodepubliccssmainless_o2110">2110</a></td> |
|
305 | 305 | <td id="rhodecodepubliccssmainless_n2110" class="lineno new"><a href="#rhodecodepubliccssmainless_n2110">2110</a></td> |
|
306 | 306 | <td class="code "> |
|
307 | 307 | <pre><span class="tab-escape"> </span>width: auto !important; |
|
308 | 308 | </pre> |
|
309 | 309 | </td> |
|
310 | 310 | </tr> |
|
311 | 311 | <tr class="line unmod"> |
|
312 | 312 | <td id="rhodecodepubliccssmainless_o2111" class="lineno old"><a href="#rhodecodepubliccssmainless_o2111">2111</a></td> |
|
313 | 313 | <td id="rhodecodepubliccssmainless_n2111" class="lineno new"><a href="#rhodecodepubliccssmainless_n2111">2111</a></td> |
|
314 | 314 | <td class="code "> |
|
315 | 315 | <pre><span class="tab-escape"> </span>min-width: 160px; |
|
316 | 316 | </pre> |
|
317 | 317 | </td> |
|
318 | 318 | </tr> |
|
319 | 319 | <tr class="line unmod"> |
|
320 | 320 | <td id="rhodecodepubliccssmainless_o2112" class="lineno old"><a href="#rhodecodepubliccssmainless_o2112">2112</a></td> |
|
321 | 321 | <td id="rhodecodepubliccssmainless_n2112" class="lineno new"><a href="#rhodecodepubliccssmainless_n2112">2112</a></td> |
|
322 | 322 | <td class="code "> |
|
323 | 323 | <pre><span class="tab-escape"> </span>margin: @padding @padding @padding 0; |
|
324 | 324 | </pre> |
|
325 | 325 | </td> |
|
326 | 326 | </tr> |
|
327 | 327 | <tr class="line del"> |
|
328 | 328 | <td id="rhodecodepubliccssmainless_o2113" class="lineno old"><a href="#rhodecodepubliccssmainless_o2113">2113</a></td> |
|
329 | 329 | <td class="lineno new"><a href="#rhodecodepubliccssmainless_n"></a></td> |
|
330 | 330 | <td class="code "> |
|
331 | 331 | <pre><span class="tab-escape"> </span>padding: .9em; /* Old comment which was making this line a very long line so that we might have to deal with it by either adding horizontal scrolling or some smart way of breaking this line. */ |
|
332 | 332 | </pre> |
|
333 | 333 | </td> |
|
334 | 334 | </tr> |
|
335 | 335 | <tr class="line unmod"> |
|
336 | 336 | <td id="rhodecodepubliccssmainless_o2114" class="lineno old"><a href="#rhodecodepubliccssmainless_o2114">2114</a></td> |
|
337 | 337 | <td id="rhodecodepubliccssmainless_n2113" class="lineno new"><a href="#rhodecodepubliccssmainless_n2113">2113</a></td> |
|
338 | 338 | <td class="code "> |
|
339 | 339 | <pre> line-height: 1em; |
|
340 | 340 | </pre> |
|
341 | 341 | </td> |
|
342 | 342 | </tr> |
|
343 | 343 | <tr class="line unmod"> |
|
344 | 344 | <td id="rhodecodepubliccssmainless_o2115" class="lineno old"><a href="#rhodecodepubliccssmainless_o2115">2115</a></td> |
|
345 | 345 | <td id="rhodecodepubliccssmainless_n2114" class="lineno new"><a href="#rhodecodepubliccssmainless_n2114">2114</a></td> |
|
346 | 346 | <td class="code "> |
|
347 | 347 | <pre><span class="tab-escape"> </span>z-index: 100;//js sets the menu below it to 9999 |
|
348 | 348 | </pre> |
|
349 | 349 | </td> |
|
350 | 350 | </tr> |
|
351 | 351 | <tr class="line unmod"> |
|
352 | 352 | <td id="rhodecodepubliccssmainless_o2116" class="lineno old"><a href="#rhodecodepubliccssmainless_o2116">2116</a></td> |
|
353 | 353 | <td id="rhodecodepubliccssmainless_n2115" class="lineno new"><a href="#rhodecodepubliccssmainless_n2115">2115</a></td> |
|
354 | 354 | <td class="code "> |
|
355 | 355 | <pre><span class="tab-escape"> </span>background-color: white; |
|
356 | 356 | </pre> |
|
357 | 357 | </td> |
|
358 | 358 | </tr> |
|
359 | 359 | <tr class="line context"> |
|
360 | 360 | <td class="lineno old"><a href="#rhodecodepubliccssmainless_o...">...</a></td> |
|
361 | 361 | <td class="lineno new"><a href="#rhodecodepubliccssmainless_n...">...</a></td> |
|
362 | 362 | <td class="code "> |
|
363 | 363 | <pre>@@ -2118,7 +2117,7 @@ |
|
364 | 364 | </pre> |
|
365 | 365 | </td> |
|
366 | 366 | </tr> |
|
367 | 367 | <tr class="line unmod"> |
|
368 | 368 | <td id="rhodecodepubliccssmainless_o2118" class="lineno old"><a href="#rhodecodepubliccssmainless_o2118">2118</a></td> |
|
369 | 369 | <td id="rhodecodepubliccssmainless_n2117" class="lineno new"><a href="#rhodecodepubliccssmainless_n2117">2117</a></td> |
|
370 | 370 | <td class="code "> |
|
371 | 371 | <pre></pre> |
|
372 | 372 | </td> |
|
373 | 373 | </tr> |
|
374 | 374 | <tr class="line unmod"> |
|
375 | 375 | <td id="rhodecodepubliccssmainless_o2119" class="lineno old"><a href="#rhodecodepubliccssmainless_o2119">2119</a></td> |
|
376 | 376 | <td id="rhodecodepubliccssmainless_n2118" class="lineno new"><a href="#rhodecodepubliccssmainless_n2118">2118</a></td> |
|
377 | 377 | <td class="code "> |
|
378 | 378 | <pre><span class="tab-escape"> </span>a { |
|
379 | 379 | </pre> |
|
380 | 380 | </td> |
|
381 | 381 | </tr> |
|
382 | 382 | <tr class="line unmod"> |
|
383 | 383 | <td id="rhodecodepubliccssmainless_o2120" class="lineno old"><a href="#rhodecodepubliccssmainless_o2120">2120</a></td> |
|
384 | 384 | <td id="rhodecodepubliccssmainless_n2119" class="lineno new"><a href="#rhodecodepubliccssmainless_n2119">2119</a></td> |
|
385 | 385 | <td class="code "> |
|
386 | 386 | <pre><span class="tab-escape"> </span><span class="tab-escape"> </span>display:block; |
|
387 | 387 | </pre> |
|
388 | 388 | </td> |
|
389 | 389 | </tr> |
|
390 | 390 | <tr class="line del"> |
|
391 | 391 | <td id="rhodecodepubliccssmainless_o2121" class="lineno old"><a href="#rhodecodepubliccssmainless_o2121">2121</a></td> |
|
392 | 392 | <td class="lineno new"><a href="#rhodecodepubliccssmainless_n"></a></td> |
|
393 | 393 | <td class="code "> |
|
394 | 394 | <pre><span class="tab-escape"> </span><del><span< del=""> <del>class=</del><del>"tab-escape"</del><del>> </del>padding: <del>0</del>; |
|
395 | 395 | </span<></del></pre> |
|
396 | 396 | </td> |
|
397 | 397 | </tr> |
|
398 | 398 | <tr class="line add"> |
|
399 | 399 | <td class="lineno old"><a href="#rhodecodepubliccssmainless_o"></a></td> |
|
400 | 400 | <td id="rhodecodepubliccssmainless_n2120" class="lineno new"><a href="#rhodecodepubliccssmainless_n2120">2120</a></td> |
|
401 | 401 | <td class="code "> |
|
402 | 402 | <pre><span class="tab-escape"> </span><ins> </ins> <ins> </ins><ins> </ins>padding: <ins>.9em</ins>; |
|
403 | 403 | </pre> |
|
404 | 404 | </td> |
|
405 | 405 | </tr> |
|
406 | 406 | <tr class="line unmod"> |
|
407 | 407 | <td id="rhodecodepubliccssmainless_o2122" class="lineno old"><a href="#rhodecodepubliccssmainless_o2122">2122</a></td> |
|
408 | 408 | <td id="rhodecodepubliccssmainless_n2121" class="lineno new"><a href="#rhodecodepubliccssmainless_n2121">2121</a></td> |
|
409 | 409 | <td class="code "> |
|
410 | 410 | <pre></pre> |
|
411 | 411 | </td> |
|
412 | 412 | </tr> |
|
413 | 413 | <tr class="line unmod"> |
|
414 | 414 | <td id="rhodecodepubliccssmainless_o2123" class="lineno old"><a href="#rhodecodepubliccssmainless_o2123">2123</a></td> |
|
415 | 415 | <td id="rhodecodepubliccssmainless_n2122" class="lineno new"><a href="#rhodecodepubliccssmainless_n2122">2122</a></td> |
|
416 | 416 | <td class="code "> |
|
417 | 417 | <pre><span class="tab-escape"> </span><span class="tab-escape"> </span>&:after { |
|
418 | 418 | </pre> |
|
419 | 419 | </td> |
|
420 | 420 | </tr> |
|
421 | 421 | <tr class="line unmod"> |
|
422 | 422 | <td id="rhodecodepubliccssmainless_o2124" class="lineno old"><a href="#rhodecodepubliccssmainless_o2124">2124</a></td> |
|
423 | 423 | <td id="rhodecodepubliccssmainless_n2123" class="lineno new"><a href="#rhodecodepubliccssmainless_n2123">2123</a></td> |
|
424 | 424 | <td class="code "> |
|
425 | 425 | <pre><span class="tab-escape"> </span><span class="tab-escape"> </span><span class="tab-escape"> </span>content: "\00A0\25BE"; |
|
426 | 426 | </pre> |
|
427 | 427 | </td> |
|
428 | 428 | </tr> |
|
429 | 429 | </tbody></table> |
|
430 | 430 | </div> |
|
431 | 431 | </div> |
|
432 | 432 | </div> |
|
433 | 433 | |
|
434 | 434 | </td> |
|
435 | 435 | </tr> |
|
436 | 436 | </tbody></table> |
|
437 | 437 | </div> |
|
438 | 438 | |
|
439 | 439 | |
|
440 | 440 | |
|
441 | 441 | |
|
442 | 442 | |
|
443 | 443 | |
|
444 | 444 | |
|
445 | 445 | |
|
446 | 446 | |
|
447 | 447 | <!-- |
|
448 | 448 | File View |
|
449 | 449 | --> |
|
450 | 450 | |
|
451 | 451 | ##TODO: lisa: I believe this needs to be updated as the layout has changed. |
|
452 | 452 | <h2>File View</h2> |
|
453 | 453 | |
|
454 | 454 | <div class="codeblock"> |
|
455 | 455 | <div class="code-header"> |
|
456 | 456 | <div class="stats"> |
|
457 | 457 | <div class="img"> |
|
458 | 458 | <i class="icon-file"></i> |
|
459 | 459 | <span class="revision_id item"><a href="/example/changeset/fc252256eb0fcb4f2613e66f0126ea27967ae28c">r5487:fc252256eb0f</a></span> |
|
460 | 460 | <span>1.2 KiB</span> |
|
461 | 461 | <span class="item last">text/x-python</span> |
|
462 | 462 | <div class="buttons"> |
|
463 | 463 | |
|
464 | 464 | <a id="file_history_overview" class="btn btn-mini" href="#"> |
|
465 | 465 | <i class="icon-time"></i> history |
|
466 | 466 | </a> |
|
467 | 467 | <a id="file_history_overview_full" class="btn btn-mini" style="display: none" href="/example/changelog/fc252256eb0fcb4f2613e66f0126ea27967ae28c/rhodecode/websetup.py"> |
|
468 | 468 | <i class="icon-time"></i> show full history |
|
469 | 469 | </a> |
|
470 | 470 | <a class="btn btn-mini" href="/example/annotate/fc252256eb0fcb4f2613e66f0126ea27967ae28c/rhodecode/websetup.py">annotation</a> |
|
471 | 471 | <a class="btn btn-mini" href="/example/raw/fc252256eb0fcb4f2613e66f0126ea27967ae28c/rhodecode/websetup.py">raw</a> |
|
472 | 472 | <a class="btn btn-mini" href="/example/rawfile/fc252256eb0fcb4f2613e66f0126ea27967ae28c/rhodecode/websetup.py"> |
|
473 |
|
|
|
473 | download | |
|
474 | 474 | </a> |
|
475 | 475 | |
|
476 | 476 | <a class="btn btn-mini disabled tooltip" href="#" title="Editing files allowed only when on branch head commit">edit</a> |
|
477 | 477 | <a class="btn btn-mini btn-danger disabled tooltip" href="#" title="Deleting files allowed only when on branch head commit">delete</a> |
|
478 | 478 | </div> |
|
479 | 479 | </div> |
|
480 | 480 | </div> |
|
481 | 481 | <div id="file_history_container"></div> |
|
482 | 482 | <div class="author"> |
|
483 | 483 | <div class="gravatar"> |
|
484 | 484 | <img alt="gravatar" src="https://secure.gravatar.com/avatar/99e27b99c64003ca8c9875c9e3843495?d=identicon&s=32" height="16" width="16"> |
|
485 | 485 | </div> |
|
486 | 486 | <div title="Marcin Kuzminski <marcin@python-works.com>" class="user">Marcin Kuzminski - <span class="tooltip" title="Wed, 02 Jul 2014 08:48:15">6m and 12d ago</span></div> |
|
487 | 487 | </div> |
|
488 | 488 | <div id="trimmed_message_box" class="commit">License changes</div> |
|
489 | 489 | <div id="message_expand" style="display: none;"> |
|
490 | 490 | <i class="icon-resize-vertical"></i> |
|
491 | 491 | expand |
|
492 | 492 | <i class="icon-resize-vertical"></i> |
|
493 | 493 | </div> |
|
494 | 494 | </div> |
|
495 | 495 | <div class="code-body"> |
|
496 | 496 | <table class="code-highlighttable"><tbody><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L1"> 1</a> |
|
497 | 497 | <a href="#L2"> 2</a> |
|
498 | 498 | <a href="#L3"> 3</a> |
|
499 | 499 | <a href="#L4"> 4</a> |
|
500 | 500 | <a href="#L5"> 5</a> |
|
501 | 501 | <a href="#L6"> 6</a> |
|
502 | 502 | <a href="#L7"> 7</a> |
|
503 | 503 | <a href="#L8"> 8</a> |
|
504 | 504 | <a href="#L9"> 9</a> |
|
505 | 505 | <a href="#L10">10</a> |
|
506 | 506 | <a href="#L11">11</a> |
|
507 | 507 | <a href="#L12">12</a> |
|
508 | 508 | <a href="#L13">13</a> |
|
509 | 509 | <a href="#L14">14</a> |
|
510 | 510 | <a href="#L15">15</a> |
|
511 | 511 | <a href="#L16">16</a> |
|
512 | 512 | <a href="#L17">17</a> |
|
513 | 513 | <a href="#L18">18</a> |
|
514 | 514 | <a href="#L19">19</a> |
|
515 | 515 | <a href="#L20">20</a> |
|
516 | 516 | <a href="#L21">21</a> |
|
517 | 517 | <a href="#L22">22</a> |
|
518 | 518 | <a href="#L23">23</a> |
|
519 | 519 | <a href="#L24">24</a> |
|
520 | 520 | <a href="#L25">25</a> |
|
521 | 521 | <a href="#L26">26</a> |
|
522 | 522 | <a href="#L27">27</a> |
|
523 | 523 | <a href="#L28">28</a> |
|
524 | 524 | <a href="#L29">29</a> |
|
525 | 525 | <a href="#L30">30</a> |
|
526 | 526 | <a href="#L31">31</a> |
|
527 | 527 | <a href="#L32">32</a> |
|
528 | 528 | <a href="#L33">33</a> |
|
529 | 529 | <a href="#L34">34</a> |
|
530 | 530 | <a href="#L35">35</a> |
|
531 | 531 | <a href="#L36">36</a> |
|
532 | 532 | <a href="#L37">37</a> |
|
533 | 533 | <a href="#L38">38</a> |
|
534 | 534 | <a href="#L39">39</a> |
|
535 | 535 | <a href="#L40">40</a> |
|
536 | 536 | <a href="#L41">41</a> |
|
537 | 537 | <a href="#L42">42</a></pre></div></td><td id="hlcode" class="code"><div class="code-highlight"><pre><div id="L1"><a name="L-1"></a><span class="c"># -*- coding: utf-8 -*-</span> |
|
538 | 538 | </div><div id="L2"><a name="L-2"></a> |
|
539 | 539 | </div><div id="L3"><a name="L-3"></a><span class="c"># Published under Business Source License.</span> |
|
540 | 540 | </div><div id="L4"><a name="L-4"></a><span class="c"># Read the full license text at https://rhodecode.com/licenses.</span> |
|
541 | 541 | </div><div id="L5"><a name="L-5"></a><span class="sd">"""</span> |
|
542 | 542 | </div><div id="L6"><a name="L-6"></a><span class="sd">rhodecode.websetup</span> |
|
543 | 543 | </div><div id="L7"><a name="L-7"></a><span class="sd">~~~~~~~~~~~~~~~~~~</span> |
|
544 | 544 | </div><div id="L8"><a name="L-8"></a> |
|
545 | 545 | </div><div id="L9"><a name="L-9"></a><span class="sd">Weboperations and setup for rhodecode. Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it.</span> |
|
546 | 546 | </div><div id="L10"><a name="L-10"></a> |
|
547 | 547 | </div><div id="L11"><a name="L-11"></a><span class="sd">:created_on: Dec 11, 2010</span> |
|
548 | 548 | </div><div id="L12"><a name="L-12"></a><span class="sd">:author: marcink</span> |
|
549 | 549 | </div><div id="L13"><a name="L-13"></a><span class="sd">:copyright: (c) 2013-2015 RhodeCode GmbH.</span> |
|
550 | 550 | </div><div id="L14"><a name="L-14"></a><span class="sd">:license: Business Source License, see LICENSE for more details.</span> |
|
551 | 551 | </div><div id="L15"><a name="L-15"></a><span class="sd">"""</span> |
|
552 | 552 | </div><div id="L16"><a name="L-16"></a> |
|
553 | 553 | </div><div id="L17"><a name="L-17"></a><span class="kn">import</span> <span class="nn">logging</span> |
|
554 | 554 | </div><div id="L18"><a name="L-18"></a> |
|
555 | 555 | </div><div id="L19"><a name="L-19"></a><span class="kn">from</span> <span class="nn">rhodecode.config.environment</span> <span class="kn">import</span> <span class="n">load_environment</span> |
|
556 | 556 | </div><div id="L20"><a name="L-20"></a><span class="kn">from</span> <span class="nn">rhodecode.lib.db_manage</span> <span class="kn">import</span> <span class="n">DbManage</span> |
|
557 | 557 | </div><div id="L21"><a name="L-21"></a><span class="kn">from</span> <span class="nn">rhodecode.model.meta</span> <span class="kn">import</span> <span class="n">Session</span> |
|
558 | 558 | </div><div id="L22"><a name="L-22"></a> |
|
559 | 559 | </div><div id="L23"><a name="L-23"></a> |
|
560 | 560 | </div><div id="L24"><a name="L-24"></a><span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span> |
|
561 | 561 | </div><div id="L25"><a name="L-25"></a> |
|
562 | 562 | </div><div id="L26"><a name="L-26"></a> |
|
563 | 563 | </div><div id="L27"><a name="L-27"></a><span class="k">def</span> <span class="nf">setup_app</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">conf</span><span class="p">,</span> <span class="nb">vars</span><span class="p">):</span> |
|
564 | 564 | </div><div id="L28"><a name="L-28"></a> <span class="sd">"""Place any commands to setup rhodecode here"""</span> |
|
565 | 565 | </div><div id="L29"><a name="L-29"></a> <span class="n">dbconf</span> <span class="o">=</span> <span class="n">conf</span><span class="p">[</span><span class="s">'sqlalchemy.db1.url'</span><span class="p">]</span> |
|
566 | 566 | </div><div id="L30"><a name="L-30"></a> <span class="n">dbmanage</span> <span class="o">=</span> <span class="n">DbManage</span><span class="p">(</span><span class="n">log_sql</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">dbconf</span><span class="o">=</span><span class="n">dbconf</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">conf</span><span class="p">[</span><span class="s">'here'</span><span class="p">],</span> |
|
567 | 567 | </div><div id="L31"><a name="L-31"></a> <span class="n">tests</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">cli_args</span><span class="o">=</span><span class="n">command</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">__dict__</span><span class="p">)</span> |
|
568 | 568 | </div><div id="L32"><a name="L-32"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">create_tables</span><span class="p">(</span><span class="n">override</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> |
|
569 | 569 | </div><div id="L33"><a name="L-33"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">set_db_version</span><span class="p">()</span> |
|
570 | 570 | </div><div id="L34"><a name="L-34"></a> <span class="n">opts</span> <span class="o">=</span> <span class="n">dbmanage</span><span class="o">.</span><span class="n">config_prompt</span><span class="p">(</span><span class="bp">None</span><span class="p">)</span> |
|
571 | 571 | </div><div id="L35"><a name="L-35"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">create_settings</span><span class="p">(</span><span class="n">opts</span><span class="p">)</span> |
|
572 | 572 | </div><div id="L36"><a name="L-36"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">create_default_user</span><span class="p">()</span> |
|
573 | 573 | </div><div id="L37"><a name="L-37"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">admin_prompt</span><span class="p">()</span> |
|
574 | 574 | </div><div id="L38"><a name="L-38"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">create_permissions</span><span class="p">()</span> |
|
575 | 575 | </div><div id="L39"><a name="L-39"></a> <span class="n">dbmanage</span><span class="o">.</span><span class="n">populate_default_permissions</span><span class="p">()</span> |
|
576 | 576 | </div><div id="L40"><a name="L-40"></a> <span class="n">Session</span><span class="p">()</span><span class="o">.</span><span class="n">commit</span><span class="p">()</span> |
|
577 | 577 | </div><div id="L41"><a name="L-41"></a> <span class="n">load_environment</span><span class="p">(</span><span class="n">conf</span><span class="o">.</span><span class="n">global_conf</span><span class="p">,</span> <span class="n">conf</span><span class="o">.</span><span class="n">local_conf</span><span class="p">,</span> <span class="n">initial</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> |
|
578 | 578 | </div><div id="L42"><a name="L-42"></a> <span class="n">DbManage</span><span class="o">.</span><span class="n">check_waitress</span><span class="p">()</span> |
|
579 | 579 | </div></pre></div> |
|
580 | 580 | </td></tr></tbody></table> |
|
581 | 581 | </div> |
|
582 | 582 | </div> |
|
583 | 583 | |
|
584 | 584 | |
|
585 | 585 | |
|
586 | 586 | |
|
587 | 587 | |
|
588 | 588 | |
|
589 | 589 | |
|
590 | 590 | |
|
591 | 591 | |
|
592 | 592 | <!-- |
|
593 | 593 | Gist Edit |
|
594 | 594 | --> |
|
595 | 595 | |
|
596 | 596 | |
|
597 | 597 | <h2>Gist Edit</h2> |
|
598 | 598 | |
|
599 | 599 | <div class="codeblock"> |
|
600 | 600 | <div class="code-header"> |
|
601 | 601 | <div class="form"> |
|
602 | 602 | <div class="fields"> |
|
603 | 603 | <input id="filename" name="filename" placeholder="name this file..." size="30" type="text"> |
|
604 | 604 | <div class="select2-container drop-menu" id="s2id_mimetype"><a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-3">Python</span><abbr class="select2-search-choice-close"></abbr> <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen3" class="select2-offscreen"></label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-3" id="s2id_autogen3"><div class="select2-drop select2-display-none drop-menu-dropdown select2-with-searchbox"> <div class="select2-search"> <label for="s2id_autogen3_search" class="select2-offscreen"></label> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-3" id="s2id_autogen3_search" placeholder=""> </div> <ul class="select2-results" role="listbox" id="select2-results-3"> </ul></div></div><select id="mimetype" name="mimetype" tabindex="-1" title="" style="display: none;"> |
|
605 | 605 | <option selected="selected" value="plain">plain</option> |
|
606 | 606 | <option value="text/apl" mode="apl">APL</option><option value="text/x-asterisk" mode="asterisk">Asterisk</option><option value="text/x-csrc" mode="clike">C</option><option value="text/x-c++src" mode="clike">C++</option><option value="text/x-cobol" mode="cobol">Cobol</option><option value="text/x-java" mode="clike">Java</option><option value="text/x-csharp" mode="clike">C#</option><option value="text/x-scala" mode="clike">Scala</option><option value="text/x-clojure" mode="clojure">Clojure</option><option value="text/x-coffeescript" mode="coffeescript">CoffeeScript</option><option value="text/x-common-lisp" mode="commonlisp">Common Lisp</option><option value="text/css" mode="css">CSS</option><option value="text/x-d" mode="d">D</option><option value="text/x-diff" mode="diff">diff</option><option value="application/xml-dtd" mode="dtd">DTD</option><option value="text/x-dylan" mode="dylan">Dylan</option><option value="text/x-ecl" mode="ecl">ECL</option><option value="text/x-eiffel" mode="eiffel">Eiffel</option><option value="text/x-erlang" mode="erlang">Erlang</option><option value="text/x-fortran" mode="fortran">Fortran</option><option value="text/x-fsharp" mode="mllike">F#</option><option value="text/x-gas" mode="gas">Gas</option><option value="text/x-go" mode="go">GO</option><option value="text/x-feature" mode="gherkin">Gherkin</option><option value="text/x-go" mode="go">Go</option><option value="text/x-groovy" mode="groovy">Groovy</option><option value="text/x-haml" mode="haml">HAML</option><option value="text/x-haskell" mode="haskell">Haskell</option><option value="text/x-haxe" mode="haxe">Haxe</option><option value="application/x-aspx" mode="htmlembedded">ASP.NET</option><option value="application/x-ejs" mode="htmlembedded">Embedded Javascript</option><option value="application/x-jsp" mode="htmlembedded">JavaServer Pages</option><option value="text/html" mode="htmlmixed">HTML</option><option value="message/http" mode="http">HTTP</option><option value="text/x-jade" mode="jade">Jade</option><option value="text/javascript" mode="javascript">JavaScript</option><option value="application/json" mode="javascript">JSON</option><option value="application/typescript" mode="javascript">TypeScript</option><option value="jinja2" mode="jinja2">Jinja2</option><option value="text/x-julia" mode="julia">Julia</option><option value="text/x-less" mode="less">LESS</option><option value="text/x-livescript" mode="livescript">LiveScript</option><option value="text/x-lua" mode="lua">Lua</option><option value="text/x-markdown" mode="markdown">Markdown (GitHub-flavour)</option><option value="text/mirc" mode="mirc">mIRC</option><option value="text/x-nginx-conf" mode="nginx">Nginx</option><option value="text/n-triples" mode="ntriples">NTriples</option><option value="text/x-ocaml" mode="ocaml">OCaml</option><option value="text/x-ocaml" mode="mllike">OCaml</option><option value="text/x-octave" mode="octave">Octave</option><option value="text/x-pascal" mode="pascal">Pascal</option><option value="null" mode="pegjs">PEG.js</option><option value="text/x-perl" mode="perl">Perl</option><option value="text/x-php" mode="php">PHP</option><option value="text/x-pig" mode="pig">Pig</option><option value="text/plain" mode="null">Plain Text</option><option value="text/x-properties" mode="properties">Properties files</option><option value="text/x-python" mode="python">Python</option><option value="text/x-puppet" mode="puppet">Puppet</option><option value="text/x-rsrc" mode="r">R</option><option value="text/x-rst" mode="rst">reStructuredText</option><option value="text/x-ruby" mode="ruby">Ruby</option><option value="text/x-rustsrc" mode="rust">Rust</option><option value="text/x-sass" mode="sass">Sass</option><option value="text/x-scheme" mode="scheme">Scheme</option><option value="text/x-scss" mode="css">SCSS</option><option value="text/x-sh" mode="shell">Shell</option><option value="application/sieve" mode="sieve">Sieve</option><option value="text/x-stsrc" mode="smalltalk">Smalltalk</option><option value="text/x-smarty" mode="smarty">Smarty</option><option value="text/x-smarty" mode="smartymixed">SmartyMixed</option><option value="text/x-solr" mode="solr">Solr</option><option value="application/x-sparql-query" mode="sparql">SPARQL</option><option value="text/x-sql" mode="sql">SQL</option><option value="text/x-mariadb" mode="sql">MariaDB</option><option value="text/x-stex" mode="stex">sTeX</option><option value="text/x-latex" mode="stex">LaTeX</option><option value="text/x-systemverilog" mode="verilog">SystemVerilog</option><option value="text/x-tcl" mode="tcl">Tcl</option><option value="text/x-tiddlywiki" mode="tiddlywiki">TiddlyWiki </option><option value="text/tiki" mode="tiki">Tiki wiki</option><option value="text/x-toml" mode="toml">TOML</option><option value="text/turtle" mode="turtle">Turtle</option><option value="text/x-vb" mode="vb">VB.NET</option><option value="text/vbscript" mode="vbscript">VBScript</option><option value="text/velocity" mode="velocity">Velocity</option><option value="text/x-verilog" mode="verilog">Verilog</option><option value="application/xml" mode="xml">XML</option><option value="text/html" mode="xml">HTML</option><option value="application/xquery" mode="xquery">XQuery</option><option value="text/x-yaml" mode="yaml">YAML</option><option value="text/x-z80" mode="z80">Z80</option></select> |
|
607 | 607 | <script> |
|
608 | 608 | $(document).ready(function() { |
|
609 | 609 | $('#mimetype').select2({ |
|
610 | 610 | containerCssClass: 'drop-menu', |
|
611 | 611 | dropdownCssClass: 'drop-menu-dropdown', |
|
612 | 612 | dropdownAutoWidth: true |
|
613 | 613 | }); |
|
614 | 614 | }); |
|
615 | 615 | </script> |
|
616 | 616 | |
|
617 | 617 | </div> |
|
618 | 618 | </div> |
|
619 | 619 | </div> |
|
620 | 620 | <div id="editor_container"> |
|
621 | 621 | <div id="editor_pre"></div> |
|
622 | 622 | <textarea id="editor" name="content" style="display: none;"></textarea><div class="CodeMirror cm-s-default"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 484px; left: 219.4091796875px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" style="position: absolute; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-hscrollbar" style="left: 29px; min-height: 18px;"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-vscrollbar" style="min-width: 18px; display: block; bottom: 0px;"><div style="min-width: 1px; height: 619px;"></div></div><div class="CodeMirror-scrollbar-filler"></div><div class="CodeMirror-gutter-filler"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="min-width: 700.269653320313px; margin-left: 29px; min-height: 619px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>47</div></div></div><div style="position: relative; z-index: 1; display: none;"></div><div class="CodeMirror-code"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">1</div></div><pre><span class="cm-keyword">import</span> <span class="cm-variable">re</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">2</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">3</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">django</span>.<span class="cm-variable">utils</span>.<span class="cm-variable">text</span> <span class="cm-keyword">import</span> <span class="cm-variable">compress_sequence</span>, <span class="cm-variable">compress_string</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">4</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">django</span>.<span class="cm-variable">utils</span>.<span class="cm-variable">cache</span> <span class="cm-keyword">import</span> <span class="cm-variable">patch_vary_headers</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">5</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">6</div></div><pre><span class="cm-variable">re_accepts_gzip</span> = <span class="cm-variable">re</span>.<span class="cm-builtin">compile</span>(<span class="cm-string">r'\bgzip\b'</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">7</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">8</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">9</div></div><pre><span class="cm-keyword">class</span> <span class="cm-def">GZipMiddleware</span>(<span class="cm-builtin">object</span>): # Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it.</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">10</div></div><pre> <span class="cm-string">"""</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">11</div></div><pre><span class="cm-string"> This middleware compresses content if the browser allows gzip compression.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">12</div></div><pre><span class="cm-string"> It sets the Vary header accordingly, so that caches will base their storage</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">13</div></div><pre><span class="cm-string"> on the Accept-Encoding header.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">14</div></div><pre><span class="cm-string"> """</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">15</div></div><pre> <span class="cm-keyword">def</span> <span class="cm-def">process_response</span>(<span class="cm-variable-2">self</span>, <span class="cm-variable">request</span>, <span class="cm-variable">response</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">16</div></div><pre> <span class="cm-comment"># It's not worth attempting to compress really short responses.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">17</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-operator">not</span> <span class="cm-variable">response</span>.<span class="cm-variable">streaming</span> <span class="cm-operator">and</span> <span class="cm-builtin">len</span>(<span class="cm-variable">response</span>.<span class="cm-variable">content</span>) <span class="cm-operator"><</span> <span class="cm-number">200</span>:</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">18</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">19</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">20</div></div><pre> <span class="cm-comment"># Avoid gzipping if we've already got a content-encoding.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">21</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-variable">response</span>.<span class="cm-variable">has_header</span>(<span class="cm-string">'Content-Encoding'</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">22</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">23</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">24</div></div><pre> <span class="cm-variable">patch_vary_headers</span>(<span class="cm-variable">response</span>, (<span class="cm-string">'Accept-Encoding'</span>,))</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">25</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">26</div></div><pre> <span class="cm-variable">ae</span> = <span class="cm-variable">request</span>.<span class="cm-variable">META</span>.<span class="cm-variable">get</span>(<span class="cm-string">'HTTP_ACCEPT_ENCODING'</span>, <span class="cm-string">''</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">27</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-operator">not</span> <span class="cm-variable">re_accepts_gzip</span>.<span class="cm-variable">search</span>(<span class="cm-variable">ae</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">28</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">29</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">30</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-variable">response</span>.<span class="cm-variable">streaming</span>:</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">31</div></div><pre> <span class="cm-comment"># Delete the `Content-Length` header for streaming content, because</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">32</div></div><pre> <span class="cm-comment"># we won't know the compressed size until we stream it.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">33</div></div><pre> <span class="cm-variable">response</span>.<span class="cm-variable">streaming_content</span> = <span class="cm-variable">compress_sequence</span>(<span class="cm-variable">response</span>.<span class="cm-variable">streaming_content</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">34</div></div><pre> <span class="cm-keyword">del</span> <span class="cm-variable">response</span>[<span class="cm-string">'Content-Length'</span>]</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">35</div></div><pre> <span class="cm-keyword">else</span>:</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">36</div></div><pre> <span class="cm-comment"># Return the compressed content only if it's actually shorter.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">37</div></div><pre> <span class="cm-variable">compressed_content</span> = <span class="cm-variable">compress_string</span>(<span class="cm-variable">response</span>.<span class="cm-variable">content</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">38</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-builtin">len</span>(<span class="cm-variable">compressed_content</span>) <span class="cm-operator">>=</span> <span class="cm-builtin">len</span>(<span class="cm-variable">response</span>.<span class="cm-variable">content</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">39</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">40</div></div><pre> <span class="cm-variable">response</span>.<span class="cm-variable">content</span> = <span class="cm-variable">compressed_content</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">41</div></div><pre> <span class="cm-variable">response</span>[<span class="cm-string">'Content-Length'</span>] = <span class="cm-builtin">str</span>(<span class="cm-builtin">len</span>(<span class="cm-variable">response</span>.<span class="cm-variable">content</span>))</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">42</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">43</div></div><pre> <span class="cm-keyword">if</span> <span class="cm-variable">response</span>.<span class="cm-variable">has_header</span>(<span class="cm-string">'ETag'</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">44</div></div><pre> <span class="cm-variable">response</span>[<span class="cm-string">'ETag'</span>] = <span class="cm-variable">re</span>.<span class="cm-variable">sub</span>(<span class="cm-string">'"$'</span>, <span class="cm-string">';gzip"'</span>, <span class="cm-variable">response</span>[<span class="cm-string">'ETag'</span>])</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">45</div></div><pre> <span class="cm-variable">response</span>[<span class="cm-string">'Content-Encoding'</span>] = <span class="cm-string">'gzip'</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">46</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">47</div></div><pre> <span class="cm-keyword">return</span> <span class="cm-variable">response</span></pre></div></div><div class="CodeMirror-cursor" style="left: 189.4091796875px; top: 598px; height: 13px;"> </div><div class="CodeMirror-cursor CodeMirror-secondarycursor" style="display: none;"> </div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; top: 619px;"></div><div class="CodeMirror-gutters" style="height: 619px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 28px;"></div></div></div></div> |
|
623 | 623 | </div> |
|
624 | 624 | </div> |
|
625 | 625 | |
|
626 | 626 | |
|
627 | 627 | |
|
628 | 628 | |
|
629 | 629 | |
|
630 | 630 | <!-- |
|
631 | 631 | File Edit |
|
632 | 632 | --> |
|
633 | 633 | |
|
634 | 634 | <h2>File Edit</h2> |
|
635 | 635 | |
|
636 | 636 | <div class="codeblock"> |
|
637 | 637 | <div class="code-header"> |
|
638 | 638 | <div class="stats"> |
|
639 | 639 | <i class="icon-file"></i> |
|
640 | 640 | <span class="item"><a href="/example/changeset/80ead1899f50a894889e19ffeb49c9cebf5bf045">r8248:80ead1899f50</a></span> |
|
641 | 641 | <span class="item">1.2 KiB</span> |
|
642 | 642 | <span class="item last">text/x-python</span> |
|
643 | 643 | <div class="buttons"> |
|
644 | 644 | <a class="btn btn-mini" href="/example/commits/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py"> |
|
645 | 645 | <i class="icon-time"></i> history |
|
646 | 646 | </a> |
|
647 | 647 | |
|
648 | 648 | <a class="btn btn-mini" href="/example/files/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py">source</a> |
|
649 | 649 | <a class="btn btn-mini" href="/example/raw/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py">raw</a> |
|
650 | 650 | <a class="btn btn-mini" href="/example/rawfile/80ead1899f50a894889e19ffeb49c9cebf5bf045/rhodecode/websetup.py"> |
|
651 |
|
|
|
651 | download | |
|
652 | 652 | </a> |
|
653 | 653 | </div> |
|
654 | 654 | </div> |
|
655 | 655 | <div class="form"> |
|
656 | 656 | <label for="set_mode">Editing file:</label> |
|
657 | 657 | rhodecode / |
|
658 | 658 | <input type="text" name="filename" value="websetup.py"> |
|
659 | 659 | |
|
660 | 660 | <div class="select2-container drop-menu" id="s2id_set_mode"><a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-2">plain</span><abbr class="select2-search-choice-close"></abbr> <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen2" class="select2-offscreen">Editing file:</label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-2" id="s2id_autogen2"><div class="select2-drop select2-display-none drop-menu-dropdown select2-with-searchbox"> <div class="select2-search"> <label for="s2id_autogen2_search" class="select2-offscreen">Editing file:</label> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-2" id="s2id_autogen2_search" placeholder=""> </div> <ul class="select2-results" role="listbox" id="select2-results-2"> </ul></div></div><select id="set_mode" name="set_mode" tabindex="-1" title="Editing file:" style="display: none;"> |
|
661 | 661 | <option selected="selected" value="plain">plain</option> |
|
662 | 662 | <option value="apl">APL</option><option value="asterisk">Asterisk</option><option value="clike">C</option><option value="clike">C++</option><option value="cobol">Cobol</option><option value="clike">Java</option><option value="clike">C#</option><option value="clike">Scala</option><option value="clojure">Clojure</option><option value="coffeescript">CoffeeScript</option><option value="commonlisp">Common Lisp</option><option value="css">CSS</option><option value="d">D</option><option value="diff">diff</option><option value="dtd">DTD</option><option value="dylan">Dylan</option><option value="ecl">ECL</option><option value="eiffel">Eiffel</option><option value="erlang">Erlang</option><option value="fortran">Fortran</option><option value="mllike">F#</option><option value="gas">Gas</option><option value="go">GO</option><option value="gherkin">Gherkin</option><option value="go">Go</option><option value="groovy">Groovy</option><option value="haml">HAML</option><option value="haskell">Haskell</option><option value="haxe">Haxe</option><option value="htmlembedded">ASP.NET</option><option value="htmlembedded">Embedded Javascript</option><option value="htmlembedded">JavaServer Pages</option><option value="htmlmixed">HTML</option><option value="http">HTTP</option><option value="jade">Jade</option><option value="javascript">JavaScript</option><option value="javascript">JSON</option><option value="javascript">TypeScript</option><option value="jinja2">Jinja2</option><option value="julia">Julia</option><option value="less">LESS</option><option value="livescript">LiveScript</option><option value="lua">Lua</option><option value="markdown">Markdown (GitHub-flavour)</option><option value="mirc">mIRC</option><option value="nginx">Nginx</option><option value="ntriples">NTriples</option><option value="ocaml">OCaml</option><option value="mllike">OCaml</option><option value="octave">Octave</option><option value="pascal">Pascal</option><option value="pegjs">PEG.js</option><option value="perl">Perl</option><option value="php">PHP</option><option value="pig">Pig</option><option value="null">Plain Text</option><option value="properties">Properties files</option><option value="python" selected="selected">Python</option><option value="puppet">Puppet</option><option value="r">R</option><option value="rst">reStructuredText</option><option value="ruby">Ruby</option><option value="rust">Rust</option><option value="sass">Sass</option><option value="scheme">Scheme</option><option value="css">SCSS</option><option value="shell">Shell</option><option value="sieve">Sieve</option><option value="smalltalk">Smalltalk</option><option value="smarty">Smarty</option><option value="smartymixed">SmartyMixed</option><option value="solr">Solr</option><option value="sparql">SPARQL</option><option value="sql">SQL</option><option value="sql">MariaDB</option><option value="stex">sTeX</option><option value="stex">LaTeX</option><option value="verilog">SystemVerilog</option><option value="tcl">Tcl</option><option value="tiddlywiki">TiddlyWiki </option><option value="tiki">Tiki wiki</option><option value="toml">TOML</option><option value="turtle">Turtle</option><option value="vb">VB.NET</option><option value="vbscript">VBScript</option><option value="velocity">Velocity</option><option value="verilog">Verilog</option><option value="xml">XML</option><option value="xml">HTML</option><option value="xquery">XQuery</option><option value="yaml">YAML</option><option value="z80">Z80</option></select> |
|
663 | 663 | <script> |
|
664 | 664 | $(document).ready(function() { |
|
665 | 665 | $('#set_mode').select2({ |
|
666 | 666 | containerCssClass: 'drop-menu', |
|
667 | 667 | dropdownCssClass: 'drop-menu-dropdown', |
|
668 | 668 | dropdownAutoWidth: true |
|
669 | 669 | }); |
|
670 | 670 | }); |
|
671 | 671 | </script> |
|
672 | 672 | |
|
673 | 673 | <label for="line_wrap">line wraps</label> |
|
674 | 674 | <div class="select2-container drop-menu" id="s2id_line_wrap"><a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-3">off</span><abbr class="select2-search-choice-close"></abbr> <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen3" class="select2-offscreen">line wraps</label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-3" id="s2id_autogen3"><div class="select2-drop select2-display-none drop-menu-dropdown"> <div class="select2-search select2-search-hidden select2-offscreen"> <label for="s2id_autogen3_search" class="select2-offscreen">line wraps</label> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-3" id="s2id_autogen3_search" placeholder=""> </div> <ul class="select2-results" role="listbox" id="select2-results-3"> </ul></div></div><select id="line_wrap" name="line_wrap" tabindex="-1" title="line wraps" style="display: none;"> |
|
675 | 675 | <option value="on">on</option> |
|
676 | 676 | <option selected="selected" value="off">off</option> |
|
677 | 677 | </select> |
|
678 | 678 | <script> |
|
679 | 679 | $(document).ready(function() { |
|
680 | 680 | $('#line_wrap').select2({ |
|
681 | 681 | containerCssClass: 'drop-menu', |
|
682 | 682 | dropdownCssClass: 'drop-menu-dropdown', |
|
683 | 683 | dropdownAutoWidth: true, |
|
684 | 684 | minimumResultsForSearch: -1 |
|
685 | 685 | |
|
686 | 686 | }); |
|
687 | 687 | }); |
|
688 | 688 | </script> |
|
689 | 689 | |
|
690 | 690 | <div id="render_preview" class="btn btn-mini hidden disabled">Preview</div> |
|
691 | 691 | </div> |
|
692 | 692 | </div> |
|
693 | 693 | <div id="editor_container"> |
|
694 | 694 | <pre id="editor_pre"></pre> |
|
695 | 695 | <textarea id="editor" name="content" style="display: none;"># -*- coding: utf-8 -*- |
|
696 | 696 | |
|
697 | 697 | # Published under Commercial License. |
|
698 | 698 | # Read the full license text at https://rhodecode.com/licenses. |
|
699 | 699 | """ |
|
700 | 700 | rhodecode.websetup |
|
701 | 701 | ~~~~~~~~~~~~~~~~~~ |
|
702 | 702 | |
|
703 | 703 | Weboperations and setup for rhodecode |
|
704 | 704 | |
|
705 | 705 | :created_on: Dec 11, 2010 |
|
706 | 706 | :author: marcink |
|
707 | 707 | :copyright: (c) 2013-2015 RhodeCode GmbH. |
|
708 | 708 | :license: Commercial License, see LICENSE for more details. |
|
709 | 709 | """ |
|
710 | 710 | |
|
711 | 711 | import logging |
|
712 | 712 | |
|
713 | 713 | from rhodecode.config.environment import load_environment |
|
714 | 714 | from rhodecode.lib.db_manage import DbManage |
|
715 | 715 | from rhodecode.model.meta import Session |
|
716 | 716 | |
|
717 | 717 | |
|
718 | 718 | log = logging.getLogger(__name__) |
|
719 | 719 | |
|
720 | 720 | |
|
721 | 721 | def setup_app(command, conf, vars): |
|
722 | 722 | """Place any commands to setup rhodecode here""" |
|
723 | 723 | dbconf = conf['sqlalchemy.db1.url'] |
|
724 | 724 | dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], |
|
725 | 725 | tests=False, cli_args=command.options.__dict__) |
|
726 | 726 | dbmanage.create_tables(override=True) |
|
727 | 727 | dbmanage.set_db_version() |
|
728 | 728 | opts = dbmanage.config_prompt(None) |
|
729 | 729 | dbmanage.create_settings(opts) |
|
730 | 730 | dbmanage.create_default_user() |
|
731 | 731 | dbmanage.admin_prompt() |
|
732 | 732 | dbmanage.create_permissions() |
|
733 | 733 | dbmanage.populate_default_permissions() |
|
734 | 734 | Session().commit() |
|
735 | 735 | load_environment(conf.global_conf, conf.local_conf, initial=True) |
|
736 | 736 | </textarea><div class="CodeMirror cm-s-default CodeMirror-focused"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 34px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" style="position: absolute; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-hscrollbar" style="left: 29px; min-height: 18px;"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-vscrollbar" style="display: block; bottom: 0px; min-width: 18px;"><div style="min-width: 1px; height: 554px;"></div></div><div class="CodeMirror-scrollbar-filler"></div><div class="CodeMirror-gutter-filler"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="min-width: 579.350463867188px; margin-left: 29px; min-height: 554px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"><div style="width: 50px; height: 50px; overflow-x: scroll;"></div></div><div style="position: relative; z-index: 1; display: none;"></div><div class="CodeMirror-code"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">1</div></div><pre><span class="cm-comment"># -*- coding: utf-8 -*-</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">2</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">3</div></div><pre><span class="cm-comment"># Published under Commercial License.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">4</div></div><pre><span class="cm-comment"># Read the full license text at https://rhodecode.com/licenses.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">5</div></div><pre><span class="cm-string">"""</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">6</div></div><pre><span class="cm-string">rhodecode.websetup</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">7</div></div><pre><span class="cm-string">~~~~~~~~~~~~~~~~~~</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">8</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">9</div></div><pre><span class="cm-string">Weboperations and setup for rhodecode</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">10</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">11</div></div><pre><span class="cm-string">:created_on: Dec 11, 2010</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">12</div></div><pre><span class="cm-string">:author: marcink</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">13</div></div><pre><span class="cm-string">:copyright: (c) 2013-2015 RhodeCode GmbH.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">14</div></div><pre><span class="cm-string">:license: Commercial License, see LICENSE for more details.</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">15</div></div><pre><span class="cm-string">"""</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">16</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">17</div></div><pre><span class="cm-keyword">import</span> <span class="cm-variable">logging</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">18</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">19</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">rhodecode</span>.<span class="cm-variable">config</span>.<span class="cm-variable">environment</span> <span class="cm-keyword">import</span> <span class="cm-variable">load_environment</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">20</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">rhodecode</span>.<span class="cm-variable">lib</span>.<span class="cm-variable">db_manage</span> <span class="cm-keyword">import</span> <span class="cm-variable">DbManage</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">21</div></div><pre><span class="cm-keyword">from</span> <span class="cm-variable">rhodecode</span>.<span class="cm-variable">model</span>.<span class="cm-variable">meta</span> <span class="cm-keyword">import</span> <span class="cm-variable">Session</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">22</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">23</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">24</div></div><pre><span class="cm-variable">log</span> = <span class="cm-variable">logging</span>.<span class="cm-variable">getLogger</span>(<span class="cm-variable">__name__</span>) # Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it.</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">25</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">26</div></div><pre> </pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">27</div></div><pre><span class="cm-keyword">def</span> <span class="cm-def">setup_app</span>(<span class="cm-variable">command</span>, <span class="cm-variable">conf</span>, <span class="cm-builtin">vars</span>):</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">28</div></div><pre> <span class="cm-string">"""Place any commands to setup rhodecode here"""</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">29</div></div><pre> <span class="cm-variable">dbconf</span> = <span class="cm-variable">conf</span>[<span class="cm-string">'sqlalchemy.db1.url'</span>]</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">30</div></div><pre> <span class="cm-variable">dbmanage</span> = <span class="cm-variable">DbManage</span>(<span class="cm-variable">log_sql</span>=<span class="cm-builtin">True</span>, <span class="cm-variable">dbconf</span>=<span class="cm-variable">dbconf</span>, <span class="cm-variable">root</span>=<span class="cm-variable">conf</span>[<span class="cm-string">'here'</span>],</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">31</div></div><pre> <span class="cm-variable">tests</span>=<span class="cm-builtin">False</span>, <span class="cm-variable">cli_args</span>=<span class="cm-variable">command</span>.<span class="cm-variable">options</span>.<span class="cm-variable">__dict__</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">32</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">create_tables</span>(<span class="cm-variable">override</span>=<span class="cm-builtin">True</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">33</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">set_db_version</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">34</div></div><pre> <span class="cm-variable">opts</span> = <span class="cm-variable">dbmanage</span>.<span class="cm-variable">config_prompt</span>(<span class="cm-builtin">None</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">35</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">create_settings</span>(<span class="cm-variable">opts</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">36</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">create_default_user</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">37</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">admin_prompt</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">38</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">create_permissions</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">39</div></div><pre> <span class="cm-variable">dbmanage</span>.<span class="cm-variable">populate_default_permissions</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">40</div></div><pre> <span class="cm-variable">Session</span>().<span class="cm-variable">commit</span>()</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">41</div></div><pre> <span class="cm-variable">load_environment</span>(<span class="cm-variable">conf</span>.<span class="cm-variable">global_conf</span>, <span class="cm-variable">conf</span>.<span class="cm-variable">local_conf</span>, <span class="cm-variable">initial</span>=<span class="cm-builtin">True</span>)</pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="position: absolute; left: -29px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 20px;">42</div></div><pre> </pre></div></div><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 13px;"> </div><div class="CodeMirror-cursor CodeMirror-secondarycursor" style="display: none;"> </div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; top: 554px;"></div><div class="CodeMirror-gutters" style="height: 554px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 28px;"></div></div></div></div> |
|
737 | 737 | <div id="editor_preview"></div> |
|
738 | 738 | </div> |
|
739 | 739 | <div class="message"> |
|
740 | 740 | <label class="codeblock-label">Commit Message</label> |
|
741 | 741 | <textarea id="commit" name="message" placeholder="Edited file rhodecode/websetup.py via RhodeCode"></textarea> |
|
742 | 742 | </div> |
|
743 | 743 | </div> |
|
744 | 744 | |
|
745 | 745 | |
|
746 | 746 | |
|
747 | 747 | |
|
748 | 748 | |
|
749 | 749 | |
|
750 | 750 | <!-- |
|
751 | 751 | Commit with comments |
|
752 | 752 | --> |
|
753 | 753 | |
|
754 | 754 | <h2>Commit with comments</h2> |
|
755 | 755 | |
|
756 | 756 | <div class="diff-container" id="diff-container-140360037209920"> |
|
757 | 757 | <div id="c-4e5ee86997c6-7046e4320b26_target"></div> |
|
758 | 758 | <div id="c-4e5ee86997c6-7046e4320b26" class="diffblock margined comm"> |
|
759 | 759 | <div class="code-header"> |
|
760 | 760 | <div title="Go back to changed files overview"> |
|
761 | 761 | <a href="#changes_box"> |
|
762 | 762 | <i class="icon-circle-arrow-up"></i> |
|
763 | 763 | </a> |
|
764 | 764 | </div> |
|
765 | 765 | <div class="changeset_header"> |
|
766 | 766 | <div class="changeset_file"> |
|
767 | 767 | <i class="icon-file"></i> |
|
768 | 768 | <a href="/andersonsantos/rhodecode-dev-fork/files/4e5ee86997c64981d85cf62283af448624e26929/rhodecode/tests/functional/test_compare_local.py">rhodecode/tests/functional/test_compare_local.py</a> |
|
769 | 769 | </div> |
|
770 | 770 | <div class="diff-actions"> |
|
771 | 771 | <a href="/andersonsantos/rhodecode-dev-fork/diff/rhodecode/tests/functional/test_compare_local.py?fulldiff=1&diff1=682135c2e3958d7c84db06d716efe482bd3ce7c6&diff=diff&diff2=4e5ee86997c64981d85cf62283af448624e26929" class="tooltip" title="Show full diff for this file"> |
|
772 | 772 | <img class="icon" src="/images/icons/page_white_go.png"> |
|
773 | 773 | </a> |
|
774 | 774 | <a href="/andersonsantos/rhodecode-dev-fork/diff-2way/rhodecode/tests/functional/test_compare_local.py?fulldiff=1&diff1=682135c2e3958d7c84db06d716efe482bd3ce7c6&diff=diff&diff2=4e5ee86997c64981d85cf62283af448624e26929" class="tooltip" title="Show full side-by-side diff for this file"> |
|
775 | 775 | <img class="icon" src="/images/icons/application_double.png"> |
|
776 | 776 | </a> |
|
777 | 777 | <a href="/andersonsantos/rhodecode-dev-fork/diff/rhodecode/tests/functional/test_compare_local.py?diff1=682135c2e3958d7c84db06d716efe482bd3ce7c6&diff=raw&diff2=4e5ee86997c64981d85cf62283af448624e26929" class="tooltip" title="Raw diff"> |
|
778 | 778 | <img class="icon" src="/images/icons/page_white.png"> |
|
779 | 779 | </a> |
|
780 | 780 | <a href="/andersonsantos/rhodecode-dev-fork/diff/rhodecode/tests/functional/test_compare_local.py?diff1=682135c2e3958d7c84db06d716efe482bd3ce7c6&diff=download&diff2=4e5ee86997c64981d85cf62283af448624e26929" class="tooltip" title="Download diff"> |
|
781 | 781 | <img class="icon" src="/images/icons/page_save.png"> |
|
782 | 782 | </a> |
|
783 | 783 | <a class="tooltip" href="/andersonsantos/rhodecode-dev-fork/changeset/4e5ee86997c64981d85cf62283af448624e26929?c-4e5ee86997c6-7046e4320b26=WS%3A1&c-4e5ee86997c6-7046e4320b26=C%3A3#c-4e5ee86997c6-7046e4320b26" title="Ignore white space"><img alt="Ignore white space" class="icon" src="/images/icons/text_strikethrough.png"></a> |
|
784 | 784 | <a class="tooltip" href="/andersonsantos/rhodecode-dev-fork/changeset/4e5ee86997c64981d85cf62283af448624e26929?c-4e5ee86997c6-7046e4320b26=C%3A6#c-4e5ee86997c6-7046e4320b26" title="increase diff context to 6 lines"><img alt="increase diff context to 6 lines" class="icon" src="/images/icons/table_add.png"></a> |
|
785 | 785 | </div> |
|
786 | 786 | <span> |
|
787 | 787 | <label> |
|
788 | 788 | Show inline comments |
|
789 | 789 | <input checked="checked" class="show-inline-comments" id="" id_for="c-4e5ee86997c6-7046e4320b26" name="" type="checkbox" value="1"> |
|
790 | 790 | </label> |
|
791 | 791 | </span> |
|
792 | 792 | </div> |
|
793 | 793 | </div> |
|
794 | 794 | <div class="code-body"> |
|
795 | 795 | <div class="full_f_path" path="rhodecode/tests/functional/test_compare_local.py"></div> |
|
796 | 796 | <table class="code-difftable"> |
|
797 | 797 | <tbody><tr class="line context"> |
|
798 | 798 | <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o...">...</a></td> |
|
799 | 799 | <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n...">...</a></td> |
|
800 | 800 | <td class="code "> |
|
801 | 801 | <pre>@@ -59,7 +59,7 @@ |
|
802 | 802 | </pre> |
|
803 | 803 | </td> |
|
804 | 804 | </tr> |
|
805 | 805 | <tr class="line unmod"> |
|
806 | 806 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o59" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o59">59</a></td> |
|
807 | 807 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n59" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n59">59</a></td> |
|
808 | 808 | <td class="code "> |
|
809 | 809 | <pre> 'tag': 'v0.2.0', |
|
810 | 810 | </pre> |
|
811 | 811 | </td> |
|
812 | 812 | </tr> |
|
813 | 813 | <tr class="line unmod"> |
|
814 | 814 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o60" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o60">60</a></td> |
|
815 | 815 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n60" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n60">60</a></td> |
|
816 | 816 | <td class="code "> |
|
817 | 817 | <pre> 'branch': 'default', |
|
818 | 818 | </pre> |
|
819 | 819 | </td> |
|
820 | 820 | </tr> |
|
821 | 821 | <tr class="line unmod"> |
|
822 | 822 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o61" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o61">61</a></td> |
|
823 | 823 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n61" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n61">61</a></td> |
|
824 | 824 | <td class="code "> |
|
825 | 825 | <pre> 'response': # Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it. |
|
826 | 826 | </pre> |
|
827 | 827 | </td> |
|
828 | 828 | </tr> |
|
829 | 829 | <tr class="line del"> |
|
830 | 830 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o62" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o62">62</a></td> |
|
831 | 831 | <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n"></a></td> |
|
832 | 832 | <td class="code "> |
|
833 | 833 | <pre> '147 files changed: 5700 inserted, 10176 deleted' |
|
834 | 834 | </pre> |
|
835 | 835 | </td> |
|
836 | 836 | </tr> |
|
837 | 837 | <tr class="line add"> |
|
838 | 838 | <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td> |
|
839 | 839 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n62" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n62">62</a></td> |
|
840 | 840 | <td class="code "> |
|
841 | 841 | <pre><ins> </ins> '147 files changed: 5700 inserted, 10176 deleted' |
|
842 | 842 | </pre> |
|
843 | 843 | </td> |
|
844 | 844 | </tr> |
|
845 | 845 | <tr class="line unmod"> |
|
846 | 846 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o63" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o63">63</a></td> |
|
847 | 847 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n63" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n63">63</a></td> |
|
848 | 848 | <td class="code "> |
|
849 | 849 | <pre> }, |
|
850 | 850 | </pre> |
|
851 | 851 | </td> |
|
852 | 852 | </tr> |
|
853 | 853 | <tr class="line unmod"> |
|
854 | 854 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o64" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o64">64</a></td> |
|
855 | 855 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n64" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n64">64</a></td> |
|
856 | 856 | <td class="code "> |
|
857 | 857 | <pre> 'git': { |
|
858 | 858 | </pre> |
|
859 | 859 | </td> |
|
860 | 860 | </tr> |
|
861 | 861 | <tr class="line unmod"> |
|
862 | 862 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o65" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o65">65</a></td> |
|
863 | 863 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n65" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n65">65</a></td> |
|
864 | 864 | <td class="code "> |
|
865 | 865 | <pre> 'tag': 'v0.2.2', |
|
866 | 866 | </pre> |
|
867 | 867 | </td> |
|
868 | 868 | </tr> |
|
869 | 869 | <tr class="line context"> |
|
870 | 870 | <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o...">...</a></td> |
|
871 | 871 | <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n...">...</a></td> |
|
872 | 872 | <td class="code "> |
|
873 | 873 | <pre>@@ -77,9 +77,11 @@ |
|
874 | 874 | </pre> |
|
875 | 875 | </td> |
|
876 | 876 | </tr> |
|
877 | 877 | <tr class="line unmod"> |
|
878 | 878 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o77" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o77">77</a></td> |
|
879 | 879 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n77" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n77">77</a></td> |
|
880 | 880 | <td class="code "> |
|
881 | 881 | <pre> target_ref=revisions[backend.alias]['tag'], |
|
882 | 882 | </pre> |
|
883 | 883 | </td> |
|
884 | 884 | </tr> |
|
885 | 885 | <tr class="line unmod"> |
|
886 | 886 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o78" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o78">78</a></td> |
|
887 | 887 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n78" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n78">78</a></td> |
|
888 | 888 | <td class="code "> |
|
889 | 889 | <pre> )) |
|
890 | 890 | </pre> |
|
891 | 891 | </td> |
|
892 | 892 | </tr><tr id="comment-tr-3754" class="inline-comments"><td></td><td></td><td> |
|
893 | 893 | |
|
894 | 894 | <div class="comment" id="comment-3754" line="n78"> |
|
895 | 895 | <div class="comment-wrapp"> |
|
896 | 896 | <div class="meta"> |
|
897 | 897 | <span class="gravatar"> |
|
898 | 898 | <img src="https://secure.gravatar.com/avatar/72706ebd30734451af9ff3fb59f05ff1?d=identicon&s=40" height="20" width="20"> |
|
899 | 899 | </span> |
|
900 | 900 | <span class="user"> |
|
901 | 901 | anderson |
|
902 | 902 | </span> |
|
903 | 903 | <span class="date"> |
|
904 | 904 | just now | |
|
905 | 905 | </span> |
|
906 | 906 | <span class="status-change"> |
|
907 | 907 | Comment on commit |
|
908 | 908 | </span> |
|
909 | 909 | <a class="permalink" href="#comment-3754">¶</a> |
|
910 | 910 | </div> |
|
911 | 911 | <div class="text"> |
|
912 | 912 | <div class="rst-block"><p>commented line |
|
913 | 913 | with multiple lines</p> |
|
914 | 914 | </div> |
|
915 | 915 | </div> |
|
916 | 916 | </div> |
|
917 | 917 | </div><div class="add-comment"><span class="btn btn-default">Add another comment</span></div> |
|
918 | 918 | |
|
919 | 919 | </td></tr> |
|
920 | 920 | <tr class="line unmod"> |
|
921 | 921 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o79" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o79">79</a></td> |
|
922 | 922 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n79" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n79">79</a></td> |
|
923 | 923 | <td class="code "> |
|
924 | 924 | <pre></pre> |
|
925 | 925 | </td> |
|
926 | 926 | </tr> |
|
927 | 927 | <tr class="line del form-open hl-comment"> |
|
928 | 928 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o80" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o80">80</a></td> |
|
929 | 929 | <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n"></a></td> |
|
930 | 930 | <td class="code "> |
|
931 | 931 | <pre> response.mustcontain('%s@%s' % (<del>backend.repo_name,</del> |
|
932 | 932 | </pre> |
|
933 | 933 | </td> |
|
934 | 934 | </tr><tr id="comment-tr-undefined" class="comment-form-inline"><td></td><td></td><td> |
|
935 | 935 | <div class="comment-inline-form ac"> |
|
936 | 936 | <div class="overlay"><div class="overlay-text">Submitting...</div></div> |
|
937 | 937 | <form action="#" class="inline-form" method="get"> |
|
938 | 938 | <div id="edit-container_o80" class="clearfix"> |
|
939 | 939 | <div class="comment-title pull-left"> |
|
940 | 940 | Commenting on line o80. |
|
941 | 941 | </div> |
|
942 | 942 | <div class="comment-help pull-right"> |
|
943 | 943 | Comments parsed using <a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html">RST</a> syntax with <span class="tooltip" title="Use @username inside this text to send notification to this RhodeCode user">@mention</span> support. |
|
944 | 944 | </div> |
|
945 | 945 | <div style="clear: both"></div> |
|
946 | 946 | <textarea id="text_o80" name="text" class="comment-block-ta ac-input" autocomplete="off"></textarea> |
|
947 | 947 | </div> |
|
948 | 948 | <div id="preview-container_o80" class="clearfix" style="display: none;"> |
|
949 | 949 | <div class="comment-help"> |
|
950 | 950 | Comment preview |
|
951 | 951 | </div> |
|
952 | 952 | <div id="preview-box_o80" class="preview-box"></div> |
|
953 | 953 | </div> |
|
954 | 954 | <div class="comment-button pull-right"> |
|
955 | 955 | <input type="hidden" name="f_path" value="rhodecode/tests/functional/test_compare_local.py"> |
|
956 | 956 | <input type="hidden" name="line" value="o80"> |
|
957 | 957 | <div id="preview-btn_o80" class="btn btn-default">Preview</div> |
|
958 | 958 | <div id="edit-btn_o80" class="btn" style="display: none;">Edit</div> |
|
959 | 959 | <input class="btn btn-success save-inline-form" id="save" name="save" type="submit" value="Comment"> |
|
960 | 960 | </div> |
|
961 | 961 | <div class="comment-button hide-inline-form-button"> |
|
962 | 962 | <input class="btn hide-inline-form" id="hide-inline-form" name="hide-inline-form" type="reset" value="Cancel"> |
|
963 | 963 | </div> |
|
964 | 964 | </form> |
|
965 | 965 | </div> |
|
966 | 966 | </td></tr> |
|
967 | 967 | <tr class="line add"> |
|
968 | 968 | <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td> |
|
969 | 969 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n80" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n80">80</a></td> |
|
970 | 970 | <td class="code "> |
|
971 | 971 | <pre> response.mustcontain('%s@%s' % ( |
|
972 | 972 | </pre> |
|
973 | 973 | </td> |
|
974 | 974 | </tr> |
|
975 | 975 | <tr class="line add"> |
|
976 | 976 | <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td> |
|
977 | 977 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n81" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n81">81</a></td> |
|
978 | 978 | <td class="code "> |
|
979 | 979 | <pre> backend.repo_name, |
|
980 | 980 | </pre> |
|
981 | 981 | </td> |
|
982 | 982 | </tr> |
|
983 | 983 | <tr class="line unmod"> |
|
984 | 984 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o81" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o81">81</a></td> |
|
985 | 985 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n82" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n82">82</a></td> |
|
986 | 986 | <td class="code "> |
|
987 | 987 | <pre> revisions[backend.alias]['branch'])) |
|
988 | 988 | </pre> |
|
989 | 989 | </td> |
|
990 | 990 | </tr> |
|
991 | 991 | <tr class="line del"> |
|
992 | 992 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o82" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o82">82</a></td> |
|
993 | 993 | <td class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n"></a></td> |
|
994 | 994 | <td class="code "> |
|
995 | 995 | <pre> response.mustcontain('%s@%s' % (<del>backend.repo_name,</del> |
|
996 | 996 | </pre> |
|
997 | 997 | </td> |
|
998 | 998 | </tr> |
|
999 | 999 | <tr class="line add"> |
|
1000 | 1000 | <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td> |
|
1001 | 1001 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n83" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n83">83</a></td> |
|
1002 | 1002 | <td class="code "> |
|
1003 | 1003 | <pre> response.mustcontain('%s@%s' % ( |
|
1004 | 1004 | </pre> |
|
1005 | 1005 | </td> |
|
1006 | 1006 | </tr> |
|
1007 | 1007 | <tr class="line add"> |
|
1008 | 1008 | <td class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o"></a></td> |
|
1009 | 1009 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n84" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n84">84</a></td> |
|
1010 | 1010 | <td class="code "> |
|
1011 | 1011 | <pre> backend.repo_name, |
|
1012 | 1012 | </pre> |
|
1013 | 1013 | </td> |
|
1014 | 1014 | </tr> |
|
1015 | 1015 | <tr class="line unmod"> |
|
1016 | 1016 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o83" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o83">83</a></td> |
|
1017 | 1017 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n85" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n85">85</a></td> |
|
1018 | 1018 | <td class="code "> |
|
1019 | 1019 | <pre> revisions[backend.alias]['tag'])) |
|
1020 | 1020 | </pre> |
|
1021 | 1021 | </td> |
|
1022 | 1022 | </tr> |
|
1023 | 1023 | <tr class="line unmod"> |
|
1024 | 1024 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o84" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o84">84</a></td> |
|
1025 | 1025 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n86" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n86">86</a></td> |
|
1026 | 1026 | <td class="code "> |
|
1027 | 1027 | <pre> response.mustcontain(revisions[backend.alias]['response']) |
|
1028 | 1028 | </pre> |
|
1029 | 1029 | </td> |
|
1030 | 1030 | </tr> |
|
1031 | 1031 | <tr class="line unmod"> |
|
1032 | 1032 | <td id="rhodecodetestsfunctionaltest_compare_localpy_o85" class="lineno old"><a href="#rhodecodetestsfunctionaltest_compare_localpy_o85">85</a></td> |
|
1033 | 1033 | <td id="rhodecodetestsfunctionaltest_compare_localpy_n87" class="lineno new"><a href="#rhodecodetestsfunctionaltest_compare_localpy_n87">87</a></td> |
|
1034 | 1034 | <td class="code "> |
|
1035 | 1035 | <pre></pre> |
|
1036 | 1036 | </td> |
|
1037 | 1037 | </tr> |
|
1038 | 1038 | </tbody></table> |
|
1039 | 1039 | </div> |
|
1040 | 1040 | </div> |
|
1041 | 1041 | </div> |
|
1042 | 1042 | |
|
1043 | 1043 | |
|
1044 | 1044 | |
|
1045 | 1045 | <!-- |
|
1046 | 1046 | Side-by-side diff |
|
1047 | 1047 | --> |
|
1048 | 1048 | |
|
1049 | 1049 | <h2>Side-by-side diff</h2> |
|
1050 | 1050 | |
|
1051 | 1051 | <div class="box"> |
|
1052 | 1052 | <div class="diff-container" style="overflow-x: hidden"> |
|
1053 | 1053 | <div class="diffblock comm" style="margin:3px; padding:1px"> |
|
1054 | 1054 | <div class="code-header"> |
|
1055 | 1055 | <div class="changeset_header"> |
|
1056 | 1056 | <div class="changeset_file"> |
|
1057 | 1057 | <i class="icon-file"></i> |
|
1058 | 1058 | <a href="/pygments/files/ea295cfb622620f5ba13e226ec531e3fe5296399/tests/test_basic_api.py">tests/test_basic_api.py</a> |
|
1059 | 1059 | [mode: <span id="selected_mode">python</span>] |
|
1060 | 1060 | </div> |
|
1061 | 1061 | <div class="diff-actions"> |
|
1062 | 1062 | <a href="/pygments/diff/tests/test_basic_api.py?diff2=ea295cfb622620f5ba13e226ec531e3fe5296399&diff=diff&diff1=de45f950b669e2d991c4ba512fa6fe450c6616db&fulldiff=1" class="tooltip" title="Show full diff for this file"> |
|
1063 | 1063 | <img class="icon" src="/images/icons/page_white_go.png"> |
|
1064 | 1064 | </a> |
|
1065 | 1065 | <a href="/pygments/diff-2way/tests/test_basic_api.py?diff2=ea295cfb622620f5ba13e226ec531e3fe5296399&diff=diff&diff1=de45f950b669e2d991c4ba512fa6fe450c6616db&fulldiff=1" class="tooltip" title="Show full side-by-side diff for this file" tt_title="Show full side-by-side diff for this file"> |
|
1066 | 1066 | <img class="icon" src="/images/icons/application_double.png"> |
|
1067 | 1067 | </a> |
|
1068 | 1068 | <a href="/pygments/diff/tests/test_basic_api.py?diff2=ea295cfb622620f5ba13e226ec531e3fe5296399&diff1=de45f950b669e2d991c4ba512fa6fe450c6616db&diff=raw" class="tooltip" title="Raw diff"> |
|
1069 | 1069 | <img class="icon" src="/images/icons/page_white.png"> |
|
1070 | 1070 | </a> |
|
1071 | 1071 | <a href="/pygments/diff/tests/test_basic_api.py?diff2=ea295cfb622620f5ba13e226ec531e3fe5296399&diff1=de45f950b669e2d991c4ba512fa6fe450c6616db&diff=download" class="tooltip" title="Download diff"> |
|
1072 | 1072 | <img class="icon" src="/images/icons/page_save.png"> |
|
1073 | 1073 | </a> |
|
1074 | 1074 | <label><input id="ignorews" name="ignorews" type="checkbox" value="1">ignore white space</label> |
|
1075 | 1075 | <label><input id="edit_mode" name="edit_mode" type="checkbox" value="1">turn on edit mode</label> |
|
1076 | 1076 | |
|
1077 | 1077 | </div> |
|
1078 | 1078 | <div style="float: right; padding: 0px 10px 0px 0px"> |
|
1079 | 1079 | r1538:de45f950b669 ... r1539:ea295cfb6226 |
|
1080 | 1080 | </div> |
|
1081 | 1081 | </div> |
|
1082 | 1082 | </div> |
|
1083 | 1083 | <div id="compare"></div> |
|
1084 | 1084 | </div> |
|
1085 | 1085 | </div> |
|
1086 | 1086 | |
|
1087 | 1087 | <script> |
|
1088 | 1088 | $(document).ready(function () { |
|
1089 | 1089 | var example_lines = '1\n2\n3\n4\n5\n6\n7\n8\n9\n \n'; |
|
1090 | 1090 | |
|
1091 | 1091 | $('#compare').mergely({ |
|
1092 | 1092 | width: 'auto', |
|
1093 | 1093 | height: '600', |
|
1094 | 1094 | fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'}, |
|
1095 | 1095 | bgcolor: '#fff', |
|
1096 | 1096 | viewport: true, |
|
1097 | 1097 | cmsettings: {mode: 'text/plain', readOnly: true, lineWrapping: false, lineNumbers: true}, |
|
1098 | 1098 | lhs: function(setValue) { |
|
1099 | 1099 | if("False" == "True"){ |
|
1100 | 1100 | setValue('Binary file') |
|
1101 | 1101 | } |
|
1102 | 1102 | else if("MercurialCommit" == "EmptyCommit"){ |
|
1103 | 1103 | setValue(''); |
|
1104 | 1104 | } |
|
1105 | 1105 | else{ |
|
1106 | 1106 | var left_value = example_lines.slice(0, 10) + |
|
1107 | 1107 | '123456789 '.repeat(10) + |
|
1108 | 1108 | '\n'+ |
|
1109 | 1109 | example_lines.slice(10, 20); |
|
1110 | 1110 | setValue(left_value + example_lines.repeat(9)); |
|
1111 | 1111 | } |
|
1112 | 1112 | |
|
1113 | 1113 | }, |
|
1114 | 1114 | rhs: function(setValue) { |
|
1115 | 1115 | if("False" == "True"){ |
|
1116 | 1116 | setValue('Binary file') |
|
1117 | 1117 | } |
|
1118 | 1118 | else if("MercurialCommit" == "EmptyCommit"){ |
|
1119 | 1119 | setValue(''); |
|
1120 | 1120 | } |
|
1121 | 1121 | else{ |
|
1122 | 1122 | var right_value = example_lines + |
|
1123 | 1123 | example_lines.slice(0, 8) + |
|
1124 | 1124 | 'abcdefghi '.repeat(10) + |
|
1125 | 1125 | '\n'+ |
|
1126 | 1126 | example_lines.slice(8, 20); |
|
1127 | 1127 | setValue(right_value + example_lines.repeat(9)); |
|
1128 | 1128 | } |
|
1129 | 1129 | }, |
|
1130 | 1130 | }); |
|
1131 | 1131 | |
|
1132 | 1132 | var detected_mode = detectCodeMirrorModeFromExt('test_basic_api.py', true); |
|
1133 | 1133 | if(detected_mode){ |
|
1134 | 1134 | setCodeMirrorMode($('#compare').mergely('cm', 'lhs'), detected_mode); |
|
1135 | 1135 | setCodeMirrorMode($('#compare').mergely('cm', 'rhs'), detected_mode); |
|
1136 | 1136 | $('#selected_mode').html(detected_mode); |
|
1137 | 1137 | } |
|
1138 | 1138 | |
|
1139 | 1139 | $('#ignorews').change(function(e){ |
|
1140 | 1140 | var val = e.currentTarget.checked; |
|
1141 | 1141 | $('#compare').mergely('options', {ignorews: val}); |
|
1142 | 1142 | $('#compare').mergely('update'); |
|
1143 | 1143 | }); |
|
1144 | 1144 | $('#edit_mode').change(function(e){ |
|
1145 | 1145 | var val = !e.currentTarget.checked; |
|
1146 | 1146 | $('#compare').mergely('cm', 'lhs').setOption('readOnly', val); |
|
1147 | 1147 | $('#compare').mergely('cm', 'rhs').setOption('readOnly', val); |
|
1148 | 1148 | $('#compare').mergely('update'); |
|
1149 | 1149 | }) |
|
1150 | 1150 | }); |
|
1151 | 1151 | </script> |
|
1152 | 1152 | |
|
1153 | 1153 | </div> |
|
1154 | 1154 | |
|
1155 | 1155 | <!-- end examples --> |
|
1156 | 1156 | |
|
1157 | 1157 | </div> |
|
1158 | 1158 | </div> |
|
1159 | 1159 | </div> |
|
1160 | 1160 | </%def> |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
General Comments 0
You need to be logged in to leave comments.
Login now