~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/revision.pt

  • Committer: Martin Albisetti
  • Date: 2008-12-05 20:27:26 UTC
  • mto: This revision was merged to the branch mainline in revision 251.
  • Revision ID: argentina@gmail.com-20081205202726-sn7he5yz4qg5khud
Quick fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
      <metal:block fill-slot="header_extras">
10
10
        <link rel="stylesheet" type="text/css" media="all"
11
11
              tal:attributes="href python:branch.static_url('/static/css/diff.css')"/>
12
 
        <script type="text/javascript"
13
 
                tal:attributes="src python:branch.static_url('/static/javascript/diff.js')"></script>
14
 
        <script type="text/javascript">
15
 
          var link_data = <tal:b content="link_data" />;
16
 
          var specific_path = <tal:b content="json_specific_path" />;
17
 
          var path_to_id = <tal:b content="path_to_id" />;
18
 
        </script>
19
12
      </metal:block>
20
13
    </head>
21
14
 
22
15
    <body>
23
 
      <tal:block metal:fill-slot="backlink">
24
 
          <tal:has-link condition="branch/branch_link">
25
 
            <div class="black-link">
26
 
                <a tal:attributes="href branch/branch_link">
27
 
                  &#8592; Back to branch summary
28
 
                </a>
29
 
            </div>
30
 
          </tal:has-link>
31
 
      </tal:block>
32
 
      <tal:block metal:fill-slot="branchname" tal:content="string:${branch/friendly_name}" />
 
16
 
33
17
      <tal:block metal:fill-slot="heading">
34
 
        <div id="breadcrumbs">
 
18
        <h1>
35
19
          <tal:has-link condition="branch/branch_link">
36
20
            <a tal:attributes="href branch/branch_link"
37
21
               tal:content="branch/friendly_name">
41
25
          <tal:no-link condition="not: branch/branch_link">
42
26
            <span metal:use-macro="breadcrumbs/directory"></span>
43
27
          </tal:no-link>
44
 
          <span class="breadcrumb">&#187; Revision
45
 
            <tal:revno condition="not:specific_path" content="change/revno"></tal:revno>
46
 
            <a tal:condition="specific_path" tal:content="change/revno"
47
 
               tal:attributes="href python:url(['/revision', change.revno])"
48
 
               title="View changes to all files"></a>
49
 
                      <tal:compare-to condition="python:compare_revid is not None">
50
 
              (compared to revision <tal:block content="python:history.get_revno(compare_revid)" />)
51
 
            </tal:compare-to>
52
 
          </span>
53
 
          <span class="breadcrumb" tal:condition="specific_path">
54
 
            : <tal:annotate content="structure python:view_link(url, change.revno, specific_path)" />
55
 
          </span>
56
 
        </div>
57
 
        <tal:branch-info replace="structure python:branchinfo(branch)" />
58
 
        <h1 tal:condition="not:specific_path">
59
 
          Viewing all changes in revision <tal:revno content="change/revno" />.
60
 
        </h1>
61
 
        <p tal:condition="specific_path">
62
 
          <a tal:attributes="href python:url(['/revision', change.revno])">
63
 
            &#xAB; back to all changes in this revision
64
 
          </a>
65
 
        </p>
66
 
        <p tal:condition="specific_path">
67
 
          Viewing changes to <tal:annotate content="structure python:view_link(url, change.revno, specific_path)" />
68
 
        </p>
 
28
          <span>: <tal:revno content="change/revno"></tal:revno>
 
29
        <tal:compare-to condition="python:compare_revid is not None">
 
30
          (compared to revision <tal:block content="python:history.get_revno(compare_revid)" />)
 
31
          </tal:compare-to>
 
32
        </span></h1>
69
33
        <ul id="submenuTabs">
70
 
          <li id="first"><a tal:attributes="href python:url(['/files', change.revno]);
71
 
                                            title string:browse files at revision ${change/revno}"
72
 
                            tal:content="string:browse files at revision ${change/revno}"></a></li>
73
 
          <li tal:condition="python:remember != change.revno">
74
 
            <a tal:attributes="href python:url(['/revision', change.revno], remember=change.revno, compare_revid=None);
75
 
                               title string:compare with another revision"
76
 
               tal:content="string:Compare with another revision"></a></li>
77
 
          <li tal:condition="python:(remember is not None) and (compare_revid is None) and (change.revno != remember)" >
78
 
            <a tal:attributes="href python:url(['/revision', change.revno], compare_revid=history.get_revno(remember))">
79
 
              compare with revision <tal:b content="python:history.get_revno(remember)" />
80
 
            </a>
81
 
          </li>
82
 
          <li>
 
34
            <li id="first"><a tal:attributes="href python:url(['/files', change.revno]); 
 
35
                                               title string:browse files at revision ${change/revno}"
 
36
                               tal:content="string:browse files at revision ${change/revno}"></a></li>
 
37
            <li tal:condition="python:remember != change.revno">
 
38
                <a tal:attributes="href python:url(['/revision', change.revno], remember=change.revno, compare_revid=None); 
 
39
                                   title string:compare with another revision"
 
40
                   tal:content="string:Compare with another revision"></a></li>       
 
41
            <li tal:condition="python:(remember is not None) and (compare_revid is None) and (change.revno != remember)" >
 
42
                <a tal:attributes="href python:url(['/revision', change.revno], compare_revid=history.get_revno(remember))">
 
43
                compare with revision <tal:b content="python:history.get_revno(remember)" />
 
44
                </a>
 
45
            </li>
 
46
            <li>
83
47
            <a tal:condition="python:len(change.parents) > 0 and compare_revid is None"
84
 
               tal:attributes="href python:url(['/diff', change.revno], clear=1)">download diff</a>
 
48
                   tal:attributes="href python:url(['/diff', change.revno], clear=1)">download diff</a>
85
49
            <a tal:condition="python:compare_revid is not None"
86
 
               tal:attributes="href python:url(['/diff', change.revno, history.get_revno(compare_revid)], clear=1)">download diff</a>
87
 
          </li>
88
 
          <li id="last"><a tal:attributes="href python:url(['/changes', change.revno]);
89
 
                                           title string:view history from revision ${change/revno}"
90
 
                           tal:content="string:view history from revision ${change/revno}"></a></li>
 
50
                   tal:attributes="href python:url(['/diff', change.revno, history.get_revno(compare_revid)], clear=1)">download diff</a>
 
51
            </li>
 
52
            <li id="last"><a tal:attributes="href python:url(['/changes', change.revno]); 
 
53
                                  title string:view history from revision ${change/revno}"
 
54
                  tal:content="string:view history from revision ${change/revno}"></a></li>
91
55
        </ul>
92
56
 
93
57
        <tal:we-are-comparing condition="python:compare_revid is not None">
94
 
          <ul id="submenuTabs">
95
 
            <li id="first">
 
58
        <ul id="submenuTabs">
 
59
          <li id="first">
96
60
              <a tal:attributes="href python:url([ '/revision', history.get_revno(compare_revid) ], remember=change.revno, compare_revid=change.revno)">
97
61
                reverse the comparison (<tal:b content="change/revno" /> to <tal:b content="python:history.get_revno(compare_revid)" />)
98
62
              </a>
99
 
            </li>
100
 
            <li id="last">
 
63
          </li>
 
64
          <li id="last">
101
65
              <a tal:attributes="href python:url(['/revision', change.revno], remember=None, compare_revid=None)">
102
66
                stop comparing with revision <tal:b content="python:history.get_revno(compare_revid)" />
103
67
              </a>
104
 
            </li>
105
 
          </ul>
 
68
          </li>
 
69
        </ul>
106
70
        </tal:we-are-comparing>
107
 
 
108
 
        <tal:revision-info replace="structure python:revisioninfo(url, branch, change, file_changes, specific_path, merged_in)" />
109
 
        <tal:specific-path condition="not:specific_path">
110
 
          <p class="expand show_if_js" id="expand_all"><a href="#">
111
 
              <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png')"
112
 
                   alt="expand all" /> expand all</a>
113
 
          </p>
114
 
          <p class="expand" id="collapse_all" style="display:none;"><a href="#">
115
 
              <img tal:attributes="src python:branch.static_url('/static/images/treeExpanded.png')"
116
 
                   alt="collapse all" /> collapse all</a>
117
 
          </p>
118
 
        </tal:specific-path>
119
 
        <!-- Table -->
120
 
        <p class="expand show_if_js"><a id="toggle_unified_sbs" href="#">Show diffs side-by-side</a></p>
 
71
        
 
72
        <tal:revision-info replace="structure python:revisioninfo(url, branch, change, modified_file_link_rev)" />
 
73
        <p class="expand" id="expand_all" style="display:none;"><a tal:attributes="href string:javascript:toggle_expand_all_revisionview('open')">
 
74
            <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png')"
 
75
                  alt="expand all" /> expand all</a>
 
76
        </p>
 
77
        <p class="expand" id="collapse_all"><a tal:attributes="href string:javascript:toggle_expand_all_revisionview('close')">
 
78
            <img tal:attributes="src python:branch.static_url('/static/images/treeExpanded.png')"
 
79
                  alt="collapse all" /> collapse all</a>
 
80
        </p>
 
81
        <!-- Table -->        
121
82
        <p class="codin"><img tal:attributes="src python:branch.static_url('/static/images/newCode.gif')" alt="added" /> added</p>
122
83
        <p class="codin"><img tal:attributes="src python:branch.static_url('/static/images/deleteCode.gif')" alt="removed" /> removed</p>
123
84
        <div class="clear"><!-- --></div>
125
86
      </tal:block>
126
87
 
127
88
      <div metal:fill-slot="content">
128
 
        <tal:block condition="specific_path">
129
 
          <div class="diff">
130
 
 
131
 
            <div  class="diffBox">
132
 
              <a tal:attributes="href python:url(['/revision', change.revno, specific_path], clear=1);
133
 
                                 id string:${specific_path};
134
 
                                 title string:View changes to ${specific_path} only"
135
 
                 class="the-link">
136
 
                <img tal:attributes="src python:branch.static_url('/static/images/treeExpanded.png')"
137
 
                     class="expand_diff"/>
138
 
                <tal:b content="specific_path" />
139
 
              </a>
140
 
            </div>
141
 
            <div style="overflow: hidden">
142
 
              <div class="container">
143
 
                <div class="loading" style="display:none">
144
 
                  <img tal:attributes="src python:branch.static_url('/static/images/spinner.gif')" />
145
 
                </div>
146
 
                <div class="diffinfo">
147
 
                  <div class="pseudotable unified"
148
 
                       tal:repeat="chunk diff_chunks">
149
 
 
150
 
                    <tal:block condition="not:repeat/chunk/start">
151
 
                      <div class="pseudorow context-row">
152
 
                        <div class="lineNumber separate"></div>
153
 
                        <div class="lineNumber second separate"></div>
154
 
                        <div class="code separate"></div>
155
 
                        <div class="clear"><!-- --></div>
156
 
                      </div>
157
 
                    </tal:block>
158
 
 
159
 
                    <div tal:repeat="line chunk/diff"
160
 
                         tal:attributes="class string:pseudorow ${line/type}-row">
161
 
                      <div class="lineNumber first"
162
 
                           tal:content="structure python:util.fill_div(line.old_lineno)"></div>
163
 
                      <div class="lineNumber second"
164
 
                           tal:content="structure python:util.fill_div(line.new_lineno)"></div>
165
 
                      <div tal:attributes="class string:code ${line/type}"
166
 
                           tal:content="structure python:util.fill_div(util.html_clean(line.line))"></div>
167
 
                      <div class="clear"><!-- --></div>
 
89
        <div class="diff"
 
90
             tal:condition="change/changes/modified"
 
91
             tal:define="uniqs python:{}">
 
92
          <!-- ! side-by-side diff -->
 
93
          <tal:block repeat="item change/changes/modified">
 
94
 
 
95
              <tal:u define="u python:util.uniq(uniqs, item.file_id)">
 
96
                      <div class="diffBox"><img tal:attributes="src python:branch.static_url('/static/images/treeExpanded.png');
 
97
                                                                title python:branch.static_url('/static/images/treeCollapsed.png');
 
98
                                                                alt python:branch.static_url('/static/images/treeExpanded.png')"
 
99
                                                                class="expand_diff" />
 
100
                                           <a tal:attributes="href python:url(['/annotate', change.revno], clear=1, file_id=item.file_id);
 
101
                                                              id string:${item/filename}-s;
 
102
                                                              title string:Annotate ${item/filename}"
 
103
                                              tal:content="item/filename"></a></div>
 
104
               <div id="psuedotable" class="diffinfo">
 
105
               <tal:block repeat="chunk item/sbs_chunks">
 
106
 
 
107
                <tal:block condition="not:repeat/chunk/start">
 
108
                 <div class="lineNumber separate"></div>
 
109
                 <div class="lineCode separate"></div>
 
110
                 <div class="lineNumber separate"></div>
 
111
                 <div class="lineCode separate"></div>
 
112
                 <div class="clear"><!-- --></div>
 
113
                </tal:block>
 
114
 
 
115
                <tal:block repeat="line chunk/diff">
 
116
                    <div id="pseudorow">
 
117
                    <tal:block condition="line/old_lineno">
 
118
                    <div class="lineNumber"><tal:block replace="structure python:util.fill_div(line.old_lineno)" /></div>
 
119
                        <div tal:attributes="class string:lineCode ${line/old_type}">
 
120
                            <tal:block replace="structure python:util.fill_div(line.old_line)" />
 
121
                        </div>
 
122
                    </tal:block>
 
123
 
 
124
                    <tal:block condition="not:line/old_lineno">
 
125
                    <div class="lineNumber"><tal:block replace="structure python:util.fill_div(line.old_lineno)" /></div>
 
126
                        <div tal:attributes="class string:lineCode ${line/old_type}">
 
127
                            <tal:block replace="structure python:util.fill_div(line.old_line)" />
 
128
                        </div>
 
129
                    </tal:block>
 
130
 
 
131
                    <tal:block condition="line/new_lineno">
 
132
                    <div class="lineNumber"><tal:block replace="structure python:util.fill_div(line.new_lineno)" /></div>
 
133
                        <div tal:attributes="class string:lineCode ${line/new_type}">
 
134
                            <tal:block replace="structure python:util.fill_div(line.new_line)" />
 
135
                        </div>
 
136
                    </tal:block>
 
137
 
 
138
                    <tal:block condition="not:line/new_lineno">
 
139
                    <div class="lineNumber"><tal:block replace="structure python:util.fill_div(line.new_lineno)" /></div>
 
140
                        <div tal:attributes="class string:lineCode ${line/new_type}">
 
141
                            <tal:block replace="structure python:util.fill_div(line.new_line)" />
 
142
                        </div>
 
143
                    </tal:block>
 
144
                    <div class="clear"><!-- --></div>
168
145
                    </div>
169
 
                  </div>
170
 
                </div>
171
 
              </div>
172
 
            </div>
173
 
          </div>
174
 
        </tal:block>
175
 
 
176
 
        <tal:block condition="not:specific_path">
177
 
          <div class="diff"
178
 
               tal:repeat="item file_changes/text_changes" tal:attributes="id string:diff-${item/index}">
179
 
 
180
 
            <div  class="diffBox">
181
 
              <a tal:attributes="href python:url(['/revision', change.revno, item.filename], clear=1);
182
 
                                 id string:${item/filename};
183
 
                                 title string:View changes to ${item/filename} only"
184
 
                 class="the-link">
185
 
                <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png')"
186
 
                     class="expand_diff" />
187
 
                <tal:b content="item/filename" />
188
 
              </a>
189
 
            </div>
190
 
            <div class="diffinfo"  style="display:none">
191
 
              <div class="loading">
192
 
                <img tal:attributes="src python:branch.static_url('/static/images/spinner.gif')" />
193
 
              </div>
194
 
            </div>
195
 
          </div>
196
 
        </tal:block>
 
146
                   </tal:block>
 
147
                 </tal:block>
 
148
                 </div>
 
149
              </tal:u>
 
150
            </tal:block>
 
151
        </div>
197
152
 
198
153
        <ul tal:condition="python:navigation.prev_page_revid or navigation.next_page_revid"
199
154
            id="pages">
200
 
          <li tal:condition="navigation/prev_page_revid"
201
 
              class="previous">
202
 
            <a tal:attributes="href navigation/prev_page_url">&laquo; Newer</a>
203
 
          </li>
204
 
          <!-- FIXME: Leaving this to eventually show page numbers. Can't show all of them,
205
 
               so some magic has to be done to just show the previous and next N page numbers
 
155
            <li tal:condition="navigation/prev_page_revid" 
 
156
                class="previous">
 
157
                <a tal:attributes="href navigation/prev_page_url">&laquo; Previous</a>
 
158
            </li>
 
159
            <!-- FIXME: Leaving this to eventually show page numbers. Can't show all of them,
 
160
                        so some magic has to be done to just show the previous and next N page numbers
206
161
 
207
 
               <li class="active">1</li>
208
 
               <tal:block tal:repeat="page_number python:range(navigation.page_count)">
209
 
                 <li><a href="#"
210
 
                        tal:content="page_number"></a></li>
 
162
            <li class="active">1</li>
 
163
            <tal:block tal:repeat="page_number python:range(navigation.page_count)">
 
164
            <li><a href="#"
 
165
                   tal:content="page_number"></a></li>
211
166
               </tal:block>-->
212
 
          <li tal:condition="navigation/next_page_revid"
213
 
              class="next">
214
 
            <a tal:attributes="href navigation/next_page_url">Older &raquo;</a>
215
 
          </li>
 
167
            <li tal:condition="navigation/next_page_revid"
 
168
                class="next">
 
169
                <a tal:attributes="href navigation/next_page_url">Next &raquo;</a>
 
170
            </li>
216
171
        </ul>
217
172
 
218
173
      </div>