Show More
@@ -1,108 +1,104 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | ## |
|
3 | 3 | ## See also repo_settings.html |
|
4 | 4 | ## |
|
5 | 5 | <%inherit file="/base/base.mako"/> |
|
6 | 6 | |
|
7 | 7 | <%def name="title()"> |
|
8 | 8 | ${_('%s repository settings') % c.rhodecode_db_repo.repo_name} |
|
9 | 9 | %if c.rhodecode_name: |
|
10 | 10 | · ${h.branding(c.rhodecode_name)} |
|
11 | 11 | %endif |
|
12 | 12 | </%def> |
|
13 | 13 | |
|
14 | 14 | <%def name="breadcrumbs_links()"> |
|
15 | 15 | ${_('Settings')} |
|
16 | 16 | </%def> |
|
17 | 17 | |
|
18 | 18 | <%def name="menu_bar_nav()"> |
|
19 | 19 | ${self.menu_items(active='repositories')} |
|
20 | 20 | </%def> |
|
21 | 21 | |
|
22 | 22 | <%def name="menu_bar_subnav()"> |
|
23 | 23 | ${self.repo_menu(active='settings')} |
|
24 | 24 | </%def> |
|
25 | 25 | |
|
26 | 26 | <%def name="main_content()"> |
|
27 | 27 | % if hasattr(c, 'repo_edit_template'): |
|
28 | 28 | <%include file="${c.repo_edit_template}"/> |
|
29 | 29 | % else: |
|
30 | 30 | <%include file="/admin/repos/repo_edit_${c.active}.mako"/> |
|
31 | 31 | % endif |
|
32 | 32 | </%def> |
|
33 | 33 | |
|
34 | 34 | |
|
35 | 35 | <%def name="main()"> |
|
36 | 36 | <div class="box"> |
|
37 | <div class="title"> | |
|
38 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
39 | ||
|
40 | </div> | |
|
41 | 37 | |
|
42 | 38 | <div class="sidebar-col-wrapper scw-small"> |
|
43 | 39 | <div class="sidebar"> |
|
44 | 40 | <ul class="nav nav-pills nav-stacked"> |
|
45 | 41 | <li class="${'active' if c.active=='settings' else ''}"> |
|
46 | 42 | <a href="${h.route_path('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a> |
|
47 | 43 | </li> |
|
48 | 44 | <li class="${'active' if c.active=='permissions' else ''}"> |
|
49 | 45 | <a href="${h.route_path('edit_repo_perms', repo_name=c.repo_name)}">${_('Permissions')}</a> |
|
50 | 46 | </li> |
|
51 | 47 | <li class="${'active' if c.active=='permissions_branch' else ''}"> |
|
52 | 48 | <a href="${h.route_path('edit_repo_perms_branch', repo_name=c.repo_name)}">${_('Branch Permissions')}</a> |
|
53 | 49 | </li> |
|
54 | 50 | <li class="${'active' if c.active=='advanced' else ''}"> |
|
55 | 51 | <a href="${h.route_path('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a> |
|
56 | 52 | </li> |
|
57 | 53 | <li class="${'active' if c.active=='vcs' else ''}"> |
|
58 | 54 | <a href="${h.route_path('edit_repo_vcs', repo_name=c.repo_name)}">${_('VCS')}</a> |
|
59 | 55 | </li> |
|
60 | 56 | <li class="${'active' if c.active=='fields' else ''}"> |
|
61 | 57 | <a href="${h.route_path('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a> |
|
62 | 58 | </li> |
|
63 | 59 | <li class="${'active' if c.active=='issuetracker' else ''}"> |
|
64 | 60 | <a href="${h.route_path('edit_repo_issuetracker', repo_name=c.repo_name)}">${_('Issue Tracker')}</a> |
|
65 | 61 | </li> |
|
66 | 62 | <li class="${'active' if c.active=='caches' else ''}"> |
|
67 | 63 | <a href="${h.route_path('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a> |
|
68 | 64 | </li> |
|
69 | 65 | %if c.rhodecode_db_repo.repo_type != 'svn': |
|
70 | 66 | <li class="${'active' if c.active=='remote' else ''}"> |
|
71 | 67 | <a href="${h.route_path('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote sync')}</a> |
|
72 | 68 | </li> |
|
73 | 69 | %endif |
|
74 | 70 | <li class="${'active' if c.active=='statistics' else ''}"> |
|
75 | 71 | <a href="${h.route_path('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a> |
|
76 | 72 | </li> |
|
77 | 73 | <li class="${'active' if c.active=='integrations' else ''}"> |
|
78 | 74 | <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a> |
|
79 | 75 | </li> |
|
80 | 76 | %if c.rhodecode_db_repo.repo_type != 'svn': |
|
81 | 77 | <li class="${'active' if c.active=='reviewers' else ''}"> |
|
82 | 78 | <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a> |
|
83 | 79 | </li> |
|
84 | 80 | %endif |
|
85 | 81 | <li class="${'active' if c.active=='automation' else ''}"> |
|
86 | 82 | <a href="${h.route_path('repo_automation', repo_name=c.repo_name)}">${_('Automation')}</a> |
|
87 | 83 | </li> |
|
88 | 84 | <li class="${'active' if c.active=='maintenance' else ''}"> |
|
89 | 85 | <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a> |
|
90 | 86 | </li> |
|
91 | 87 | <li class="${'active' if c.active=='strip' else ''}"> |
|
92 | 88 | <a href="${h.route_path('edit_repo_strip', repo_name=c.repo_name)}">${_('Strip')}</a> |
|
93 | 89 | </li> |
|
94 | 90 | <li class="${'active' if c.active=='audit' else ''}"> |
|
95 | 91 | <a href="${h.route_path('edit_repo_audit_logs', repo_name=c.repo_name)}">${_('Audit logs')}</a> |
|
96 | 92 | </li> |
|
97 | 93 | |
|
98 | 94 | </ul> |
|
99 | 95 | </div> |
|
100 | 96 | |
|
101 | 97 | <div class="main-content-full-width"> |
|
102 | 98 | ${self.main_content()} |
|
103 | 99 | </div> |
|
104 | 100 | |
|
105 | 101 | </div> |
|
106 | 102 | </div> |
|
107 | 103 | |
|
108 | 104 | </%def> No newline at end of file |
@@ -1,102 +1,102 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('%s Bookmarks') % c.repo_name} |
|
6 | 6 | %if c.rhodecode_name: |
|
7 | 7 | · ${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 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
27 | ||
|
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 | emptyTable: _gettext("No bookmarks available yet.") |
|
73 | 73 | }, |
|
74 | 74 | "initComplete": function(settings, json) { |
|
75 | 75 | get_datatable_count(); |
|
76 | 76 | timeagoActivate(); |
|
77 | 77 | compare_radio_buttons("${c.repo_name}", 'book'); |
|
78 | 78 | } |
|
79 | 79 | }); |
|
80 | 80 | |
|
81 | 81 | // update when things change |
|
82 | 82 | $('#obj_list_table').on('draw.dt', function() { |
|
83 | 83 | get_datatable_count(); |
|
84 | 84 | timeagoActivate(); |
|
85 | 85 | }); |
|
86 | 86 | |
|
87 | 87 | // filter, filter both grids |
|
88 | 88 | $('#q_filter').on('keyup', function() { |
|
89 | 89 | var obj_api = $('#obj_list_table').dataTable().api(); |
|
90 | 90 | obj_api |
|
91 | 91 | .columns(0) |
|
92 | 92 | .search(this.value) |
|
93 | 93 | .draw(); |
|
94 | 94 | }); |
|
95 | 95 | |
|
96 | 96 | // refilter table if page load via back button |
|
97 | 97 | $("#q_filter").trigger('keyup'); |
|
98 | 98 | |
|
99 | 99 | }); |
|
100 | 100 | |
|
101 | 101 | </script> |
|
102 | 102 | </%def> |
@@ -1,101 +1,101 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('%s Branches') % c.repo_name} |
|
6 | 6 | %if c.rhodecode_name: |
|
7 | 7 | · ${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 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
27 | ||
|
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 | emptyTable: _gettext("No branches available yet.") |
|
72 | 72 | }, |
|
73 | 73 | "initComplete": function( settings, json ) { |
|
74 | 74 | get_datatable_count(); |
|
75 | 75 | timeagoActivate(); |
|
76 | 76 | compare_radio_buttons("${c.repo_name}", 'branch'); |
|
77 | 77 | } |
|
78 | 78 | }); |
|
79 | 79 | |
|
80 | 80 | // update when things change |
|
81 | 81 | $('#obj_list_table').on('draw.dt', function() { |
|
82 | 82 | get_datatable_count(); |
|
83 | 83 | timeagoActivate(); |
|
84 | 84 | }); |
|
85 | 85 | |
|
86 | 86 | // filter, filter both grids |
|
87 | 87 | $('#q_filter').on( 'keyup', function () { |
|
88 | 88 | var obj_api = $('#obj_list_table').dataTable().api(); |
|
89 | 89 | obj_api |
|
90 | 90 | .columns(0) |
|
91 | 91 | .search(this.value) |
|
92 | 92 | .draw(); |
|
93 | 93 | }); |
|
94 | 94 | |
|
95 | 95 | // refilter table if page load via back button |
|
96 | 96 | $("#q_filter").trigger('keyup'); |
|
97 | 97 | |
|
98 | 98 | }); |
|
99 | 99 | |
|
100 | 100 | </script> |
|
101 | 101 | </%def> |
@@ -1,350 +1,347 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | <%inherit file="/base/base.mako"/> |
|
4 | 4 | <%namespace name="diff_block" file="/changeset/diff_block.mako"/> |
|
5 | 5 | |
|
6 | 6 | <%def name="title()"> |
|
7 | 7 | ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)} |
|
8 | 8 | %if c.rhodecode_name: |
|
9 | 9 | · ${h.branding(c.rhodecode_name)} |
|
10 | 10 | %endif |
|
11 | 11 | </%def> |
|
12 | 12 | |
|
13 | 13 | <%def name="menu_bar_nav()"> |
|
14 | 14 | ${self.menu_items(active='repositories')} |
|
15 | 15 | </%def> |
|
16 | 16 | |
|
17 | 17 | <%def name="menu_bar_subnav()"> |
|
18 | 18 | ${self.repo_menu(active='changelog')} |
|
19 | 19 | </%def> |
|
20 | 20 | |
|
21 | 21 | <%def name="main()"> |
|
22 | 22 | <script> |
|
23 | 23 | // TODO: marcink switch this to pyroutes |
|
24 | 24 | AJAX_COMMENT_DELETE_URL = "${h.route_path('repo_commit_comment_delete',repo_name=c.repo_name,commit_id=c.commit.raw_id,comment_id='__COMMENT_ID__')}"; |
|
25 | 25 | templateContext.commit_data.commit_id = "${c.commit.raw_id}"; |
|
26 | 26 | </script> |
|
27 | 27 | <div class="box"> |
|
28 | <div class="title"> | |
|
29 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
30 | </div> | |
|
31 | 28 | |
|
32 | 29 | <div id="changeset_compare_view_content" class="summary changeset"> |
|
33 | 30 | <div class="summary-detail"> |
|
34 | 31 | <div class="summary-detail-header"> |
|
35 | 32 | <div class="breadcrumbs files_location"> |
|
36 | 33 | <h4> |
|
37 | 34 | ${_('Commit')} |
|
38 | 35 | |
|
39 | 36 | <code> |
|
40 | 37 | ${h.show_id(c.commit)} |
|
41 | 38 | </code> |
|
42 | 39 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i> |
|
43 | 40 | % if hasattr(c.commit, 'phase'): |
|
44 | 41 | <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span> |
|
45 | 42 | % endif |
|
46 | 43 | |
|
47 | 44 | ## obsolete commits |
|
48 | 45 | % if hasattr(c.commit, 'obsolete'): |
|
49 | 46 | % if c.commit.obsolete: |
|
50 | 47 | <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span> |
|
51 | 48 | % endif |
|
52 | 49 | % endif |
|
53 | 50 | |
|
54 | 51 | ## hidden commits |
|
55 | 52 | % if hasattr(c.commit, 'hidden'): |
|
56 | 53 | % if c.commit.hidden: |
|
57 | 54 | <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span> |
|
58 | 55 | % endif |
|
59 | 56 | % endif |
|
60 | 57 | </h4> |
|
61 | 58 | |
|
62 | 59 | </div> |
|
63 | 60 | <div class="pull-right"> |
|
64 | 61 | <span id="parent_link"> |
|
65 | 62 | <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a> |
|
66 | 63 | </span> |
|
67 | 64 | | |
|
68 | 65 | <span id="child_link"> |
|
69 | 66 | <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a> |
|
70 | 67 | </span> |
|
71 | 68 | </div> |
|
72 | 69 | </div> |
|
73 | 70 | |
|
74 | 71 | <div class="fieldset"> |
|
75 | 72 | <div class="left-label"> |
|
76 | 73 | ${_('Description')}: |
|
77 | 74 | </div> |
|
78 | 75 | <div class="right-content"> |
|
79 | 76 | <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> |
|
80 | 77 | <div id="message_expand" style="display:none;"> |
|
81 | 78 | ${_('Expand')} |
|
82 | 79 | </div> |
|
83 | 80 | </div> |
|
84 | 81 | </div> |
|
85 | 82 | |
|
86 | 83 | %if c.statuses: |
|
87 | 84 | <div class="fieldset"> |
|
88 | 85 | <div class="left-label"> |
|
89 | 86 | ${_('Commit status')}: |
|
90 | 87 | </div> |
|
91 | 88 | <div class="right-content"> |
|
92 | 89 | <div class="changeset-status-ico"> |
|
93 | 90 | <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div> |
|
94 | 91 | </div> |
|
95 | 92 | <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div> |
|
96 | 93 | </div> |
|
97 | 94 | </div> |
|
98 | 95 | %endif |
|
99 | 96 | |
|
100 | 97 | <div class="fieldset"> |
|
101 | 98 | <div class="left-label"> |
|
102 | 99 | ${_('References')}: |
|
103 | 100 | </div> |
|
104 | 101 | <div class="right-content"> |
|
105 | 102 | <div class="tags"> |
|
106 | 103 | |
|
107 | 104 | %if c.commit.merge: |
|
108 | 105 | <span class="mergetag tag"> |
|
109 | 106 | <i class="icon-merge"></i>${_('merge')} |
|
110 | 107 | </span> |
|
111 | 108 | %endif |
|
112 | 109 | |
|
113 | 110 | %if h.is_hg(c.rhodecode_repo): |
|
114 | 111 | %for book in c.commit.bookmarks: |
|
115 | 112 | <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}"> |
|
116 | 113 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> |
|
117 | 114 | </span> |
|
118 | 115 | %endfor |
|
119 | 116 | %endif |
|
120 | 117 | |
|
121 | 118 | %for tag in c.commit.tags: |
|
122 | 119 | <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}"> |
|
123 | 120 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=tag))}"><i class="icon-tag"></i>${tag}</a> |
|
124 | 121 | </span> |
|
125 | 122 | %endfor |
|
126 | 123 | |
|
127 | 124 | %if c.commit.branch: |
|
128 | 125 | <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % c.commit.branch)}"> |
|
129 | 126 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=c.commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a> |
|
130 | 127 | </span> |
|
131 | 128 | %endif |
|
132 | 129 | </div> |
|
133 | 130 | </div> |
|
134 | 131 | </div> |
|
135 | 132 | |
|
136 | 133 | <div class="fieldset"> |
|
137 | 134 | <div class="left-label"> |
|
138 | 135 | ${_('Diff options')}: |
|
139 | 136 | </div> |
|
140 | 137 | <div class="right-content"> |
|
141 | 138 | <div class="diff-actions"> |
|
142 | 139 | <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> |
|
143 | 140 | ${_('Raw Diff')} |
|
144 | 141 | </a> |
|
145 | 142 | | |
|
146 | 143 | <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}"> |
|
147 | 144 | ${_('Patch Diff')} |
|
148 | 145 | </a> |
|
149 | 146 | | |
|
150 | 147 | <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> |
|
151 | 148 | ${_('Download Diff')} |
|
152 | 149 | </a> |
|
153 | 150 | </div> |
|
154 | 151 | </div> |
|
155 | 152 | </div> |
|
156 | 153 | |
|
157 | 154 | <div class="fieldset"> |
|
158 | 155 | <div class="left-label"> |
|
159 | 156 | ${_('Comments')}: |
|
160 | 157 | </div> |
|
161 | 158 | <div class="right-content"> |
|
162 | 159 | <div class="comments-number"> |
|
163 | 160 | %if c.comments: |
|
164 | 161 | <a href="#comments">${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>, |
|
165 | 162 | %else: |
|
166 | 163 | ${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)} |
|
167 | 164 | %endif |
|
168 | 165 | %if c.inline_cnt: |
|
169 | 166 | <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a> |
|
170 | 167 | %else: |
|
171 | 168 | ${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt} |
|
172 | 169 | %endif |
|
173 | 170 | </div> |
|
174 | 171 | </div> |
|
175 | 172 | </div> |
|
176 | 173 | |
|
177 | 174 | <div class="fieldset"> |
|
178 | 175 | <div class="left-label"> |
|
179 | 176 | ${_('Unresolved TODOs')}: |
|
180 | 177 | </div> |
|
181 | 178 | <div class="right-content"> |
|
182 | 179 | <div class="comments-number"> |
|
183 | 180 | % if c.unresolved_comments: |
|
184 | 181 | % for co in c.unresolved_comments: |
|
185 | 182 | <a class="permalink" href="#comment-${co.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))"> #${co.comment_id}</a>${'' if loop.last else ','} |
|
186 | 183 | % endfor |
|
187 | 184 | % else: |
|
188 | 185 | ${_('There are no unresolved TODOs')} |
|
189 | 186 | % endif |
|
190 | 187 | </div> |
|
191 | 188 | </div> |
|
192 | 189 | </div> |
|
193 | 190 | |
|
194 | 191 | </div> <!-- end summary-detail --> |
|
195 | 192 | |
|
196 | 193 | <div id="commit-stats" class="sidebar-right"> |
|
197 | 194 | <div class="summary-detail-header"> |
|
198 | 195 | <h4 class="item"> |
|
199 | 196 | ${_('Author')} |
|
200 | 197 | </h4> |
|
201 | 198 | </div> |
|
202 | 199 | <div class="sidebar-right-content"> |
|
203 | 200 | ${self.gravatar_with_user(c.commit.author)} |
|
204 | 201 | <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div> |
|
205 | 202 | </div> |
|
206 | 203 | </div><!-- end sidebar --> |
|
207 | 204 | </div> <!-- end summary --> |
|
208 | 205 | <div class="cs_files"> |
|
209 | 206 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
210 | 207 | ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id])} |
|
211 | 208 | ${cbdiffs.render_diffset( |
|
212 | 209 | c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )} |
|
213 | 210 | </div> |
|
214 | 211 | |
|
215 | 212 | ## template for inline comment form |
|
216 | 213 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
217 | 214 | |
|
218 | 215 | ## render comments |
|
219 | 216 | ${comment.generate_comments(c.comments)} |
|
220 | 217 | |
|
221 | 218 | ## main comment form and it status |
|
222 | 219 | ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id), |
|
223 | 220 | h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))} |
|
224 | 221 | </div> |
|
225 | 222 | |
|
226 | 223 | ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS |
|
227 | 224 | <script type="text/javascript"> |
|
228 | 225 | |
|
229 | 226 | $(document).ready(function() { |
|
230 | 227 | |
|
231 | 228 | var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10); |
|
232 | 229 | if($('#trimmed_message_box').height() === boxmax){ |
|
233 | 230 | $('#message_expand').show(); |
|
234 | 231 | } |
|
235 | 232 | |
|
236 | 233 | $('#message_expand').on('click', function(e){ |
|
237 | 234 | $('#trimmed_message_box').css('max-height', 'none'); |
|
238 | 235 | $(this).hide(); |
|
239 | 236 | }); |
|
240 | 237 | |
|
241 | 238 | $('.show-inline-comments').on('click', function(e){ |
|
242 | 239 | var boxid = $(this).attr('data-comment-id'); |
|
243 | 240 | var button = $(this); |
|
244 | 241 | |
|
245 | 242 | if(button.hasClass("comments-visible")) { |
|
246 | 243 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
247 | 244 | $(this).hide(); |
|
248 | 245 | }); |
|
249 | 246 | button.removeClass("comments-visible"); |
|
250 | 247 | } else { |
|
251 | 248 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
252 | 249 | $(this).show(); |
|
253 | 250 | }); |
|
254 | 251 | button.addClass("comments-visible"); |
|
255 | 252 | } |
|
256 | 253 | }); |
|
257 | 254 | |
|
258 | 255 | |
|
259 | 256 | // next links |
|
260 | 257 | $('#child_link').on('click', function(e){ |
|
261 | 258 | // fetch via ajax what is going to be the next link, if we have |
|
262 | 259 | // >1 links show them to user to choose |
|
263 | 260 | if(!$('#child_link').hasClass('disabled')){ |
|
264 | 261 | $.ajax({ |
|
265 | 262 | url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}', |
|
266 | 263 | success: function(data) { |
|
267 | 264 | if(data.results.length === 0){ |
|
268 | 265 | $('#child_link').html("${_('No Child Commits')}").addClass('disabled'); |
|
269 | 266 | } |
|
270 | 267 | if(data.results.length === 1){ |
|
271 | 268 | var commit = data.results[0]; |
|
272 | 269 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); |
|
273 | 270 | } |
|
274 | 271 | else if(data.results.length === 2){ |
|
275 | 272 | $('#child_link').addClass('disabled'); |
|
276 | 273 | $('#child_link').addClass('double'); |
|
277 | 274 | var _html = ''; |
|
278 | 275 | _html +='<a title="__title__" href="__url__">__rev__</a> ' |
|
279 | 276 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
280 | 277 | .replace('__title__', data.results[0].message) |
|
281 | 278 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); |
|
282 | 279 | _html +=' | '; |
|
283 | 280 | _html +='<a title="__title__" href="__url__">__rev__</a> ' |
|
284 | 281 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
285 | 282 | .replace('__title__', data.results[1].message) |
|
286 | 283 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); |
|
287 | 284 | $('#child_link').html(_html); |
|
288 | 285 | } |
|
289 | 286 | } |
|
290 | 287 | }); |
|
291 | 288 | e.preventDefault(); |
|
292 | 289 | } |
|
293 | 290 | }); |
|
294 | 291 | |
|
295 | 292 | // prev links |
|
296 | 293 | $('#parent_link').on('click', function(e){ |
|
297 | 294 | // fetch via ajax what is going to be the next link, if we have |
|
298 | 295 | // >1 links show them to user to choose |
|
299 | 296 | if(!$('#parent_link').hasClass('disabled')){ |
|
300 | 297 | $.ajax({ |
|
301 | 298 | url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}', |
|
302 | 299 | success: function(data) { |
|
303 | 300 | if(data.results.length === 0){ |
|
304 | 301 | $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled'); |
|
305 | 302 | } |
|
306 | 303 | if(data.results.length === 1){ |
|
307 | 304 | var commit = data.results[0]; |
|
308 | 305 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); |
|
309 | 306 | } |
|
310 | 307 | else if(data.results.length === 2){ |
|
311 | 308 | $('#parent_link').addClass('disabled'); |
|
312 | 309 | $('#parent_link').addClass('double'); |
|
313 | 310 | var _html = ''; |
|
314 | 311 | _html +='<a title="__title__" href="__url__">Parent __rev__</a>' |
|
315 | 312 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
316 | 313 | .replace('__title__', data.results[0].message) |
|
317 | 314 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); |
|
318 | 315 | _html +=' | '; |
|
319 | 316 | _html +='<a title="__title__" href="__url__">Parent __rev__</a>' |
|
320 | 317 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
321 | 318 | .replace('__title__', data.results[1].message) |
|
322 | 319 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); |
|
323 | 320 | $('#parent_link').html(_html); |
|
324 | 321 | } |
|
325 | 322 | } |
|
326 | 323 | }); |
|
327 | 324 | e.preventDefault(); |
|
328 | 325 | } |
|
329 | 326 | }); |
|
330 | 327 | |
|
331 | 328 | if (location.hash) { |
|
332 | 329 | var result = splitDelimitedHash(location.hash); |
|
333 | 330 | var line = $('html').find(result.loc); |
|
334 | 331 | if (line.length > 0){ |
|
335 | 332 | offsetScroll(line, 70); |
|
336 | 333 | } |
|
337 | 334 | } |
|
338 | 335 | |
|
339 | 336 | // browse tree @ revision |
|
340 | 337 | $('#files_link').on('click', function(e){ |
|
341 | 338 | window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}'; |
|
342 | 339 | e.preventDefault(); |
|
343 | 340 | }); |
|
344 | 341 | |
|
345 | 342 | // inject comments into their proper positions |
|
346 | 343 | var file_comments = $('.inline-comment-placeholder'); |
|
347 | 344 | }) |
|
348 | 345 | </script> |
|
349 | 346 | |
|
350 | 347 | </%def> |
@@ -1,108 +1,102 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('%s Commits') % c.repo_name} - |
|
6 | 6 | r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)} |
|
7 | 7 | ... |
|
8 | 8 | r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)} |
|
9 | 9 | ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
10 | 10 | %if c.rhodecode_name: |
|
11 | 11 | · ${h.branding(c.rhodecode_name)} |
|
12 | 12 | %endif |
|
13 | 13 | </%def> |
|
14 | 14 | |
|
15 | 15 | <%def name="breadcrumbs_links()"> |
|
16 | 16 | ${_('Commits')} - |
|
17 | 17 | r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)} |
|
18 | 18 | ... |
|
19 | 19 | r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)} |
|
20 | 20 | ${_ungettext('(%s commit)','(%s commits)', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
21 | 21 | </%def> |
|
22 | 22 | |
|
23 | 23 | <%def name="menu_bar_nav()"> |
|
24 | 24 | ${self.menu_items(active='repositories')} |
|
25 | 25 | </%def> |
|
26 | 26 | |
|
27 | 27 | <%def name="menu_bar_subnav()"> |
|
28 | 28 | ${self.repo_menu(active='changelog')} |
|
29 | 29 | </%def> |
|
30 | 30 | |
|
31 | 31 | <%def name="main()"> |
|
32 | <div class="summary-header"> | |
|
33 | <div class="title"> | |
|
34 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
35 | </div> | |
|
36 | </div> | |
|
37 | ||
|
38 | 32 | |
|
39 | 33 | <div class="summary changeset"> |
|
40 | 34 | <div class="summary-detail"> |
|
41 | 35 | <div class="summary-detail-header"> |
|
42 | 36 | <span class="breadcrumbs files_location"> |
|
43 | 37 | <h4> |
|
44 | 38 | ${_('Commit Range')} |
|
45 | 39 | <code> |
|
46 | 40 | r${c.commit_ranges[0].idx}:${h.short_id(c.commit_ranges[0].raw_id)}...r${c.commit_ranges[-1].idx}:${h.short_id(c.commit_ranges[-1].raw_id)} |
|
47 | 41 | </code> |
|
48 | 42 | </h4> |
|
49 | 43 | </span> |
|
50 | 44 | </div> |
|
51 | 45 | |
|
52 | 46 | <div class="fieldset"> |
|
53 | 47 | <div class="left-label"> |
|
54 | 48 | ${_('Diff option')}: |
|
55 | 49 | </div> |
|
56 | 50 | <div class="right-content"> |
|
57 | 51 | <div class="btn btn-primary"> |
|
58 | 52 | <a href="${h.route_path('repo_compare', |
|
59 | 53 | repo_name=c.repo_name, |
|
60 | 54 | source_ref_type='rev', |
|
61 | 55 | source_ref=getattr(c.commit_ranges[0].parents[0] if c.commit_ranges[0].parents else h.EmptyCommit(), 'raw_id'), |
|
62 | 56 | target_ref_type='rev', |
|
63 | 57 | target_ref=c.commit_ranges[-1].raw_id)}" |
|
64 | 58 | > |
|
65 | 59 | ${_('Show combined compare')} |
|
66 | 60 | </a> |
|
67 | 61 | </div> |
|
68 | 62 | </div> |
|
69 | 63 | </div> |
|
70 | 64 | |
|
71 | 65 | </div> <!-- end summary-detail --> |
|
72 | 66 | |
|
73 | 67 | </div> <!-- end summary --> |
|
74 | 68 | |
|
75 | 69 | <div id="changeset_compare_view_content"> |
|
76 | 70 | <div class="pull-left"> |
|
77 | 71 | <div class="btn-group"> |
|
78 | 72 | <a |
|
79 | 73 | class="btn" |
|
80 | 74 | href="#" |
|
81 | 75 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
82 | 76 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
83 | 77 | </a> |
|
84 | 78 | <a |
|
85 | 79 | class="btn" |
|
86 | 80 | href="#" |
|
87 | 81 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
88 | 82 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
89 | 83 | </a> |
|
90 | 84 | </div> |
|
91 | 85 | </div> |
|
92 | 86 | ## Commit range generated below |
|
93 | 87 | <%include file="../compare/compare_commits.mako"/> |
|
94 | 88 | <div class="cs_files"> |
|
95 | 89 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
96 | 90 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
97 | 91 | <%namespace name="diff_block" file="/changeset/diff_block.mako"/> |
|
98 | 92 | ${cbdiffs.render_diffset_menu()} |
|
99 | 93 | %for commit in c.commit_ranges: |
|
100 | 94 | ${cbdiffs.render_diffset( |
|
101 | 95 | diffset=c.changes[commit.raw_id], |
|
102 | 96 | collapse_when_files_over=5, |
|
103 | 97 | commit=commit, |
|
104 | 98 | )} |
|
105 | 99 | %endfor |
|
106 | 100 | </div> |
|
107 | 101 | </div> |
|
108 | 102 | </%def> |
@@ -1,238 +1,236 b'' | |||
|
1 | 1 | <%inherit file="/base/base.mako"/> |
|
2 | 2 | |
|
3 | 3 | <%def name="title()"> |
|
4 | 4 | ${_('%s Files Add') % c.repo_name} |
|
5 | 5 | %if c.rhodecode_name: |
|
6 | 6 | · ${h.branding(c.rhodecode_name)} |
|
7 | 7 | %endif |
|
8 | 8 | </%def> |
|
9 | 9 | |
|
10 | 10 | <%def name="menu_bar_nav()"> |
|
11 | 11 | ${self.menu_items(active='repositories')} |
|
12 | 12 | </%def> |
|
13 | 13 | |
|
14 | 14 | <%def name="breadcrumbs_links()"> |
|
15 | 15 | ${_('Add new file')} @ ${h.show_id(c.commit)} ${_('Branch')}: ${c.commit.branch} |
|
16 | 16 | </%def> |
|
17 | 17 | |
|
18 | 18 | <%def name="menu_bar_subnav()"> |
|
19 | 19 | ${self.repo_menu(active='files')} |
|
20 | 20 | </%def> |
|
21 | 21 | |
|
22 | 22 | <%def name="main()"> |
|
23 | 23 | <div class="box"> |
|
24 | <div class="title"> | |
|
25 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
26 | </div> | |
|
24 | ||
|
27 | 25 | <div class="edit-file-title"> |
|
28 | 26 | ${self.breadcrumbs()} |
|
29 | 27 | </div> |
|
30 | 28 | ${h.secure_form(h.route_path('repo_files_create_file', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path), id='eform', enctype="multipart/form-data", class_="form-horizontal", request=request)} |
|
31 | 29 | <div class="edit-file-fieldset"> |
|
32 | 30 | <div class="fieldset"> |
|
33 | 31 | <div id="destination-label" class="left-label"> |
|
34 | 32 | ${_('Path')}: |
|
35 | 33 | </div> |
|
36 | 34 | <div class="right-content"> |
|
37 | 35 | <div id="specify-custom-path-container"> |
|
38 | 36 | <span id="path-breadcrumbs">${h.files_breadcrumbs(c.repo_name,c.commit.raw_id,c.f_path)}</span> |
|
39 | 37 | <a class="custom-path-link" id="specify-custom-path" href="#">${_('Specify Custom Path')}</a> |
|
40 | 38 | </div> |
|
41 | 39 | <div id="remove-custom-path-container" style="display: none;"> |
|
42 | 40 | ${c.repo_name}/ |
|
43 | 41 | <input type="input-small" value="${c.f_path}" size="46" name="location" id="location"> |
|
44 | 42 | <a class="custom-path-link" id="remove-custom-path" href="#">${_('Remove Custom Path')}</a> |
|
45 | 43 | </div> |
|
46 | 44 | </div> |
|
47 | 45 | </div> |
|
48 | 46 | <div id="filename_container" class="fieldset"> |
|
49 | 47 | <div class="filename-label left-label"> |
|
50 | 48 | ${_('Filename')}: |
|
51 | 49 | </div> |
|
52 | 50 | <div class="right-content"> |
|
53 | 51 | <input class="input-small" type="text" value="" size="46" name="filename" id="filename"> |
|
54 | 52 | <p>${_('or')} <a id="upload_file_enable" href="#">${_('Upload File')}</a></p> |
|
55 | 53 | </div> |
|
56 | 54 | </div> |
|
57 | 55 | <div id="upload_file_container" class="fieldset" style="display: none;"> |
|
58 | 56 | <div class="filename-label left-label"> |
|
59 | 57 | ${_('Filename')}: |
|
60 | 58 | </div> |
|
61 | 59 | <div class="right-content"> |
|
62 | 60 | <input class="input-small" type="text" value="" size="46" name="filename_upload" id="filename_upload" placeholder="${_('No file selected')}"> |
|
63 | 61 | </div> |
|
64 | 62 | <div class="filename-label left-label file-upload-label"> |
|
65 | 63 | ${_('Upload file')}: |
|
66 | 64 | </div> |
|
67 | 65 | <div class="right-content file-upload-input"> |
|
68 | 66 | <label for="upload_file" class="btn btn-default">Browse</label> |
|
69 | 67 | |
|
70 | 68 | <input type="file" name="upload_file" id="upload_file"> |
|
71 | 69 | <p>${_('or')} <a id="file_enable" href="#">${_('Create New File')}</a></p> |
|
72 | 70 | </div> |
|
73 | 71 | </div> |
|
74 | 72 | </div> |
|
75 | 73 | <div class="table"> |
|
76 | 74 | <div id="files_data"> |
|
77 | 75 | <div id="codeblock" class="codeblock"> |
|
78 | 76 | <div class="code-header form" id="set_mode_header"> |
|
79 | 77 | <div class="fields"> |
|
80 | 78 | ${h.dropdownmenu('set_mode','plain',[('plain',_('plain'))],enable_filter=True)} |
|
81 | 79 | <label for="line_wrap">${_('line wraps')}</label> |
|
82 | 80 | ${h.dropdownmenu('line_wrap', 'off', [('on', _('on')), ('off', _('off')),])} |
|
83 | 81 | |
|
84 | 82 | <div id="render_preview" class="btn btn-small preview hidden" >${_('Preview')}</div> |
|
85 | 83 | </div> |
|
86 | 84 | </div> |
|
87 | 85 | <div id="editor_container"> |
|
88 | 86 | <pre id="editor_pre"></pre> |
|
89 | 87 | <textarea id="editor" name="content" ></textarea> |
|
90 | 88 | <div id="editor_preview"></div> |
|
91 | 89 | </div> |
|
92 | 90 | </div> |
|
93 | 91 | </div> |
|
94 | 92 | </div> |
|
95 | 93 | |
|
96 | 94 | <div class="edit-file-fieldset"> |
|
97 | 95 | <div class="fieldset"> |
|
98 | 96 | <div id="commit-message-label" class="commit-message-label left-label"> |
|
99 | 97 | ${_('Commit Message')}: |
|
100 | 98 | </div> |
|
101 | 99 | <div class="right-content"> |
|
102 | 100 | <div class="message"> |
|
103 | 101 | <textarea id="commit" name="message" placeholder="${c.default_message}"></textarea> |
|
104 | 102 | </div> |
|
105 | 103 | </div> |
|
106 | 104 | </div> |
|
107 | 105 | <div class="pull-right"> |
|
108 | 106 | ${h.reset('reset',_('Cancel'),class_="btn btn-small")} |
|
109 | 107 | ${h.submit('commit_btn',_('Commit changes'),class_="btn btn-small btn-success")} |
|
110 | 108 | </div> |
|
111 | 109 | </div> |
|
112 | 110 | ${h.end_form()} |
|
113 | 111 | </div> |
|
114 | 112 | <script type="text/javascript"> |
|
115 | 113 | |
|
116 | 114 | $('#commit_btn').on('click', function() { |
|
117 | 115 | var button = $(this); |
|
118 | 116 | if (button.hasClass('clicked')) { |
|
119 | 117 | button.attr('disabled', true); |
|
120 | 118 | } else { |
|
121 | 119 | button.addClass('clicked'); |
|
122 | 120 | } |
|
123 | 121 | }); |
|
124 | 122 | |
|
125 | 123 | $('#specify-custom-path').on('click', function(e){ |
|
126 | 124 | e.preventDefault(); |
|
127 | 125 | $('#specify-custom-path-container').hide(); |
|
128 | 126 | $('#remove-custom-path-container').show(); |
|
129 | 127 | $('#destination-label').css('margin-top', '13px'); |
|
130 | 128 | }); |
|
131 | 129 | |
|
132 | 130 | $('#remove-custom-path').on('click', function(e){ |
|
133 | 131 | e.preventDefault(); |
|
134 | 132 | $('#specify-custom-path-container').show(); |
|
135 | 133 | $('#remove-custom-path-container').hide(); |
|
136 | 134 | $('#location').val('${c.f_path}'); |
|
137 | 135 | $('#destination-label').css('margin-top', '0'); |
|
138 | 136 | }); |
|
139 | 137 | |
|
140 | 138 | var hide_upload = function(){ |
|
141 | 139 | $('#files_data').show(); |
|
142 | 140 | $('#upload_file_container').hide(); |
|
143 | 141 | $('#filename_container').show(); |
|
144 | 142 | }; |
|
145 | 143 | |
|
146 | 144 | $('#file_enable').on('click', function(e){ |
|
147 | 145 | e.preventDefault(); |
|
148 | 146 | hide_upload(); |
|
149 | 147 | }); |
|
150 | 148 | |
|
151 | 149 | $('#upload_file_enable').on('click', function(e){ |
|
152 | 150 | e.preventDefault(); |
|
153 | 151 | $('#files_data').hide(); |
|
154 | 152 | $('#upload_file_container').show(); |
|
155 | 153 | $('#filename_container').hide(); |
|
156 | 154 | if (detectIE() && detectIE() <= 9) { |
|
157 | 155 | $('#upload_file_container .file-upload-input label').hide(); |
|
158 | 156 | $('#upload_file_container .file-upload-input span').hide(); |
|
159 | 157 | $('#upload_file_container .file-upload-input input').show(); |
|
160 | 158 | } |
|
161 | 159 | }); |
|
162 | 160 | |
|
163 | 161 | $('#upload_file').on('change', function() { |
|
164 | 162 | if (this.files && this.files[0]) { |
|
165 | 163 | $('#filename_upload').val(this.files[0].name); |
|
166 | 164 | } |
|
167 | 165 | }); |
|
168 | 166 | |
|
169 | 167 | hide_upload(); |
|
170 | 168 | |
|
171 | 169 | var renderer = ""; |
|
172 | 170 | var reset_url = "${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}"; |
|
173 | 171 | var myCodeMirror = initCodeMirror('editor', reset_url, false); |
|
174 | 172 | |
|
175 | 173 | var modes_select = $('#set_mode'); |
|
176 | 174 | fillCodeMirrorOptions(modes_select); |
|
177 | 175 | |
|
178 | 176 | var filename_selector = '#filename'; |
|
179 | 177 | var callback = function(filename, mimetype, mode){ |
|
180 | 178 | CodeMirrorPreviewEnable(mode); |
|
181 | 179 | }; |
|
182 | 180 | // on change of select field set mode |
|
183 | 181 | setCodeMirrorModeFromSelect( |
|
184 | 182 | modes_select, filename_selector, myCodeMirror, callback); |
|
185 | 183 | |
|
186 | 184 | // on entering the new filename set mode, from given extension |
|
187 | 185 | setCodeMirrorModeFromInput( |
|
188 | 186 | modes_select, filename_selector, myCodeMirror, callback); |
|
189 | 187 | |
|
190 | 188 | // if the file is renderable set line wraps automatically |
|
191 | 189 | if (renderer !== ""){ |
|
192 | 190 | var line_wrap = 'on'; |
|
193 | 191 | $($('#line_wrap option[value="'+line_wrap+'"]')[0]).attr("selected", "selected"); |
|
194 | 192 | setCodeMirrorLineWrap(myCodeMirror, true); |
|
195 | 193 | } |
|
196 | 194 | |
|
197 | 195 | // on select line wraps change the editor |
|
198 | 196 | $('#line_wrap').on('change', function(e){ |
|
199 | 197 | var selected = e.currentTarget; |
|
200 | 198 | var line_wraps = {'on': true, 'off': false}[selected.value]; |
|
201 | 199 | setCodeMirrorLineWrap(myCodeMirror, line_wraps) |
|
202 | 200 | }); |
|
203 | 201 | |
|
204 | 202 | // render preview/edit button |
|
205 | 203 | $('#render_preview').on('click', function(e){ |
|
206 | 204 | if($(this).hasClass('preview')){ |
|
207 | 205 | $(this).removeClass('preview'); |
|
208 | 206 | $(this).html("${_('Edit')}"); |
|
209 | 207 | $('#editor_preview').show(); |
|
210 | 208 | $(myCodeMirror.getWrapperElement()).hide(); |
|
211 | 209 | |
|
212 | 210 | var possible_renderer = { |
|
213 | 211 | 'rst':'rst', |
|
214 | 212 | 'markdown':'markdown', |
|
215 | 213 | 'gfm': 'markdown'}[myCodeMirror.getMode().name]; |
|
216 | 214 | var _text = myCodeMirror.getValue(); |
|
217 | 215 | var _renderer = possible_renderer || DEFAULT_RENDERER; |
|
218 | 216 | var post_data = {'text': _text, 'renderer': _renderer, 'csrf_token': CSRF_TOKEN}; |
|
219 | 217 | $('#editor_preview').html(_gettext('Loading ...')); |
|
220 | 218 | var url = pyroutes.url('repo_commit_comment_preview', |
|
221 | 219 | {'repo_name': '${c.repo_name}', |
|
222 | 220 | 'commit_id': '${c.commit.raw_id}'}); |
|
223 | 221 | |
|
224 | 222 | ajaxPOST(url, post_data, function(o){ |
|
225 | 223 | $('#editor_preview').html(o); |
|
226 | 224 | }) |
|
227 | 225 | } |
|
228 | 226 | else{ |
|
229 | 227 | $(this).addClass('preview'); |
|
230 | 228 | $(this).html("${_('Preview')}"); |
|
231 | 229 | $('#editor_preview').hide(); |
|
232 | 230 | $(myCodeMirror.getWrapperElement()).show(); |
|
233 | 231 | } |
|
234 | 232 | }); |
|
235 | 233 | $('#filename').focus(); |
|
236 | 234 | |
|
237 | 235 | </script> |
|
238 | 236 | </%def> |
@@ -1,75 +1,72 b'' | |||
|
1 | 1 | <%inherit file="/base/base.mako"/> |
|
2 | 2 | |
|
3 | 3 | <%def name="title()"> |
|
4 | 4 | ${_('%s Files Delete') % c.repo_name} |
|
5 | 5 | %if c.rhodecode_name: |
|
6 | 6 | · ${h.branding(c.rhodecode_name)} |
|
7 | 7 | %endif |
|
8 | 8 | </%def> |
|
9 | 9 | |
|
10 | 10 | <%def name="menu_bar_nav()"> |
|
11 | 11 | ${self.menu_items(active='repositories')} |
|
12 | 12 | </%def> |
|
13 | 13 | |
|
14 | 14 | <%def name="breadcrumbs_links()"> |
|
15 | 15 | ${_('Delete file')} @ ${h.show_id(c.commit)} |
|
16 | 16 | </%def> |
|
17 | 17 | |
|
18 | 18 | <%def name="menu_bar_subnav()"> |
|
19 | 19 | ${self.repo_menu(active='files')} |
|
20 | 20 | </%def> |
|
21 | 21 | |
|
22 | 22 | <%def name="main()"> |
|
23 | 23 | <div class="box"> |
|
24 | <div class="title"> | |
|
25 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
26 | </div> | |
|
27 | 24 | <div class="edit-file-title"> |
|
28 | 25 | ${self.breadcrumbs()} |
|
29 | 26 | </div> |
|
30 | 27 | ${h.secure_form(h.route_path('repo_files_delete_file', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path), id='eform', class_="form-horizontal", request=request)} |
|
31 | 28 | <div class="edit-file-fieldset"> |
|
32 | 29 | <div class="fieldset"> |
|
33 | 30 | <div id="destination-label" class="left-label"> |
|
34 | 31 | ${_('Path')}: |
|
35 | 32 | </div> |
|
36 | 33 | <div class="right-content"> |
|
37 | 34 | <span id="path-breadcrumbs">${h.files_breadcrumbs(c.repo_name,c.commit.raw_id,c.f_path)}</span> |
|
38 | 35 | </div> |
|
39 | 36 | </div> |
|
40 | 37 | </div> |
|
41 | 38 | |
|
42 | 39 | <div id="codeblock" class="codeblock delete-file-preview"> |
|
43 | 40 | <div class="code-body"> |
|
44 | 41 | %if c.file.is_binary: |
|
45 | 42 | ${_('Binary file (%s)') % c.file.mimetype} |
|
46 | 43 | %else: |
|
47 | 44 | %if c.file.size < c.visual.cut_off_limit_file: |
|
48 | 45 | ${h.pygmentize(c.file,linenos=True,anchorlinenos=False,cssclass="code-highlight")} |
|
49 | 46 | %else: |
|
50 | 47 | ${_('File size {} is bigger then allowed limit {}. ').format(h.format_byte_size_binary(c.file.size), h.format_byte_size_binary(c.visual.cut_off_limit_file))} ${h.link_to(_('Show as raw'), |
|
51 | 48 | h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))} |
|
52 | 49 | %endif |
|
53 | 50 | %endif |
|
54 | 51 | </div> |
|
55 | 52 | </div> |
|
56 | 53 | |
|
57 | 54 | <div class="edit-file-fieldset"> |
|
58 | 55 | <div class="fieldset"> |
|
59 | 56 | <div id="commit-message-label" class="commit-message-label left-label"> |
|
60 | 57 | ${_('Commit Message')}: |
|
61 | 58 | </div> |
|
62 | 59 | <div class="right-content"> |
|
63 | 60 | <div class="message"> |
|
64 | 61 | <textarea id="commit" name="message" placeholder="${c.default_message}"></textarea> |
|
65 | 62 | </div> |
|
66 | 63 | </div> |
|
67 | 64 | </div> |
|
68 | 65 | <div class="pull-right"> |
|
69 | 66 | ${h.reset('reset',_('Cancel'),class_="btn btn-small btn-danger")} |
|
70 | 67 | ${h.submit('commit',_('Delete File'),class_="btn btn-small btn-danger-action")} |
|
71 | 68 | </div> |
|
72 | 69 | </div> |
|
73 | 70 | ${h.end_form()} |
|
74 | 71 | </div> |
|
75 | 72 | </%def> |
@@ -1,197 +1,194 b'' | |||
|
1 | 1 | <%inherit file="/base/base.mako"/> |
|
2 | 2 | |
|
3 | 3 | <%def name="title()"> |
|
4 | 4 | ${_('%s File Edit') % c.repo_name} |
|
5 | 5 | %if c.rhodecode_name: |
|
6 | 6 | · ${h.branding(c.rhodecode_name)} |
|
7 | 7 | %endif |
|
8 | 8 | </%def> |
|
9 | 9 | |
|
10 | 10 | <%def name="menu_bar_nav()"> |
|
11 | 11 | ${self.menu_items(active='repositories')} |
|
12 | 12 | </%def> |
|
13 | 13 | |
|
14 | 14 | <%def name="breadcrumbs_links()"> |
|
15 | 15 | ${_('Edit file')} @ ${h.show_id(c.commit)} |
|
16 | 16 | </%def> |
|
17 | 17 | |
|
18 | 18 | <%def name="menu_bar_subnav()"> |
|
19 | 19 | ${self.repo_menu(active='files')} |
|
20 | 20 | </%def> |
|
21 | 21 | |
|
22 | 22 | <%def name="main()"> |
|
23 | 23 | <% renderer = h.renderer_from_filename(c.f_path)%> |
|
24 | 24 | <div class="box"> |
|
25 | <div class="title"> | |
|
26 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
27 | </div> | |
|
28 | 25 | <div class="edit-file-title"> |
|
29 | 26 | ${self.breadcrumbs()} |
|
30 | 27 | </div> |
|
31 | 28 | <div class="edit-file-fieldset"> |
|
32 | 29 | <div class="fieldset"> |
|
33 | 30 | <div id="destination-label" class="left-label"> |
|
34 | 31 | ${_('Path')}: |
|
35 | 32 | </div> |
|
36 | 33 | <div class="right-content"> |
|
37 | 34 | <div id="specify-custom-path-container"> |
|
38 | 35 | <span id="path-breadcrumbs">${h.files_breadcrumbs(c.repo_name,c.commit.raw_id,c.f_path)}</span> |
|
39 | 36 | </div> |
|
40 | 37 | </div> |
|
41 | 38 | </div> |
|
42 | 39 | </div> |
|
43 | 40 | |
|
44 | 41 | <div class="table"> |
|
45 | 42 | ${h.secure_form(h.route_path('repo_files_update_file', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path), id='eform', request=request)} |
|
46 | 43 | <div id="codeblock" class="codeblock" > |
|
47 | 44 | <div class="code-header"> |
|
48 | 45 | <div class="stats"> |
|
49 | 46 | <i class="icon-file"></i> |
|
50 | 47 | <span class="item">${h.link_to("r%s:%s" % (c.file.commit.idx,h.short_id(c.file.commit.raw_id)),h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.file.commit.raw_id))}</span> |
|
51 | 48 | <span class="item">${h.format_byte_size_binary(c.file.size)}</span> |
|
52 | 49 | <span class="item last">${c.file.mimetype}</span> |
|
53 | 50 | <div class="buttons"> |
|
54 | 51 | <a class="btn btn-mini" href="${h.route_path('repo_changelog_file',repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path)}"> |
|
55 | 52 | <i class="icon-time"></i> ${_('history')} |
|
56 | 53 | </a> |
|
57 | 54 | |
|
58 | 55 | % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): |
|
59 | 56 | % if not c.file.is_binary: |
|
60 | 57 | %if True: |
|
61 | 58 | ${h.link_to(_('source'), h.route_path('repo_files', repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path),class_="btn btn-mini")} |
|
62 | 59 | %else: |
|
63 | 60 | ${h.link_to(_('annotation'),h.route_path('repo_files:annotated',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path),class_="btn btn-mini")} |
|
64 | 61 | %endif |
|
65 | 62 | |
|
66 | 63 | <a class="btn btn-mini" href="${h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}"> |
|
67 | 64 | ${_('raw')} |
|
68 | 65 | </a> |
|
69 | 66 | <a class="btn btn-mini" href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}"> |
|
70 | 67 | <i class="icon-archive"></i> ${_('download')} |
|
71 | 68 | </a> |
|
72 | 69 | % endif |
|
73 | 70 | % endif |
|
74 | 71 | </div> |
|
75 | 72 | </div> |
|
76 | 73 | <div class="form"> |
|
77 | 74 | <label for="set_mode">${_('Editing file')}:</label> |
|
78 | 75 | ${'%s /' % c.file.dir_path if c.file.dir_path else c.file.dir_path} |
|
79 | 76 | <input id="filename" type="text" name="filename" value="${c.file.name}"> |
|
80 | 77 | |
|
81 | 78 | ${h.dropdownmenu('set_mode','plain',[('plain',_('plain'))],enable_filter=True)} |
|
82 | 79 | <label for="line_wrap">${_('line wraps')}</label> |
|
83 | 80 | ${h.dropdownmenu('line_wrap', 'off', [('on', _('on')), ('off', _('off')),])} |
|
84 | 81 | |
|
85 | 82 | <div id="render_preview" class="btn btn-small preview hidden">${_('Preview')}</div> |
|
86 | 83 | </div> |
|
87 | 84 | </div> |
|
88 | 85 | <div id="editor_container"> |
|
89 | 86 | <pre id="editor_pre"></pre> |
|
90 | 87 | <textarea id="editor" name="content" >${h.escape(c.file.content)|n}</textarea> |
|
91 | 88 | <div id="editor_preview" ></div> |
|
92 | 89 | </div> |
|
93 | 90 | </div> |
|
94 | 91 | </div> |
|
95 | 92 | |
|
96 | 93 | <div class="edit-file-fieldset"> |
|
97 | 94 | <div class="fieldset"> |
|
98 | 95 | <div id="commit-message-label" class="commit-message-label left-label"> |
|
99 | 96 | ${_('Commit Message')}: |
|
100 | 97 | </div> |
|
101 | 98 | <div class="right-content"> |
|
102 | 99 | <div class="message"> |
|
103 | 100 | <textarea id="commit" name="message" placeholder="${c.default_message}"></textarea> |
|
104 | 101 | </div> |
|
105 | 102 | </div> |
|
106 | 103 | </div> |
|
107 | 104 | <div class="pull-right"> |
|
108 | 105 | ${h.reset('reset',_('Cancel'),class_="btn btn-small")} |
|
109 | 106 | ${h.submit('commit',_('Commit changes'),class_="btn btn-small btn-success")} |
|
110 | 107 | </div> |
|
111 | 108 | </div> |
|
112 | 109 | ${h.end_form()} |
|
113 | 110 | </div> |
|
114 | 111 | |
|
115 | 112 | <script type="text/javascript"> |
|
116 | 113 | $(document).ready(function(){ |
|
117 | 114 | var renderer = "${renderer}"; |
|
118 | 115 | var reset_url = "${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.file.path)}"; |
|
119 | 116 | var myCodeMirror = initCodeMirror('editor', reset_url); |
|
120 | 117 | |
|
121 | 118 | var modes_select = $('#set_mode'); |
|
122 | 119 | fillCodeMirrorOptions(modes_select); |
|
123 | 120 | |
|
124 | 121 | // try to detect the mode based on the file we edit |
|
125 | 122 | var mimetype = "${c.file.mimetype}"; |
|
126 | 123 | var detected_mode = detectCodeMirrorMode( |
|
127 | 124 | "${c.file.name}", mimetype); |
|
128 | 125 | |
|
129 | 126 | if(detected_mode){ |
|
130 | 127 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
131 | 128 | $(modes_select).select2("val", mimetype); |
|
132 | 129 | $(modes_select).change(); |
|
133 | 130 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
134 | 131 | } |
|
135 | 132 | |
|
136 | 133 | var filename_selector = '#filename'; |
|
137 | 134 | var callback = function(filename, mimetype, mode){ |
|
138 | 135 | CodeMirrorPreviewEnable(mode); |
|
139 | 136 | }; |
|
140 | 137 | // on change of select field set mode |
|
141 | 138 | setCodeMirrorModeFromSelect( |
|
142 | 139 | modes_select, filename_selector, myCodeMirror, callback); |
|
143 | 140 | |
|
144 | 141 | // on entering the new filename set mode, from given extension |
|
145 | 142 | setCodeMirrorModeFromInput( |
|
146 | 143 | modes_select, filename_selector, myCodeMirror, callback); |
|
147 | 144 | |
|
148 | 145 | // if the file is renderable set line wraps automatically |
|
149 | 146 | if (renderer !== ""){ |
|
150 | 147 | var line_wrap = 'on'; |
|
151 | 148 | $($('#line_wrap option[value="'+line_wrap+'"]')[0]).attr("selected", "selected"); |
|
152 | 149 | setCodeMirrorLineWrap(myCodeMirror, true); |
|
153 | 150 | } |
|
154 | 151 | // on select line wraps change the editor |
|
155 | 152 | $('#line_wrap').on('change', function(e){ |
|
156 | 153 | var selected = e.currentTarget; |
|
157 | 154 | var line_wraps = {'on': true, 'off': false}[selected.value]; |
|
158 | 155 | setCodeMirrorLineWrap(myCodeMirror, line_wraps) |
|
159 | 156 | }); |
|
160 | 157 | |
|
161 | 158 | // render preview/edit button |
|
162 | 159 | if (mimetype === 'text/x-rst' || mimetype === 'text/plain') { |
|
163 | 160 | $('#render_preview').removeClass('hidden'); |
|
164 | 161 | } |
|
165 | 162 | $('#render_preview').on('click', function(e){ |
|
166 | 163 | if($(this).hasClass('preview')){ |
|
167 | 164 | $(this).removeClass('preview'); |
|
168 | 165 | $(this).html("${_('Edit')}"); |
|
169 | 166 | $('#editor_preview').show(); |
|
170 | 167 | $(myCodeMirror.getWrapperElement()).hide(); |
|
171 | 168 | |
|
172 | 169 | var possible_renderer = { |
|
173 | 170 | 'rst':'rst', |
|
174 | 171 | 'markdown':'markdown', |
|
175 | 172 | 'gfm': 'markdown'}[myCodeMirror.getMode().name]; |
|
176 | 173 | var _text = myCodeMirror.getValue(); |
|
177 | 174 | var _renderer = possible_renderer || DEFAULT_RENDERER; |
|
178 | 175 | var post_data = {'text': _text, 'renderer': _renderer, 'csrf_token': CSRF_TOKEN}; |
|
179 | 176 | $('#editor_preview').html(_gettext('Loading ...')); |
|
180 | 177 | var url = pyroutes.url('repo_commit_comment_preview', |
|
181 | 178 | {'repo_name': '${c.repo_name}', |
|
182 | 179 | 'commit_id': '${c.commit.raw_id}'}); |
|
183 | 180 | ajaxPOST(url, post_data, function(o){ |
|
184 | 181 | $('#editor_preview').html(o); |
|
185 | 182 | }) |
|
186 | 183 | } |
|
187 | 184 | else{ |
|
188 | 185 | $(this).addClass('preview'); |
|
189 | 186 | $(this).html("${_('Preview')}"); |
|
190 | 187 | $('#editor_preview').hide(); |
|
191 | 188 | $(myCodeMirror.getWrapperElement()).show(); |
|
192 | 189 | } |
|
193 | 190 | }); |
|
194 | 191 | |
|
195 | 192 | }) |
|
196 | 193 | </script> |
|
197 | 194 | </%def> |
@@ -1,106 +1,106 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('%s Forks') % c.repo_name} |
|
6 | 6 | %if c.rhodecode_name: |
|
7 | 7 | · ${h.branding(c.rhodecode_name)} |
|
8 | 8 | %endif |
|
9 | 9 | </%def> |
|
10 | 10 | |
|
11 | 11 | <%def name="breadcrumbs_links()"> |
|
12 | 12 | ${_('Forks')} |
|
13 | 13 | </%def> |
|
14 | 14 | |
|
15 | 15 | <%def name="menu_bar_nav()"> |
|
16 | 16 | ${self.menu_items(active='repositories')} |
|
17 | 17 | </%def> |
|
18 | 18 | |
|
19 | 19 | <%def name="menu_bar_subnav()"> |
|
20 | 20 | ${self.repo_menu(active='summary')} |
|
21 | 21 | </%def> |
|
22 | 22 | |
|
23 | 23 | <%def name="main()"> |
|
24 | 24 | <div class="box"> |
|
25 | 25 | <div class="title"> |
|
26 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
26 | ||
|
27 | 27 | <ul class="links"> |
|
28 | 28 | <li> |
|
29 | 29 | <a class="btn btn-small btn-success" href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}"> |
|
30 | 30 | ${_('Create new fork')} |
|
31 | 31 | </a> |
|
32 | 32 | </li> |
|
33 | 33 | </ul> |
|
34 | 34 | </div> |
|
35 | 35 | |
|
36 | 36 | <div id="fork_list_wrap"> |
|
37 | 37 | <table id="fork_list_table" class="display"></table> |
|
38 | 38 | </div> |
|
39 | 39 | </div> |
|
40 | 40 | |
|
41 | 41 | |
|
42 | 42 | |
|
43 | 43 | <script type="text/javascript"> |
|
44 | 44 | |
|
45 | 45 | $(document).ready(function() { |
|
46 | 46 | var $forksListTable = $('#fork_list_table'); |
|
47 | 47 | |
|
48 | 48 | // fork list |
|
49 | 49 | $forksListTable.DataTable({ |
|
50 | 50 | processing: true, |
|
51 | 51 | serverSide: true, |
|
52 | 52 | ajax: { |
|
53 | 53 | "url": "${h.route_path('repo_forks_data', repo_name=c.repo_name)}", |
|
54 | 54 | }, |
|
55 | 55 | dom: 'rtp', |
|
56 | 56 | pageLength: ${c.visual.dashboard_items}, |
|
57 | 57 | order: [[ 0, "asc" ]], |
|
58 | 58 | columns: [ |
|
59 | 59 | { data: {"_": "username", |
|
60 | 60 | "sort": "username"}, title: "${_('Owner')}", className: "td-user" }, |
|
61 | 61 | { data: {"_": "fork_name", |
|
62 | 62 | "sort": "fork_name"}, title: "${_('Fork name')}", className: "td-email" }, |
|
63 | 63 | { data: {"_": "description", |
|
64 | 64 | "sort": "description"}, title: "${_('Description')}", className: "td-user" }, |
|
65 | 65 | { data: {"_": "fork_date", |
|
66 | 66 | "sort": "fork_date"}, title: "${_('Forked')}", className: "td-user" }, |
|
67 | 67 | { data: {"_": "last_activity", |
|
68 | 68 | "sort": "last_activity", |
|
69 | 69 | "type": Number}, title: "${_('Last activity')}", className: "td-time" }, |
|
70 | 70 | { data: {"_": "action", |
|
71 | 71 | "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false } |
|
72 | 72 | ], |
|
73 | 73 | |
|
74 | 74 | language: { |
|
75 | 75 | paginate: DEFAULT_GRID_PAGINATION, |
|
76 | 76 | sProcessing: _gettext('loading...'), |
|
77 | 77 | emptyTable: _gettext("No forks available yet.") |
|
78 | 78 | }, |
|
79 | 79 | |
|
80 | 80 | "createdRow": function ( row, data, index ) { |
|
81 | 81 | if (!data['active_raw']){ |
|
82 | 82 | $(row).addClass('closed') |
|
83 | 83 | } |
|
84 | 84 | } |
|
85 | 85 | }); |
|
86 | 86 | |
|
87 | 87 | $forksListTable.on('xhr.dt', function(e, settings, json, xhr){ |
|
88 | 88 | $forksListTable.css('opacity', 1); |
|
89 | 89 | }); |
|
90 | 90 | |
|
91 | 91 | $forksListTable.on('preXhr.dt', function(e, settings, data){ |
|
92 | 92 | $forksListTable.css('opacity', 0.3); |
|
93 | 93 | }); |
|
94 | 94 | |
|
95 | 95 | // filter |
|
96 | 96 | $('#q_filter').on('keyup', |
|
97 | 97 | $.debounce(250, function() { |
|
98 | 98 | $forksListTable.DataTable().search( |
|
99 | 99 | $('#q_filter').val() |
|
100 | 100 | ).draw(); |
|
101 | 101 | }) |
|
102 | 102 | ); |
|
103 | 103 | |
|
104 | 104 | }); |
|
105 | 105 | </script> |
|
106 | 106 | </%def> |
@@ -1,845 +1,841 b'' | |||
|
1 | 1 | <%inherit file="/base/base.mako"/> |
|
2 | 2 | <%namespace name="base" file="/base/base.mako"/> |
|
3 | 3 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
4 | 4 | |
|
5 | 5 | <%def name="title()"> |
|
6 | 6 | ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} |
|
7 | 7 | %if c.rhodecode_name: |
|
8 | 8 | · ${h.branding(c.rhodecode_name)} |
|
9 | 9 | %endif |
|
10 | 10 | </%def> |
|
11 | 11 | |
|
12 | 12 | <%def name="breadcrumbs_links()"> |
|
13 | 13 | <span id="pr-title"> |
|
14 | 14 | ${c.pull_request.title} |
|
15 | 15 | %if c.pull_request.is_closed(): |
|
16 | 16 | (${_('Closed')}) |
|
17 | 17 | %endif |
|
18 | 18 | </span> |
|
19 | 19 | <div id="pr-title-edit" class="input" style="display: none;"> |
|
20 | 20 | ${h.text('pullrequest_title', id_="pr-title-input", class_="large", value=c.pull_request.title)} |
|
21 | 21 | </div> |
|
22 | 22 | </%def> |
|
23 | 23 | |
|
24 | 24 | <%def name="menu_bar_nav()"> |
|
25 | 25 | ${self.menu_items(active='repositories')} |
|
26 | 26 | </%def> |
|
27 | 27 | |
|
28 | 28 | <%def name="menu_bar_subnav()"> |
|
29 | 29 | ${self.repo_menu(active='showpullrequest')} |
|
30 | 30 | </%def> |
|
31 | 31 | |
|
32 | 32 | <%def name="main()"> |
|
33 | 33 | |
|
34 | 34 | <script type="text/javascript"> |
|
35 | 35 | // TODO: marcink switch this to pyroutes |
|
36 | 36 | AJAX_COMMENT_DELETE_URL = "${h.route_path('pullrequest_comment_delete',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id,comment_id='__COMMENT_ID__')}"; |
|
37 | 37 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; |
|
38 | 38 | </script> |
|
39 | 39 | <div class="box"> |
|
40 | 40 | |
|
41 | <div class="title"> | |
|
42 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
43 | </div> | |
|
44 | ||
|
45 | 41 | ${self.breadcrumbs()} |
|
46 | 42 | |
|
47 | 43 | <div class="box pr-summary"> |
|
48 | 44 | |
|
49 | 45 | <div class="summary-details block-left"> |
|
50 | 46 | <% summary = lambda n:{False:'summary-short'}.get(n) %> |
|
51 | 47 | <div class="pr-details-title"> |
|
52 | 48 | <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request #%s') % c.pull_request.pull_request_id}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)} |
|
53 | 49 | %if c.allowed_to_update: |
|
54 | 50 | <div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0"> |
|
55 | 51 | % if c.allowed_to_delete: |
|
56 | 52 | ${h.secure_form(h.route_path('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id), request=request)} |
|
57 | 53 | ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'), |
|
58 | 54 | class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} |
|
59 | 55 | ${h.end_form()} |
|
60 | 56 | % else: |
|
61 | 57 | ${_('Delete')} |
|
62 | 58 | % endif |
|
63 | 59 | </div> |
|
64 | 60 | <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div> |
|
65 | 61 | <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div> |
|
66 | 62 | %endif |
|
67 | 63 | </div> |
|
68 | 64 | |
|
69 | 65 | <div id="summary" class="fields pr-details-content"> |
|
70 | 66 | <div class="field"> |
|
71 | 67 | <div class="label-summary"> |
|
72 | 68 | <label>${_('Source')}:</label> |
|
73 | 69 | </div> |
|
74 | 70 | <div class="input"> |
|
75 | 71 | <div class="pr-origininfo"> |
|
76 | 72 | ## branch link is only valid if it is a branch |
|
77 | 73 | <span class="tag"> |
|
78 | 74 | %if c.pull_request.source_ref_parts.type == 'branch': |
|
79 | 75 | <a href="${h.route_path('repo_changelog', repo_name=c.pull_request.source_repo.repo_name, _query=dict(branch=c.pull_request.source_ref_parts.name))}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a> |
|
80 | 76 | %else: |
|
81 | 77 | ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} |
|
82 | 78 | %endif |
|
83 | 79 | </span> |
|
84 | 80 | <span class="clone-url"> |
|
85 | 81 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> |
|
86 | 82 | </span> |
|
87 | 83 | <br/> |
|
88 | 84 | % if c.ancestor_commit: |
|
89 | 85 | ${_('Common ancestor')}: |
|
90 | 86 | <code><a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a></code> |
|
91 | 87 | % endif |
|
92 | 88 | </div> |
|
93 | 89 | %if h.is_hg(c.pull_request.source_repo): |
|
94 | 90 | <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> |
|
95 | 91 | %elif h.is_git(c.pull_request.source_repo): |
|
96 | 92 | <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> |
|
97 | 93 | %endif |
|
98 | 94 | |
|
99 | 95 | <div class=""> |
|
100 | 96 | <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly"> |
|
101 | 97 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i> |
|
102 | 98 | </div> |
|
103 | 99 | |
|
104 | 100 | </div> |
|
105 | 101 | </div> |
|
106 | 102 | <div class="field"> |
|
107 | 103 | <div class="label-summary"> |
|
108 | 104 | <label>${_('Target')}:</label> |
|
109 | 105 | </div> |
|
110 | 106 | <div class="input"> |
|
111 | 107 | <div class="pr-targetinfo"> |
|
112 | 108 | ## branch link is only valid if it is a branch |
|
113 | 109 | <span class="tag"> |
|
114 | 110 | %if c.pull_request.target_ref_parts.type == 'branch': |
|
115 | 111 | <a href="${h.route_path('repo_changelog', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a> |
|
116 | 112 | %else: |
|
117 | 113 | ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} |
|
118 | 114 | %endif |
|
119 | 115 | </span> |
|
120 | 116 | <span class="clone-url"> |
|
121 | 117 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a> |
|
122 | 118 | </span> |
|
123 | 119 | </div> |
|
124 | 120 | </div> |
|
125 | 121 | </div> |
|
126 | 122 | |
|
127 | 123 | ## Link to the shadow repository. |
|
128 | 124 | <div class="field"> |
|
129 | 125 | <div class="label-summary"> |
|
130 | 126 | <label>${_('Merge')}:</label> |
|
131 | 127 | </div> |
|
132 | 128 | <div class="input"> |
|
133 | 129 | % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: |
|
134 | 130 | %if h.is_hg(c.pull_request.target_repo): |
|
135 | 131 | <% clone_url = 'hg clone --update {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> |
|
136 | 132 | %elif h.is_git(c.pull_request.target_repo): |
|
137 | 133 | <% clone_url = 'git clone --branch {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> |
|
138 | 134 | %endif |
|
139 | 135 | <div class=""> |
|
140 | 136 | <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly"> |
|
141 | 137 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i> |
|
142 | 138 | </div> |
|
143 | 139 | % else: |
|
144 | 140 | <div class=""> |
|
145 | 141 | ${_('Shadow repository data not available')}. |
|
146 | 142 | </div> |
|
147 | 143 | % endif |
|
148 | 144 | </div> |
|
149 | 145 | </div> |
|
150 | 146 | |
|
151 | 147 | <div class="field"> |
|
152 | 148 | <div class="label-summary"> |
|
153 | 149 | <label>${_('Review')}:</label> |
|
154 | 150 | </div> |
|
155 | 151 | <div class="input"> |
|
156 | 152 | %if c.pull_request_review_status: |
|
157 | 153 | <div class="${'flag_status %s' % c.pull_request_review_status} tooltip pull-left"></div> |
|
158 | 154 | <span class="changeset-status-lbl tooltip"> |
|
159 | 155 | %if c.pull_request.is_closed(): |
|
160 | 156 | ${_('Closed')}, |
|
161 | 157 | %endif |
|
162 | 158 | ${h.commit_status_lbl(c.pull_request_review_status)} |
|
163 | 159 | </span> |
|
164 | 160 | - ${_ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} |
|
165 | 161 | %endif |
|
166 | 162 | </div> |
|
167 | 163 | </div> |
|
168 | 164 | <div class="field"> |
|
169 | 165 | <div class="pr-description-label label-summary" title="${_('Rendered using {} renderer').format(c.renderer)}"> |
|
170 | 166 | <label>${_('Description')}:</label> |
|
171 | 167 | </div> |
|
172 | 168 | <div id="pr-desc" class="input"> |
|
173 | 169 | <div class="pr-description">${h.render(c.pull_request.description, renderer=c.renderer)}</div> |
|
174 | 170 | </div> |
|
175 | 171 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> |
|
176 | 172 | <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}"> |
|
177 | 173 | ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)} |
|
178 | 174 | </div> |
|
179 | 175 | </div> |
|
180 | 176 | |
|
181 | 177 | <div class="field"> |
|
182 | 178 | <div class="label-summary"> |
|
183 | 179 | <label>${_('Versions')}:</label> |
|
184 | 180 | </div> |
|
185 | 181 | |
|
186 | 182 | <% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %> |
|
187 | 183 | <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %> |
|
188 | 184 | |
|
189 | 185 | <div class="pr-versions"> |
|
190 | 186 | % if c.show_version_changes: |
|
191 | 187 | <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %> |
|
192 | 188 | <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %> |
|
193 | 189 | <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions" |
|
194 | 190 | data-toggle-on="${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))}" |
|
195 | 191 | data-toggle-off="${_('Hide all versions of this pull request')}"> |
|
196 | 192 | ${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))} |
|
197 | 193 | </a> |
|
198 | 194 | <table> |
|
199 | 195 | ## SHOW ALL VERSIONS OF PR |
|
200 | 196 | <% ver_pr = None %> |
|
201 | 197 | |
|
202 | 198 | % for data in reversed(list(enumerate(c.versions, 1))): |
|
203 | 199 | <% ver_pos = data[0] %> |
|
204 | 200 | <% ver = data[1] %> |
|
205 | 201 | <% ver_pr = ver.pull_request_version_id %> |
|
206 | 202 | <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %> |
|
207 | 203 | |
|
208 | 204 | <tr class="version-pr" style="display: ${display_row}"> |
|
209 | 205 | <td> |
|
210 | 206 | <code> |
|
211 | 207 | <a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a> |
|
212 | 208 | </code> |
|
213 | 209 | </td> |
|
214 | 210 | <td> |
|
215 | 211 | <input ${'checked="checked"' if c.from_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
216 | 212 | <input ${'checked="checked"' if c.at_version_num == ver_pr else ''} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/> |
|
217 | 213 | </td> |
|
218 | 214 | <td> |
|
219 | 215 | <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %> |
|
220 | 216 | <div class="${'flag_status %s' % review_status} tooltip pull-left" title="${_('Your review status at this version')}"> |
|
221 | 217 | </div> |
|
222 | 218 | </td> |
|
223 | 219 | <td> |
|
224 | 220 | % if c.at_version_num != ver_pr: |
|
225 | 221 | <i class="icon-comment"></i> |
|
226 | 222 | <code class="tooltip" title="${_('Comment from pull request version v{0}, general:{1} inline:{2}').format(ver_pos, len(c.comment_versions[ver_pr]['at']), len(c.inline_versions[ver_pr]['at']))}"> |
|
227 | 223 | G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])} |
|
228 | 224 | </code> |
|
229 | 225 | % endif |
|
230 | 226 | </td> |
|
231 | 227 | <td> |
|
232 | 228 | ##<code>${ver.source_ref_parts.commit_id[:6]}</code> |
|
233 | 229 | </td> |
|
234 | 230 | <td> |
|
235 | 231 | ${h.age_component(ver.updated_on, time_is_local=True)} |
|
236 | 232 | </td> |
|
237 | 233 | </tr> |
|
238 | 234 | % endfor |
|
239 | 235 | |
|
240 | 236 | <tr> |
|
241 | 237 | <td colspan="6"> |
|
242 | 238 | <button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none" |
|
243 | 239 | data-label-text-locked="${_('select versions to show changes')}" |
|
244 | 240 | data-label-text-diff="${_('show changes between versions')}" |
|
245 | 241 | data-label-text-show="${_('show pull request for this version')}" |
|
246 | 242 | > |
|
247 | 243 | ${_('select versions to show changes')} |
|
248 | 244 | </button> |
|
249 | 245 | </td> |
|
250 | 246 | </tr> |
|
251 | 247 | |
|
252 | 248 | ## show comment/inline comments summary |
|
253 | 249 | <%def name="comments_summary()"> |
|
254 | 250 | <tr> |
|
255 | 251 | <td colspan="6" class="comments-summary-td"> |
|
256 | 252 | |
|
257 | 253 | % if c.at_version: |
|
258 | 254 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['display']) %> |
|
259 | 255 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['display']) %> |
|
260 | 256 | ${_('Comments at this version')}: |
|
261 | 257 | % else: |
|
262 | 258 | <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['until']) %> |
|
263 | 259 | <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['until']) %> |
|
264 | 260 | ${_('Comments for this pull request')}: |
|
265 | 261 | % endif |
|
266 | 262 | |
|
267 | 263 | |
|
268 | 264 | %if general_comm_count_ver: |
|
269 | 265 | <a href="#comments">${_("%d General ") % general_comm_count_ver}</a> |
|
270 | 266 | %else: |
|
271 | 267 | ${_("%d General ") % general_comm_count_ver} |
|
272 | 268 | %endif |
|
273 | 269 | |
|
274 | 270 | %if inline_comm_count_ver: |
|
275 | 271 | , <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_("%d Inline") % inline_comm_count_ver}</a> |
|
276 | 272 | %else: |
|
277 | 273 | , ${_("%d Inline") % inline_comm_count_ver} |
|
278 | 274 | %endif |
|
279 | 275 | |
|
280 | 276 | %if outdated_comm_count_ver: |
|
281 | 277 | , <a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">${_("%d Outdated") % outdated_comm_count_ver}</a> |
|
282 | 278 | <a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated comments')}</a> |
|
283 | 279 | <a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated comments')}</a> |
|
284 | 280 | %else: |
|
285 | 281 | , ${_("%d Outdated") % outdated_comm_count_ver} |
|
286 | 282 | %endif |
|
287 | 283 | </td> |
|
288 | 284 | </tr> |
|
289 | 285 | </%def> |
|
290 | 286 | ${comments_summary()} |
|
291 | 287 | </table> |
|
292 | 288 | % else: |
|
293 | 289 | <div class="input"> |
|
294 | 290 | ${_('Pull request versions not available')}. |
|
295 | 291 | </div> |
|
296 | 292 | <div> |
|
297 | 293 | <table> |
|
298 | 294 | ${comments_summary()} |
|
299 | 295 | </table> |
|
300 | 296 | </div> |
|
301 | 297 | % endif |
|
302 | 298 | </div> |
|
303 | 299 | </div> |
|
304 | 300 | |
|
305 | 301 | <div id="pr-save" class="field" style="display: none;"> |
|
306 | 302 | <div class="label-summary"></div> |
|
307 | 303 | <div class="input"> |
|
308 | 304 | <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span> |
|
309 | 305 | </div> |
|
310 | 306 | </div> |
|
311 | 307 | </div> |
|
312 | 308 | </div> |
|
313 | 309 | <div> |
|
314 | 310 | ## AUTHOR |
|
315 | 311 | <div class="reviewers-title block-right"> |
|
316 | 312 | <div class="pr-details-title"> |
|
317 | 313 | ${_('Author of this pull request')} |
|
318 | 314 | </div> |
|
319 | 315 | </div> |
|
320 | 316 | <div class="block-right pr-details-content reviewers"> |
|
321 | 317 | <ul class="group_members"> |
|
322 | 318 | <li> |
|
323 | 319 | ${self.gravatar_with_user(c.pull_request.author.email, 16)} |
|
324 | 320 | </li> |
|
325 | 321 | </ul> |
|
326 | 322 | </div> |
|
327 | 323 | |
|
328 | 324 | ## REVIEW RULES |
|
329 | 325 | <div id="review_rules" style="display: none" class="reviewers-title block-right"> |
|
330 | 326 | <div class="pr-details-title"> |
|
331 | 327 | ${_('Reviewer rules')} |
|
332 | 328 | %if c.allowed_to_update: |
|
333 | 329 | <span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span> |
|
334 | 330 | %endif |
|
335 | 331 | </div> |
|
336 | 332 | <div class="pr-reviewer-rules"> |
|
337 | 333 | ## review rules will be appended here, by default reviewers logic |
|
338 | 334 | </div> |
|
339 | 335 | <input id="review_data" type="hidden" name="review_data" value=""> |
|
340 | 336 | </div> |
|
341 | 337 | |
|
342 | 338 | ## REVIEWERS |
|
343 | 339 | <div class="reviewers-title block-right"> |
|
344 | 340 | <div class="pr-details-title"> |
|
345 | 341 | ${_('Pull request reviewers')} |
|
346 | 342 | %if c.allowed_to_update: |
|
347 | 343 | <span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span> |
|
348 | 344 | %endif |
|
349 | 345 | </div> |
|
350 | 346 | </div> |
|
351 | 347 | <div id="reviewers" class="block-right pr-details-content reviewers"> |
|
352 | 348 | |
|
353 | 349 | ## members redering block |
|
354 | 350 | <input type="hidden" name="__start__" value="review_members:sequence"> |
|
355 | 351 | <ul id="review_members" class="group_members"> |
|
356 | 352 | |
|
357 | 353 | % for review_obj, member, reasons, mandatory, status in c.pull_request_reviewers: |
|
358 | 354 | <script> |
|
359 | 355 | var member = ${h.json.dumps(h.reviewer_as_json(member, reasons=reasons, mandatory=mandatory, user_group=review_obj.rule_user_group_data()))|n}; |
|
360 | 356 | var status = "${(status[0][1].status if status else 'not_reviewed')}"; |
|
361 | 357 | var status_lbl = "${h.commit_status_lbl(status[0][1].status if status else 'not_reviewed')}"; |
|
362 | 358 | var allowed_to_update = ${h.json.dumps(c.allowed_to_update)}; |
|
363 | 359 | |
|
364 | 360 | var entry = renderTemplate('reviewMemberEntry', { |
|
365 | 361 | 'member': member, |
|
366 | 362 | 'mandatory': member.mandatory, |
|
367 | 363 | 'reasons': member.reasons, |
|
368 | 364 | 'allowed_to_update': allowed_to_update, |
|
369 | 365 | 'review_status': status, |
|
370 | 366 | 'review_status_label': status_lbl, |
|
371 | 367 | 'user_group': member.user_group, |
|
372 | 368 | 'create': false |
|
373 | 369 | }); |
|
374 | 370 | $('#review_members').append(entry) |
|
375 | 371 | </script> |
|
376 | 372 | |
|
377 | 373 | % endfor |
|
378 | 374 | |
|
379 | 375 | </ul> |
|
380 | 376 | <input type="hidden" name="__end__" value="review_members:sequence"> |
|
381 | 377 | ## end members redering block |
|
382 | 378 | |
|
383 | 379 | %if not c.pull_request.is_closed(): |
|
384 | 380 | <div id="add_reviewer" class="ac" style="display: none;"> |
|
385 | 381 | %if c.allowed_to_update: |
|
386 | 382 | % if not c.forbid_adding_reviewers: |
|
387 | 383 | <div id="add_reviewer_input" class="reviewer_ac"> |
|
388 | 384 | ${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))} |
|
389 | 385 | <div id="reviewers_container"></div> |
|
390 | 386 | </div> |
|
391 | 387 | % endif |
|
392 | 388 | <div class="pull-right"> |
|
393 | 389 | <button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button> |
|
394 | 390 | </div> |
|
395 | 391 | %endif |
|
396 | 392 | </div> |
|
397 | 393 | %endif |
|
398 | 394 | </div> |
|
399 | 395 | </div> |
|
400 | 396 | </div> |
|
401 | 397 | <div class="box"> |
|
402 | 398 | ##DIFF |
|
403 | 399 | <div class="table" > |
|
404 | 400 | <div id="changeset_compare_view_content"> |
|
405 | 401 | ##CS |
|
406 | 402 | % if c.missing_requirements: |
|
407 | 403 | <div class="box"> |
|
408 | 404 | <div class="alert alert-warning"> |
|
409 | 405 | <div> |
|
410 | 406 | <strong>${_('Missing requirements:')}</strong> |
|
411 | 407 | ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')} |
|
412 | 408 | </div> |
|
413 | 409 | </div> |
|
414 | 410 | </div> |
|
415 | 411 | % elif c.missing_commits: |
|
416 | 412 | <div class="box"> |
|
417 | 413 | <div class="alert alert-warning"> |
|
418 | 414 | <div> |
|
419 | 415 | <strong>${_('Missing commits')}:</strong> |
|
420 | 416 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} |
|
421 | 417 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} |
|
422 | 418 | ${_('Consider doing a {force_refresh_url} in case you think this is an error.').format(force_refresh_url=h.link_to('force refresh', h.current_route_path(request, force_refresh='1')))|n} |
|
423 | 419 | </div> |
|
424 | 420 | </div> |
|
425 | 421 | </div> |
|
426 | 422 | % endif |
|
427 | 423 | |
|
428 | 424 | <div class="compare_view_commits_title"> |
|
429 | 425 | % if not c.compare_mode: |
|
430 | 426 | |
|
431 | 427 | % if c.at_version_pos: |
|
432 | 428 | <h4> |
|
433 | 429 | ${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos} |
|
434 | 430 | </h4> |
|
435 | 431 | % endif |
|
436 | 432 | |
|
437 | 433 | <div class="pull-left"> |
|
438 | 434 | <div class="btn-group"> |
|
439 | 435 | <a |
|
440 | 436 | class="btn" |
|
441 | 437 | href="#" |
|
442 | 438 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
443 | 439 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
444 | 440 | </a> |
|
445 | 441 | <a |
|
446 | 442 | class="btn" |
|
447 | 443 | href="#" |
|
448 | 444 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
449 | 445 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
450 | 446 | </a> |
|
451 | 447 | </div> |
|
452 | 448 | </div> |
|
453 | 449 | |
|
454 | 450 | <div class="pull-right"> |
|
455 | 451 | % if c.allowed_to_update and not c.pull_request.is_closed(): |
|
456 | 452 | <a id="update_commits" class="btn btn-primary no-margin pull-right">${_('Update commits')}</a> |
|
457 | 453 | % else: |
|
458 | 454 | <a class="tooltip btn disabled pull-right" disabled="disabled" title="${_('Update is disabled for current view')}">${_('Update commits')}</a> |
|
459 | 455 | % endif |
|
460 | 456 | |
|
461 | 457 | </div> |
|
462 | 458 | % endif |
|
463 | 459 | </div> |
|
464 | 460 | |
|
465 | 461 | % if not c.missing_commits: |
|
466 | 462 | % if c.compare_mode: |
|
467 | 463 | % if c.at_version: |
|
468 | 464 | <h4> |
|
469 | 465 | ${_('Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled').format(ver_from=c.from_version_pos, ver_to=c.at_version_pos if c.at_version_pos else 'latest')}: |
|
470 | 466 | </h4> |
|
471 | 467 | |
|
472 | 468 | <div class="subtitle-compare"> |
|
473 | 469 | ${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))} |
|
474 | 470 | </div> |
|
475 | 471 | |
|
476 | 472 | <div class="container"> |
|
477 | 473 | <table class="rctable compare_view_commits"> |
|
478 | 474 | <tr> |
|
479 | 475 | <th></th> |
|
480 | 476 | <th>${_('Time')}</th> |
|
481 | 477 | <th>${_('Author')}</th> |
|
482 | 478 | <th>${_('Commit')}</th> |
|
483 | 479 | <th></th> |
|
484 | 480 | <th>${_('Description')}</th> |
|
485 | 481 | </tr> |
|
486 | 482 | |
|
487 | 483 | % for c_type, commit in c.commit_changes: |
|
488 | 484 | % if c_type in ['a', 'r']: |
|
489 | 485 | <% |
|
490 | 486 | if c_type == 'a': |
|
491 | 487 | cc_title = _('Commit added in displayed changes') |
|
492 | 488 | elif c_type == 'r': |
|
493 | 489 | cc_title = _('Commit removed in displayed changes') |
|
494 | 490 | else: |
|
495 | 491 | cc_title = '' |
|
496 | 492 | %> |
|
497 | 493 | <tr id="row-${commit.raw_id}" commit_id="${commit.raw_id}" class="compare_select"> |
|
498 | 494 | <td> |
|
499 | 495 | <div class="commit-change-indicator color-${c_type}-border"> |
|
500 | 496 | <div class="commit-change-content color-${c_type} tooltip" title="${h.tooltip(cc_title)}"> |
|
501 | 497 | ${c_type.upper()} |
|
502 | 498 | </div> |
|
503 | 499 | </div> |
|
504 | 500 | </td> |
|
505 | 501 | <td class="td-time"> |
|
506 | 502 | ${h.age_component(commit.date)} |
|
507 | 503 | </td> |
|
508 | 504 | <td class="td-user"> |
|
509 | 505 | ${base.gravatar_with_user(commit.author, 16)} |
|
510 | 506 | </td> |
|
511 | 507 | <td class="td-hash"> |
|
512 | 508 | <code> |
|
513 | 509 | <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=commit.raw_id)}"> |
|
514 | 510 | r${commit.idx}:${h.short_id(commit.raw_id)} |
|
515 | 511 | </a> |
|
516 | 512 | ${h.hidden('revisions', commit.raw_id)} |
|
517 | 513 | </code> |
|
518 | 514 | </td> |
|
519 | 515 | <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_( 'Expand commit message')}" onclick="commitsController.expandCommit(this); return false"> |
|
520 | 516 | <i class="icon-expand-linked"></i> |
|
521 | 517 | </td> |
|
522 | 518 | <td class="mid td-description"> |
|
523 | 519 | <div class="log-container truncate-wrap"> |
|
524 | 520 | <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">${h.urlify_commit_message(commit.message, c.repo_name)}</div> |
|
525 | 521 | </div> |
|
526 | 522 | </td> |
|
527 | 523 | </tr> |
|
528 | 524 | % endif |
|
529 | 525 | % endfor |
|
530 | 526 | </table> |
|
531 | 527 | </div> |
|
532 | 528 | |
|
533 | 529 | % endif |
|
534 | 530 | |
|
535 | 531 | % else: |
|
536 | 532 | <%include file="/compare/compare_commits.mako" /> |
|
537 | 533 | % endif |
|
538 | 534 | |
|
539 | 535 | <div class="cs_files"> |
|
540 | 536 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
541 | 537 | |
|
542 | 538 | ${cbdiffs.render_diffset_menu(c.diffset, range_diff_on=c.range_diff_on)} |
|
543 | 539 | |
|
544 | 540 | % if c.range_diff_on: |
|
545 | 541 | % for commit in c.commit_ranges: |
|
546 | 542 | ${cbdiffs.render_diffset( |
|
547 | 543 | c.changes[commit.raw_id], |
|
548 | 544 | commit=commit, use_comments=True, |
|
549 | 545 | collapse_when_files_over=5, |
|
550 | 546 | disable_new_comments=True, |
|
551 | 547 | deleted_files_comments=c.deleted_files_comments, |
|
552 | 548 | inline_comments=c.inline_comments)} |
|
553 | 549 | % endfor |
|
554 | 550 | % else: |
|
555 | 551 | ${cbdiffs.render_diffset( |
|
556 | 552 | c.diffset, use_comments=True, |
|
557 | 553 | collapse_when_files_over=30, |
|
558 | 554 | disable_new_comments=not c.allowed_to_comment, |
|
559 | 555 | deleted_files_comments=c.deleted_files_comments, |
|
560 | 556 | inline_comments=c.inline_comments)} |
|
561 | 557 | % endif |
|
562 | 558 | |
|
563 | 559 | </div> |
|
564 | 560 | % else: |
|
565 | 561 | ## skipping commits we need to clear the view for missing commits |
|
566 | 562 | <div style="clear:both;"></div> |
|
567 | 563 | % endif |
|
568 | 564 | |
|
569 | 565 | </div> |
|
570 | 566 | </div> |
|
571 | 567 | |
|
572 | 568 | ## template for inline comment form |
|
573 | 569 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
574 | 570 | |
|
575 | 571 | ## render general comments |
|
576 | 572 | |
|
577 | 573 | <div id="comment-tr-show"> |
|
578 | 574 | <div class="comment"> |
|
579 | 575 | % if general_outdated_comm_count_ver: |
|
580 | 576 | <div class="meta"> |
|
581 | 577 | % if general_outdated_comm_count_ver == 1: |
|
582 | 578 | ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)}, |
|
583 | 579 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show it')}</a> |
|
584 | 580 | % else: |
|
585 | 581 | ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)}, |
|
586 | 582 | <a href="#show-hidden-comments" onclick="$('.comment-general.comment-outdated').show(); $(this).parent().hide(); return false;">${_('show them')}</a> |
|
587 | 583 | % endif |
|
588 | 584 | </div> |
|
589 | 585 | % endif |
|
590 | 586 | </div> |
|
591 | 587 | </div> |
|
592 | 588 | |
|
593 | 589 | ${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)} |
|
594 | 590 | |
|
595 | 591 | % if not c.pull_request.is_closed(): |
|
596 | 592 | ## merge status, and merge action |
|
597 | 593 | <div class="pull-request-merge"> |
|
598 | 594 | <%include file="/pullrequests/pullrequest_merge_checks.mako"/> |
|
599 | 595 | </div> |
|
600 | 596 | |
|
601 | 597 | ## main comment form and it status |
|
602 | 598 | ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name, |
|
603 | 599 | pull_request_id=c.pull_request.pull_request_id), |
|
604 | 600 | c.pull_request_review_status, |
|
605 | 601 | is_pull_request=True, change_status=c.allowed_to_change_status)} |
|
606 | 602 | %endif |
|
607 | 603 | |
|
608 | 604 | <script type="text/javascript"> |
|
609 | 605 | if (location.hash) { |
|
610 | 606 | var result = splitDelimitedHash(location.hash); |
|
611 | 607 | var line = $('html').find(result.loc); |
|
612 | 608 | // show hidden comments if we use location.hash |
|
613 | 609 | if (line.hasClass('comment-general')) { |
|
614 | 610 | $(line).show(); |
|
615 | 611 | } else if (line.hasClass('comment-inline')) { |
|
616 | 612 | $(line).show(); |
|
617 | 613 | var $cb = $(line).closest('.cb'); |
|
618 | 614 | $cb.removeClass('cb-collapsed') |
|
619 | 615 | } |
|
620 | 616 | if (line.length > 0){ |
|
621 | 617 | offsetScroll(line, 70); |
|
622 | 618 | } |
|
623 | 619 | } |
|
624 | 620 | |
|
625 | 621 | versionController = new VersionController(); |
|
626 | 622 | versionController.init(); |
|
627 | 623 | |
|
628 | 624 | reviewersController = new ReviewersController(); |
|
629 | 625 | commitsController = new CommitsController(); |
|
630 | 626 | |
|
631 | 627 | $(function(){ |
|
632 | 628 | |
|
633 | 629 | // custom code mirror |
|
634 | 630 | var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm; |
|
635 | 631 | |
|
636 | 632 | var PRDetails = { |
|
637 | 633 | editButton: $('#open_edit_pullrequest'), |
|
638 | 634 | closeButton: $('#close_edit_pullrequest'), |
|
639 | 635 | deleteButton: $('#delete_pullrequest'), |
|
640 | 636 | viewFields: $('#pr-desc, #pr-title'), |
|
641 | 637 | editFields: $('#pr-desc-edit, #pr-title-edit, #pr-save'), |
|
642 | 638 | |
|
643 | 639 | init: function() { |
|
644 | 640 | var that = this; |
|
645 | 641 | this.editButton.on('click', function(e) { that.edit(); }); |
|
646 | 642 | this.closeButton.on('click', function(e) { that.view(); }); |
|
647 | 643 | }, |
|
648 | 644 | |
|
649 | 645 | edit: function(event) { |
|
650 | 646 | this.viewFields.hide(); |
|
651 | 647 | this.editButton.hide(); |
|
652 | 648 | this.deleteButton.hide(); |
|
653 | 649 | this.closeButton.show(); |
|
654 | 650 | this.editFields.show(); |
|
655 | 651 | codeMirrorInstance.refresh(); |
|
656 | 652 | }, |
|
657 | 653 | |
|
658 | 654 | view: function(event) { |
|
659 | 655 | this.editButton.show(); |
|
660 | 656 | this.deleteButton.show(); |
|
661 | 657 | this.editFields.hide(); |
|
662 | 658 | this.closeButton.hide(); |
|
663 | 659 | this.viewFields.show(); |
|
664 | 660 | } |
|
665 | 661 | }; |
|
666 | 662 | |
|
667 | 663 | var ReviewersPanel = { |
|
668 | 664 | editButton: $('#open_edit_reviewers'), |
|
669 | 665 | closeButton: $('#close_edit_reviewers'), |
|
670 | 666 | addButton: $('#add_reviewer'), |
|
671 | 667 | removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove'), |
|
672 | 668 | |
|
673 | 669 | init: function() { |
|
674 | 670 | var self = this; |
|
675 | 671 | this.editButton.on('click', function(e) { self.edit(); }); |
|
676 | 672 | this.closeButton.on('click', function(e) { self.close(); }); |
|
677 | 673 | }, |
|
678 | 674 | |
|
679 | 675 | edit: function(event) { |
|
680 | 676 | this.editButton.hide(); |
|
681 | 677 | this.closeButton.show(); |
|
682 | 678 | this.addButton.show(); |
|
683 | 679 | this.removeButtons.css('visibility', 'visible'); |
|
684 | 680 | // review rules |
|
685 | 681 | reviewersController.loadReviewRules( |
|
686 | 682 | ${c.pull_request.reviewer_data_json | n}); |
|
687 | 683 | }, |
|
688 | 684 | |
|
689 | 685 | close: function(event) { |
|
690 | 686 | this.editButton.show(); |
|
691 | 687 | this.closeButton.hide(); |
|
692 | 688 | this.addButton.hide(); |
|
693 | 689 | this.removeButtons.css('visibility', 'hidden'); |
|
694 | 690 | // hide review rules |
|
695 | 691 | reviewersController.hideReviewRules() |
|
696 | 692 | } |
|
697 | 693 | }; |
|
698 | 694 | |
|
699 | 695 | PRDetails.init(); |
|
700 | 696 | ReviewersPanel.init(); |
|
701 | 697 | |
|
702 | 698 | showOutdated = function(self){ |
|
703 | 699 | $('.comment-inline.comment-outdated').show(); |
|
704 | 700 | $('.filediff-outdated').show(); |
|
705 | 701 | $('.showOutdatedComments').hide(); |
|
706 | 702 | $('.hideOutdatedComments').show(); |
|
707 | 703 | }; |
|
708 | 704 | |
|
709 | 705 | hideOutdated = function(self){ |
|
710 | 706 | $('.comment-inline.comment-outdated').hide(); |
|
711 | 707 | $('.filediff-outdated').hide(); |
|
712 | 708 | $('.hideOutdatedComments').hide(); |
|
713 | 709 | $('.showOutdatedComments').show(); |
|
714 | 710 | }; |
|
715 | 711 | |
|
716 | 712 | refreshMergeChecks = function(){ |
|
717 | 713 | var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}"; |
|
718 | 714 | $('.pull-request-merge').css('opacity', 0.3); |
|
719 | 715 | $('.action-buttons-extra').css('opacity', 0.3); |
|
720 | 716 | |
|
721 | 717 | $('.pull-request-merge').load( |
|
722 | 718 | loadUrl, function() { |
|
723 | 719 | $('.pull-request-merge').css('opacity', 1); |
|
724 | 720 | |
|
725 | 721 | $('.action-buttons-extra').css('opacity', 1); |
|
726 | 722 | injectCloseAction(); |
|
727 | 723 | } |
|
728 | 724 | ); |
|
729 | 725 | }; |
|
730 | 726 | |
|
731 | 727 | injectCloseAction = function() { |
|
732 | 728 | var closeAction = $('#close-pull-request-action').html(); |
|
733 | 729 | var $actionButtons = $('.action-buttons-extra'); |
|
734 | 730 | // clear the action before |
|
735 | 731 | $actionButtons.html(""); |
|
736 | 732 | $actionButtons.html(closeAction); |
|
737 | 733 | }; |
|
738 | 734 | |
|
739 | 735 | closePullRequest = function (status) { |
|
740 | 736 | // inject closing flag |
|
741 | 737 | $('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">'); |
|
742 | 738 | $(generalCommentForm.statusChange).select2("val", status).trigger('change'); |
|
743 | 739 | $(generalCommentForm.submitForm).submit(); |
|
744 | 740 | }; |
|
745 | 741 | |
|
746 | 742 | $('#show-outdated-comments').on('click', function(e){ |
|
747 | 743 | var button = $(this); |
|
748 | 744 | var outdated = $('.comment-outdated'); |
|
749 | 745 | |
|
750 | 746 | if (button.html() === "(Show)") { |
|
751 | 747 | button.html("(Hide)"); |
|
752 | 748 | outdated.show(); |
|
753 | 749 | } else { |
|
754 | 750 | button.html("(Show)"); |
|
755 | 751 | outdated.hide(); |
|
756 | 752 | } |
|
757 | 753 | }); |
|
758 | 754 | |
|
759 | 755 | $('.show-inline-comments').on('change', function(e){ |
|
760 | 756 | var show = 'none'; |
|
761 | 757 | var target = e.currentTarget; |
|
762 | 758 | if(target.checked){ |
|
763 | 759 | show = '' |
|
764 | 760 | } |
|
765 | 761 | var boxid = $(target).attr('id_for'); |
|
766 | 762 | var comments = $('#{0} .inline-comments'.format(boxid)); |
|
767 | 763 | var fn_display = function(idx){ |
|
768 | 764 | $(this).css('display', show); |
|
769 | 765 | }; |
|
770 | 766 | $(comments).each(fn_display); |
|
771 | 767 | var btns = $('#{0} .inline-comments-button'.format(boxid)); |
|
772 | 768 | $(btns).each(fn_display); |
|
773 | 769 | }); |
|
774 | 770 | |
|
775 | 771 | $('#merge_pull_request_form').submit(function() { |
|
776 | 772 | if (!$('#merge_pull_request').attr('disabled')) { |
|
777 | 773 | $('#merge_pull_request').attr('disabled', 'disabled'); |
|
778 | 774 | } |
|
779 | 775 | return true; |
|
780 | 776 | }); |
|
781 | 777 | |
|
782 | 778 | $('#edit_pull_request').on('click', function(e){ |
|
783 | 779 | var title = $('#pr-title-input').val(); |
|
784 | 780 | var description = codeMirrorInstance.getValue(); |
|
785 | 781 | var renderer = $('#pr-renderer-input').val(); |
|
786 | 782 | editPullRequest( |
|
787 | 783 | "${c.repo_name}", "${c.pull_request.pull_request_id}", |
|
788 | 784 | title, description, renderer); |
|
789 | 785 | }); |
|
790 | 786 | |
|
791 | 787 | $('#update_pull_request').on('click', function(e){ |
|
792 | 788 | $(this).attr('disabled', 'disabled'); |
|
793 | 789 | $(this).addClass('disabled'); |
|
794 | 790 | $(this).html(_gettext('Saving...')); |
|
795 | 791 | reviewersController.updateReviewers( |
|
796 | 792 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
797 | 793 | }); |
|
798 | 794 | |
|
799 | 795 | $('#update_commits').on('click', function(e){ |
|
800 | 796 | var isDisabled = !$(e.currentTarget).attr('disabled'); |
|
801 | 797 | $(e.currentTarget).attr('disabled', 'disabled'); |
|
802 | 798 | $(e.currentTarget).addClass('disabled'); |
|
803 | 799 | $(e.currentTarget).removeClass('btn-primary'); |
|
804 | 800 | $(e.currentTarget).text(_gettext('Updating...')); |
|
805 | 801 | if(isDisabled){ |
|
806 | 802 | updateCommits( |
|
807 | 803 | "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
808 | 804 | } |
|
809 | 805 | }); |
|
810 | 806 | // fixing issue with caches on firefox |
|
811 | 807 | $('#update_commits').removeAttr("disabled"); |
|
812 | 808 | |
|
813 | 809 | $('.show-inline-comments').on('click', function(e){ |
|
814 | 810 | var boxid = $(this).attr('data-comment-id'); |
|
815 | 811 | var button = $(this); |
|
816 | 812 | |
|
817 | 813 | if(button.hasClass("comments-visible")) { |
|
818 | 814 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
819 | 815 | $(this).hide(); |
|
820 | 816 | }); |
|
821 | 817 | button.removeClass("comments-visible"); |
|
822 | 818 | } else { |
|
823 | 819 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
824 | 820 | $(this).show(); |
|
825 | 821 | }); |
|
826 | 822 | button.addClass("comments-visible"); |
|
827 | 823 | } |
|
828 | 824 | }); |
|
829 | 825 | |
|
830 | 826 | // register submit callback on commentForm form to track TODOs |
|
831 | 827 | window.commentFormGlobalSubmitSuccessCallback = function(){ |
|
832 | 828 | refreshMergeChecks(); |
|
833 | 829 | }; |
|
834 | 830 | // initial injection |
|
835 | 831 | injectCloseAction(); |
|
836 | 832 | |
|
837 | 833 | ReviewerAutoComplete('#user'); |
|
838 | 834 | |
|
839 | 835 | }) |
|
840 | 836 | </script> |
|
841 | 837 | |
|
842 | 838 | </div> |
|
843 | 839 | </div> |
|
844 | 840 | |
|
845 | 841 | </%def> |
@@ -1,34 +1,31 b'' | |||
|
1 | 1 | <%inherit file="/summary/summary_base.mako"/> |
|
2 | 2 | |
|
3 | 3 | <%namespace name="components" file="/summary/components.mako"/> |
|
4 | 4 | |
|
5 | 5 | <%def name="main()"> |
|
6 | <div class="title"> | |
|
7 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
8 | </div> | |
|
9 | 6 | |
|
10 | 7 | <div id="repo-summary" class="summary"> |
|
11 | 8 | ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=False)} |
|
12 | 9 | ${components.summary_stats(gravatar_function=self.gravatar_with_user)} |
|
13 | 10 | </div><!--end repo-summary--> |
|
14 | 11 | |
|
15 | 12 | <div class="alert alert-dismissable alert-warning"> |
|
16 | 13 | <strong>Missing requirements</strong> |
|
17 | 14 | Commits cannot be displayed, because this repository uses one or more extensions, which was not enabled. <br/> |
|
18 | 15 | Please <a href="${h.route_path('edit_repo_vcs', repo_name=c.repo_name)}">enable extension in settings</a>, or contact the repository owner for help. |
|
19 | 16 | Missing extensions could be: |
|
20 | 17 | <pre> |
|
21 | 18 | |
|
22 | 19 | - Mercurial largefiles |
|
23 | 20 | - Git LFS |
|
24 | 21 | </pre> |
|
25 | 22 | <br/> |
|
26 | 23 | Requirement error: ${c.repository_requirements_missing.get('error')} |
|
27 | 24 | </div> |
|
28 | 25 | |
|
29 | 26 | </%def> |
|
30 | 27 | |
|
31 | 28 | |
|
32 | 29 | <%def name="menu_bar_subnav()"> |
|
33 | 30 | ${self.repo_menu(active='summary')} |
|
34 | 31 | </%def> |
@@ -1,101 +1,101 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('%s Tags') % c.repo_name} |
|
6 | 6 | %if c.rhodecode_name: |
|
7 | 7 | · ${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 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
|
27 | ||
|
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 | emptyTable: _gettext("No tags available yet.") |
|
73 | 73 | }, |
|
74 | 74 | "initComplete": function(settings, json) { |
|
75 | 75 | get_datatable_count(); |
|
76 | 76 | timeagoActivate(); |
|
77 | 77 | compare_radio_buttons("${c.repo_name}", 'tag'); |
|
78 | 78 | } |
|
79 | 79 | }); |
|
80 | 80 | |
|
81 | 81 | // update when things change |
|
82 | 82 | $('#obj_list_table').on('draw.dt', function() { |
|
83 | 83 | get_datatable_count(); |
|
84 | 84 | timeagoActivate(); |
|
85 | 85 | }); |
|
86 | 86 | |
|
87 | 87 | // filter, filter both grids |
|
88 | 88 | $('#q_filter').on('keyup', function() { |
|
89 | 89 | var obj_api = $('#obj_list_table').dataTable().api(); |
|
90 | 90 | obj_api |
|
91 | 91 | .columns(0) |
|
92 | 92 | .search(this.value) |
|
93 | 93 | .draw(); |
|
94 | 94 | }); |
|
95 | 95 | |
|
96 | 96 | // refilter table if page load via back button |
|
97 | 97 | $("#q_filter").trigger('keyup'); |
|
98 | 98 | }); |
|
99 | 99 | |
|
100 | 100 | </script> |
|
101 | 101 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now