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