Commits

Marcin Kuzminski  committed a16f9a7

#574 Show pull request status also in shortlog (if any)

  • Participants
  • Parent commits b1822f4

Comments (0)

Files changed (3)

File rhodecode/controllers/shortlog.py

 
         c.repo_changesets = RepoPage(c.rhodecode_repo, page=p,
                                     items_per_page=size, url=url_generator)
+        page_revisions = [x.raw_id for x in list(c.repo_changesets)]
+        c.statuses = c.rhodecode_db_repo.statuses(page_revisions)
 
         if not c.repo_changesets:
             return redirect(url('summary_home', repo_name=repo_name))

File rhodecode/controllers/summary.py

 
         c.repo_changesets = RepoPage(c.rhodecode_repo, page=1,
                                      items_per_page=10, url=url_generator)
+        page_revisions = [x.raw_id for x in list(c.repo_changesets)]
+        c.statuses = c.rhodecode_db_repo.statuses(page_revisions)
 
         if self.rhodecode_user.username == 'default':
             # for default(anonymous) user we don't need to pass credentials

File rhodecode/templates/shortlog/shortlog_data.html

 %for cnt,cs in enumerate(c.repo_changesets):
 	<tr class="parity${cnt%2}">
         <td>
-            <div><pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}">r${cs.revision}:${h.short_id(cs.raw_id)}</a></pre></div>
+          <div>
+            <div class="changeset-status-container">
+              %if c.statuses.get(cs.raw_id):
+                <div class="changeset-status-ico">
+                %if c.statuses.get(cs.raw_id)[2]:
+                  <a class="tooltip" title="${_('Click to open associated pull request')}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
+                    <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
+                  </a>
+                %else:
+                  <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
+                %endif
+                </div>
+              %endif
+            </div>            
+            <pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}">r${cs.revision}:${h.short_id(cs.raw_id)}</a></pre>
+         </div>
         </td>
         <td>
             ${h.link_to(h.truncate(cs.message,50) or _('No commit message'),