Eli Carter wrote:
> On Wednesday 16 May 2007, Christian Boos wrote:
>   
>> Well, I'd like to get a bit more time to review/change this branch.
>> I tried it yesterday evening and there's a few things I'd like to improve:
>>  - the presentation of the "row" fields could be enhanced (in particular 
>> the verbose flag should only be a compatibility flag for 
>> row=description, not an additional setting)
>>     
>
> Well, the verbose flag added reporter, age, and description, which didn't 
> match 1:1 with the row selection.  And without it, there isn't a way to get 
> the age of the ticket.  

I think that as soon as we have a "row" field, we could add the reporter 
and age information.
It makes for fewer choices in the selector panel and looks more like the 
way it did in 0.10.
Also the row fields are displayed in a cleaner way. See attached patch.

> (For that matter, there isn't a way to get the ticket 
> creation time or the last modified time; both of which would be useful.)
>
>   

See the recent #5326 and #4966 tickets.

>>  - the list of checkboxes for selecting the columns is a bit too intrusive
>>     
>
> Yeah, it's not real pretty.  For javascript-enabled clients, making it a 
> collapsable box would probably be a small step in the right direction.  
> Otherwise, do you have a suggestion on how that could be presented better?
>   

Without javascript, I would prefer to have the list of fields below the 
table, if possible.
Then with javascript, we move them back on the top, but collapsed and we 
leave a [Customize...] link at the topleft of the table.

-- Christian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to trac-dev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Index: trac/ticket/query.py
===================================================================
--- trac/ticket/query.py	(revision 5402)
+++ trac/ticket/query.py	(working copy)
@@ -48,7 +48,7 @@
 
     def __init__(self, env, report=None, constraints=None, cols=None,
                  order=None, desc=0, group=None, groupdesc=0, verbose=0,
-                 rows=None, limit=None):
+                 rows=[], limit=None):
         self.env = env
         self.id = report # if not None, it's the corresponding saved query
         self.constraints = constraints or {}
@@ -57,11 +57,12 @@
         self.group = group
         self.groupdesc = groupdesc
         self.limit = limit
-        self.verbose = verbose
+        if verbose and 'description' not in rows: # 0.10 compatibility
+            rows.append('description')
         self.fields = TicketSystem(self.env).get_ticket_fields()
         field_names = [f['name'] for f in self.fields]
         self.cols = [c for c in cols or [] if c in field_names or c == 'id']
-        self.rows = [c for c in rows or [] if c in field_names]
+        self.rows = [c for c in rows if c in field_names]
 
         if self.order != 'id' and self.order not in field_names:
             # TODO: fix after adding time/changetime to the api.py
@@ -229,9 +230,8 @@
                                   order=order, desc=desc and 1 or None,
                                   group=self.group or None,
                                   groupdesc=self.groupdesc and 1 or None,
-                                  verbose=self.verbose and 1 or None,
-                                  col=self.get_columns() or None,
-                                  row=self.rows or None,
+                                  col=self.get_columns(),
+                                  row=self.rows,
                                   format=format, **self.constraints)
 
     def to_string(self, context):
@@ -259,10 +259,8 @@
                     cols.append(col)
         if self.group and not self.group in cols:
             add_cols(self.group)
-        if self.verbose:
-            add_cols('reporter')
         if self.rows:
-            add_cols(*self.rows)
+            add_cols('reporter', *self.rows)
         add_cols('priority', 'time', 'changetime', self.order)
         cols.extend([c for c in self.constraints.keys() if not c in cols])
 
@@ -580,7 +578,7 @@
             cols = [cols]
         if cols and 'id' not in cols: # Since we don't show 'id' as an option to the user, we need to re-insert it here.
             cols.insert(0, 'id')
-        rows = req.args.get('row')
+        rows = req.args.get('row', [])
         if isinstance(rows,basestring):
             rows = [rows]
         query = Query(self.env, req.args.get('report'),
@@ -755,13 +753,14 @@
         return (content.getvalue(), '%s;charset=utf-8' % mimetype)
 
     def export_rss(self, req, query):
-        query.verbose = True
+        if 'description' not in query.rows:
+            query.rows.append('description')
         db = self.env.get_db_cnx()
         results = query.execute(req, db)
         query_href = req.abs_href.query(group=query.group,
                                         groupdesc=(query.groupdesc and 1
                                                    or None),
-                                        verbose=query.verbose and 1 or None,
+                                        row=self.rows, 
                                         **query.constraints)
 
         data = {
@@ -826,6 +825,7 @@
 
     The optional `verbose` parameter can be set to a true value in order to
     get the description for the listed tickets. For '''table''' format only.
+    ''deprecated in favor of the row parameter''.
 
     For compatibility with Trac 0.10, if there's a second positional parameter
     given to the macro, it will be used to specify the `format`.
Index: trac/ticket/templates/query.html
===================================================================
--- trac/ticket/templates/query.html	(revision 5402)
+++ trac/ticket/templates/query.html	(working copy)
@@ -143,17 +143,6 @@
           </py:for>
         </p>
 
-        <p>
-          Verbose fields: <!-- Allow the user to decide what columns to include in the output of the query -->
-          <py:for each="column in all_textareas">
-            <input type="checkbox" id="row_$column" name="row"
-              value="$column"
-              checked="${any([(value == column)
-                              for value in row]) and 'checked' or None}" />
-            <label for="row_$column">${column or 'none'}</label>
-          </py:for>
-        </p>
-
         <p class="option">
           <label for="group">Group results by</label>
           <select name="group" id="group">
@@ -169,9 +158,15 @@
         </p>
 
         <p class="option">
-          <input type="checkbox" name="verbose" id="verbose"
-                 checked="${query.verbose or None}" />
-          <label for="verbose">Show reporter and age under each result</label>
+          <!-- Allow the user to decide what columns to include in the output of the query -->
+          Show
+          <py:for each="column in all_textareas">
+            <input type="checkbox" id="row_$column" name="row"
+              value="$column"
+              checked="${any([(value == column)
+                              for value in row]) and 'checked' or None}" />
+            <label for="row_$column">${column or 'none'}</label>
+          </py:for> under each result
         </p>
 
         <div class="buttons">
Index: trac/ticket/templates/query_results.html
===================================================================
--- trac/ticket/templates/query_results.html	(revision 5402)
+++ trac/ticket/templates/query_results.html	(working copy)
@@ -57,18 +57,18 @@
             </py:for>
           </tr>
 
-          <tr class="fullrow" py:if="query.verbose or [t for t in row if result[t]]">
-            <td colspan="${len(headers)}">
-              <p class="meta" py:if="query.verbose">Reported by <strong>${result.reporter}</strong>,
-                ${dateinfo(result.time)} ago.</p>
-              <py:for each="r in row">
-                <p py:if="result[r]">
-                  ${r}:<br/>
-                  ${wiki_to_html(context('ticket', result.id), result[r])}
-                </p>
-              </py:for>
-            </td>
-          </tr>
+          <py:with vars="result_rows = [t for t in row if result[t]]">
+            <tr py:if="result_rows" class="fullrow">
+              <td colspan="${len(headers)}">
+                <p class="meta">Reported by <strong>${authorinfo(result.reporter)}</strong>,
+                  ${dateinfo(result.time)} ago.</p>
+              </td>
+            </tr>
+            <tr py:for="r in result_rows" class="fullrow">
+              <th class="meta">$r</th>
+              <td colspan="${len(headers)-1}">${wiki_to_html(context('ticket', result.id), result[r])}</td>
+            </tr>
+          </py:with>
         </py:for>
       </tbody>
     </table>
Index: trac/htdocs/css/report.css
===================================================================
--- trac/htdocs/css/report.css	(revision 5402)
+++ trac/htdocs/css/report.css	(working copy)
@@ -90,3 +90,9 @@
 table.tickets tbody tr.even.prio5 { background: #dde7ff }
 table.tickets tbody tr.prio6 { background: #f0f0f0; border-color: #ddd }
 table.tickets tbody tr.even.prio6 { background: #f7f7f7 }
+table.tickets tbody tr.fullrow th { 
+  border: none;
+  vertical-align: middle;
+  text-align: center;
+  font-size: 85%;
+}
\ No newline at end of file

Reply via email to