##// END OF EJS Templates
tooltips: remove all occurences of explicit tooltip activation
ergo -
r385:4c58728c default
parent child Browse files
Show More
@@ -1,655 +1,653 b''
1 1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 2 // #
3 3 // # This program is free software: you can redistribute it and/or modify
4 4 // # it under the terms of the GNU Affero General Public License, version 3
5 5 // # (only), as published by the Free Software Foundation.
6 6 // #
7 7 // # This program is distributed in the hope that it will be useful,
8 8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 // # GNU General Public License for more details.
11 11 // #
12 12 // # You should have received a copy of the GNU Affero General Public License
13 13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14 // #
15 15 // # This program is dual-licensed. If you wish to learn more about the
16 16 // # RhodeCode Enterprise Edition, including its added features, Support services,
17 17 // # and proprietary license terms, please see https://rhodecode.com/licenses/
18 18
19 19 var firefoxAnchorFix = function() {
20 20 // hack to make anchor links behave properly on firefox, in our inline
21 21 // comments generation when comments are injected firefox is misbehaving
22 22 // when jumping to anchor links
23 23 if (location.href.indexOf('#') > -1) {
24 24 location.href += '';
25 25 }
26 26 };
27 27
28 28 // returns a node from given html;
29 29 var fromHTML = function(html){
30 30 var _html = document.createElement('element');
31 31 _html.innerHTML = html;
32 32 return _html;
33 33 };
34 34
35 35 var tableTr = function(cls, body){
36 36 var _el = document.createElement('div');
37 37 var _body = $(body).attr('id');
38 38 var comment_id = fromHTML(body).children[0].id.split('comment-')[1];
39 39 var id = 'comment-tr-{0}'.format(comment_id);
40 40 var _html = ('<table><tbody><tr id="{0}" class="{1}">'+
41 41 '<td class="add-comment-line"><span class="add-comment-content"></span></td>'+
42 42 '<td></td>'+
43 43 '<td></td>'+
44 44 '<td>{2}</td>'+
45 45 '</tr></tbody></table>').format(id, cls, body);
46 46 $(_el).html(_html);
47 47 return _el.children[0].children[0].children[0];
48 48 };
49 49
50 50 var removeInlineForm = function(form) {
51 51 form.parentNode.removeChild(form);
52 52 };
53 53
54 54 var createInlineForm = function(parent_tr, f_path, line) {
55 55 var tmpl = $('#comment-inline-form-template').html();
56 56 tmpl = tmpl.format(f_path, line);
57 57 var form = tableTr('comment-form-inline', tmpl);
58 58 var form_hide_button = $(form).find('.hide-inline-form');
59 59
60 60 $(form_hide_button).click(function(e) {
61 61 $('.inline-comments').removeClass('hide-comment-button');
62 62 var newtr = e.currentTarget.parentNode.parentNode.parentNode.parentNode.parentNode;
63 63 if ($(newtr.nextElementSibling).hasClass('inline-comments-button')) {
64 64 $(newtr.nextElementSibling).show();
65 65 }
66 66 $(newtr).parents('.comment-form-inline').remove();
67 67 $(parent_tr).removeClass('form-open');
68 68 $(parent_tr).removeClass('hl-comment');
69 69 });
70 70
71 71 return form;
72 72 };
73 73
74 74 var getLineNo = function(tr) {
75 75 var line;
76 76 // Try to get the id and return "" (empty string) if it doesn't exist
77 77 var o = ($(tr).find('.lineno.old').attr('id')||"").split('_');
78 78 var n = ($(tr).find('.lineno.new').attr('id')||"").split('_');
79 79 if (n.length >= 2) {
80 80 line = n[n.length-1];
81 81 } else if (o.length >= 2) {
82 82 line = o[o.length-1];
83 83 }
84 84 return line;
85 85 };
86 86
87 87 /**
88 88 * make a single inline comment and place it inside
89 89 */
90 90 var renderInlineComment = function(json_data, show_add_button) {
91 91 show_add_button = typeof show_add_button !== 'undefined' ? show_add_button : true;
92 92 try {
93 93 var html = json_data.rendered_text;
94 94 var lineno = json_data.line_no;
95 95 var target_id = json_data.target_id;
96 96 placeInline(target_id, lineno, html, show_add_button);
97 97 } catch (e) {
98 98 console.error(e);
99 99 }
100 100 };
101 101
102 102 function bindDeleteCommentButtons() {
103 103 $('.delete-comment').one('click', function() {
104 104 var comment_id = $(this).data("comment-id");
105 105
106 106 if (comment_id){
107 107 deleteComment(comment_id);
108 108 }
109 109 });
110 110 }
111 111
112 112 /**
113 113 * Inject inline comment for on given TR this tr should be always an .line
114 114 * tr containing the line. Code will detect comment, and always put the comment
115 115 * block at the very bottom
116 116 */
117 117 var injectInlineForm = function(tr){
118 118 if (!$(tr).hasClass('line')) {
119 119 return;
120 120 }
121 121
122 122 var _td = $(tr).find('.code').get(0);
123 123 if ($(tr).hasClass('form-open') ||
124 124 $(tr).hasClass('context') ||
125 125 $(_td).hasClass('no-comment')) {
126 126 return;
127 127 }
128 128 $(tr).addClass('form-open');
129 129 $(tr).addClass('hl-comment');
130 130 var node = $(tr.parentNode.parentNode.parentNode).find('.full_f_path').get(0);
131 131 var f_path = $(node).attr('path');
132 132 var lineno = getLineNo(tr);
133 133 var form = createInlineForm(tr, f_path, lineno);
134 134
135 135 var parent = tr;
136 136 while (1) {
137 137 var n = parent.nextElementSibling;
138 138 // next element are comments !
139 139 if ($(n).hasClass('inline-comments')) {
140 140 parent = n;
141 141 }
142 142 else {
143 143 break;
144 144 }
145 145 }
146 146 var _parent = $(parent).get(0);
147 147 $(_parent).after(form);
148 148 $('.comment-form-inline').prev('.inline-comments').addClass('hide-comment-button');
149 149 var f = $(form).get(0);
150 150
151 151 var _form = $(f).find('.inline-form').get(0);
152 152
153 153 var pullRequestId = templateContext.pull_request_data.pull_request_id;
154 154 var commitId = templateContext.commit_data.commit_id;
155 155
156 156 var commentForm = new CommentForm(_form, commitId, pullRequestId, lineno, false);
157 157 var cm = commentForm.getCmInstance();
158 158
159 159 // set a CUSTOM submit handler for inline comments.
160 160 commentForm.setHandleFormSubmit(function(o) {
161 161 var text = commentForm.cm.getValue();
162 162
163 163 if (text === "") {
164 164 return;
165 165 }
166 166
167 167 if (lineno === undefined) {
168 168 alert('missing line !');
169 169 return;
170 170 }
171 171 if (f_path === undefined) {
172 172 alert('missing file path !');
173 173 return;
174 174 }
175 175
176 176 var excludeCancelBtn = false;
177 177 var submitEvent = true;
178 178 commentForm.setActionButtonsDisabled(true, excludeCancelBtn, submitEvent);
179 179 commentForm.cm.setOption("readOnly", true);
180 180 var postData = {
181 181 'text': text,
182 182 'f_path': f_path,
183 183 'line': lineno,
184 184 'csrf_token': CSRF_TOKEN
185 185 };
186 186 var submitSuccessCallback = function(o) {
187 187 $(tr).removeClass('form-open');
188 188 removeInlineForm(f);
189 189 renderInlineComment(o);
190 190 $('.inline-comments').removeClass('hide-comment-button');
191 191
192 192 // re trigger the linkification of next/prev navigation
193 193 linkifyComments($('.inline-comment-injected'));
194 194 timeagoActivate();
195 tooltip_activate();
196 195 bindDeleteCommentButtons();
197 196 commentForm.setActionButtonsDisabled(false);
198 197
199 198 };
200 199 var submitFailCallback = function(){
201 200 commentForm.resetCommentFormState(text)
202 201 };
203 202 commentForm.submitAjaxPOST(
204 203 commentForm.submitUrl, postData, submitSuccessCallback, submitFailCallback);
205 204 });
206 205
207 206 setTimeout(function() {
208 207 // callbacks
209 208 if (cm !== undefined) {
210 209 cm.focus();
211 210 }
212 211 }, 10);
213 212
214 213 $.Topic('/ui/plugins/code/comment_form_built').prepare({
215 214 form:_form,
216 215 parent:_parent}
217 216 );
218 217 };
219 218
220 219 var deleteComment = function(comment_id) {
221 220 var url = AJAX_COMMENT_DELETE_URL.replace('__COMMENT_ID__', comment_id);
222 221 var postData = {
223 222 '_method': 'delete',
224 223 'csrf_token': CSRF_TOKEN
225 224 };
226 225
227 226 var success = function(o) {
228 227 window.location.reload();
229 228 };
230 229 ajaxPOST(url, postData, success);
231 230 };
232 231
233 232 var createInlineAddButton = function(tr){
234 233 var label = _gettext('Add another comment');
235 234 var html_el = document.createElement('div');
236 235 $(html_el).addClass('add-comment');
237 236 html_el.innerHTML = '<span class="btn btn-secondary">{0}</span>'.format(label);
238 237 var add = new $(html_el);
239 238 add.on('click', function(e) {
240 239 injectInlineForm(tr);
241 240 });
242 241 return add;
243 242 };
244 243
245 244 var placeAddButton = function(target_tr){
246 245 if(!target_tr){
247 246 return;
248 247 }
249 248 var last_node = target_tr;
250 249 // scan
251 250 while (1){
252 251 var n = last_node.nextElementSibling;
253 252 // next element are comments !
254 253 if($(n).hasClass('inline-comments')){
255 254 last_node = n;
256 255 // also remove the comment button from previous
257 256 var comment_add_buttons = $(last_node).find('.add-comment');
258 257 for(var i=0; i<comment_add_buttons.length; i++){
259 258 var b = comment_add_buttons[i];
260 259 b.parentNode.removeChild(b);
261 260 }
262 261 }
263 262 else{
264 263 break;
265 264 }
266 265 }
267 266 var add = createInlineAddButton(target_tr);
268 267 // get the comment div
269 268 var comment_block = $(last_node).find('.comment')[0];
270 269 // attach add button
271 270 $(add).insertAfter(comment_block);
272 271 };
273 272
274 273 /**
275 274 * Places the inline comment into the changeset block in proper line position
276 275 */
277 276 var placeInline = function(target_container, lineno, html, show_add_button) {
278 277 show_add_button = typeof show_add_button !== 'undefined' ? show_add_button : true;
279 278
280 279 var lineid = "{0}_{1}".format(target_container, lineno);
281 280 var target_line = $('#' + lineid).get(0);
282 281 var comment = new $(tableTr('inline-comments', html));
283 282 // check if there are comments already !
284 283 var parent_node = target_line.parentNode;
285 284 var root_parent = parent_node;
286 285 while (1) {
287 286 var n = parent_node.nextElementSibling;
288 287 // next element are comments !
289 288 if ($(n).hasClass('inline-comments')) {
290 289 parent_node = n;
291 290 }
292 291 else {
293 292 break;
294 293 }
295 294 }
296 295 // put in the comment at the bottom
297 296 $(comment).insertAfter(parent_node);
298 297 $(comment).find('.comment-inline').addClass('inline-comment-injected');
299 298 // scan nodes, and attach add button to last one
300 299 if (show_add_button) {
301 300 placeAddButton(root_parent);
302 301 }
303 302
304 303 return target_line;
305 304 };
306 305
307 306 var linkifyComments = function(comments) {
308 307
309 308 for (var i = 0; i < comments.length; i++) {
310 309 var comment_id = $(comments[i]).data('comment-id');
311 310 var prev_comment_id = $(comments[i - 1]).data('comment-id');
312 311 var next_comment_id = $(comments[i + 1]).data('comment-id');
313 312
314 313 // place next/prev links
315 314 if (prev_comment_id) {
316 315 $('#prev_c_' + comment_id).show();
317 316 $('#prev_c_' + comment_id + " a.arrow_comment_link").attr(
318 317 'href', '#comment-' + prev_comment_id).removeClass('disabled');
319 318 }
320 319 if (next_comment_id) {
321 320 $('#next_c_' + comment_id).show();
322 321 $('#next_c_' + comment_id + " a.arrow_comment_link").attr(
323 322 'href', '#comment-' + next_comment_id).removeClass('disabled');
324 323 }
325 324 // place a first link to the total counter
326 325 if (i === 0) {
327 326 $('#inline-comments-counter').attr('href', '#comment-' + comment_id);
328 327 }
329 328 }
330 329
331 330 };
332 331
333 332 /**
334 333 * Iterates over all the inlines, and places them inside proper blocks of data
335 334 */
336 335 var renderInlineComments = function(file_comments, show_add_button) {
337 336 show_add_button = typeof show_add_button !== 'undefined' ? show_add_button : true;
338 337
339 338 for (var i = 0; i < file_comments.length; i++) {
340 339 var box = file_comments[i];
341 340
342 341 var target_id = $(box).attr('target_id');
343 342
344 343 // actually comments with line numbers
345 344 var comments = box.children;
346 345
347 346 for (var j = 0; j < comments.length; j++) {
348 347 var data = {
349 348 'rendered_text': comments[j].outerHTML,
350 349 'line_no': $(comments[j]).attr('line'),
351 350 'target_id': target_id
352 351 };
353 352 renderInlineComment(data, show_add_button);
354 353 }
355 354 }
356 355
357 356 // since order of injection is random, we're now re-iterating
358 357 // from correct order and filling in links
359 358 linkifyComments($('.inline-comment-injected'));
360 359 bindDeleteCommentButtons();
361 360 firefoxAnchorFix();
362 361 };
363 362
364 363
365 364 /* Comment form for main and inline comments */
366 365 var CommentForm = (function() {
367 366 "use strict";
368 367
369 368 function CommentForm(formElement, commitId, pullRequestId, lineNo, initAutocompleteActions) {
370 369
371 370 this.withLineNo = function(selector) {
372 371 var lineNo = this.lineNo;
373 372 if (lineNo === undefined) {
374 373 return selector
375 374 } else {
376 375 return selector + '_' + lineNo;
377 376 }
378 377 };
379 378
380 379 this.commitId = commitId;
381 380 this.pullRequestId = pullRequestId;
382 381 this.lineNo = lineNo;
383 382 this.initAutocompleteActions = initAutocompleteActions;
384 383
385 384 this.previewButton = this.withLineNo('#preview-btn');
386 385 this.previewContainer = this.withLineNo('#preview-container');
387 386
388 387 this.previewBoxSelector = this.withLineNo('#preview-box');
389 388
390 389 this.editButton = this.withLineNo('#edit-btn');
391 390 this.editContainer = this.withLineNo('#edit-container');
392 391
393 392 this.cancelButton = this.withLineNo('#cancel-btn');
394 393
395 394 this.statusChange = '#change_status';
396 395 this.cmBox = this.withLineNo('#text');
397 396 this.cm = initCommentBoxCodeMirror(this.cmBox, this.initAutocompleteActions);
398 397
399 398 this.submitForm = formElement;
400 399 this.submitButton = $(this.submitForm).find('input[type="submit"]');
401 400 this.submitButtonText = this.submitButton.val();
402 401
403 402 this.previewUrl = pyroutes.url('changeset_comment_preview',
404 403 {'repo_name': templateContext.repo_name});
405 404
406 405 // based on commitId, or pullReuqestId decide where do we submit
407 406 // out data
408 407 if (this.commitId){
409 408 this.submitUrl = pyroutes.url('changeset_comment',
410 409 {'repo_name': templateContext.repo_name,
411 410 'revision': this.commitId});
412 411
413 412 } else if (this.pullRequestId) {
414 413 this.submitUrl = pyroutes.url('pullrequest_comment',
415 414 {'repo_name': templateContext.repo_name,
416 415 'pull_request_id': this.pullRequestId});
417 416
418 417 } else {
419 418 throw new Error(
420 419 'CommentForm requires pullRequestId, or commitId to be specified.')
421 420 }
422 421
423 422 this.getCmInstance = function(){
424 423 return this.cm
425 424 };
426 425
427 426 var self = this;
428 427
429 428 this.getCommentStatus = function() {
430 429 return $(this.submitForm).find(this.statusChange).val();
431 430 };
432 431
433 432 this.isAllowedToSubmit = function() {
434 433 return !$(this.submitButton).prop('disabled');
435 434 };
436 435
437 436 this.initStatusChangeSelector = function(){
438 437 var formatChangeStatus = function(state, escapeMarkup) {
439 438 var originalOption = state.element;
440 439 return '<div class="flag_status ' + $(originalOption).data('status') + ' pull-left"></div>' +
441 440 '<span>' + escapeMarkup(state.text) + '</span>';
442 441 };
443 442 var formatResult = function(result, container, query, escapeMarkup) {
444 443 return formatChangeStatus(result, escapeMarkup);
445 444 };
446 445
447 446 var formatSelection = function(data, container, escapeMarkup) {
448 447 return formatChangeStatus(data, escapeMarkup);
449 448 };
450 449
451 450 $(this.submitForm).find(this.statusChange).select2({
452 451 placeholder: _gettext('Status Review'),
453 452 formatResult: formatResult,
454 453 formatSelection: formatSelection,
455 454 containerCssClass: "drop-menu status_box_menu",
456 455 dropdownCssClass: "drop-menu-dropdown",
457 456 dropdownAutoWidth: true,
458 457 minimumResultsForSearch: -1
459 458 });
460 459 $(this.submitForm).find(this.statusChange).on('change', function() {
461 460 var status = self.getCommentStatus();
462 461 if (status && !self.lineNo) {
463 462 $(self.submitButton).prop('disabled', false);
464 463 }
465 464 //todo, fix this name
466 465 var placeholderText = _gettext('Comment text will be set automatically based on currently selected status ({0}) ...').format(status);
467 466 self.cm.setOption('placeholder', placeholderText);
468 467 })
469 468 };
470 469
471 470 // reset the comment form into it's original state
472 471 this.resetCommentFormState = function(content) {
473 472 content = content || '';
474 473
475 474 $(this.editContainer).show();
476 475 $(this.editButton).hide();
477 476
478 477 $(this.previewContainer).hide();
479 478 $(this.previewButton).show();
480 479
481 480 this.setActionButtonsDisabled(true);
482 481 self.cm.setValue(content);
483 482 self.cm.setOption("readOnly", false);
484 483 };
485 484
486 485 this.submitAjaxPOST = function(url, postData, successHandler, failHandler) {
487 486 failHandler = failHandler || function() {};
488 487 var postData = toQueryString(postData);
489 488 var request = $.ajax({
490 489 url: url,
491 490 type: 'POST',
492 491 data: postData,
493 492 headers: {'X-PARTIAL-XHR': true}
494 493 })
495 494 .done(function(data) {
496 495 successHandler(data);
497 496 })
498 497 .fail(function(data, textStatus, errorThrown){
499 498 alert(
500 499 "Error while submitting comment.\n" +
501 500 "Error code {0} ({1}).".format(data.status, data.statusText));
502 501 failHandler()
503 502 });
504 503 return request;
505 504 };
506 505
507 506 // overwrite a submitHandler, we need to do it for inline comments
508 507 this.setHandleFormSubmit = function(callback) {
509 508 this.handleFormSubmit = callback;
510 509 };
511 510
512 511 // default handler for for submit for main comments
513 512 this.handleFormSubmit = function() {
514 513 var text = self.cm.getValue();
515 514 var status = self.getCommentStatus();
516 515
517 516 if (text === "" && !status) {
518 517 return;
519 518 }
520 519
521 520 var excludeCancelBtn = false;
522 521 var submitEvent = true;
523 522 self.setActionButtonsDisabled(true, excludeCancelBtn, submitEvent);
524 523 self.cm.setOption("readOnly", true);
525 524 var postData = {
526 525 'text': text,
527 526 'changeset_status': status,
528 527 'csrf_token': CSRF_TOKEN
529 528 };
530 529
531 530 var submitSuccessCallback = function(o) {
532 531 if (status) {
533 532 location.reload(true);
534 533 } else {
535 534 $('#injected_page_comments').append(o.rendered_text);
536 535 self.resetCommentFormState();
537 536 bindDeleteCommentButtons();
538 537 timeagoActivate();
539 tooltip_activate();
540 538 }
541 539 };
542 540 var submitFailCallback = function(){
543 541 self.resetCommentFormState(text)
544 542 };
545 543 self.submitAjaxPOST(
546 544 self.submitUrl, postData, submitSuccessCallback, submitFailCallback);
547 545 };
548 546
549 547 this.previewSuccessCallback = function(o) {
550 548 $(self.previewBoxSelector).html(o);
551 549 $(self.previewBoxSelector).removeClass('unloaded');
552 550
553 551 // swap buttons
554 552 $(self.previewButton).hide();
555 553 $(self.editButton).show();
556 554
557 555 // unlock buttons
558 556 self.setActionButtonsDisabled(false);
559 557 };
560 558
561 559 this.setActionButtonsDisabled = function(state, excludeCancelBtn, submitEvent) {
562 560 excludeCancelBtn = excludeCancelBtn || false;
563 561 submitEvent = submitEvent || false;
564 562
565 563 $(this.editButton).prop('disabled', state);
566 564 $(this.previewButton).prop('disabled', state);
567 565
568 566 if (!excludeCancelBtn) {
569 567 $(this.cancelButton).prop('disabled', state);
570 568 }
571 569
572 570 var submitState = state;
573 571 if (!submitEvent && this.getCommentStatus() && !this.lineNo) {
574 572 // if the value of commit review status is set, we allow
575 573 // submit button, but only on Main form, lineNo means inline
576 574 submitState = false
577 575 }
578 576 $(this.submitButton).prop('disabled', submitState);
579 577 if (submitEvent) {
580 578 $(this.submitButton).val(_gettext('Submitting...'));
581 579 } else {
582 580 $(this.submitButton).val(this.submitButtonText);
583 581 }
584 582
585 583 };
586 584
587 585 // lock preview/edit/submit buttons on load, but exclude cancel button
588 586 var excludeCancelBtn = true;
589 587 this.setActionButtonsDisabled(true, excludeCancelBtn);
590 588
591 589 // anonymous users don't have access to initialized CM instance
592 590 if (this.cm !== undefined){
593 591 this.cm.on('change', function(cMirror) {
594 592 if (cMirror.getValue() === "") {
595 593 self.setActionButtonsDisabled(true, excludeCancelBtn)
596 594 } else {
597 595 self.setActionButtonsDisabled(false, excludeCancelBtn)
598 596 }
599 597 });
600 598 }
601 599
602 600 $(this.editButton).on('click', function(e) {
603 601 e.preventDefault();
604 602
605 603 $(self.previewButton).show();
606 604 $(self.previewContainer).hide();
607 605 $(self.editButton).hide();
608 606 $(self.editContainer).show();
609 607
610 608 });
611 609
612 610 $(this.previewButton).on('click', function(e) {
613 611 e.preventDefault();
614 612 var text = self.cm.getValue();
615 613
616 614 if (text === "") {
617 615 return;
618 616 }
619 617
620 618 var postData = {
621 619 'text': text,
622 620 'renderer': DEFAULT_RENDERER,
623 621 'csrf_token': CSRF_TOKEN
624 622 };
625 623
626 624 // lock ALL buttons on preview
627 625 self.setActionButtonsDisabled(true);
628 626
629 627 $(self.previewBoxSelector).addClass('unloaded');
630 628 $(self.previewBoxSelector).html(_gettext('Loading ...'));
631 629 $(self.editContainer).hide();
632 630 $(self.previewContainer).show();
633 631
634 632 // by default we reset state of comment preserving the text
635 633 var previewFailCallback = function(){
636 634 self.resetCommentFormState(text)
637 635 };
638 636 self.submitAjaxPOST(
639 637 self.previewUrl, postData, self.previewSuccessCallback, previewFailCallback);
640 638
641 639 });
642 640
643 641 $(this.submitForm).submit(function(e) {
644 642 e.preventDefault();
645 643 var allowedToSubmit = self.isAllowedToSubmit();
646 644 if (!allowedToSubmit){
647 645 return false;
648 646 }
649 647 self.handleFormSubmit();
650 648 });
651 649
652 650 }
653 651
654 652 return CommentForm;
655 653 })();
@@ -1,103 +1,94 b''
1 1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 2 // #
3 3 // # This program is free software: you can redistribute it and/or modify
4 4 // # it under the terms of the GNU Affero General Public License, version 3
5 5 // # (only), as published by the Free Software Foundation.
6 6 // #
7 7 // # This program is distributed in the hope that it will be useful,
8 8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 // # GNU General Public License for more details.
11 11 // #
12 12 // # You should have received a copy of the GNU Affero General Public License
13 13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14 // #
15 15 // # This program is dual-licensed. If you wish to learn more about the
16 16 // # RhodeCode Enterprise Edition, including its added features, Support services,
17 17 // # and proprietary license terms, please see https://rhodecode.com/licenses/
18 18
19 19 /**
20 20 * TOOLTIP IMPL.
21 21 */
22 22
23 23 var TTIP = {};
24 24
25 25 TTIP.main = {
26 26 offset: [15,15],
27 27 maxWidth: 600,
28 28
29 29 setDeferredListeners: function(){
30 30 $('body').on('mouseover', '.tooltip', yt.show_tip);
31 31 $('body').on('mousemove', '.tooltip', yt.move_tip);
32 32 $('body').on('mouseout', '.tooltip', yt.close_tip);
33 33 },
34 34
35 35 init: function(){
36 36 $('#tip-box').remove();
37 37 yt.tipBox = document.createElement('div');
38 38 document.body.appendChild(yt.tipBox);
39 39 yt.tipBox.id = 'tip-box';
40 40
41 41 $(yt.tipBox).hide();
42 42 $(yt.tipBox).css('position', 'absolute');
43 43 if(yt.maxWidth !== null){
44 44 $(yt.tipBox).css('max-width', yt.maxWidth+'px');
45 45 }
46 46 yt.setDeferredListeners();
47 47 },
48 48
49 49 show_tip: function(e, el){
50 50 e.stopPropagation();
51 51 e.preventDefault();
52 52 var el = e.data || e.currentTarget || el;
53 53 if(el.tagName.toLowerCase() === 'img'){
54 54 yt.tipText = el.alt ? el.alt : '';
55 55 } else {
56 56 yt.tipText = el.title ? el.title : '';
57 57 }
58 58
59 59 if(yt.tipText !== ''){
60 60 // save org title
61 61 $(el).attr('tt_title', yt.tipText);
62 62 // reset title to not show org tooltips
63 63 $(el).attr('title', '');
64 64
65 65 yt.tipBox.innerHTML = yt.tipText;
66 66 $(yt.tipBox).show();
67 67 }
68 68 },
69 69
70 70 move_tip: function(e, el){
71 71 e.stopPropagation();
72 72 e.preventDefault();
73 73 var el = e.data || e.currentTarget || el;
74 74 var movePos = [e.pageX, e.pageY];
75 75 $(yt.tipBox).css('top', (movePos[1] + yt.offset[1]) + 'px')
76 76 $(yt.tipBox).css('left', (movePos[0] + yt.offset[0]) + 'px')
77 77 },
78 78
79 79 close_tip: function(e, el){
80 80 e.stopPropagation();
81 81 e.preventDefault();
82 82 var el = e.data || e.currentTarget || el;
83 83 $(yt.tipBox).hide();
84 84 $(el).attr('title', $(el).attr('tt_title'));
85 85 $('#tip-box').hide();
86 86 }
87 87 };
88 88
89 /**
90 * tooltip activate
91 */
92 var tooltip_activate = function(){
89 // activate tooltips
93 90 yt = TTIP.main;
94 91 if ($(document).data('activated-tooltips') !== '1'){
95 92 $(document).ready(yt.init);
96 93 $(document).data('activated-tooltips', '1');
97 94 }
98 };
99
100 /**
101 * show changeset tooltip
102 */
103 var show_changeset_tooltip = function(){};
@@ -1,60 +1,58 b''
1 1 ## -*- coding: utf-8 -*-
2 2 %if c.users_log:
3 3 <table class="rctable admin_log">
4 4 <tr>
5 5 <th>${_('Username')}</th>
6 6 <th>${_('Action')}</th>
7 7 <th>${_('Repository')}</th>
8 8 <th>${_('Date')}</th>
9 9 <th>${_('From IP')}</th>
10 10 </tr>
11 11
12 12 %for cnt,l in enumerate(c.users_log):
13 13 <tr class="parity${cnt%2}">
14 14 <td class="td-user">
15 15 %if l.user is not None:
16 16 ${h.link_to(l.user.username,h.url('edit_user', user_id=l.user.user_id))}
17 17 %else:
18 18 ${l.username}
19 19 %endif
20 20 </td>
21 21 <td class="td-journalaction">${h.action_parser(l)[0]()}
22 22 <div class="journal_action_params">
23 23 ${h.literal(h.action_parser(l)[1]())}
24 24 </div>
25 25 </td>
26 26 <td class="td-componentname">
27 27 %if l.repository is not None:
28 28 ${h.link_to(l.repository.repo_name,h.url('summary_home',repo_name=l.repository.repo_name))}
29 29 %else:
30 30 ${l.repository_name}
31 31 %endif
32 32 </td>
33 33
34 34 <td class="td-time">${h.format_date(l.action_date)}</td>
35 35 <td class="td-ip">${l.user_ip}</td>
36 36 </tr>
37 37 %endfor
38 38 </table>
39 39
40 40 <div class="pagination-wh pagination-left">
41 41 ${c.users_log.pager('$link_previous ~2~ $link_next')}
42 42 </div>
43 43 %else:
44 44 ${_('No actions yet')}
45 45 %endif
46 46
47 47 <script type="text/javascript">
48 48 $(function(){
49 49 //because this is loaded on every pjax request, it must run only once
50 50 //therefore the .one method
51 51 $(document).on('pjax:complete',function(){
52 52 show_more_event();
53 tooltip_activate();
54 show_changeset_tooltip();
55 53 });
56 54
57 55 $(document).pjax('#user_log .pager_link', '#user_log');
58 56 });
59 57 </script>
60 58
@@ -1,151 +1,149 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 %if c.show_private:
6 6 ${_('Private Gists for user %s') % c.rhodecode_user.username}
7 7 %elif c.show_public:
8 8 ${_('Public Gists for user %s') % c.rhodecode_user.username}
9 9 %else:
10 10 ${_('Public Gists')}
11 11 %endif
12 12 %if c.rhodecode_name:
13 13 &middot; ${h.branding(c.rhodecode_name)}
14 14 %endif
15 15 </%def>
16 16
17 17 <%def name="breadcrumbs_links()">
18 18 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
19 19 %if c.show_private and not c.show_public:
20 20 ${_('Private Gists for user %s') % c.rhodecode_user.username}
21 21 %elif c.show_public and not c.show_private:
22 22 ${_('Public Gists for user %s') % c.rhodecode_user.username}
23 23 %elif c.show_public and c.show_private:
24 24 ${_('All Gists for user %s') % c.rhodecode_user.username}
25 25 %else:
26 26 ${_('All Public Gists')}
27 27 %endif
28 28 - <span id="gists_count">0</span>
29 29 </%def>
30 30
31 31 <%def name="menu_bar_nav()">
32 32 ${self.menu_items(active='gists')}
33 33 </%def>
34 34
35 35
36 36
37 37 <%def name="main()">
38 38 <div class="box">
39 39 <div class="title">
40 40 ${self.breadcrumbs(class_="breadcrumbs block-left")}
41 41 %if c.rhodecode_user.username != h.DEFAULT_USER:
42 42 <ul class="links block-right">
43 43 <li>
44 44 <a href="${h.url('new_gist')}" class="btn btn-primary">${_(u'Create New Gist')}</a>
45 45 </li>
46 46 </ul>
47 47 %endif
48 48 </div>
49 49
50 50
51 51 <div class="sidebar-col-wrapper scw-small">
52 52 ##main
53 53 <div class="sidebar">
54 54 <ul class="nav nav-pills nav-stacked">
55 55 % if h.HasPermissionAll('hg.admin')('access admin gists page'):
56 56 <li class="${'active' if c.active=='all' else ''}"><a href="${h.url('gists', all=1)}">${_('All gists')}</a></li>
57 57 %endif
58 58 <li class="${'active' if c.active=='public' else ''}"><a href="${h.url('gists')}">${_('All public')}</a></li>
59 59 %if c.rhodecode_user.username != h.DEFAULT_USER:
60 60 <li class="${'active' if c.active=='my_all' else ''}"><a href="${h.url('gists', public=1, private=1)}">${_('My gists')}</a></li>
61 61 <li class="${'active' if c.active=='my_private' else ''}"><a href="${h.url('gists', private=1)}">${_('My private')}</a></li>
62 62 <li class="${'active' if c.active=='my_public' else ''}"><a href="${h.url('gists', public=1)}">${_('My public')}</a></li>
63 63 %endif
64 64 </ul>
65 65 </div>
66 66
67 67 <div class="main-content">
68 68 <div id="repos_list_wrap">
69 69 <table id="gist_list_table" class="display"></table>
70 70 </div>
71 71 </div>
72 72 </div>
73 73 </div>
74 74 <script>
75 75 $(document).ready(function() {
76 76
77 77 var get_datatable_count = function(){
78 78 var api = $('#gist_list_table').dataTable().api();
79 79 $('#gists_count').text(api.page.info().recordsDisplay);
80 80 };
81 81
82 82
83 83 // custom filter that filters by access_id, description or author
84 84 $.fn.dataTable.ext.search.push(
85 85 function( settings, data, dataIndex ) {
86 86 var query = $('#q_filter').val();
87 87 var author = data[0].strip();
88 88 var access_id = data[2].strip();
89 89 var description = data[3].strip();
90 90
91 91 var query_str = (access_id + " " + author + " " + description).toLowerCase();
92 92
93 93 if(query_str.indexOf(query.toLowerCase()) !== -1){
94 94 return true;
95 95 }
96 96 return false;
97 97 }
98 98 );
99 99
100 100 // gists list
101 101 $('#gist_list_table').DataTable({
102 102 data: ${c.data|n},
103 103 dom: 'rtp',
104 104 pageLength: ${c.visual.dashboard_items},
105 105 order: [[ 4, "desc" ]],
106 106 columns: [
107 107 { data: {"_": "author",
108 108 "sort": "author_raw"}, title: "${_("Author")}", width: "250px", className: "td-user" },
109 109 { data: {"_": "type",
110 110 "sort": "type"}, title: "${_("Type")}", width: "70px", className: "td-tags" },
111 111 { data: {"_": "access_id",
112 112 "sort": "access_id"}, title: "${_("Name")}", width:"150px", className: "td-componentname" },
113 113 { data: {"_": "description",
114 114 "sort": "description"}, title: "${_("Description")}", width: "250px", className: "td-description" },
115 115 { data: {"_": "created_on",
116 116 "sort": "created_on_raw"}, title: "${_("Created on")}", className: "td-time" },
117 117 { data: {"_": "expires",
118 118 "sort": "expires"}, title: "${_("Expires")}", className: "td-exp" }
119 119 ],
120 120 language: {
121 121 paginate: DEFAULT_GRID_PAGINATION
122 122 },
123 123 "initComplete": function( settings, json ) {
124 124 timeagoActivate();
125 tooltip_activate();
126 125 get_datatable_count();
127 126 }
128 127 });
129 128
130 129 // update the counter when things change
131 130 $('#gist_list_table').on('draw.dt', function() {
132 131 timeagoActivate();
133 tooltip_activate();
134 132 get_datatable_count();
135 133 });
136 134
137 135 // filter, filter both grids
138 136 $('#q_filter').on( 'keyup', function () {
139 137 var repo_api = $('#gist_list_table').dataTable().api();
140 138 repo_api
141 139 .draw();
142 140 });
143 141
144 142 // refilter table if page load via back button
145 143 $("#q_filter").trigger('keyup');
146 144
147 145 });
148 146
149 147 </script>
150 148 </%def>
151 149
@@ -1,68 +1,67 b''
1 1 <div class="panel panel-default">
2 2 <div class="panel-heading">
3 3 <h3 class="panel-title">${_('Repositories You Own')}</h3>
4 4 </div>
5 5
6 6 <div class="panel-body">
7 7 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
8 8
9 9 <div id="repos_list_wrap">
10 10 <table id="repo_list_table" class="display"></table>
11 11 </div>
12 12 </div>
13 13 </div>
14 14
15 15 <script>
16 16 $(document).ready(function() {
17 17
18 18 var get_datatable_count = function(){
19 19 var api = $('#repo_list_table').dataTable().api();
20 20 $('#repo_count').text(api.page.info().recordsDisplay);
21 21 };
22 22
23 23 // repo list
24 24 $('#repo_list_table').DataTable({
25 25 data: ${c.data|n},
26 26 dom: 'rtp',
27 27 pageLength: ${c.visual.admin_grid_items},
28 28 order: [[ 0, "asc" ]],
29 29 columns: [
30 30 { data: {"_": "name",
31 31 "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" },
32 32 { data: 'menu', className: "quick_repo_menu" },
33 33 { data: {"_": "last_changeset",
34 34 "sort": "last_changeset_raw",
35 35 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
36 36 { data: {"_": "action",
37 37 "sort": "action"}, title: "${_('Action')}", className: "td-action" }
38 38 ],
39 39 language: {
40 40 paginate: DEFAULT_GRID_PAGINATION
41 41 },
42 42 "initComplete": function( settings, json ) {
43 43 get_datatable_count();
44 tooltip_activate();
45 44 quick_repo_menu();
46 45 }
47 46 });
48 47
49 48 // update the counter when doing search
50 49 $('#repo_list_table').on( 'search.dt', function (e,settings) {
51 50 get_datatable_count();
52 51 });
53 52
54 53 // filter, filter both grids
55 54 $('#q_filter').on( 'keyup', function () {
56 55 var repo_api = $('#repo_list_table').dataTable().api();
57 56 repo_api
58 57 .columns(0)
59 58 .search(this.value)
60 59 .draw();
61 60 });
62 61
63 62 // refilter table if page load via back button
64 63 $("#q_filter").trigger('keyup');
65 64
66 65 });
67 66
68 67 </script>
@@ -1,66 +1,65 b''
1 1 <div class="panel panel-default">
2 2 <div class="panel-heading">
3 3 <h3 class="panel-title">${_('Your Watched Repositories')}</h3>
4 4 </div>
5 5
6 6 <div class="panel-body">
7 7 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
8 8
9 9 <div id="repos_list_wrap">
10 10 <table id="repo_list_table" class="display"></table>
11 11 </div>
12 12 </div>
13 13 </div>
14 14
15 15 <script>
16 16 $(document).ready(function() {
17 17
18 18 var get_datatable_count = function(){
19 19 var api = $('#repo_list_table').dataTable().api();
20 20 $('#repo_count').text(api.page.info().recordsDisplay);
21 21 };
22 22
23 23 // repo list
24 24 $('#repo_list_table').DataTable({
25 25 data: ${c.data|n},
26 26 dom: 'rtp',
27 27 pageLength: ${c.visual.admin_grid_items},
28 28 order: [[ 0, "asc" ]],
29 29 columns: [
30 30 { data: {"_": "name",
31 31 "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" },
32 32 { data: 'menu', className: "quick_repo_menu" },
33 33 { data: {"_": "last_changeset",
34 34 "sort": "last_changeset_raw",
35 35 "type": Number}, title: "${_('Commit')}", className: "td-hash" }
36 36 ],
37 37 language: {
38 38 paginate: DEFAULT_GRID_PAGINATION
39 39 },
40 40 "initComplete": function( settings, json ) {
41 41 get_datatable_count();
42 tooltip_activate();
43 42 quick_repo_menu();
44 43 }
45 44 });
46 45
47 46 // update the counter when doing search
48 47 $('#repo_list_table').on( 'search.dt', function (e,settings) {
49 48 get_datatable_count();
50 49 });
51 50
52 51 // filter, filter both grids
53 52 $('#q_filter').on( 'keyup', function () {
54 53 var repo_api = $('#repo_list_table').dataTable().api();
55 54 repo_api
56 55 .columns(0)
57 56 .search(this.value)
58 57 .draw();
59 58 });
60 59
61 60 // refilter table if page load via back button
62 61 $("#q_filter").trigger('keyup');
63 62
64 63 });
65 64
66 65 </script>
@@ -1,94 +1,93 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 ${_('Repository groups administration')}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
13 13 ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; <span id="repo_group_count">0</span> ${_('repository groups')}
14 14 </%def>
15 15
16 16 <%def name="menu_bar_nav()">
17 17 ${self.menu_items(active='admin')}
18 18 </%def>
19 19
20 20 <%def name="main()">
21 21 <div class="box">
22 22 <div class="title">
23 23 ${self.breadcrumbs()}
24 24 <ul class="links">
25 25 %if h.HasPermissionAny('hg.admin','hg.repogroup.create.true')():
26 26 <li>
27 27 <a href="${h.url('new_repo_group')}" class="btn btn-small btn-success">${_(u'Add Repository Group')}</a>
28 28 </li>
29 29 %endif
30 30 </ul>
31 31 </div>
32 32 <div id="repos_list_wrap">
33 33 <table id="group_list_table" class="display"></table>
34 34 </div>
35 35 </div>
36 36
37 37 <script>
38 38 $(document).ready(function() {
39 39
40 40 var get_datatable_count = function(){
41 41 var api = $('#group_list_table').dataTable().api();
42 42 $('#repo_group_count').text(api.page.info().recordsDisplay);
43 43 };
44 44
45 45 // repo group list
46 46 $('#group_list_table').DataTable({
47 47 data: ${c.data|n},
48 48 dom: 'rtp',
49 49 pageLength: ${c.visual.admin_grid_items},
50 50 order: [[ 0, "asc" ]],
51 51 columns: [
52 52 { data: {"_": "name",
53 53 "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" },
54 54 { data: 'menu', "bSortable": false, className: "quick_repo_menu" },
55 55 { data: {"_": "desc",
56 56 "sort": "desc"}, title: "${_('Description')}", className: "td-description" },
57 57 { data: {"_": "top_level_repos",
58 58 "sort": "top_level_repos"}, title: "${_('Number of top level repositories')}" },
59 59 { data: {"_": "owner",
60 60 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" },
61 61 { data: {"_": "action",
62 62 "sort": "action"}, title: "${_('Action')}", className: "td-action" }
63 63 ],
64 64 language: {
65 65 paginate: DEFAULT_GRID_PAGINATION
66 66 },
67 67 "initComplete": function( settings, json ) {
68 68 get_datatable_count();
69 tooltip_activate();
70 69 quick_repo_menu();
71 70 }
72 71 });
73 72
74 73 // update the counter when doing search
75 74 $('#group_list_table').on( 'search.dt', function (e,settings) {
76 75 get_datatable_count();
77 76 });
78 77
79 78 // filter, filter both grids
80 79 $('#q_filter').on( 'keyup', function () {
81 80
82 81 var repo_group_api = $('#group_list_table').dataTable().api();
83 82 repo_group_api
84 83 .columns(0)
85 84 .search(this.value)
86 85 .draw();
87 86 });
88 87
89 88 // refilter table if page load via back button
90 89 $("#q_filter").trigger('keyup');
91 90 });
92 91 </script>
93 92 </%def>
94 93
@@ -1,101 +1,100 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 ${_('Repositories administration')}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
13 13 ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; <span id="repo_count">0</span> ${_('repositories')}
14 14 </%def>
15 15
16 16 <%def name="menu_bar_nav()">
17 17 ${self.menu_items(active='admin')}
18 18 </%def>
19 19
20 20 <%def name="main()">
21 21 <div class="box">
22 22 <div class="title">
23 23 ${self.breadcrumbs()}
24 24 <ul class="links">
25 25 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
26 26 <li>
27 27 <a href="${h.url('new_repo')}" class="btn btn-small btn-success">${_(u'Add Repository')}</a>
28 28 </li>
29 29 %endif
30 30 </ul>
31 31 </div>
32 32 <div id="repos_list_wrap">
33 33 <table id="repo_list_table" class="display"></table>
34 34 </div>
35 35 </div>
36 36
37 37 <script>
38 38 $(document).ready(function() {
39 39
40 40 var get_datatable_count = function(){
41 41 var api = $('#repo_list_table').dataTable().api();
42 42 $('#repo_count').text(api.page.info().recordsDisplay);
43 43 };
44 44
45 45
46 46 // repo list
47 47 $('#repo_list_table').DataTable({
48 48 data: ${c.data|n},
49 49 dom: 'rtp',
50 50 pageLength: ${c.visual.admin_grid_items},
51 51 order: [[ 0, "asc" ]],
52 52 columns: [
53 53 { data: {"_": "name",
54 54 "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" },
55 55 { data: 'menu', "bSortable": false, className: "quick_repo_menu" },
56 56 { data: {"_": "desc",
57 57 "sort": "desc"}, title: "${_('Description')}", className: "td-description" },
58 58 { data: {"_": "last_change",
59 59 "sort": "last_change_raw",
60 60 "type": Number}, title: "${_('Last Change')}", className: "td-time" },
61 61 { data: {"_": "last_changeset",
62 62 "sort": "last_changeset_raw",
63 63 "type": Number}, title: "${_('Commit')}", className: "td-commit" },
64 64 { data: {"_": "owner",
65 65 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" },
66 66 { data: {"_": "state",
67 67 "sort": "state"}, title: "${_('State')}", className: "td-tags td-state" },
68 68 { data: {"_": "action",
69 69 "sort": "action"}, title: "${_('Action')}", className: "td-action" }
70 70 ],
71 71 language: {
72 72 paginate: DEFAULT_GRID_PAGINATION
73 73 },
74 74 "initComplete": function( settings, json ) {
75 75 get_datatable_count();
76 tooltip_activate();
77 76 quick_repo_menu();
78 77 }
79 78 });
80 79
81 80 // update the counter when doing search
82 81 $('#repo_list_table').on( 'search.dt', function (e,settings) {
83 82 get_datatable_count();
84 83 });
85 84
86 85 // filter, filter both grids
87 86 $('#q_filter').on( 'keyup', function () {
88 87 var repo_api = $('#repo_list_table').dataTable().api();
89 88 repo_api
90 89 .columns(0)
91 90 .search(this.value)
92 91 .draw();
93 92 });
94 93
95 94 // refilter table if page load via back button
96 95 $("#q_filter").trigger('keyup');
97 96 });
98 97
99 98 </script>
100 99
101 100 </%def>
@@ -1,98 +1,97 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 ${_('User groups administration')}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
13 13 ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; <span id="user_group_count">0</span> ${_('user groups')}
14 14 </%def>
15 15
16 16 <%def name="menu_bar_nav()">
17 17 ${self.menu_items(active='admin')}
18 18 </%def>
19 19
20 20 <%def name="main()">
21 21 <div class="box">
22 22
23 23 <div class="title">
24 24 ${self.breadcrumbs()}
25 25 <ul class="links">
26 26 %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')():
27 27 <li>
28 28 <a href="${h.url('new_users_group')}" class="btn btn-small btn-success">${_(u'Add User Group')}</a>
29 29 </li>
30 30 %endif
31 31 </ul>
32 32 </div>
33 33
34 34 <div id="repos_list_wrap">
35 35 <table id="user_group_list_table" class="display"></table>
36 36 </div>
37 37
38 38 </div>
39 39 <script>
40 40 $(document).ready(function() {
41 41
42 42 var get_datatable_count = function(){
43 43 var api = $('#user_group_list_table').dataTable().api();
44 44 $('#user_group_count').text(api.page.info().recordsDisplay);
45 45 };
46 46
47 47 // user list
48 48 $('#user_group_list_table').DataTable({
49 49 data: ${c.data|n},
50 50 dom: 'rtp',
51 51 pageLength: ${c.visual.admin_grid_items},
52 52 order: [[ 0, "asc" ]],
53 53 columns: [
54 54 { data: {"_": "group_name",
55 55 "sort": "group_name_raw"}, title: "${_('Name')}", className: "td-componentname" },
56 56 { data: {"_": "desc",
57 57 "sort": "desc"}, title: "${_('Description')}", className: "td-description" },
58 58 { data: {"_": "members",
59 59 "sort": "members",
60 60 "type": Number}, title: "${_('Members')}", className: "td-number" },
61 61 { data: {"_": "active",
62 62 "sort": "active"}, title: "${_('Active')}", className: "td-active", className: "td-number"},
63 63 { data: {"_": "owner",
64 64 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" },
65 65 { data: {"_": "action",
66 66 "sort": "action"}, title: "${_('Action')}", className: "td-action" }
67 67 ],
68 68 language: {
69 69 paginate: DEFAULT_GRID_PAGINATION
70 70 },
71 71 "initComplete": function( settings, json ) {
72 72 get_datatable_count();
73 tooltip_activate();
74 73 }
75 74 });
76 75
77 76 // update the counter when doing search
78 77 $('#user_group_list_table').on( 'search.dt', function (e,settings) {
79 78 get_datatable_count();
80 79 });
81 80
82 81 // filter, filter both grids
83 82 $('#q_filter').on( 'keyup', function () {
84 83 var user_api = $('#user_group_list_table').dataTable().api();
85 84 user_api
86 85 .columns(0)
87 86 .search(this.value)
88 87 .draw();
89 88 });
90 89
91 90 // refilter table if page load via back button
92 91 $("#q_filter").trigger('keyup');
93 92
94 93 });
95 94
96 95 </script>
97 96
98 97 </%def>
@@ -1,141 +1,140 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 ${_('Users administration')}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
13 13 ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; <span id="user_count">0</span>
14 14 </%def>
15 15
16 16 <%def name="menu_bar_nav()">
17 17 ${self.menu_items(active='admin')}
18 18 </%def>
19 19
20 20 <%def name="main()">
21 21 <div class="box">
22 22
23 23 <div class="title">
24 24 ${self.breadcrumbs()}
25 25 <ul class="links">
26 26 <li>
27 27 <a href="${h.url('new_user')}" class="btn btn-small btn-success">${_(u'Add User')}</a>
28 28 </li>
29 29 </ul>
30 30 </div>
31 31
32 32 <div id="repos_list_wrap">
33 33 <table id="user_list_table" class="display"></table>
34 34 </div>
35 35 </div>
36 36
37 37 <script>
38 38 $(document).ready(function() {
39 39
40 40 var get_datatable_count = function(){
41 41 var datatable = $('#user_list_table').dataTable();
42 42 var api = datatable.api();
43 43 var total = api.page.info().recordsDisplay;
44 44 var active = datatable.fnGetFilteredData();
45 45 var _text = _gettext("{0} active out of {1} users").format(active, total);
46 46 $('#user_count').text(_text);
47 47 };
48 48
49 49 // custom filter that filters by username OR email
50 50 $.fn.dataTable.ext.search.push(
51 51 function( settings, data, dataIndex ) {
52 52 var query = $('#q_filter').val();
53 53 var username = data[1];
54 54 var email = data[2];
55 55 var first_name = data[3];
56 56 var last_name = data[4];
57 57
58 58 var query_str = username + " " +
59 59 email + " " +
60 60 first_name + " " +
61 61 last_name;
62 62 if((query_str).indexOf(query) !== -1){
63 63 return true;
64 64 }
65 65 return false;
66 66 }
67 67 );
68 68 // filtered data plugin
69 69 $.fn.dataTableExt.oApi.fnGetFilteredData = function ( oSettings ) {
70 70 var res = [];
71 71 for ( var i=0, iLen=oSettings.fnRecordsDisplay() ; i<iLen ; i++ ) {
72 72 var record = oSettings.aoData[i]._aData;
73 73 if(record['active_raw']){
74 74 res.push(record);
75 75 }
76 76 }
77 77 return res.length;
78 78 };
79 79
80 80 // user list
81 81 $('#user_list_table').DataTable({
82 82 data: ${c.data|n},
83 83 dom: 'rtp',
84 84 pageLength: ${c.visual.admin_grid_items},
85 85 order: [[ 1, "asc" ]],
86 86 columns: [
87 87 { data: {"_": "gravatar"}, className: "td-gravatar" },
88 88 { data: {"_": "username",
89 89 "sort": "username_raw"}, title: "${_('Username')}", className: "td-user" },
90 90 { data: {"_": "email",
91 91 "sort": "email"}, title: "${_('Email')}", className: "td-email" },
92 92 { data: {"_": "first_name",
93 93 "sort": "first_name"}, title: "${_('First Name')}", className: "td-user" },
94 94 { data: {"_": "last_name",
95 95 "sort": "last_name"}, title: "${_('Last Name')}", className: "td-user" },
96 96 { data: {"_": "last_login",
97 97 "sort": "last_login_raw",
98 98 "type": Number}, title: "${_('Last login')}", className: "td-time" },
99 99 { data: {"_": "active",
100 100 "sort": "active_raw"}, title: "${_('Active')}", className: "td-active" },
101 101 { data: {"_": "admin",
102 102 "sort": "admin_raw"}, title: "${_('Admin')}", className: "td-admin" },
103 103 { data: {"_": "extern_type",
104 104 "sort": "extern_type"}, title: "${_('Authentication type')}", className: "td-type" },
105 105 { data: {"_": "action",
106 106 "sort": "action"}, title: "${_('Action')}", className: "td-action" }
107 107 ],
108 108 language: {
109 109 paginate: DEFAULT_GRID_PAGINATION
110 110 },
111 111 "initComplete": function( settings, json ) {
112 112 get_datatable_count();
113 tooltip_activate();
114 113 },
115 114 "createdRow": function ( row, data, index ) {
116 115 if (!data['active_raw']){
117 116 $(row).addClass('closed')
118 117 }
119 118 }
120 119 });
121 120
122 121 // update the counter when doing search
123 122 $('#user_list_table').on( 'search.dt', function (e,settings) {
124 123 get_datatable_count();
125 124 });
126 125
127 126 // filter, filter both grids
128 127 $('#q_filter').on( 'keyup', function () {
129 128 var user_api = $('#user_list_table').dataTable().api();
130 129 user_api
131 130 .draw();
132 131 });
133 132
134 133 // refilter table if page load via back button
135 134 $("#q_filter").trigger('keyup');
136 135
137 136 });
138 137
139 138 </script>
140 139
141 140 </%def>
@@ -1,172 +1,170 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <!DOCTYPE html>
3 3
4 4 <%def name="get_template_context()" filter="n, trim">{
5 5
6 6 ## repo data
7 7 repo_name: "${getattr(c, 'repo_name', '')}",
8 8 % if hasattr(c, 'rhodecode_db_repo'):
9 9 repo_type: "${c.rhodecode_db_repo.repo_type}",
10 10 repo_landing_commit: "${c.rhodecode_db_repo.landing_rev[1]}",
11 11 % else:
12 12 repo_type: null,
13 13 repo_landing_commit: null,
14 14 % endif
15 15
16 16 ## user data
17 17 % if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id:
18 18 rhodecode_user: {
19 19 username: "${c.rhodecode_user.username}",
20 20 email: "${c.rhodecode_user.email}",
21 21 },
22 22 % else:
23 23 rhodecode_user: {
24 24 username: null,
25 25 email: null,
26 26 },
27 27 % endif
28 28
29 29 ## visual settings
30 30 visual: {
31 31 default_renderer: "${h.get_visual_attr(c, 'default_renderer')}"
32 32 },
33 33
34 34 ## current commit context, filled inside templates that expose that
35 35 commit_data: {
36 36 commit_id: null,
37 37 },
38 38
39 39 ## current pr context, filled inside templates that expose that
40 40 pull_request_data: {
41 41 pull_request_id: null,
42 42 },
43 43
44 44 ## timeago settings, can be overwritten by custom user settings later
45 45 timeago: {
46 46 refresh_time: ${120 * 1000},
47 47 cutoff_limit: ${1000*60*60*24*7}
48 48 }
49 49 }
50 50
51 51 </%def>
52 52
53 53 <html xmlns="http://www.w3.org/1999/xhtml">
54 54 <head>
55 55 <title>${self.title()}</title>
56 56 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
57 57 <%def name="robots()">
58 58 <meta name="robots" content="index, nofollow"/>
59 59 </%def>
60 60 ${self.robots()}
61 61 <link rel="icon" href="${h.url('/images/favicon.ico', ver=c.rhodecode_version_hash)}" sizes="16x16 32x32" type="image/png" />
62 62
63 63 ## CSS definitions
64 64 <%def name="css()">
65 65 <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css', ver=c.rhodecode_version_hash)}" media="screen"/>
66 66 <!--[if lt IE 9]>
67 67 <link rel="stylesheet" type="text/css" href="${h.url('/css/ie.css', ver=c.rhodecode_version_hash)}" media="screen"/>
68 68 <![endif]-->
69 69 ## EXTRA FOR CSS
70 70 ${self.css_extra()}
71 71 </%def>
72 72 ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites
73 73 <%def name="css_extra()">
74 74 </%def>
75 75
76 76 ${self.css()}
77 77
78 78 ## JAVASCRIPT
79 79 <%def name="js()">
80 80 <script src="${h.url('/js/rhodecode/i18n/%s.js' % c.language, ver=c.rhodecode_version_hash)}"></script>
81 81 <script type="text/javascript">
82 82 // register templateContext to pass template variables to JS
83 83 var templateContext = ${get_template_context()};
84 84
85 85 var REPO_NAME = "${getattr(c, 'repo_name', '')}";
86 86 %if hasattr(c, 'rhodecode_db_repo'):
87 87 var REPO_LANDING_REV = '${c.rhodecode_db_repo.landing_rev[1]}';
88 88 var REPO_TYPE = '${c.rhodecode_db_repo.repo_type}';
89 89 %else:
90 90 var REPO_LANDING_REV = '';
91 91 var REPO_TYPE = '';
92 92 %endif
93 93 var APPLICATION_URL = "${h.url('home').rstrip('/')}";
94 94 var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}";
95 95 var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}";
96 96 % if getattr(c, 'rhodecode_user', None):
97 97 var USER = {name:'${c.rhodecode_user.username}'};
98 98 % else:
99 99 var USER = {name:null};
100 100 % endif
101 101
102 102 var APPENLIGHT = {
103 103 enabled: ${'true' if getattr(c, 'appenlight_enabled', False) else 'false'},
104 104 key: '${getattr(c, "appenlight_api_public_key", "")}',
105 105 serverUrl: '${getattr(c, "appenlight_server_url", "")}',
106 106 requestInfo: {
107 107 % if getattr(c, 'rhodecode_user', None):
108 108 ip: '${c.rhodecode_user.ip_addr}',
109 109 username: '${c.rhodecode_user.username}'
110 110 % endif
111 111 }
112 112 };
113 113 </script>
114 114
115 115 <!--[if lt IE 9]>
116 116 <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script>
117 117 <![endif]-->
118 118 <script language="javascript" type="text/javascript" src="${h.url('/js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
119 119 <script language="javascript" type="text/javascript" src="${h.url('/js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
120 120 <script>CodeMirror.modeURL = "${h.url('/js/mode/%N/%N.js')}";</script>
121 121
122 122 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
123 123 ${self.js_extra()}
124 124
125 125 <script type="text/javascript">
126 126 $(document).ready(function(){
127 tooltip_activate();
128 127 show_more_event();
129 show_changeset_tooltip();
130 128 timeagoActivate();
131 129 })
132 130 </script>
133 131
134 132 </%def>
135 133
136 134 ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates
137 135 <%def name="js_extra()"></%def>
138 136 ${self.js()}
139 137
140 138 <%def name="head_extra()"></%def>
141 139 ${self.head_extra()}
142 140
143 141 <%include file="/base/plugins_base.html"/>
144 142
145 143 ## extra stuff
146 144 %if c.pre_code:
147 145 ${c.pre_code|n}
148 146 %endif
149 147 </head>
150 148 <body id="body">
151 149 <noscript>
152 150 <div class="noscript-error">
153 151 ${_('Please enable JavaScript to use RhodeCode Enterprise')}
154 152 </div>
155 153 </noscript>
156 154 ## IE hacks
157 155 <!--[if IE 7]>
158 156 <script>$(document.body).addClass('ie7')</script>
159 157 <![endif]-->
160 158 <!--[if IE 8]>
161 159 <script>$(document.body).addClass('ie8')</script>
162 160 <![endif]-->
163 161 <!--[if IE 9]>
164 162 <script>$(document.body).addClass('ie9')</script>
165 163 <![endif]-->
166 164
167 165 ${next.body()}
168 166 %if c.post_code:
169 167 ${c.post_code|n}
170 168 %endif
171 169 </body>
172 170 </html>
@@ -1,103 +1,101 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 ${_('%s Bookmarks') % c.repo_name}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
13 13 <span id="obj_count">0</span> ${_('bookmarks')}
14 14 </%def>
15 15
16 16 <%def name="menu_bar_nav()">
17 17 ${self.menu_items(active='repositories')}
18 18 </%def>
19 19
20 20 <%def name="menu_bar_subnav()">
21 21 ${self.repo_menu(active='summary')}
22 22 </%def>
23 23
24 24 <%def name="main()">
25 25 <div class="box">
26 26 <div class="title">
27 27 ${self.repo_page_title(c.rhodecode_db_repo)}
28 28 %if c.has_references:
29 29 <ul class="links">
30 30 <li>
31 31 <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Bookmarks')}">
32 32 </li>
33 33 </ul>
34 34 %endif
35 35 %if c.has_references:
36 36 ${self.breadcrumbs()}
37 37 %endif
38 38 </div>
39 39 <table id="obj_list_table" class="display"></table>
40 40 </div>
41 41
42 42
43 43 <script type="text/javascript">
44 44 $(document).ready(function() {
45 45
46 46 var get_datatable_count = function(){
47 47 var api = $('#obj_list_table').dataTable().api();
48 48 $('#obj_count').text(api.page.info().recordsDisplay);
49 49 };
50 50
51 51 // object list
52 52 $('#obj_list_table').DataTable({
53 53 data: ${c.data|n},
54 54 dom: 'rtp',
55 55 pageLength: ${c.visual.dashboard_items},
56 56 order: [[ 0, "asc" ]],
57 57 columns: [
58 58 { data: {"_": "name",
59 59 "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" },
60 60 { data: {"_": "date",
61 61 "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" },
62 62 { data: {"_": "author",
63 63 "sort": "author"}, title: "${_('Author')}", className: "td-user" },
64 64 { data: {"_": "commit",
65 65 "sort": "commit_raw",
66 66 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
67 67 { data: {"_": "compare",
68 68 "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" }
69 69 ],
70 70 language: {
71 71 paginate: DEFAULT_GRID_PAGINATION
72 72 },
73 73 "initComplete": function(settings, json) {
74 74 get_datatable_count();
75 tooltip_activate();
76 75 timeagoActivate();
77 76 compare_radio_buttons("${c.repo_name}", 'book');
78 77 }
79 78 });
80 79
81 80 // update when things change
82 81 $('#obj_list_table').on('draw.dt', function() {
83 82 get_datatable_count();
84 tooltip_activate();
85 83 timeagoActivate();
86 84 });
87 85
88 86 // filter, filter both grids
89 87 $('#q_filter').on('keyup', function() {
90 88 var obj_api = $('#obj_list_table').dataTable().api();
91 89 obj_api
92 90 .columns(0)
93 91 .search(this.value)
94 92 .draw();
95 93 });
96 94
97 95 // refilter table if page load via back button
98 96 $("#q_filter").trigger('keyup');
99 97
100 98 });
101 99
102 100 </script>
103 101 </%def>
@@ -1,102 +1,100 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 ${_('%s Branches') % c.repo_name}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
13 13 <span id="obj_count">0</span> ${_('branches')}
14 14 </%def>
15 15
16 16 <%def name="menu_bar_nav()">
17 17 ${self.menu_items(active='repositories')}
18 18 </%def>
19 19
20 20 <%def name="menu_bar_subnav()">
21 21 ${self.repo_menu(active='summary')}
22 22 </%def>
23 23
24 24 <%def name="main()">
25 25 <div class="box">
26 26 <div class="title">
27 27 ${self.repo_page_title(c.rhodecode_db_repo)}
28 28 %if c.has_references:
29 29 <ul class="links">
30 30 <li>
31 31 <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Branches')}"/>
32 32 </li>
33 33 </ul>
34 34 %endif
35 35 %if c.has_references:
36 36 ${self.breadcrumbs()}
37 37 %endif
38 38 </div>
39 39 <table id="obj_list_table" class="display"></table>
40 40 </div>
41 41
42 42 <script type="text/javascript">
43 43 $(document).ready(function() {
44 44
45 45 var get_datatable_count = function(){
46 46 var api = $('#obj_list_table').dataTable().api();
47 47 $('#obj_count').text(api.page.info().recordsDisplay);
48 48 };
49 49
50 50 // object list
51 51 $('#obj_list_table').DataTable({
52 52 data: ${c.data|n},
53 53 dom: 'rtp',
54 54 pageLength: ${c.visual.dashboard_items},
55 55 order: [[ 0, "asc" ]],
56 56 columns: [
57 57 { data: {"_": "name",
58 58 "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" },
59 59 { data: {"_": "date",
60 60 "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" },
61 61 { data: {"_": "author",
62 62 "sort": "author"}, title: "${_('Author')}", className: "td-user" },
63 63 { data: {"_": "commit",
64 64 "sort": "commit_raw",
65 65 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
66 66 { data: {"_": "compare",
67 67 "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" }
68 68 ],
69 69 language: {
70 70 paginate: DEFAULT_GRID_PAGINATION
71 71 },
72 72 "initComplete": function( settings, json ) {
73 73 get_datatable_count();
74 tooltip_activate();
75 74 timeagoActivate();
76 75 compare_radio_buttons("${c.repo_name}", 'branch');
77 76 }
78 77 });
79 78
80 79 // update when things change
81 80 $('#obj_list_table').on('draw.dt', function() {
82 81 get_datatable_count();
83 tooltip_activate();
84 82 timeagoActivate();
85 83 });
86 84
87 85 // filter, filter both grids
88 86 $('#q_filter').on( 'keyup', function () {
89 87 var obj_api = $('#obj_list_table').dataTable().api();
90 88 obj_api
91 89 .columns(0)
92 90 .search(this.value)
93 91 .draw();
94 92 });
95 93
96 94 // refilter table if page load via back button
97 95 $("#q_filter").trigger('keyup');
98 96
99 97 });
100 98
101 99 </script>
102 100 </%def>
@@ -1,127 +1,127 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.html"/>
3 3 %if c.repo_commits:
4 4 <table class="rctable repo_summary table_disp">
5 5 <tr>
6 6 <th>${_('Commit')}</th>
7 7 <th class="status" colspan="2"></th>
8 8 <th>${_('Commit message')}</th>
9 9 <th>${_('Age')}</th>
10 10 <th>${_('Author')}</th>
11 11 <th>${_('Refs')}</th>
12 12 </tr>
13 13 %for cnt,cs in enumerate(c.repo_commits):
14 14 <tr class="parity${cnt%2}">
15 15 <td class="td-commit">
16 16 <pre><a href="${h.url('changeset_home', repo_name=c.repo_name, revision=cs.raw_id)}">${h.show_id(cs)}</a></pre>
17 17 </td>
18 18 <td class="td-status">
19 19 %if c.statuses.get(cs.raw_id):
20 20 <div class="changeset-status-ico shortlog">
21 21 %if c.statuses.get(cs.raw_id)[2]:
22 22 <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (c.statuses.get(cs.raw_id)[0], c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
23 23 <div class="${'flag_status %s' % c.statuses.get(cs.raw_id)[0]}"></div>
24 24 </a>
25 25 %else:
26 26 <div class="${'flag_status %s' % c.statuses.get(cs.raw_id)[0]}"></div>
27 27 %endif
28 28 </div>
29 29 %endif
30 30 </td>
31 31 <td class="td-comments">
32 32 %if c.comments.get(cs.raw_id,[]):
33 33 <a title="${_('Commit has comments')}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
34 34 <i class="icon-comment icon-comment-colored"></i> ${len(c.comments[cs.raw_id])}
35 35 </a>
36 36 %endif
37 37 </td>
38 38 <td class="td-message">
39 39 ${h.urlify_commit_message(h.truncate(cs.message, 50), c.repo_name)}
40 40 </td>
41 41 <td class="td-time">
42 42 ${h.age_component(cs.date)}
43 43 </td>
44 44
45 45 <td class="td-user author">
46 46 ${base.gravatar(h.email_or_none(cs.author), 16)}
47 47 <span title="${cs.author}" class="user">${h.link_to_user(cs.author, length=22)}</span>
48 48 </td>
49 49 <td class="td-tags truncate-wrap">
50 50 <div class="truncate tags-truncate"><div class="autoexpand">
51 51 %if h.is_hg(c.rhodecode_repo):
52 52 %for book in cs.bookmarks:
53 53 <span class="booktag tag" title="${_('Bookmark %s') % book}">
54 54 <a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
55 55 </span>
56 56 %endfor
57 57 %endif
58 58 ## tags
59 59 %for tag in cs.tags:
60 60 <span class="tagtag tag" title="${_('Tag %s') % tag}">
61 61 <a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
62 62 </span>
63 63 %endfor
64 64
65 65 ## branch
66 66 %if cs.branch:
67 67 <span class="branchtag tag" title="${_('Branch %s') % cs.branch}">
68 68 <a href="${h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch)}"><i class="icon-code-fork"></i>${h.shorter(cs.branch)}</a>
69 69 </span>
70 70 %endif
71 71 </div>
72 72 </td>
73 73 </tr>
74 74 %endfor
75 75
76 76 </table>
77 77
78 78 <script type="text/javascript">
79 79 $(document).pjax('#shortlog_data .pager_link','#shortlog_data', {timeout: 2000, scrollTo: false });
80 $(document).on('pjax:success', function(){ timeagoActivate(); tooltip_activate(); });
80 $(document).on('pjax:success', function(){ timeagoActivate(); });
81 81 </script>
82 82
83 83 <div class="pagination-wh pagination-left">
84 84 ${c.repo_commits.pager('$link_previous ~2~ $link_next')}
85 85 </div>
86 86 %else:
87 87
88 88 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
89 89 <div class="quick_start">
90 90 <div class="fieldset">
91 91 <div class="left-label">${_('Add or upload files directly via RhodeCode:')}</div>
92 92 <div class="right-content">
93 93 <div id="add_node_id" class="add_node">
94 94 <a href="${h.url('files_add_home',repo_name=c.repo_name,revision=0,f_path='', anchor='edit')}" class="btn btn-default">${_('Add New File')}</a>
95 95 </div>
96 96 </div>
97 97 %endif
98 98 </div>
99 99
100 100 %if not h.is_svn(c.rhodecode_repo):
101 101 <div class="fieldset">
102 102 <div class="left-label">${_('Push new repo:')}</div>
103 103 <div class="right-content">
104 104 <pre>
105 105 ${c.rhodecode_repo.alias} clone ${c.clone_repo_url}
106 106 ${c.rhodecode_repo.alias} add README # add first file
107 107 ${c.rhodecode_repo.alias} commit -m "Initial" # commit with message
108 108 ${c.rhodecode_repo.alias} push ${'origin master' if h.is_git(c.rhodecode_repo) else ''} # push changes back
109 109 </pre>
110 110 </div>
111 111 </div>
112 112 <div class="fieldset">
113 113 <div class="left-label">${_('Existing repository?')}</div>
114 114 <div class="right-content">
115 115 <pre>
116 116 %if h.is_git(c.rhodecode_repo):
117 117 git remote add origin ${c.clone_repo_url}
118 118 git push -u origin master
119 119 %else:
120 120 hg push ${c.clone_repo_url}
121 121 %endif
122 122 </pre>
123 123 </div>
124 124 </div>
125 125 %endif
126 126 </div>
127 127 %endif
@@ -1,336 +1,333 b''
1 1 <%inherit file="/base/base.html"/>
2 2
3 3 <%def name="title(*args)">
4 4 ${_('%s Files') % c.repo_name}
5 5 %if hasattr(c,'file'):
6 6 &middot; ${h.safe_unicode(c.file.path) or '\\'}
7 7 %endif
8 8
9 9 %if c.rhodecode_name:
10 10 &middot; ${h.branding(c.rhodecode_name)}
11 11 %endif
12 12 </%def>
13 13
14 14 <%def name="breadcrumbs_links()">
15 15 ${_('Files')}
16 16 %if c.file:
17 17 @ ${h.show_id(c.commit)}
18 18 %endif
19 19 </%def>
20 20
21 21 <%def name="menu_bar_nav()">
22 22 ${self.menu_items(active='repositories')}
23 23 </%def>
24 24
25 25 <%def name="menu_bar_subnav()">
26 26 ${self.repo_menu(active='files')}
27 27 </%def>
28 28
29 29 <%def name="main()">
30 30 <div class="title">
31 31 ${self.repo_page_title(c.rhodecode_db_repo)}
32 32 </div>
33 33
34 34 <div id="pjax-container" class="summary">
35 35 <div id="files_data">
36 36 <%include file='files_pjax.html'/>
37 37 </div>
38 38 </div>
39 39 <script>
40 40 var curState = {
41 41 commit_id: "${c.commit.raw_id}"
42 42 };
43 43
44 44 var getState = function(context) {
45 45 var url = $(location).attr('href');
46 46 var _base_url = '${h.url("files_home",repo_name=c.repo_name,revision='',f_path='')}';
47 47 var _annotate_url = '${h.url("files_annotate_home",repo_name=c.repo_name,revision='',f_path='')}';
48 48 _base_url = _base_url.replace('//', '/');
49 49 _annotate_url = _annotate_url.replace('//', '/');
50 50
51 51 //extract f_path from url.
52 52 var parts = url.split(_base_url);
53 53 if (parts.length != 2) {
54 54 parts = url.split(_annotate_url);
55 55 if (parts.length != 2) {
56 56 var rev = "tip";
57 57 var f_path = "";
58 58 } else {
59 59 var parts2 = parts[1].split('/');
60 60 var rev = parts2.shift(); // pop the first element which is the revision
61 61 var f_path = parts2.join('/');
62 62 }
63 63
64 64 } else {
65 65 var parts2 = parts[1].split('/');
66 66 var rev = parts2.shift(); // pop the first element which is the revision
67 67 var f_path = parts2.join('/');
68 68 }
69 69
70 70 var _node_list_url = pyroutes.url('files_nodelist_home',
71 71 {repo_name: templateContext.repo_name,
72 72 revision: rev, f_path: f_path});
73 73 var _url_base = pyroutes.url('files_home',
74 74 {repo_name: templateContext.repo_name,
75 75 revision: rev, f_path:'__FPATH__'});
76 76 return {
77 77 url: url,
78 78 f_path: f_path,
79 79 rev: rev,
80 80 commit_id: curState.commit_id,
81 81 node_list_url: _node_list_url,
82 82 url_base: _url_base
83 83 };
84 84 };
85 85
86 86 var metadataRequest = null;
87 87 var getFilesMetadata = function() {
88 88 if (metadataRequest && metadataRequest.readyState != 4) {
89 89 metadataRequest.abort();
90 90 }
91 91 if (source_page) {
92 92 return false;
93 93 }
94 94 var state = getState('metadata');
95 95 var url_data = {
96 96 'repo_name': templateContext.repo_name,
97 97 'revision': state.commit_id,
98 98 'f_path': state.f_path
99 99 };
100 100
101 101 var url = pyroutes.url('files_metadata_list_home', url_data);
102 102
103 103 metadataRequest = $.ajax({url: url});
104 104
105 105 metadataRequest.done(function(data) {
106 106 var data = data.metadata;
107 107 var dataLength = data.length;
108 108 for (var i = 0; i < dataLength; i++) {
109 109 var rowData = data[i];
110 110 var name = rowData.name.replace('\\', '\\\\');
111 111
112 112 $('td[title="size-' + name + '"]').html(rowData.size);
113 113 var timeComponent = AgeModule.createTimeComponent(
114 114 rowData.modified_ts, rowData.modified_at);
115 115 $('td[title="modified_at-' + name + '"]').html(timeComponent);
116 116
117 117 $('td[title="revision-' + name + '"]').html(
118 118 '<div class="tooltip" title="{0}"><pre>r{1}:{2}</pre></div>'.format(
119 119 data[i].message, data[i].revision, data[i].short_id));
120 120 $('td[title="author-' + name + '"]').html(
121 121 '<span title="{0}">{1}</span>'.format(
122 122 data[i].author, data[i].user_profile));
123 123 }
124 tooltip_activate();
125 124 timeagoActivate();
126 125 });
127 126 metadataRequest.fail(function (data, textStatus, errorThrown) {
128 127 console.log(data);
129 128 if (data.status != 0) {
130 129 alert("Error while fetching metadata.\nError code {0} ({1}).Please consider reloading the page".format(data.status,data.statusText));
131 130 }
132 131 });
133 132 };
134 133
135 134 var callbacks = function() {
136 135 var state = getState('callbacks');
137 tooltip_activate();
138 136 timeagoActivate();
139 137
140 138 // used for history, and switch to
141 139 var initialCommitData = {
142 140 id: null,
143 141 text: "${_("Switch To Commit")}",
144 142 type: 'sha',
145 143 raw_id: null,
146 144 files_url: null
147 145 };
148 146
149 147 if ($('#trimmed_message_box').height() < 50) {
150 148 $('#message_expand').hide();
151 149 }
152 150
153 151 $('#message_expand').on('click', function(e) {
154 152 $('#trimmed_message_box').css('max-height', 'none');
155 153 $(this).hide();
156 154 });
157 155
158 156
159 157 if (source_page) {
160 158 // variants for with source code, not tree view
161 159
162 160 if (location.href.indexOf('#') != -1) {
163 161 page_highlights = location.href.substring(location.href.indexOf('#') + 1).split('L');
164 162 if (page_highlights.length == 2) {
165 163 highlight_ranges = page_highlights[1].split(",");
166 164
167 165 var h_lines = [];
168 166 for (pos in highlight_ranges) {
169 167 var _range = highlight_ranges[pos].split('-');
170 168 if (_range.length == 2) {
171 169 var start = parseInt(_range[0]);
172 170 var end = parseInt(_range[1]);
173 171 if (start < end) {
174 172 for (var i = start; i <= end; i++) {
175 173 h_lines.push(i);
176 174 }
177 175 }
178 176 }
179 177 else {
180 178 h_lines.push(parseInt(highlight_ranges[pos]));
181 179 }
182 180 }
183 181
184 182 for (pos in h_lines) {
185 183 // @comment-highlight-color
186 184 $('#L' + h_lines[pos]).css('background-color', '#ffd887');
187 185 }
188 186
189 187 var _first_line = $('#L' + h_lines[0]).get(0);
190 188 if (_first_line) {
191 189 var line = $('#L' + h_lines[0]);
192 190 offsetScroll(line, 70);
193 191 }
194 192 }
195 193 }
196 194
197 195 // select code link event
198 196 $("#hlcode").mouseup(getSelectionLink);
199 197
200 198 // file history select2
201 199 select2FileHistorySwitcher('#diff1', initialCommitData, state);
202 200 $('#diff1').on('change', function(e) {
203 201 $('#diff').removeClass('disabled').removeAttr("disabled");
204 202 $('#show_rev').removeClass('disabled').removeAttr("disabled");
205 203 });
206 204
207 205 // show more authors
208 206 $('#show_authors').on('click', function(e) {
209 207 e.preventDefault();
210 208 var url = pyroutes.url('files_authors_home',
211 209 {'repo_name': templateContext.repo_name,
212 210 'revision': state.rev, 'f_path': state.f_path});
213 211
214 212 $.pjax({
215 213 url: url,
216 214 data: 'annotate=${"1" if c.annotate else "0"}',
217 215 container: '#file_authors',
218 216 push: false,
219 217 timeout: pjaxTimeout
220 218 }).complete(function(){
221 219 $('#show_authors').hide();
222 220 })
223 221 });
224 222
225 223 // load file short history
226 224 $('#file_history_overview').on('click', function(e) {
227 225 e.preventDefault();
228 226 path = state.f_path;
229 227 if (path.indexOf("#") >= 0) {
230 228 path = path.slice(0, path.indexOf("#"));
231 229 }
232 230 var url = pyroutes.url('changelog_file_home',
233 231 {'repo_name': templateContext.repo_name,
234 232 'revision': state.rev, 'f_path': path, 'limit': 6});
235 233 $('#file_history_container').show();
236 234 $('#file_history_container').html('<div class="file-history-inner">{0}</div>'.format(_gettext('Loading ...')));
237 235
238 236 $.pjax({
239 237 url: url,
240 238 container: '#file_history_container',
241 239 push: false,
242 240 timeout: pjaxTimeout
243 241 })
244 242 });
245 243
246 244 }
247 245 else {
248 246 getFilesMetadata();
249 247
250 248 // fuzzy file filter
251 249 fileBrowserListeners(state.node_list_url, state.url_base);
252 250
253 251 // switch to widget
254 252 select2RefSwitcher('#refs_filter', initialCommitData);
255 253 $('#refs_filter').on('change', function(e) {
256 254 var data = $('#refs_filter').select2('data');
257 255 curState.commit_id = data.raw_id;
258 256 $.pjax({url: data.files_url, container: '#pjax-container', timeout: pjaxTimeout});
259 257 });
260 258
261 259 $("#prev_commit_link").on('click', function(e) {
262 260 var data = $(this).data();
263 261 curState.commit_id = data.commitId;
264 262 });
265 263
266 264 $("#next_commit_link").on('click', function(e) {
267 265 var data = $(this).data();
268 266 curState.commit_id = data.commitId;
269 267 });
270 268
271 269 $('#at_rev').on("keypress", function(e) {
272 270 /* ENTER PRESSED */
273 271 if (e.keyCode === 13) {
274 272 var rev = $('#at_rev').val();
275 273 // explicit reload page here. with pjax entering bad input
276 274 // produces not so nice results
277 275 window.location = pyroutes.url('files_home',
278 276 {'repo_name': templateContext.repo_name,
279 277 'revision': rev, 'f_path': state.f_path});
280 278 }
281 279 });
282 280 }
283 281 };
284 282
285 283 var pjaxTimeout = 5000;
286 284
287 285 $(document).pjax(".pjax-link", "#pjax-container", {
288 286 "fragment": "#pjax-content",
289 287 "maxCacheLength": 1000,
290 288 "timeout": pjaxTimeout
291 289 });
292 290
293 291 // define global back/forward states
294 292 var isPjaxPopState = false;
295 293 $(document).on('pjax:popstate', function() {
296 294 isPjaxPopState = true;
297 295 });
298 296
299 297 $(document).on('pjax:end', function(xhr, options) {
300 298 if (isPjaxPopState) {
301 299 isPjaxPopState = false;
302 300 callbacks();
303 301 _NODEFILTER.resetFilter();
304 302 }
305 303
306 304 // run callback for tracking if defined for google analytics etc.
307 305 // this is used to trigger tracking on pjax
308 306 if (typeof window.rhodecode_statechange_callback !== 'undefined') {
309 307 var state = getState('statechange');
310 308 rhodecode_statechange_callback(state.url, null)
311 309 }
312 310 });
313 311
314 312 $(document).on('pjax:success', function(event, xhr, options) {
315 313 if (event.target.id == "file_history_container") {
316 314 $('#file_history_overview').hide();
317 315 $('#file_history_overview_full').show();
318 316 timeagoActivate();
319 tooltip_activate();
320 317 } else {
321 318 callbacks();
322 319 }
323 320 });
324 321
325 322 $(document).ready(function() {
326 323 callbacks();
327 324 var search_GET = "${request.GET.get('search','')}";
328 325 if (search_GET == "1") {
329 326 _NODEFILTER.initFilter();
330 327 }
331 328 });
332 329
333 330 </script>
334 331
335 332
336 333 </%def>
@@ -1,31 +1,29 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.html"/>
3 3 <table class="rctable followers_data">
4 4 <tr>
5 5 <th>${_('Follower Name')}</th>
6 6 <th>${_('Following Since')}</th>
7 7 </tr>
8 8 % for f in c.followers_pager:
9 9 <tr>
10 10 <td class="td-user follower_user">
11 11 ${base.gravatar_with_user(f.user.email, 16)}
12 12 </td>
13 13 <td class="td-time follower_date">
14 14 ${h.age_component(f.follows_from, time_is_local=True)}
15 15 </td>
16 16 </tr>
17 17 % endfor
18 18 </table>
19 19
20 20 <div class="pagination-wh pagination-left">
21 21 <script type="text/javascript">
22 22 $(document).pjax('#followers.pager_link','#followers');
23 23 $(document).on('pjax:success',function(){
24 24 show_more_event();
25 25 timeagoActivate();
26 tooltip_activate();
27 show_changeset_tooltip();
28 26 });
29 27 </script>
30 28 ${c.followers_pager.pager('$link_previous ~2~ $link_next')}
31 29 </div>
@@ -1,49 +1,47 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.html"/>
3 3
4 4 % if c.forks_pager:
5 5 <table class="rctable fork_summary">
6 6 <tr>
7 7 <th>${_('Owner')}</th>
8 8 <th>${_('Fork')}</th>
9 9 <th>${_('Description')}</th>
10 10 <th>${_('Forked')}</th>
11 11 <th></th>
12 12 </tr>
13 13 % for f in c.forks_pager:
14 14 <tr>
15 15 <td class="td-user fork_user">
16 16 ${base.gravatar_with_user(f.user.email, 16)}
17 17 </td>
18 18 <td class="td-componentname">
19 19 ${h.link_to(f.repo_name,h.url('summary_home',repo_name=f.repo_name))}
20 20 </td>
21 21 <td class="td-description">
22 22 <div class="truncate">${f.description}</div>
23 23 </td>
24 24 <td class="td-time follower_date">
25 25 ${h.age_component(f.created_on, time_is_local=True)}
26 26 </td>
27 27 <td class="td-compare">
28 28 <a title="${_('Compare fork with %s' % c.repo_name)}"
29 29 href="${h.url('compare_url',repo_name=c.repo_name, source_ref_type=c.rhodecode_db_repo.landing_rev[0],source_ref=c.rhodecode_db_repo.landing_rev[1],target_repo=f.repo_name,target_ref_type=c.rhodecode_db_repo.landing_rev[0],target_ref=c.rhodecode_db_repo.landing_rev[1], merge=1)}"
30 30 class="btn-link"><i class="icon-loop"></i> ${_('Compare fork')}</a>
31 31 </td>
32 32 </tr>
33 33 % endfor
34 34 </table>
35 35 <div class="pagination-wh pagination-left">
36 36 <script type="text/javascript">
37 37 $(document).pjax('#forks .pager_link','#forks');
38 38 $(document).on('pjax:success',function(){
39 39 show_more_event();
40 40 timeagoActivate();
41 tooltip_activate();
42 show_changeset_tooltip();
43 41 });
44 42 </script>
45 43 ${c.forks_pager.pager('$link_previous ~2~ $link_next')}
46 44 </div>
47 45 % else:
48 46 ${_('There are no forks yet')}
49 47 % endif
@@ -1,172 +1,170 b''
1 1 <%inherit file="/base/base.html"/>
2 2
3 3 <%def name="main()">
4 4 <div class="box">
5 5 <!-- box / title -->
6 6 <div class="title">
7 7 <div class="block-left breadcrumbs">
8 8 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
9 9 ${self.breadcrumbs()}
10 10 <span id="match_container" style="display:none">&raquo; <span id="match_count">0</span> ${_('matches')}</span>
11 11 </div>
12 12 %if c.rhodecode_user.username != h.DEFAULT_USER:
13 13 <div class="block-right">
14 14 <%
15 15 is_admin = h.HasPermissionAny('hg.admin')('can create repos index page')
16 16 create_repo = h.HasPermissionAny('hg.create.repository')('can create repository index page')
17 17 create_repo_group = h.HasPermissionAny('hg.repogroup.create.true')('can create repository groups index page')
18 18 create_user_group = h.HasPermissionAny('hg.usergroup.create.true')('can create user groups index page')
19 19
20 20 gr_name = c.repo_group.group_name if c.repo_group else None
21 21 # create repositories with write permission on group is set to true
22 22 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
23 23 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
24 24 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
25 25 %>
26 26
27 27 %if not c.repo_group:
28 28 ## no repository group context here
29 29 %if is_admin or create_repo:
30 30 <a href="${h.url('new_repo')}" class="btn btn-small btn-success btn-primary">${_('Add Repository')}</a>
31 31 %endif
32 32
33 33 %if is_admin or create_repo_group:
34 34 <a href="${h.url('new_repo_group')}" class="btn btn-small btn-default">${_(u'Add Repository Group')}</a>
35 35 %endif
36 36 %else:
37 37 ##we're inside other repository group other terms apply
38 38 %if is_admin or group_admin or (group_write and create_on_write):
39 39 <a href="${h.url('new_repo',parent_group=c.repo_group.group_id)}" class="btn btn-small btn-success btn-primary">${_('Add Repository')}</a>
40 40 %endif
41 41 %if is_admin or group_admin:
42 42 <a href="${h.url('new_repo_group', parent_group=c.repo_group.group_id)}" class="btn btn-small btn-default">${_(u'Add Repository Group')}</a>
43 43 %endif
44 44 %if is_admin or group_admin:
45 45 <a href="${h.url('edit_repo_group',group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}" class="btn btn-small btn-primary">${_('Edit Repository Group')}</a>
46 46 %endif
47 47 %endif
48 48 </div>
49 49 %endif
50 50 </div>
51 51 <!-- end box / title -->
52 52 <div class="table">
53 53 <div id="groups_list_wrap">
54 54 <table id="group_list_table" class="display"></table>
55 55 </div>
56 56 </div>
57 57
58 58 <div class="table">
59 59 <div id="repos_list_wrap">
60 60 <table id="repo_list_table" class="display"></table>
61 61 </div>
62 62 </div>
63 63 </div>
64 64 <script>
65 65 $(document).ready(function() {
66 66
67 67 var get_datatable_count = function() {
68 68 var api = $('#repo_list_table').dataTable().api();
69 69 var pageInfo = api.page.info();
70 70 var repos = pageInfo.recordsDisplay;
71 71 var reposTotal = pageInfo.recordsTotal;
72 72
73 73 api = $('#group_list_table').dataTable().api();
74 74 pageInfo = api.page.info();
75 75 var repoGroups = pageInfo.recordsDisplay;
76 76 var repoGroupsTotal = pageInfo.recordsTotal;
77 77
78 78 if (repoGroups !== repoGroupsTotal) {
79 79 $('#match_count').text(repos+repoGroups);
80 80 }
81 81 if (repos !== reposTotal) {
82 82 $('#match_container').show();
83 83 }
84 84 if ($('#q_filter').val() === '') {
85 85 $('#match_container').hide();
86 86 }
87 87 };
88 88
89 89 // repo group list
90 90 $('#group_list_table').DataTable({
91 91 data: ${c.repo_groups_data|n},
92 92 dom: 'rtp',
93 93 pageLength: ${c.visual.dashboard_items},
94 94 order: [[ 0, "asc" ]],
95 95 columns: [
96 96 { data: {"_": "name",
97 97 "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" },
98 98 { data: 'menu', "bSortable": false, className: "quick_repo_menu" },
99 99 { data: {"_": "desc",
100 100 "sort": "desc"}, title: "${_('Description')}", className: "td-description" },
101 101 { data: {"_": "owner",
102 102 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }
103 103 ],
104 104 language: {
105 105 paginate: DEFAULT_GRID_PAGINATION
106 106 },
107 107 "drawCallback": function( settings, json ) {
108 108 timeagoActivate();
109 tooltip_activate();
110 109 quick_repo_menu();
111 110 }
112 111 });
113 112
114 113 // repo list
115 114 $('#repo_list_table').DataTable({
116 115 data: ${c.repos_data|n},
117 116 dom: 'rtp',
118 117 order: [[ 0, "asc" ]],
119 118 pageLength: ${c.visual.dashboard_items},
120 119 columns: [
121 120 { data: {"_": "name",
122 121 "sort": "name_raw"}, title: "${_('Name')}", className: "truncate-wrap td-componentname" },
123 122 { data: 'menu', "bSortable": false, className: "quick_repo_menu" },
124 123 { data: {"_": "desc",
125 124 "sort": "desc"}, title: "${_('Description')}", className: "td-description" },
126 125 { data: {"_": "last_change",
127 126 "sort": "last_change_raw",
128 127 "type": Number}, title: "${_('Last Change')}", className: "td-time" },
129 128 { data: {"_": "last_changeset",
130 129 "sort": "last_changeset_raw",
131 130 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
132 131 { data: {"_": "owner",
133 132 "sort": "owner"}, title: "${_('Owner')}", className: "td-user" },
134 133 { data: {"_": "rss",
135 134 "sort": "rss"}, title: "rss", className: "td-rss" }
136 135 ],
137 136 language: {
138 137 paginate: DEFAULT_GRID_PAGINATION
139 138 },
140 139 "drawCallback": function( settings, json ) {
141 140 timeagoActivate();
142 tooltip_activate();
143 141 quick_repo_menu();
144 142 }
145 143 });
146 144
147 145 // update the counter when doing search
148 146 $('#repo_list_table, #group_list_table').on( 'search.dt', function (e,settings) {
149 147 get_datatable_count();
150 148 });
151 149
152 150 // filter, filter both grids
153 151 $('#q_filter').on( 'keyup', function () {
154 152 var repo_api = $('#repo_list_table').dataTable().api();
155 153 repo_api
156 154 .columns( 0 )
157 155 .search( this.value )
158 156 .draw();
159 157
160 158 var repo_group_api = $('#group_list_table').dataTable().api();
161 159 repo_group_api
162 160 .columns( 0 )
163 161 .search( this.value )
164 162 .draw();
165 163 });
166 164
167 165 // refilter table if page load via back button
168 166 $("#q_filter").trigger('keyup');
169 167
170 168 });
171 169 </script>
172 170 </%def>
@@ -1,56 +1,54 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3 <%def name="title()">
4 4 ${_('Journal')}
5 5 %if c.rhodecode_name:
6 6 &middot; ${h.branding(c.rhodecode_name)}
7 7 %endif
8 8 </%def>
9 9 <%def name="breadcrumbs()">
10 10 <h1 class="block-left">
11 11 ${h.form(None, id_="filter_form", method="get")}
12 12 <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term}" placeholder="${_('quick filter...')}"/>
13 13 <input type='submit' value="${_('Filter')}" class="btn" />
14 14 ${_('Journal')} - ${ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
15 15 ${h.end_form()}
16 16 </h1>
17 17 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help())}">${_('Example Queries')}</p>
18 18 </%def>
19 19 <%def name="menu_bar_nav()">
20 20 ${self.menu_items(active='journal')}
21 21 </%def>
22 22 <%def name="head_extra()">
23 23 <link href="${h.url('journal_atom', auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
24 24 <link href="${h.url('journal_rss', auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
25 25 </%def>
26 26 <%def name="main()">
27 27
28 28 <div class="box">
29 29 <!-- box / title -->
30 30 <div class="title journal">
31 31 ${self.breadcrumbs()}
32 32 <ul class="links icon-only-links block-right">
33 33 <li>
34 34 <span><a id="refresh" href="${h.url('journal')}"><i class="icon-refresh"></i></a></span>
35 35 </li>
36 36 <li>
37 37 <span><a href="${h.url('journal_atom', auth_token=c.rhodecode_user.feed_token)}"><i class="icon-rss-sign"></i></a></span>
38 38 </li>
39 39 </ul>
40 40 </div>
41 41 <div id="journal">${c.journal_data}</div>
42 42 </div>
43 43
44 44 <script type="text/javascript">
45 45
46 46 $('#j_filter').autoGrowInput();
47 47 $(document).on('pjax:success',function(){
48 48 show_more_event();
49 tooltip_activate();
50 show_changeset_tooltip();
51 49 });
52 50 $(document).pjax('#refresh', '#journal',
53 51 {url: "${h.url.current(filter=c.search_term)}", push: false});
54 52
55 53 </script>
56 54 </%def>
@@ -1,55 +1,53 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.html"/>
3 3
4 4 %if c.journal_day_aggreagate:
5 5 %for day,items in c.journal_day_aggreagate:
6 6 <div class="journal_day">${day}</div>
7 7 % for user,entries in items:
8 8 <div class="journal_container">
9 9 ${base.gravatar(user.email if user else '', 30)}
10 10 %if user:
11 11 <div class="journal_user user">${h.link_to_user(user.username)}</div>
12 12 %else:
13 13 <div class="journal_user user deleted">${entries[0].username}</div>
14 14 %endif
15 15 <div class="journal_action_container">
16 16 % for entry in entries:
17 17 <div class="journal_icon"> ${h.action_parser(entry)[2]()}</div>
18 18 <div class="journal_action">${h.action_parser(entry)[0]()}</div>
19 19 <div class="journal_repo">
20 20 <span class="journal_repo_name">
21 21 %if entry.repository is not None:
22 22 ${h.link_to(entry.repository.repo_name,
23 23 h.url('summary_home',repo_name=entry.repository.repo_name))}
24 24 %else:
25 25 ${entry.repository_name}
26 26 %endif
27 27 </span>
28 28 </div>
29 29 <div class="journal_action_params">${h.literal(h.action_parser(entry)[1]())}</div>
30 30 <div class="date">
31 31 ${h.age_component(entry.action_date, time_is_local=True)}
32 32 </div>
33 33 %endfor
34 34 </div>
35 35 </div>
36 36 %endfor
37 37 %endfor
38 38
39 39 <div class="pagination-wh pagination-left" >
40 40 ${c.journal_pager.pager('$link_previous ~2~ $link_next')}
41 41 </div>
42 42 <script type="text/javascript">
43 43 $(document).pjax('#journal .pager_link','#journal');
44 44 $(document).on('pjax:success',function(){
45 45 show_more_event();
46 46 timeagoActivate();
47 tooltip_activate();
48 show_changeset_tooltip();
49 47 });
50 48 </script>
51 49 %else:
52 50 <div>
53 51 ${_('No entries yet')}
54 52 </div>
55 53 %endif
@@ -1,132 +1,131 b''
1 1 <%inherit file="/base/base.html"/>
2 2
3 3 <%def name="title()">
4 4 ${_('%s Pull Requests') % c.repo_name}
5 5 %if c.rhodecode_name:
6 6 &middot; ${h.branding(c.rhodecode_name)}
7 7 %endif
8 8 </%def>
9 9
10 10 <%def name="breadcrumbs_links()">
11 11
12 12 </%def>
13 13
14 14 <%def name="menu_bar_nav()">
15 15 ${self.menu_items(active='repositories')}
16 16 </%def>
17 17
18 18
19 19 <%def name="menu_bar_subnav()">
20 20 ${self.repo_menu(active='showpullrequest')}
21 21 </%def>
22 22
23 23
24 24 <%def name="main()">
25 25 <div class="box">
26 26 <div class="title">
27 27 ${self.repo_page_title(c.rhodecode_db_repo)}
28 28
29 29 <ul class="links">
30 30 <li>
31 31 %if c.rhodecode_user.username != h.DEFAULT_USER:
32 32 <span>
33 33 <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}">
34 34 ${_('Open new Pull Request')}
35 35 </a>
36 36 </span>
37 37 %endif
38 38 </li>
39 39 </ul>
40 40
41 41 ${self.breadcrumbs()}
42 42 </div>
43 43
44 44 <div class="sidebar-col-wrapper">
45 45 ##main
46 46 <div class="sidebar">
47 47 <ul class="nav nav-pills nav-stacked">
48 48 <li class="${'active' if c.active=='open' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0)}">${_('Opened')}</a></li>
49 49 <li class="${'active' if c.active=='my' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,my=1)}">${_('Opened by me')}</a></li>
50 50 <li class="${'active' if c.active=='awaiting' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,awaiting_review=1)}">${_('Awaiting review')}</a></li>
51 51 <li class="${'active' if c.active=='awaiting_my' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,awaiting_my_review=1)}">${_('Awaiting my review')}</a></li>
52 52 <li class="${'active' if c.active=='closed' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,closed=1)}">${_('Closed')}</a></li>
53 53 <li class="${'active' if c.active=='source' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=1)}">${_('From this repo')}</a></li>
54 54 </ul>
55 55 </div>
56 56
57 57 <div class="main-content-full-width">
58 58 <div class="panel panel-default">
59 59 <div class="panel-heading">
60 60 <h3 class="panel-title">
61 61 %if c.source:
62 62 ${_('Pull Requests from %(repo_name)s repository') % {'repo_name': c.repo_name}}
63 63 %elif c.closed:
64 64 ${_('Closed Pull Requests to repository %(repo_name)s') % {'repo_name': c.repo_name}}
65 65 %elif c.my:
66 66 ${_('Pull Requests to %(repo_name)s repository opened by me') % {'repo_name': c.repo_name}}
67 67 %elif c.awaiting_review:
68 68 ${_('Pull Requests to %(repo_name)s repository awaiting review') % {'repo_name': c.repo_name}}
69 69 %elif c.awaiting_my_review:
70 70 ${_('Pull Requests to %(repo_name)s repository awaiting my review') % {'repo_name': c.repo_name}}
71 71 %else:
72 72 ${_('Pull Requests to %(repo_name)s repository') % {'repo_name': c.repo_name}}
73 73 %endif
74 74 </h3>
75 75 </div>
76 76 <div class="panel-body">
77 77 <table id="pull_request_list_table" class="display"></table>
78 78 </div>
79 79 </div>
80 80 </div>
81 81 </div>
82 82 </div>
83 83
84 84 <script type="text/javascript">
85 85 $(document).ready(function() {
86 86 // object list
87 87 $('#pull_request_list_table').DataTable({
88 88 data: ${c.data|n},
89 89 processing: true,
90 90 serverSide: true,
91 91 deferLoading: ${c.records_total},
92 92 ajax: "",
93 93 dom: 'tp',
94 94 pageLength: ${c.visual.dashboard_items},
95 95 order: [[ 1, "desc" ]],
96 96 columns: [
97 97 { data: {"_": "status",
98 98 "sort": "status"}, title: "", className: "td-status", orderable: false},
99 99 { data: {"_": "name",
100 100 "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname", "type": "num" },
101 101 { data: {"_": "author",
102 102 "sort": "author_raw"}, title: "${_('Author')}", className: "td-user", orderable: false },
103 103 { data: {"_": "title",
104 104 "sort": "title"}, title: "${_('Title')}", className: "td-description" },
105 105 { data: {"_": "comments",
106 106 "sort": "comments_raw"}, title: "", className: "td-comments", orderable: false},
107 107 { data: {"_": "updated_on",
108 108 "sort": "updated_on_raw"}, title: "${_('Updated on')}", className: "td-time" }
109 109 ],
110 110 language: {
111 111 paginate: DEFAULT_GRID_PAGINATION
112 112 },
113 113 "drawCallback": function( settings, json ) {
114 114 timeagoActivate();
115 tooltip_activate();
116 115 },
117 116 "createdRow": function ( row, data, index ) {
118 117 if (data['closed']) {
119 118 $(row).addClass('closed');
120 119 }
121 120 }
122 121 });
123 122 });
124 123 $('#pull_request_list_table').on('xhr.dt', function(e, settings, json, xhr){
125 124 $('#pull_request_list_table').css('opacity', 1);
126 125 });
127 126
128 127 $('#pull_request_list_table').on('preXhr.dt', function(e, settings, data){
129 128 $('#pull_request_list_table').css('opacity', 0.3);
130 129 });
131 130 </script>
132 131 </%def>
@@ -1,102 +1,100 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 ${_('%s Tags') % c.repo_name}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
13 13 <span id="obj_count">0</span> ${_('tags')}
14 14 </%def>
15 15
16 16 <%def name="menu_bar_nav()">
17 17 ${self.menu_items(active='repositories')}
18 18 </%def>
19 19
20 20 <%def name="menu_bar_subnav()">
21 21 ${self.repo_menu(active='summary')}
22 22 </%def>
23 23
24 24 <%def name="main()">
25 25 <div class="box">
26 26 <div class="title">
27 27 ${self.repo_page_title(c.rhodecode_db_repo)}
28 28 %if c.has_references:
29 29 <ul class="links">
30 30 <li>
31 31 <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Tags')}">
32 32 </li>
33 33 </ul>
34 34 %endif
35 35 %if c.has_references:
36 36 ${self.breadcrumbs()}
37 37 %endif
38 38 </div>
39 39 <table id="obj_list_table" class="display"></table>
40 40 </div>
41 41
42 42
43 43 <script type="text/javascript">
44 44 $(document).ready(function() {
45 45
46 46 var get_datatable_count = function(){
47 47 var api = $('#obj_list_table').dataTable().api();
48 48 $('#obj_count').text(api.page.info().recordsDisplay);
49 49 };
50 50
51 51 // object list
52 52 $('#obj_list_table').DataTable({
53 53 data: ${c.data|n},
54 54 dom: 'rtp',
55 55 pageLength: ${c.visual.dashboard_items},
56 56 order: [[ 0, "asc" ]],
57 57 columns: [
58 58 { data: {"_": "name",
59 59 "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" },
60 60 { data: {"_": "date",
61 61 "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" },
62 62 { data: {"_": "author",
63 63 "sort": "author"}, title: "${_('Author')}", className: "td-user" },
64 64 { data: {"_": "commit",
65 65 "sort": "commit_raw",
66 66 "type": Number}, title: "${_('Commit')}", className: "td-hash" },
67 67 { data: {"_": "compare",
68 68 "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" }
69 69 ],
70 70 language: {
71 71 paginate: DEFAULT_GRID_PAGINATION
72 72 },
73 73 "initComplete": function(settings, json) {
74 74 get_datatable_count();
75 tooltip_activate();
76 75 timeagoActivate();
77 76 compare_radio_buttons("${c.repo_name}", 'tag');
78 77 }
79 78 });
80 79
81 80 // update when things change
82 81 $('#obj_list_table').on('draw.dt', function() {
83 82 get_datatable_count();
84 tooltip_activate();
85 83 timeagoActivate();
86 84 });
87 85
88 86 // filter, filter both grids
89 87 $('#q_filter').on('keyup', function() {
90 88 var obj_api = $('#obj_list_table').dataTable().api();
91 89 obj_api
92 90 .columns(0)
93 91 .search(this.value)
94 92 .draw();
95 93 });
96 94
97 95 // refilter table if page load via back button
98 96 $("#q_filter").trigger('keyup');
99 97 });
100 98
101 99 </script>
102 100 </%def>
@@ -1,498 +1,496 b''
1 1 <html xmlns="http://www.w3.org/1999/xhtml">
2 2 <head>
3 3 <title>
4 4 Gist &middot; 22
5 5 </title>
6 6 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7 7 <meta name="robots" content="index, nofollow"/>
8 8 <link rel="icon" href="/images/favicon.ico?ver=b5cbcb03" sizes="16x16 32x32" type="image/png" />
9 9 <link rel="stylesheet" type="text/css" href="/css/style.css?ver=b5cbcb03" media="screen"/>
10 10 <!--[if lt IE 9]>
11 11 <link rel="stylesheet" type="text/css" href="/css/ie.css?ver=b5cbcb03" media="screen"/>
12 12 <![endif]-->
13 13 <script src="/js/rhodecode/i18n/en.js?ver=b5cbcb03"></script>
14 14 <script type="text/javascript">
15 15 // register templateContext to pass template variables to JS
16 16 var templateContext = {
17 17 repo_name: "",
18 18 repo_type: null,
19 19 repo_landing_commit: null,
20 20 rhodecode_user: {
21 21 username: "default",
22 22 email: "anonymous@rhodecode.org",
23 23 },
24 24 visual: {
25 25 default_renderer: "rst"
26 26 },
27 27 commit_data: {
28 28 commit_id: null,
29 29 },
30 30 pull_request_data: {
31 31 pull_request_id: null,
32 32 },
33 33 timeago: {
34 34 refresh_time: 120000,
35 35 cutoff_limit: 604800000
36 36 }
37 37 };
38 38 var REPO_NAME = "";
39 39 var REPO_LANDING_REV = '';
40 40 var REPO_TYPE = '';
41 41 var APPLICATION_URL = "";
42 42 var DEFAULT_RENDERER = "rst";
43 43 var CSRF_TOKEN = "0fd2775cf20f09b9942125e6ffb4c6da143d1b14";
44 44 var USER = {name:'default'};
45 45 var APPENLIGHT = {
46 46 enabled: false,
47 47 key: 'YOUR_API_PUBLIC_KEY',
48 48 serverUrl: 'https://api.appenlight.com',
49 49 requestInfo: {
50 50 ip: '0.0.0.0',
51 51 username: 'default'
52 52 }
53 53 };
54 54 </script>
55 55 <!--[if lt IE 9]>
56 56 <script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script>
57 57 <![endif]-->
58 58 <script language="javascript" type="text/javascript" src="/js/scripts.js?ver=b5cbcb03"></script>
59 59 <script>CodeMirror.modeURL = "/js/mode/%N/%N.js";</script>
60 60 <script type="text/javascript">
61 61 $(document).ready(function(){
62 tooltip_activate();
63 62 show_more_event();
64 show_changeset_tooltip();
65 63 timeagoActivate();
66 64 })
67 65 </script>
68 66 </head>
69 67 <body id="body">
70 68 <noscript>
71 69 <div class="noscript-error">
72 70 Please enable JavaScript to use RhodeCode Enterprise
73 71 </div>
74 72 </noscript>
75 73 <!--[if IE 7]>
76 74 <script>$(document.body).addClass('ie7')</script>
77 75 <![endif]-->
78 76 <!--[if IE 8]>
79 77 <script>$(document.body).addClass('ie8')</script>
80 78 <![endif]-->
81 79 <!--[if IE 9]>
82 80 <script>$(document.body).addClass('ie9')</script>
83 81 <![endif]-->
84 82 <div class="outerwrapper">
85 83 <!-- HEADER -->
86 84 <div class="header">
87 85 <div id="header-inner" class="wrapper">
88 86 <div id="logo">
89 87 <div class="logo-wrapper">
90 88 <a href="/"><img src="/images/rhodecode-logo-white-216x60.png" alt="RhodeCode"/></a>
91 89 </div>
92 90 </div>
93 91 <!-- MENU BAR NAV -->
94 92 <ul id="quick" class="main_nav navigation horizontal-list">
95 93 <!-- repo switcher -->
96 94 <li class=" repo_switcher_li has_select2">
97 95 <input id="repo_switcher" name="repo_switcher" type="hidden">
98 96 </li>
99 97 <li class="">
100 98 <a class="menulink" title="Show Public activity journal" href="/_admin/public_journal">
101 99 <div class="menulabel">Public journal</div>
102 100 </a>
103 101 </li>
104 102 <li class="active">
105 103 <a class="menulink childs" title="Show Gists" href="/_admin/gists">
106 104 <div class="menulabel">Gists</div>
107 105 </a>
108 106 </li>
109 107 <li class="">
110 108 <a class="menulink" title="Search in repositories you have access to" href="/_admin/search">
111 109 <div class="menulabel">Search</div>
112 110 </a>
113 111 </li>
114 112 <li id="quick_login_li">
115 113 <a id="quick_login_link" class="menulink childs">
116 114 <img class="gravatar gravatar-large" src="data:image/svg+xml;base64,CiAgICAgICAgPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgICAgICAg
117 115 dmVyc2lvbj0iMS4xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIgogICAg
118 116 ICAgIHZpZXdCb3g9Ii0xNSAtMTAgNDM5LjE2NSA0MjkuMTY0IgoKICAgICAgICB4bWw6c3BhY2U9
119 117 InByZXNlcnZlIgogICAgICAgIHN0eWxlPSJiYWNrZ3JvdW5kOiM5Nzk3OTc7IiA+CgogICAgICAg
120 118 IDxwYXRoIGQ9Ik0yMDQuNTgzLDIxNi42NzFjNTAuNjY0LDAsOTEuNzQtNDguMDc1LAogICAgICAg
121 119 ICAgICAgICAgIDkxLjc0LTEwNy4zNzhjMC04Mi4yMzctNDEuMDc0LTEwNy4zNzctOTEuNzQtMTA3
122 120 LjM3NwogICAgICAgICAgICAgICAgIGMtNTAuNjY4LDAtOTEuNzQsMjUuMTQtOTEuNzQsMTA3LjM3
123 121 N0MxMTIuODQ0LAogICAgICAgICAgICAgICAgIDE2OC41OTYsMTUzLjkxNiwyMTYuNjcxLAogICAg
124 122 ICAgICAgICAgICAgIDIwNC41ODMsMjE2LjY3MXoiIGZpbGw9IiNmZmYiLz4KICAgICAgICA8cGF0
125 123 aCBkPSJNNDA3LjE2NCwzNzQuNzE3TDM2MC44OCwKICAgICAgICAgICAgICAgICAyNzAuNDU0Yy0y
126 124 LjExNy00Ljc3MS01LjgzNi04LjcyOC0xMC40NjUtMTEuMTM4bC03MS44My0zNy4zOTIKICAgICAg
127 125 ICAgICAgICAgICBjLTEuNTg0LTAuODIzLTMuNTAyLTAuNjYzLTQuOTI2LDAuNDE1Yy0yMC4zMTYs
128 126 CiAgICAgICAgICAgICAgICAgMTUuMzY2LTQ0LjIwMywyMy40ODgtNjkuMDc2LDIzLjQ4OGMtMjQu
129 127 ODc3LAogICAgICAgICAgICAgICAgIDAtNDguNzYyLTguMTIyLTY5LjA3OC0yMy40ODgKICAgICAg
130 128 ICAgICAgICAgICBjLTEuNDI4LTEuMDc4LTMuMzQ2LTEuMjM4LTQuOTMtMC40MTVMNTguNzUsCiAg
131 129 ICAgICAgICAgICAgICAgMjU5LjMxNmMtNC42MzEsMi40MS04LjM0Niw2LjM2NS0xMC40NjUsMTEu
132 130 MTM4TDIuMDAxLDM3NC43MTcKICAgICAgICAgICAgICAgICBjLTMuMTkxLDcuMTg4LTIuNTM3LDE1
133 131 LjQxMiwxLjc1LDIyLjAwNWM0LjI4NSwKICAgICAgICAgICAgICAgICA2LjU5MiwxMS41MzcsMTAu
134 132 NTI2LDE5LjQsMTAuNTI2aDM2Mi44NjFjNy44NjMsMCwxNS4xMTctMy45MzYsCiAgICAgICAgICAg
135 133 ICAgICAgMTkuNDAyLTEwLjUyNyBDNDA5LjY5OSwzOTAuMTI5LAogICAgICAgICAgICAgICAgIDQx
136 134 MC4zNTUsMzgxLjkwMiw0MDcuMTY0LDM3NC43MTd6IiBmaWxsPSIjZmZmIi8+CiAgICAgICAgPC9z
137 135 dmc+
138 136 " height="20" width="20">
139 137 <span class="user">
140 138 <span>Sign in</span>
141 139 </span>
142 140 </a>
143 141 <div class="user-menu submenu">
144 142 <div id="quick_login">
145 143 <h4>Sign in to your account</h4>
146 144 <form action="/_admin/login?came_from=%2F_admin%2Fgists%2F22" method="post">
147 145 <div class="form form-vertical">
148 146 <div class="fields">
149 147 <div class="field">
150 148 <div class="label">
151 149 <label for="username">Username:</label>
152 150 </div>
153 151 <div class="input">
154 152 <input class="focus" id="username" name="username" tabindex="1" type="text" />
155 153 </div>
156 154 </div>
157 155 <div class="field">
158 156 <div class="label">
159 157 <label for="password">Password:</label>
160 158 <span class="forgot_password"><a href="/_admin/password_reset">(Forgot password?)</a></span>
161 159 </div>
162 160 <div class="input">
163 161 <input class="focus" id="password" name="password" tabindex="2" type="password" />
164 162 </div>
165 163 </div>
166 164 <div class="buttons">
167 165 <div class="register">
168 166 <a href="/_admin/register">Don&#39;t have an account ?</a>
169 167 </div>
170 168 <div class="submit">
171 169 <input class="btn btn-small" id="sign_in" name="sign_in" tabindex="3" type="submit" value="Sign In" />
172 170 </div>
173 171 </div>
174 172 </div>
175 173 </div>
176 174 </form>
177 175 </div>
178 176 </div>
179 177 </li>
180 178 </ul>
181 179 <script type="text/javascript">
182 180 var visual_show_public_icon = "True" == "True";
183 181 /*format the look of items in the list*/
184 182 var format = function(state, escapeMarkup){
185 183 if (!state.id){
186 184 return state.text; // optgroup
187 185 }
188 186 var obj_dict = state.obj;
189 187 var tmpl = '';
190 188 if(obj_dict && state.type == 'repo'){
191 189 if(obj_dict['repo_type'] === 'hg'){
192 190 tmpl += '<i class="icon-hg"></i> ';
193 191 }
194 192 else if(obj_dict['repo_type'] === 'git'){
195 193 tmpl += '<i class="icon-git"></i> ';
196 194 }
197 195 else if(obj_dict['repo_type'] === 'svn'){
198 196 tmpl += '<i class="icon-svn"></i> ';
199 197 }
200 198 if(obj_dict['private']){
201 199 tmpl += '<i class="icon-lock" ></i> ';
202 200 }
203 201 else if(visual_show_public_icon){
204 202 tmpl += '<i class="icon-unlock-alt"></i> ';
205 203 }
206 204 }
207 205 if(obj_dict && state.type == 'group'){
208 206 tmpl += '<i class="icon-folder-close"></i> ';
209 207 }
210 208 tmpl += escapeMarkup(state.text);
211 209 return tmpl;
212 210 };
213 211 var formatResult = function(result, container, query, escapeMarkup) {
214 212 return format(result, escapeMarkup);
215 213 };
216 214 var formatSelection = function(data, container, escapeMarkup) {
217 215 return format(data, escapeMarkup);
218 216 };
219 217 $("#repo_switcher").select2({
220 218 cachedDataSource: {},
221 219 minimumInputLength: 2,
222 220 placeholder: '<div class="menulabel">Go to <div class="show_more"></div></div>',
223 221 dropdownAutoWidth: true,
224 222 formatResult: formatResult,
225 223 formatSelection: formatSelection,
226 224 containerCssClass: "repo-switcher",
227 225 dropdownCssClass: "repo-switcher-dropdown",
228 226 escapeMarkup: function(m){
229 227 // don't escape our custom placeholder
230 228 if(m.substr(0,23) == '<div class="menulabel">'){
231 229 return m;
232 230 }
233 231 return Select2.util.escapeMarkup(m);
234 232 },
235 233 query: $.debounce(250, function(query){
236 234 self = this;
237 235 var cacheKey = query.term;
238 236 var cachedData = self.cachedDataSource[cacheKey];
239 237 if (cachedData) {
240 238 query.callback({results: cachedData.results});
241 239 } else {
242 240 $.ajax({
243 241 url: "/_repos_and_groups",
244 242 data: {'query': query.term},
245 243 dataType: 'json',
246 244 type: 'GET',
247 245 success: function(data) {
248 246 self.cachedDataSource[cacheKey] = data;
249 247 query.callback({results: data.results});
250 248 },
251 249 error: function(data, textStatus, errorThrown) {
252 250 alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText));
253 251 }
254 252 })
255 253 }
256 254 })
257 255 });
258 256 $("#repo_switcher").on('select2-selecting', function(e){
259 257 e.preventDefault();
260 258 window.location = pyroutes.url('summary_home', {'repo_name': e.val});
261 259 });
262 260 // general help "?"
263 261 Mousetrap.bind(['?'], function(e) {
264 262 $('#help_kb').modal({})
265 263 });
266 264 // / open the quick filter
267 265 Mousetrap.bind(['/'], function(e) {
268 266 $("#repo_switcher").select2("open");
269 267 // return false to prevent default browser behavior
270 268 // and stop event from bubbling
271 269 return false;
272 270 });
273 271 // general nav g + action
274 272 Mousetrap.bind(['g h'], function(e) {
275 273 window.location = pyroutes.url('home');
276 274 });
277 275 Mousetrap.bind(['g g'], function(e) {
278 276 window.location = pyroutes.url('gists', {'private':1});
279 277 });
280 278 Mousetrap.bind(['g G'], function(e) {
281 279 window.location = pyroutes.url('gists', {'public':1});
282 280 });
283 281 Mousetrap.bind(['n g'], function(e) {
284 282 window.location = pyroutes.url('new_gist');
285 283 });
286 284 Mousetrap.bind(['n r'], function(e) {
287 285 window.location = pyroutes.url('new_repo');
288 286 });
289 287 </script>
290 288 <script src="/js/rhodecode/base/keyboard-bindings.js?ver=b5cbcb03"></script>
291 289 <!-- END MENU BAR NAV -->
292 290 </div>
293 291 </div>
294 292 <!-- END HEADER -->
295 293 <!-- CONTENT -->
296 294 <div id="content" class="wrapper">
297 295 <div class="flash_msg">
298 296 <script>
299 297 if (typeof jQuery != 'undefined') {
300 298 $(".alert").alert();
301 299 }
302 300 </script>
303 301 </div>
304 302 <div class="main">
305 303 <div class="box">
306 304 <!-- box / title -->
307 305 <div class="title">
308 306 <div class="breadcrumbs">
309 307 Gist &middot; 22
310 308 / URL: http://test.example.com:80/_admin/gists/22
311 309 </div>
312 310 </div>
313 311 <div class="table">
314 312 <div id="files_data">
315 313 <div id="codeblock" class="codeblock">
316 314 <div class="code-header">
317 315 <div class="stats">
318 316 <div class="buttons">
319 317 <a class="btn btn-mini" href="/_admin/gists/22/tip/raw">Show as Raw</a>
320 318 </div>
321 319 <div class="left" >
322 320 <span> gist-desc</span>
323 321 <span>Expires:
324 322 never
325 323 </span>
326 324 </div>
327 325 </div>
328 326 <div class="author">
329 327 <div title="RhodeCode Admin &lt;test_admin@mail.com&gt;">
330 328 <div class="rc-user tooltip" title="RhodeCode Admin &lt;test_admin@mail.com&gt;">
331 329 <img class="gravatar" src="data:image/svg+xml;base64,CiAgICAgICAgPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHBvaW50ZXIt
332 330 ZXZlbnRzPSJub25lIgogICAgICAgICAgICAgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIgogICAgICAg
333 331 ICAgICAgc3R5bGU9IndpZHRoOiAxMDAlOyBoZWlnaHQ6IDEwMCU7IGJhY2tncm91bmQtY29sb3I6
334 332 ICM1OWIzODkiCiAgICAgICAgICAgICB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgICAgICAgICA8
335 333 dGV4dCB0ZXh0LWFuY2hvcj0ibWlkZGxlIiB5PSI1MCUiIHg9IjUwJSIgZHk9IjAuMzVlbSIKICAg
336 334 ICAgICAgICAgICAgICAgcG9pbnRlci1ldmVudHM9ImF1dG8iIGZpbGw9IiNmZmYiCiAgICAgICAg
337 335 ICAgICAgICAgIGZvbnQtZmFtaWx5PSJwcm94aW1hbm92YXJlZ3VsYXIsUHJveGltYSBOb3ZhIFJl
338 336 Z3VsYXIsUHJveGltYSBOb3ZhLEFyaWFsLEx1Y2lkYSBHcmFuZGUsc2Fucy1zZXJpZiIKICAgICAg
339 337 ICAgICAgICAgICAgc3R5bGU9ImZvbnQtd2VpZ2h0OiA0MDA7IGZvbnQtc2l6ZTogMTcuMjk3Mjk3
340 338 Mjk3M3B4OyI+VE0KICAgICAgICAgICAgPC90ZXh0PgogICAgICAgIDwvc3ZnPg==
341 339 " height="16" width="16">
342 340 <span class="user"> <a href="/_profiles/test_admin">test_admin</a></span>
343 341 </div>
344 342 - created <time class="timeago tooltip" title="Mon, 23 May 2016 19:54:34" datetime="2016-05-23 19:54:34+00:00">Mon, 23 May 2016 19:54:34</time>
345 343 </div>
346 344 </div>
347 345 <div class="commit">added file: gist-show-me</div>
348 346 </div>
349 347 <!-- <div id="c-G-eff3be0ea272" class="stats" >
350 348 <a href="http://test.example.com:80/_admin/gists/22">ΒΆ</a>
351 349 <b >gist-show-me</b>
352 350 <div>
353 351 <a class="btn btn-mini" href="/_admin/gists/22/3f6f18ddcd5669697303ab3cd5a2eabb1c558c6f/raw/gist-show-me">Show as raw</a>
354 352 </div>
355 353 </div> -->
356 354 <div class="code-body textarea text-area editor">
357 355 <table class="code-highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L1">1</a></pre></div></td><td id="hlcode" class="code"><div class="code-highlight"><pre><div id="L1"><a name="L-1"></a>some gist
358 356 </div></pre></div>
359 357 </td></tr></table>
360 358 </div>
361 359 </div>
362 360 </div>
363 361 </div>
364 362 </div>
365 363 </div>
366 364 </div>
367 365 <!-- END CONTENT -->
368 366 </div>
369 367 <!-- FOOTER -->
370 368 <div id="footer">
371 369 <div id="footer-inner" class="title wrapper">
372 370 <div>
373 371 <p class="footer-link-right">
374 372 RhodeCode Enterprise 4.0.0 Community Edition
375 373 &copy; 2010-2016, <a href="https://rhodecode.com" target="_blank">RhodeCode GmbH</a>. All rights reserved.
376 374 <a href="https://rhodecode.com/help/" target="_blank">Support</a>
377 375 </p>
378 376 <p class="server-instance" style="display:none">
379 377 RhodeCode instance id: vps1.local-105134
380 378 </p>
381 379 </div>
382 380 </div>
383 381 </div>
384 382 <!-- END FOOTER -->
385 383 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
386 384 <div class="modal-dialog">
387 385 <div class="modal-content">
388 386 <div class="modal-header">
389 387 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
390 388 <h4 class="modal-title" id="myModalLabel">Keyboard shortcuts</h4>
391 389 </div>
392 390 <div class="modal-body">
393 391 <div class="block-left">
394 392 <table class="keyboard-mappings">
395 393 <tbody>
396 394 <tr>
397 395 <th></th>
398 396 <th>Site-wide shortcuts</th>
399 397 </tr>
400 398 <tr>
401 399 <td class="keys">
402 400 <span class="key tag">/</span>
403 401 </td>
404 402 <td>Open quick search box</td>
405 403 </tr>
406 404 <tr>
407 405 <td class="keys">
408 406 <span class="key tag">g h</span>
409 407 </td>
410 408 <td>Goto home page</td>
411 409 </tr>
412 410 <tr>
413 411 <td class="keys">
414 412 <span class="key tag">g g</span>
415 413 </td>
416 414 <td>Goto my private gists page</td>
417 415 </tr>
418 416 <tr>
419 417 <td class="keys">
420 418 <span class="key tag">g G</span>
421 419 </td>
422 420 <td>Goto my public gists page</td>
423 421 </tr>
424 422 <tr>
425 423 <td class="keys">
426 424 <span class="key tag">n r</span>
427 425 </td>
428 426 <td>New repository page</td>
429 427 </tr>
430 428 <tr>
431 429 <td class="keys">
432 430 <span class="key tag">n g</span>
433 431 </td>
434 432 <td>New gist page</td>
435 433 </tr>
436 434 </tbody>
437 435 </table>
438 436 </div>
439 437 <div class="block-left">
440 438 <table class="keyboard-mappings">
441 439 <tbody>
442 440 <tr>
443 441 <th></th>
444 442 <th>Repositories</th>
445 443 </tr>
446 444 <tr>
447 445 <td class="keys">
448 446 <span class="key tag">g s</span>
449 447 </td>
450 448 <td>Goto summary page</td>
451 449 </tr>
452 450 <tr>
453 451 <td class="keys">
454 452 <span class="key tag">g c</span>
455 453 </td>
456 454 <td>Goto changelog page</td>
457 455 </tr>
458 456 <tr>
459 457 <td class="keys">
460 458 <span class="key tag">g f</span>
461 459 </td>
462 460 <td>Goto files page</td>
463 461 </tr>
464 462 <tr>
465 463 <td class="keys">
466 464 <span class="key tag">g F</span>
467 465 </td>
468 466 <td>Goto files page with file search activated</td>
469 467 </tr>
470 468 <tr>
471 469 <td class="keys">
472 470 <span class="key tag">g p</span>
473 471 </td>
474 472 <td>Goto pull requests page</td>
475 473 </tr>
476 474 <tr>
477 475 <td class="keys">
478 476 <span class="key tag">g o</span>
479 477 </td>
480 478 <td>Goto repository settings</td>
481 479 </tr>
482 480 <tr>
483 481 <td class="keys">
484 482 <span class="key tag">g O</span>
485 483 </td>
486 484 <td>Goto repository permissions settings</td>
487 485 </tr>
488 486 </tbody>
489 487 </table>
490 488 </div>
491 489 </div>
492 490 <div class="modal-footer">
493 491 </div>
494 492 </div><!-- /.modal-content -->
495 493 </div><!-- /.modal-dialog -->
496 494 </div><!-- /.modal -->
497 495 </body>
498 </html> No newline at end of file
496 </html>
General Comments 0
You need to be logged in to leave comments. Login now