Commits

Anonymous committed 22c49ec Draft

Updated format

Comments (0)

Files changed (3)

bloodhound_theme/bhtheme/templates/bh_empty_table.html

 
 <!--!
 		Render an empty table to enter batch of data to create tickets.
-		
-		
-       groups    - a dict, where:
-                     key       - is the value shared by all results in this group
-                     value     - is the list of corresponding tickets
+-->
 
-       headers   - a sequence of header structure:
-                     .name     - field name for this header
-                     .label    - what to display for this header
-
-       fields    - dict of field name to field structure:
-                     .label    - field label
-
-       query     - the actual Query instance used to perform the query
-
--->
 <div xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:i18n="http://genshi.edgewall.org/i18n"
      xmlns:xi="http://www.w3.org/2001/XInclude">
-  <div py:if="paginator.has_more_pages">
-    <div class="report-result" style="float: left; margin-right: 1.6em;">
-      Results <span class="numresults">(${paginator.displayed_items()})</span>
-    </div>
-    <xi:include py:if="paginator.show_index" href="page_index.html" />
-  </div>
-  <py:def function="group_heading(groupname, results, is_first=False)">
-    <div class="report-result" py:if="groupname is not None"
-        style="${'border: 1px #DDDDDD solid; border-bottom: none; font-weight: bold; padding: 4px 5px;' if is_first else None}"
-        i18n:msg="grouplabel, groupname, count"
-        py:with="grouplabel = fields[query.group].label;
-                 groupname = authorinfo(groupname) if query.group in ['owner', 'reporter'] else (groupname or _('None'));
-                 count = ngettext('%(num)s match', '%(num)s', len(results))">
-      Batch Create ${count}+8 Tickets
-    </div>
-  </py:def>
   
   <style>
     .table-bordered.query thead:first-child tr:first-child th:first-child, 
       border-top-left-radius: 0px;
     }
   </style>
-  ${group_heading(*groups[0], is_first=True) if groups else None}
+  <h1>Batch Create Tickets</h1>
+  <form id="qct-form" name="qct" method="post"><div><input type="hidden" name="__FORM_TOKEN" value="91dfcfa0a63de2f6b9a3797e"/></div>
   <table class="listing tickets table table-bordered table-condensed query"
-      style="border-radius: 0px 0px 4px 4px">
+      style="border-radius: 0px 0px 4px 4px"
+	  py:with="columnheaders = {'summary':'Summary','description':'Description','product':'Product','status':'Status'}">
     <tr class="trac-columns">
-		<py:for each="header in headers">
-			<py:if test="header.name not in 'ticket' and header.name not in 'id'">
-				<th class="$header.name${(' desc' if query.desc else ' asc') if query.order == header.name else ''}" py:with="label=header.label">
-					${label}
-				</th>
-			</py:if>
-		</py:for>
+	  <py:for each="idx,header in enumerate(columnheaders)">
+		<th>
+		  <font color="#1975D1">
+			${columnheaders[header]}
+		  </font>
+		</th>
+	  </py:for>	
     </tr>
+      
+    <tbody>    
+      <py:for each="num in range(0,4)">          
+        <tr>
+          <py:for each="idx, header in enumerate(columnheaders)" py:choose="">
+            <py:with vars="name = header; value = ''">                    
+	     	  <py:if test="name not in 'ticket' and name not in 'id'">
+				<td py:otherwise="" class="$name" py:choose="">
+				  <py:when test="name == 'summary'">
+					<div class="control-group">
+					  <input type="text" id="field-summary" class="input-block-level" name="field_summary"/>
+					</div>
+				  </py:when>
+				  <py:when test="name == 'description'">
+					<div class="control-group">
+                      <textarea id="field-description" class="input-block-level" name="field_description" rows="3" cols="28"></textarea>
+					</div>
+				  </py:when>
+				  <py:when test="name == 'status'">
+					<div class="control-group">
+ 					  <select name="status">
+					    <option value="accepted">accepted</option>
+						<option value="assigned">assigned</option>
+						<option value="closed">closed</option>
+						<option selected="selected" value="new">new</option>
+						<option value="reopened">reopened</option>
+					  </select>
+					</div>
+			      </py:when>
+				  <py:when test="name == 'priority'">
+					<div class="control-group">
+					  <select name="priority">
+						<option value="blocker">blocker</option>
+						<option value="critical">critical</option>
+						<option selected="selected" value="major">major</option>
+						<option value="minor">minor</option>
+						<option value="trivial">trivial</option>
+					  </select>
+					</div>
+				  </py:when>
+				  <py:when test="name == 'type'">
+					<div class="control-group">
+					  <select name="type">
+						<option value="defect">defect</option>
+						<option value="enhancement">enhancement</option>
+						<option selected="selected" value="task">task</option>
+					  </select>
+					</div>
+				  </py:when>
+				  <py:when test="name == 'product'">
+					<div class="control-group">
+                      <select id="field-product" name="field_product" class="input-block-level" data-field="product" data-optional="false">
+                        <option value="">Choose...</option>
+                        <option value="@" data-product-new-ticket-url="/sqlite/products/%40/newticket">Default</option>
+                      </select>
+                    </div>
+				  </py:when>
+				  <div class="control-group">
+					<input name="owner" type='text' py:when="name == 'owner'"></input>
+				  </div>
+				  <div class="control-group">
+					<input name="reporter" type='text' py:when="name == 'reporter'"></input>
+				  </div>
+				  <div class="control-group">
+					<input name="cc" type='text' py:when="name == 'cc'"></input>
+				  </div>
+				  <div class="control-group">
+					<input name="milestone" type='text' py:when="name == 'milestone'"></input>
+				  </div>
+				  <div class="control-group">
+					<input name="keywords" type='text' py:when="name == 'keywords'"></input>
+				  </div>
+				</td>
+			  </py:if>
+			</py:with>
+          </py:for>
+        </tr>
+      </py:for>
+      <tr py:if="group_index == len(groups)-1 and last_group_is_partial">
+        <td colspan="${len(headers)}">
+          <i>(more results for this group on next page)</i>
+        </td>
+      </tr>
+    </tbody>
+  </table>
+  <div class="btn-group pull-right">
+	  <input type="submit" class="btn pull-right" name="save" value="${_('save')}" />
+    </div>
+  </form>
+  <form method="get" style="display:inline" action="${href.query()}" id="batchcreate">
+    <input type="hidden" name="actionticketbatchcreate" value="rename" />
+    
+  </form>
 
-    <py:for each="group_index, (groupname, results) in enumerate(groups)">
-      
-      <tbody>
-        
-        <py:for each="num in range(0,10)">
-			
-          
-              <tr>
-                <py:for each="idx, header in enumerate(headers)" py:choose="">
-				
-                  <py:with vars="name = header.name; value = ''">                    
-						<py:if test="name not in 'ticket' and name not in 'id'">
-							<td py:otherwise="" class="$name" py:choose="">
-								<input type='text' py:when="name == 'summary'"></input>
-								<py:when test="name == 'status'">
-									<select>
-										<option value="accepted">accepted</option>
-										<option value="assigned">assigned</option>
-										<option value="closed">closed</option>
-										<option selected="selected" value="new">new</option>
-										<option value="reopened">reopened</option>
-									</select>
-								</py:when>
-								<py:when test="name == 'priority'">
-									<select>
-										<option value="blocker">blocker</option>
-										<option value="critical">critical</option>
-										<option selected="selected" value="major">major</option>
-										<option value="minor">minor</option>
-										<option value="trivial">trivial</option>
-									</select>
-								</py:when>
-								<py:when test="name == 'type'">
-									<select>
-										<option value="defect">defect</option>
-										<option value="enhancement">enhancement</option>
-										<option selected="selected" value="task">task</option>
-									</select>
-								</py:when>
-								<py:when test="name == 'product'">
-									<select>
-										<option selected="selected" value="null"></option>
-										<option value="default">Default</option>
-									</select>
-								</py:when>
-								<input type='text' py:when="name == 'owner'"></input>
-								<input type='text' py:when="name == 'reporter'"></input>
-								<input type='text' py:when="name == 'cc'"></input>
-								<input type='text' py:when="name == 'milestone'"></input>
-								<input type='text' py:when="name == 'keywords'"></input>
-							</td>
-						</py:if>
-					</py:with>
-                </py:for>
-              </tr>
-			  
-            
-        </py:for>
-        <tr py:if="group_index == len(groups)-1 and last_group_is_partial">
-          <td colspan="${len(headers)}">
-            <i>(more results for this group on next page)</i>
-          </td>
-        </tr>
-      </tbody>
-    </py:for>
-  </table>
   <xi:include py:if="paginator.show_index" href="page_index.html" />
 </div>
 

bloodhound_theme/bhtheme/templates/bh_query.html

         <hr />
       </form>
 
-      <div class="span12">
+	  <div class="span12">
         <xi:include href="widget_query_results.html" />
       </div>
       <div py:if="tickets and batch_modify" class="span12">
           <xi:include href="bh_batch_modify.html" />
         </div>
       </div>
+	  <div class="span12">
+        <xi:include href="bh_empty_table.html" />
+      </div>
 
       <div class="buttons span12"
            py:with="edit = report_resource and 'REPORT_MODIFY' in perm(report_resource);

bloodhound_theme/bhtheme/templates/bh_wiki_view.html

                 <button class="btn" type="submit" name="rename_page_button">${_('Rename page')}</button>
               </div>
             </form>
+			<form method="get" style="display:inline" action="${href.query()}" id="batchcreate">
+              <input type="hidden" name="actionticketbatchcreate" value="rename" />
+              <div class="btn-group">
+                <button class="btn" type="submit" name="batchcreate">${_('Batch Create')}</button>
+              </div>
+            </form>
             <form method="get" style="display:inline" action="${href.wiki(page.name)}" py:if="page.exists and delete_perm">
               <input type="hidden" name="action" value="delete" />
               <input type="hidden" name="version" value="$page.version" />