Source

custom-time / custom-time_to_ticket-template-ticket-html.patch

Full commit
diff --git a/trac/ticket/templates/ticket.html b/trac/ticket/templates/ticket.html
--- a/trac/ticket/templates/ticket.html
+++ b/trac/ticket/templates/ticket.html
@@ -303,6 +303,19 @@
                                  checked="${value == option or None}" />
                           ${option}
                         </label>
+                        <!--! Pre-formatted value for custom time fields -->
+                        <span py:when="'time'">
+                          <py:choose test="">
+                            <py:when test="'rendered' in field">
+                              <input type="text" id="field-${field.name}" title="${field.format_hint}"
+                                name="field_${field.name}" value="${field.rendered}" />
+                            </py:when>
+                            <py:otherwise><!--! if empty or invalid timestamp -->
+                              <input type="text" id="field-${field.name}" title="${field.format_hint}"
+                                name="field_${field.name}" value="${ticket[field.name]}" />
+                            </py:otherwise>
+                          </py:choose>
+                        </span>
                         <py:otherwise><!--! Text input fields -->
                           <py:choose>
                             <span py:when="field.cc_entry"><!--! Special case for Cc: field -->