Commits

Olemis Lang  committed 3f6ce38

BH Theme #129 : First ticket field box in a row aligned correctly to the left

  • Participants
  • Parent commits 3c3e501
  • Branches t129_ticket_field_pos

Comments (0)

Files changed (2)

 hgsvn/rm_files.diff
+t129/t129_r1365626_ticket_field_rows.diff

File t129/t129_r1365626_ticket_field_rows.diff

+# HG changeset patch
+# Parent 6d0916cf241efe3158323a095cfa9e439c69bec2
+BH Theme #129 : Explicit rows for ticket fields in ticket view
+
+diff --git a/bhtheme/templates/bh_ticket.html b/bhtheme/templates/bh_ticket.html
+--- a/bhtheme/templates/bh_ticket.html
++++ b/bhtheme/templates/bh_ticket.html
+@@ -177,7 +177,9 @@
+         <py:if test="ticket.exists">
+           <div class="row">
+             <div class="$colspan">
+-              <xi:include href="bh_ticket_box.html" py:with="preview_mode = change_preview.fields"/>
++              <xi:include href="bh_ticket_box.html"
++                  py:with="preview_mode = change_preview.fields ; 
++                      colcount=4 if bhdb else 6"/>
+             </div>
+ 
+             <!--! do not show attachments for old versions of this ticket or for new tickets -->
+diff --git a/bhtheme/templates/bh_ticket_box.html b/bhtheme/templates/bh_ticket_box.html
+--- a/bhtheme/templates/bh_ticket_box.html
++++ b/bhtheme/templates/bh_ticket_box.html
+@@ -28,6 +28,7 @@
+  - preview_mode: if True, show the "draft" background
+  - reporter_link=None: rendered link for the reporter field
+  - owner_link=None: rendered link for the owner field
++ - colcount=6: the number of fields to display in a row
+ -->
+ <div xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:py="http://genshi.edgewall.org/"
+@@ -35,23 +36,26 @@
+      xmlns:i18n="http://genshi.edgewall.org/i18n"
+      id="ticket" class="${'ticketdraft' if preview_mode else None}">
+ 
+-  <div class="properties row" style="margin-top: 1.2em"
++  <div class="properties" style="margin-top: 1.2em"
+          py:with="fields = [f for f in fields if not f.skip and f.name not in ('type', 'owner', 'keywords')]">
+-    <div py:for="idx, field in enumerate(fields)"
+-        class="${'span2' if field.name != 'cc' else 'span4'}">
+-      <py:if test="field.type != 'textarea'">
+-        <p id="${'h_' + field.name if field else None}">
+-          <py:if test="field"><i18n:msg params="field">${field.label or field.name}:</i18n:msg></py:if>
+-        </p>
+-        <p style="font-size: ${'150%' if field and field.name != 'cc' else '120%'}">
+-          <py:if test="field">
+-            <py:choose test="">
+-              <py:when test="'rendered' in field">${field.rendered}</py:when>
+-              <py:otherwise>${ticket[field.name]}</py:otherwise>
+-            </py:choose>
+-          </py:if>
+-        </p>
+-      </py:if>
++    <div class="row" py:for="fields_row in group(fields, colcount or 6)">
++      <div py:for="idx, field in enumerate(fields_row)" py:if="field is not None"
++          class="${'span2' if field.name != 'cc' else 'span4'}">
++        <py:if test="field.type != 'textarea'">
++          <p id="${'h_' + field.name if field else None}">
++            <py:if test="field"><i18n:msg params="field">${field.label or field.name}:</i18n:msg></py:if>
++          </p>
++          <p style="font-size: ${'150%' if field and field.name != 'cc' else '120%'}">
++            <py:if test="field">
++              <py:choose test="">
++                <py:when test="'rendered' in field">${field.rendered}</py:when>
++                <py:otherwise>${ticket[field.name]}</py:otherwise>
++              </py:choose>
++            </py:if>
++            &nbsp;
++          </p>
++        </py:if>
++      </div>
+     </div>
+   </div>
+   <div class="${'well' if not preview_mode else None}">