##// END OF EJS Templates
pull-requests: fixed ui based on latest changes
dan -
r3761:bebba65f new-ui
parent child Browse files
Show More
@@ -1,142 +1,117 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 Pull Requests') % c.repo_name}
4 ${_('%s Pull Requests') % 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="breadcrumbs_links()"></%def>
10 <%def name="breadcrumbs_links()"></%def>
11
11
12 <%def name="menu_bar_nav()">
12 <%def name="menu_bar_nav()">
13 ${self.menu_items(active='repositories')}
13 ${self.menu_items(active='repositories')}
14 </%def>
14 </%def>
15
15
16
16
17 <%def name="menu_bar_subnav()">
17 <%def name="menu_bar_subnav()">
18 ${self.repo_menu(active='showpullrequest')}
18 ${self.repo_menu(active='showpullrequest')}
19 </%def>
19 </%def>
20
20
21
21
22 <%def name="main()">
22 <%def name="main()">
23 <style>
24
25 </style>
26
23
27 <div class="box">
24 <div class="box">
28 <div class="title">
25 <div class="title">
29 <ul class="button-links">
26 <ul class="button-links">
30 <li class="btn ${('active' if c.active=='open' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0})}">${_('Opened')}</a></li>
27 <li class="btn ${('active' if c.active=='open' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0})}">${_('Opened')}</a></li>
31 <li class="btn ${('active' if c.active=='my' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'my':1})}">${_('Opened by me')}</a></li>
28 <li class="btn ${('active' if c.active=='my' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'my':1})}">${_('Opened by me')}</a></li>
32 <li class="btn ${('active' if c.active=='awaiting' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_review':1})}">${_('Awaiting review')}</a></li>
29 <li class="btn ${('active' if c.active=='awaiting' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_review':1})}">${_('Awaiting review')}</a></li>
33 <li class="btn ${('active' if c.active=='awaiting_my' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_my_review':1})}">${_('Awaiting my review')}</a></li>
30 <li class="btn ${('active' if c.active=='awaiting_my' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_my_review':1})}">${_('Awaiting my review')}</a></li>
34 <li class="btn ${('active' if c.active=='closed' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'closed':1})}">${_('Closed')}</a></li>
31 <li class="btn ${('active' if c.active=='closed' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'closed':1})}">${_('Closed')}</a></li>
35 <li class="btn ${('active' if c.active=='source' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':1})}">${_('From this repo')}</a></li>
32 <li class="btn ${('active' if c.active=='source' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':1})}">${_('From this repo')}</a></li>
36 </ul>
33 </ul>
37
34
38 <ul class="links">
35 <ul class="links">
39 % if c.rhodecode_user.username != h.DEFAULT_USER:
36 % if c.rhodecode_user.username != h.DEFAULT_USER:
40 <li>
37 <li>
41 <span>
38 <span>
42 <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">
39 <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">
43 ${_('Open new Pull Request')}
40 ${_('Open new Pull Request')}
44 </a>
41 </a>
45 </span>
42 </span>
46 </li>
43 </li>
47 % endif
44 % endif
48 </ul>
45 </ul>
49
46
50 ${self.breadcrumbs()}
51 </div>
47 </div>
52
48
53 <div class="main-content-full-width">
49 <div class="main-content-full-width">
54 <div class="panel panel-default">
50 <table id="pull_request_list_table" class="display"></table>
55 <div class="panel-heading">
56 <h3 class="panel-title">
57 %if c.source:
58 ${_('Pull Requests from %(repo_name)s repository') % {'repo_name': c.repo_name}}
59 %elif c.closed:
60 ${_('Closed Pull Requests to repository %(repo_name)s') % {'repo_name': c.repo_name}}
61 %elif c.my:
62 ${_('Pull Requests to %(repo_name)s repository opened by me') % {'repo_name': c.repo_name}}
63 %elif c.awaiting_review:
64 ${_('Pull Requests to %(repo_name)s repository awaiting review') % {'repo_name': c.repo_name}}
65 %elif c.awaiting_my_review:
66 ${_('Pull Requests to %(repo_name)s repository awaiting my review') % {'repo_name': c.repo_name}}
67 %else:
68 ${_('Pull Requests to %(repo_name)s repository') % {'repo_name': c.repo_name}}
69 %endif
70 </h3>
71 </div>
72 <div class="panel-body panel-body-min-height">
73 <table id="pull_request_list_table" class="display"></table>
74 </div>
75 </div>
76 </div>
51 </div>
77
52
78 </div>
53 </div>
79
54
80 <script type="text/javascript">
55 <script type="text/javascript">
81 $(document).ready(function() {
56 $(document).ready(function() {
82
57
83 var $pullRequestListTable = $('#pull_request_list_table');
58 var $pullRequestListTable = $('#pull_request_list_table');
84
59
85 // object list
60 // object list
86 $pullRequestListTable.DataTable({
61 $pullRequestListTable.DataTable({
87 processing: true,
62 processing: true,
88 serverSide: true,
63 serverSide: true,
89 ajax: {
64 ajax: {
90 "url": "${h.route_path('pullrequest_show_all_data', repo_name=c.repo_name)}",
65 "url": "${h.route_path('pullrequest_show_all_data', repo_name=c.repo_name)}",
91 "data": function (d) {
66 "data": function (d) {
92 d.source = "${c.source}";
67 d.source = "${c.source}";
93 d.closed = "${c.closed}";
68 d.closed = "${c.closed}";
94 d.my = "${c.my}";
69 d.my = "${c.my}";
95 d.awaiting_review = "${c.awaiting_review}";
70 d.awaiting_review = "${c.awaiting_review}";
96 d.awaiting_my_review = "${c.awaiting_my_review}";
71 d.awaiting_my_review = "${c.awaiting_my_review}";
97 }
72 }
98 },
73 },
99 dom: 'rtp',
74 dom: 'rtp',
100 pageLength: ${c.visual.dashboard_items},
75 pageLength: ${c.visual.dashboard_items},
101 order: [[ 1, "desc" ]],
76 order: [[ 1, "desc" ]],
102 columns: [
77 columns: [
103 { data: {"_": "status",
78 { data: {"_": "status",
104 "sort": "status"}, title: "", className: "td-status", orderable: false},
79 "sort": "status"}, title: "", className: "td-status", orderable: false},
105 { data: {"_": "name",
80 { data: {"_": "name",
106 "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname", "type": "num" },
81 "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname", "type": "num" },
107 { data: {"_": "author",
82 { data: {"_": "author",
108 "sort": "author_raw"}, title: "${_('Author')}", className: "td-user", orderable: false },
83 "sort": "author_raw"}, title: "${_('Author')}", className: "td-user", orderable: false },
109 { data: {"_": "title",
84 { data: {"_": "title",
110 "sort": "title"}, title: "${_('Title')}", className: "td-description" },
85 "sort": "title"}, title: "${_('Title')}", className: "td-description" },
111 { data: {"_": "comments",
86 { data: {"_": "comments",
112 "sort": "comments_raw"}, title: "", className: "td-comments", orderable: false},
87 "sort": "comments_raw"}, title: "", className: "td-comments", orderable: false},
113 { data: {"_": "updated_on",
88 { data: {"_": "updated_on",
114 "sort": "updated_on_raw"}, title: "${_('Last Update')}", className: "td-time" }
89 "sort": "updated_on_raw"}, title: "${_('Last Update')}", className: "td-time" }
115 ],
90 ],
116 language: {
91 language: {
117 paginate: DEFAULT_GRID_PAGINATION,
92 paginate: DEFAULT_GRID_PAGINATION,
118 sProcessing: _gettext('loading...'),
93 sProcessing: _gettext('loading...'),
119 emptyTable: _gettext("No pull requests available yet.")
94 emptyTable: _gettext("No pull requests available yet.")
120 },
95 },
121 "drawCallback": function( settings, json ) {
96 "drawCallback": function( settings, json ) {
122 timeagoActivate();
97 timeagoActivate();
123 },
98 },
124 "createdRow": function ( row, data, index ) {
99 "createdRow": function ( row, data, index ) {
125 if (data['closed']) {
100 if (data['closed']) {
126 $(row).addClass('closed');
101 $(row).addClass('closed');
127 }
102 }
128 }
103 }
129 });
104 });
130
105
131 $pullRequestListTable.on('xhr.dt', function(e, settings, json, xhr){
106 $pullRequestListTable.on('xhr.dt', function(e, settings, json, xhr){
132 $pullRequestListTable.css('opacity', 1);
107 $pullRequestListTable.css('opacity', 1);
133 });
108 });
134
109
135 $pullRequestListTable.on('preXhr.dt', function(e, settings, data){
110 $pullRequestListTable.on('preXhr.dt', function(e, settings, data){
136 $pullRequestListTable.css('opacity', 0.3);
111 $pullRequestListTable.css('opacity', 0.3);
137 });
112 });
138
113
139 });
114 });
140
115
141 </script>
116 </script>
142 </%def>
117 </%def>
General Comments 0
You need to be logged in to leave comments. Login now