##// END OF EJS Templates
pr: adding pr count to user pull request tables fixes #4160
lisaq -
r671:f630dd05 default
parent child Browse files
Show More
@@ -1,155 +1,155 b''
1 <%namespace name="base" file="/base/base.html"/>
1 <%namespace name="base" file="/base/base.html"/>
2
2
3 <div class="panel panel-default">
3 <div class="panel panel-default">
4 <div class="panel-body">
4 <div class="panel-body">
5 %if c.show_closed:
5 %if c.show_closed:
6 ${h.checkbox('show_closed',checked="checked", label=_('Show Closed Pull Requests'))}
6 ${h.checkbox('show_closed',checked="checked", label=_('Show Closed Pull Requests'))}
7 %else:
7 %else:
8 ${h.checkbox('show_closed',label=_('Show Closed Pull Requests'))}
8 ${h.checkbox('show_closed',label=_('Show Closed Pull Requests'))}
9 %endif
9 %endif
10 </div>
10 </div>
11 </div>
11 </div>
12
12
13 <div class="panel panel-default">
13 <div class="panel panel-default">
14 <div class="panel-heading">
14 <div class="panel-heading">
15 <h3 class="panel-title">${_('Pull Requests You Opened')}</h3>
15 <h3 class="panel-title">${_('Pull Requests You Opened')}: ${len(c.my_pull_requests)}</h3>
16 </div>
16 </div>
17 <div class="panel-body">
17 <div class="panel-body">
18 <div class="pullrequestlist">
18 <div class="pullrequestlist">
19 %if c.my_pull_requests:
19 %if c.my_pull_requests:
20 <table class="rctable">
20 <table class="rctable">
21 <thead>
21 <thead>
22 <th class="td-status"></th>
22 <th class="td-status"></th>
23 <th>${_('Target Repo')}</th>
23 <th>${_('Target Repo')}</th>
24 <th>${_('Author')}</th>
24 <th>${_('Author')}</th>
25 <th></th>
25 <th></th>
26 <th>${_('Title')}</th>
26 <th>${_('Title')}</th>
27 <th class="td-time">${_('Last Update')}</th>
27 <th class="td-time">${_('Last Update')}</th>
28 <th></th>
28 <th></th>
29 </thead>
29 </thead>
30 %for pull_request in c.my_pull_requests:
30 %for pull_request in c.my_pull_requests:
31 <tr class="${'closed' if pull_request.is_closed() else ''} prwrapper">
31 <tr class="${'closed' if pull_request.is_closed() else ''} prwrapper">
32 <td class="td-status">
32 <td class="td-status">
33 <div class="${'flag_status %s' % pull_request.calculated_review_status()} pull-left"></div>
33 <div class="${'flag_status %s' % pull_request.calculated_review_status()} pull-left"></div>
34 </td>
34 </td>
35 <td class="truncate-wrap td-componentname">
35 <td class="truncate-wrap td-componentname">
36 <div class="truncate">
36 <div class="truncate">
37 ${h.link_to(pull_request.target_repo.repo_name,h.url('summary_home',repo_name=pull_request.target_repo.repo_name))}
37 ${h.link_to(pull_request.target_repo.repo_name,h.url('summary_home',repo_name=pull_request.target_repo.repo_name))}
38 </div>
38 </div>
39 </td>
39 </td>
40 <td class="user">
40 <td class="user">
41 ${base.gravatar_with_user(pull_request.author.email, 16)}
41 ${base.gravatar_with_user(pull_request.author.email, 16)}
42 </td>
42 </td>
43 <td class="td-message expand_commit" data-pr-id="m${pull_request.pull_request_id}" title="${_('Expand commit message')}">
43 <td class="td-message expand_commit" data-pr-id="m${pull_request.pull_request_id}" title="${_('Expand commit message')}">
44 <div class="show_more_col">
44 <div class="show_more_col">
45 <i class="show_more"></i>&nbsp;
45 <i class="show_more"></i>&nbsp;
46 </div>
46 </div>
47 </td>
47 </td>
48 <td class="mid td-description">
48 <td class="mid td-description">
49 <div class="log-container truncate-wrap">
49 <div class="log-container truncate-wrap">
50 <div class="message truncate" id="c-m${pull_request.pull_request_id}"><a href="${h.url('pullrequest_show',repo_name=pull_request.target_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">#${pull_request.pull_request_id}: ${pull_request.title}</a>\
50 <div class="message truncate" id="c-m${pull_request.pull_request_id}"><a href="${h.url('pullrequest_show',repo_name=pull_request.target_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">#${pull_request.pull_request_id}: ${pull_request.title}</a>\
51 %if pull_request.is_closed():
51 %if pull_request.is_closed():
52 &nbsp;(${_('Closed')})\
52 &nbsp;(${_('Closed')})\
53 %endif
53 %endif
54 <br/>${pull_request.description}</div>
54 <br/>${pull_request.description}</div>
55 </div>
55 </div>
56 </td>
56 </td>
57 <td class="td-time">
57 <td class="td-time">
58 ${h.age_component(pull_request.updated_on)}
58 ${h.age_component(pull_request.updated_on)}
59 </td>
59 </td>
60 <td class="td-action repolist_actions">
60 <td class="td-action repolist_actions">
61 ${h.secure_form(url('pullrequest_delete', repo_name=pull_request.target_repo.repo_name, pull_request_id=pull_request.pull_request_id),method='delete')}
61 ${h.secure_form(url('pullrequest_delete', repo_name=pull_request.target_repo.repo_name, pull_request_id=pull_request.pull_request_id),method='delete')}
62 ${h.submit('remove_%s' % pull_request.pull_request_id, _('Delete'),
62 ${h.submit('remove_%s' % pull_request.pull_request_id, _('Delete'),
63 class_="btn btn-link btn-danger",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
63 class_="btn btn-link btn-danger",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
64 ${h.end_form()}
64 ${h.end_form()}
65 </td>
65 </td>
66 </tr>
66 </tr>
67 %endfor
67 %endfor
68 </table>
68 </table>
69 %else:
69 %else:
70 <h2><span class="empty_data">${_('You currently have no open pull requests.')}</span></h2>
70 <h2><span class="empty_data">${_('You currently have no open pull requests.')}</span></h2>
71 %endif
71 %endif
72 </div>
72 </div>
73 </div>
73 </div>
74 </div>
74 </div>
75
75
76 <div class="panel panel-default">
76 <div class="panel panel-default">
77 <div class="panel-heading">
77 <div class="panel-heading">
78 <h3 class="panel-title">${_('Pull Requests You Participate In')}</h3>
78 <h3 class="panel-title">${_('Pull Requests You Participate In')}: ${len(c.participate_in_pull_requests)}</h3>
79 </div>
79 </div>
80
80
81 <div class="panel-body">
81 <div class="panel-body">
82 <div class="pullrequestlist">
82 <div class="pullrequestlist">
83 %if c.participate_in_pull_requests:
83 %if c.participate_in_pull_requests:
84 <table class="rctable">
84 <table class="rctable">
85 <thead>
85 <thead>
86 <th class="td-status"></th>
86 <th class="td-status"></th>
87 <th>${_('Target Repo')}</th>
87 <th>${_('Target Repo')}</th>
88 <th>${_('Author')}</th>
88 <th>${_('Author')}</th>
89 <th></th>
89 <th></th>
90 <th>${_('Title')}</th>
90 <th>${_('Title')}</th>
91 <th class="td-time">${_('Last Update')}</th>
91 <th class="td-time">${_('Last Update')}</th>
92 </thead>
92 </thead>
93 %for pull_request in c.participate_in_pull_requests:
93 %for pull_request in c.participate_in_pull_requests:
94 <tr class="${'closed' if pull_request.is_closed() else ''} prwrapper">
94 <tr class="${'closed' if pull_request.is_closed() else ''} prwrapper">
95 <td class="td-status">
95 <td class="td-status">
96 <div class="${'flag_status %s' % pull_request.calculated_review_status()} pull-left"></div>
96 <div class="${'flag_status %s' % pull_request.calculated_review_status()} pull-left"></div>
97 </td>
97 </td>
98 <td class="truncate-wrap td-componentname">
98 <td class="truncate-wrap td-componentname">
99 <div class="truncate">
99 <div class="truncate">
100 ${h.link_to(pull_request.target_repo.repo_name,h.url('summary_home',repo_name=pull_request.target_repo.repo_name))}
100 ${h.link_to(pull_request.target_repo.repo_name,h.url('summary_home',repo_name=pull_request.target_repo.repo_name))}
101 </div>
101 </div>
102 </td>
102 </td>
103 <td class="user">
103 <td class="user">
104 ${base.gravatar_with_user(pull_request.author.email, 16)}
104 ${base.gravatar_with_user(pull_request.author.email, 16)}
105 </td>
105 </td>
106 <td class="td-message expand_commit" data-pr-id="p${pull_request.pull_request_id}" title="${_('Expand commit message')}">
106 <td class="td-message expand_commit" data-pr-id="p${pull_request.pull_request_id}" title="${_('Expand commit message')}">
107 <div class="show_more_col">
107 <div class="show_more_col">
108 <i class="show_more"></i>&nbsp;
108 <i class="show_more"></i>&nbsp;
109 </div>
109 </div>
110 </td>
110 </td>
111 <td class="mid td-description">
111 <td class="mid td-description">
112 <div class="log-container truncate-wrap">
112 <div class="log-container truncate-wrap">
113 <div class="message truncate" id="c-p${pull_request.pull_request_id}"><a href="${h.url('pullrequest_show',repo_name=pull_request.target_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">#${pull_request.pull_request_id}: ${pull_request.title}</a>\
113 <div class="message truncate" id="c-p${pull_request.pull_request_id}"><a href="${h.url('pullrequest_show',repo_name=pull_request.target_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">#${pull_request.pull_request_id}: ${pull_request.title}</a>\
114 %if pull_request.is_closed():
114 %if pull_request.is_closed():
115 &nbsp;(${_('Closed')})\
115 &nbsp;(${_('Closed')})\
116 %endif
116 %endif
117 <br/>${pull_request.description}</div>
117 <br/>${pull_request.description}</div>
118 </div>
118 </div>
119 </td>
119 </td>
120 <td class="td-time">
120 <td class="td-time">
121 ${h.age_component(pull_request.updated_on)}
121 ${h.age_component(pull_request.updated_on)}
122 </td>
122 </td>
123 </tr>
123 </tr>
124 %endfor
124 %endfor
125 </table>
125 </table>
126 %else:
126 %else:
127 <h2 class="empty_data">${_('There are currently no open pull requests requiring your participation.')}</h2>
127 <h2 class="empty_data">${_('There are currently no open pull requests requiring your participation.')}</h2>
128 %endif
128 %endif
129 </div>
129 </div>
130 </div>
130 </div>
131 </div>
131 </div>
132
132
133 <script>
133 <script>
134 $('#show_closed').on('click', function(e){
134 $('#show_closed').on('click', function(e){
135 if($(this).is(":checked")){
135 if($(this).is(":checked")){
136 window.location = "${h.url('my_account_pullrequests', pr_show_closed=1)}";
136 window.location = "${h.url('my_account_pullrequests', pr_show_closed=1)}";
137 }
137 }
138 else{
138 else{
139 window.location = "${h.url('my_account_pullrequests')}";
139 window.location = "${h.url('my_account_pullrequests')}";
140 }
140 }
141 });
141 });
142 $('.expand_commit').on('click',function(e){
142 $('.expand_commit').on('click',function(e){
143 var target_expand = $(this);
143 var target_expand = $(this);
144 var cid = target_expand.data('prId');
144 var cid = target_expand.data('prId');
145
145
146 if (target_expand.hasClass('open')){
146 if (target_expand.hasClass('open')){
147 $('#c-'+cid).css({'height': '2.75em', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
147 $('#c-'+cid).css({'height': '2.75em', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
148 target_expand.removeClass('open');
148 target_expand.removeClass('open');
149 }
149 }
150 else {
150 else {
151 $('#c-'+cid).css({'height': 'auto', 'text-overflow': 'initial', 'overflow':'visible'});
151 $('#c-'+cid).css({'height': 'auto', 'text-overflow': 'initial', 'overflow':'visible'});
152 target_expand.addClass('open');
152 target_expand.addClass('open');
153 }
153 }
154 });
154 });
155 </script>
155 </script>
General Comments 0
You need to be logged in to leave comments. Login now