Changeset 2391

Show
Ignore:
Timestamp:
07/05/07 13:56:31 (2 years ago)
Author:
nferchen
Message:

BackRefPatch:

patch aganst trac-r 5805 now without errors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • backrefpatch/0.11/backref.patch

    r1629 r2391  
    11Index: trac/ticket/web_ui.py 
    22=================================================================== 
    3 --- trac/ticket/web_ui.py       (revision 4391
     3--- trac/ticket/web_ui.py       (revision 5807
    44+++ trac/ticket/web_ui.py       (working copy) 
    5 @@ -214,6 +214,8 @@ 
    6              # Store a timestamp in order to detect "mid air collisions" 
    7              data['timestamp'] = str(ticket.time_changed
     5@@ -431,6 +431,8 @@ 
     6                          # Store a timestamp for detecting "mid air collisions" 
     7                          'timestamp': str(ticket.time_changed)}
    88  
    9 +        data['backrefs'] = self._get_backrefs(db, ticket) 
    10 +               
    11          self._insert_ticket_data(req, db, ticket, data
    12                                   get_reporter_id(req, 'author')
     9+        data['backrefs'] = self._get_backrefs(context, ticket) 
     10+ 
     11         self._insert_ticket_data(context, data, get_reporter_id(req, 'author')
     12                                  field_changes
    1313  
    14 @@ -716,6 +718,40 @@ 
    15          fragment = cnum and '#comment:'+cnum or '' 
    16          req.redirect(req.href.ticket(ticket.id) + fragment) 
     14@@ -894,6 +896,39 @@ 
     15         for key in field_changes: 
     16             ticket[key] = field_changes[key]['new'] 
    1717  
    18 +    def _get_backrefs(self, db, ticket): 
     18+    def _get_backrefs(self, context, ticket): 
    1919+        id = ticket.id 
    20 +        cursor = db.cursor() 
     20+        cursor = context.db.cursor() 
    2121+        refs = "" 
    2222+ 
     
    4848+                refs += ref.strip() + " - " 
    4949+        return refs[:-3] 
    50 +         
    51 +                
    52      def _insert_ticket_data(self, req, db, ticket, data, reporter_id): 
    53          """Insert ticket data into the hdf""" 
    54          replyto = req.args.get('replyto') 
    55 Index: templates/ticket_view.html 
     50
     51     def _insert_ticket_data(self, context, data, author_id, field_changes): 
     52         """Insert ticket data into the template `data`""" 
     53         req = context.req 
     54Index: trac/ticket/templates/ticket.html 
    5655=================================================================== 
    57 --- templates/ticket_view.html  (revision 4391) 
    58 +++ templates/ticket_view.html  (working copy) 
    59 @@ -93,6 +93,16 @@ 
     56--- trac/ticket/templates/ticket.html   (revision 5807) 
     57+++ trac/ticket/templates/ticket.html   (working copy) 
     58@@ -209,6 +209,16 @@ 
     59                 ${wiki_to_html(context, ticket.description)} 
     60               </div> 
    6061             </div> 
    61            </div> 
    62          </form> 
    6362+ 
    64 +        <py:if test="backrefs"> 
    65 +          <div class="description"> 
    66 +            <h3 id="comment:backref">Referenced by</h3> 
    67 +            <div class="searchable"> 
    68 +              ${wiki_to_html(backrefs)}  
     63+            <div py:if="backrefs"> 
     64+               <div class="description"> 
     65+                    <h3 id="comment:bakref">Referenced by </h3> 
     66+                    <div class="searchable"> 
     67+                       ${wiki_to_html(context, backrefs)} 
     68+                    </div> 
     69+               </div> 
    6970+            </div> 
    70 +          </div> 
    71 +        </py:if> 
    7271+ 
    73        </div> 
    74   
    75        <py:if test="not version and version != 0"
     72         </div> 
     73       </fieldset> 
     74       <!--! End of ticket box --