[PATCH 1 of 6] pullrequest overview: display in table to improve readability

Thomas De Schampheleire patrickdepinguin at gmail.com
Tue Mar 3 16:40:28 EST 2015


# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1425414784 -3600
#      Tue Mar 03 21:33:04 2015 +0100
# Node ID c3adb366628c8e7a5cfa016801a7c2f44abc312b
# Parent  d80090d1053468f6b84eb8ef41c62446995ddb73
pullrequest overview: display in table to improve readability

Instead of showing all info in the pullrequest overview right after each
other on the same line, use a table to improve readability.

Additionally, add following information:
- author
- destination repository

The latter is always the same when viewing the list of pullrequests of a
certain repository, but this change already anticipates re-use of this
block in the 'my pullrequests' overview.

The table is still static, non-sortable, since YUI is deprecated and no new
alternative has been decided upon yet. This improvement can be done later.

diff --git a/kallithea/public/css/style.css b/kallithea/public/css/style.css
--- a/kallithea/public/css/style.css
+++ b/kallithea/public/css/style.css
@@ -4639,6 +4639,10 @@
 div.pr-closed {
     background-color: #eee;
 }
+tr.pr-closed td {
+    background-color: #eee !important;
+    color: #555 !important;
+}
 
 span.pr-closed-tag {
     margin-bottom: 1px;
diff --git a/kallithea/templates/pullrequests/pullrequest_data.html b/kallithea/templates/pullrequests/pullrequest_data.html
--- a/kallithea/templates/pullrequests/pullrequest_data.html
+++ b/kallithea/templates/pullrequests/pullrequest_data.html
@@ -1,28 +1,56 @@
 ## -*- coding: utf-8 -*-
 
+<div class="table">
+  <table>
+    <thead>
+      <tr>
+        <th></th>
+        <th class="left">${_('Title')}</th>
+        <th class="left">${_('Author')}</th>
+        <th class="left">${_('Date')}</th>
+        <th class="left">${_('From')}</th>
+        <th class="left">${_('To')}</th>
+      </tr>
+    </thead>
 % for pr in c.pullrequests_pager:
-  <div class="pr ${'pr-closed' if pr.is_closed() else ''}">
-    <div>
-    %if pr.last_review_status:
-      <i class="icon-circle changeset-status-${pr.last_review_status}" title="${_("Someone voted: %s") % pr.last_review_status}"></i>
-    %else:
-      <i class="icon-circle changeset-status-not_reviewed" title="${_("Nobody voted")}"></i>
-    %endif
-      <a href="${pr.url()}">
-      ${pr.title or _("(no title)")}
-       %if pr.is_closed():
-         <span class="pr-closed-tag">${_('Closed')}</span>
-       %endif
-      </a>
-            ${_('opened on %s from') % (h.fmt_date(pr.created_on))}
-            <% org_ref_name=pr.org_ref.rsplit(':', 2)[-2] %>
-            <a href="${h.url('summary_home', repo_name=pr.org_repo.repo_name, anchor=org_ref_name)}">
-              ${pr.org_repo.repo_name}#${org_ref_name}
-            </a>
-    </div>
-  </div>
+    <tr class="${'pr-closed' if pr.is_closed() else ''}">
+      <td>
+        %if pr.last_review_status:
+          <i class="icon-circle changeset-status-${pr.last_review_status}" title="${_("Someone voted: %s") % pr.last_review_status}"></i>
+        %else:
+          <i class="icon-circle changeset-status-not_reviewed" title="${_("Nobody voted")}"></i>
+        %endif
+      </td>
+      <td>
+        <a href="${pr.url()}">
+        ${pr.title or _("(no title)")}
+        %if pr.is_closed():
+          <span class="pr-closed-tag">${_('Closed')}</span>
+        %endif
+        </a>
+      </td>
+      <td>
+        ${pr.author.username_and_name}
+      </td>
+      <td>
+        ${h.fmt_date(pr.created_on)}
+      </td>
+      <td>
+        <% org_ref_name=pr.org_ref.rsplit(':', 2)[-2] %>
+        <a href="${h.url('summary_home', repo_name=pr.org_repo.repo_name, anchor=org_ref_name)}">
+          ${pr.org_repo.repo_name}#${org_ref_name}
+        </a>
+      </td>
+      <td>
+        <% other_ref_name=pr.other_ref.rsplit(':', 2)[-2] %>
+        <a href="${h.url('summary_home', repo_name=pr.other_repo.repo_name, anchor=other_ref_name)}">
+          ${pr.other_repo.repo_name}#${other_ref_name}
+        </a>
+      </td>
+    </tr>
 % endfor
-
+  </table>
+</div>
 
 <div class="notification-paginator">
   <div class="pagination-wh pagination-left">


More information about the kallithea-general mailing list