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