~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/revision.kid

  • Committer: Robey Pointer
  • Date: 2007-01-06 05:02:02 UTC
  • Revision ID: robey@lag.net-20070106050202-i1hzwt613qigsin3
refactor and clean up the javascript code for the expand/collapse buttons,
and apply the same logic to files being diff'd on the revision view.  the
primary difference is that a revision starts out expanded, since otherwise
there's not much to see.  also, change the terminology from "show/hide" to
"expand/collapse" on nicholas allen's recommendation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
    <span py:def="file_link(filename, file_id)">
9
9
        <a href="${branch.url([ '/annotate', revid ], file_id=file_id)}" title="Annotate ${filename}">${filename}</a>
10
10
    </span>
 
11
    
 
12
    ${use_expand_buttons()}
11
13
</head>
12
14
 
13
15
<body>
91
93
<div class="diff-link"> <b>&#8594;</b> <a href="${branch.url([ '/revision', revid ], start_revid=start_revid, file_id=file_id, unified=1)}">view as unified diff</a> </div>
92
94
-->
93
95
 
 
96
<span class="revision-page"> ${expand_all_button('table-row')} </span>
 
97
 
94
98
<div class="diff" py:if="change.changes.modified">
95
99
    <table class="diff-block">
96
 
        <span py:for="item in change.changes.modified">
97
 
            <tr><th class="filename" colspan="4"> <a href="${branch.url([ '/annotate', change.revid ], file_id=item.file_id)}" name="${item.filename}">${item.filename}</a> </th></tr>
 
100
        <span py:strip="True" py:for="item in change.changes.modified">
 
101
            <tr><th class="filename" colspan="4"> ${expand_button(util.b64(item.file_id), 'table-row')} <a href="${branch.url([ '/annotate', change.revid ], file_id=item.file_id)}" name="${item.filename}">${item.filename}</a> </th></tr>
98
102
            <!-- ! unified diff -->
99
 
            <span py:if="not side_by_side" py:for="chunk in item.chunks">
 
103
            <span py:strip="True" py:if="not side_by_side" py:for="chunk in item.chunks">
100
104
                <tr class="diff-chunk"> <th class="lineno">old</th> <th class="lineno">new</th> <th></th> <th></th> </tr>
101
105
                <tr py:for="line in chunk.diff" class="diff-chunk">
102
106
                    <td class="lineno">${line.old_lineno}</td>
107
111
                <tr class="diff-chunk-spacing"> <td colspan="4"> &nbsp; </td> </tr>
108
112
            </span>
109
113
            <!-- ! side-by-side diff -->
110
 
            <span py:if="side_by_side" py:for="chunk in item.chunks">
111
 
                <tr class="diff-chunk"> <th class="lineno">old</th> <th></th> <th class="lineno">new</th> <th></th> </tr>
112
 
                <tr py:for="line in chunk.diff" class="diff-chunk">
 
114
            <span py:strip="True" py:if="side_by_side" py:for="chunk in item.chunks">
 
115
                <tr class="diff-chunk details-${util.b64(item.file_id)}">
 
116
                    <th class="lineno">old</th> <th></th> <th class="lineno">new</th> <th></th>
 
117
                </tr>
 
118
                <tr py:for="line in chunk.diff" class="diff-chunk details-${util.b64(item.file_id)}">
113
119
                    <td py:if="line.old_lineno" class="lineno">${line.old_lineno}</td>
114
120
                    <td py:if="not line.old_lineno" class="lineno-skip">${line.old_lineno}</td>
115
121
                    <td class="diff-${line.old_type}">${XML(line.old_line)}</td>
117
123
                    <td py:if="not line.new_lineno" class="lineno-skip">${line.new_lineno}</td>
118
124
                    <td class="diff-${line.new_type}">${XML(line.new_line)}</td>
119
125
                </tr>
120
 
                <tr class="diff-chunk-spacing"> <td colspan="4"> &nbsp; </td> </tr>
 
126
                <tr class="diff-chunk-spacing details-${util.b64(item.file_id)}"> <td colspan="4"> &nbsp; </td> </tr>
121
127
            </span>
122
128
            <tr class="diff-spacing"> <td colspan="4"> &nbsp; </td> </tr>
123
129
        </span>