~loggerhead-team/loggerhead/trunk-rich

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tal:block define="onload string:load()">
  <html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros/main">
    <head>
      <title metal:fill-slot="title"
             tal:content="string:${branch/friendly_name} : revision ${change/revno}">
      </title>

      <metal:block fill-slot="header_extras">
        <link rel="stylesheet" type="text/css" media="all"
              tal:attributes="href python:branch.static_url('/static/css/diff.css')"/>
        <script type="text/javascript"
                tal:attributes="src python:branch.static_url('/static/javascript/diff.js')"></script>
        <script type="text/javascript">
          var link_data = <tal:b content="link_data" />;
          var specific_path = <tal:b content="json_specific_path" />;
          var path_to_id = <tal:b content="path_to_id" />;
        </script>
      </metal:block>
    </head>

    <body>
      <tal:block metal:fill-slot="backlink">
          <tal:has-link condition="branch/branch_link">
            <div class="black-link">
                <a tal:attributes="href branch/branch_link">
                  &#8592; Back to branch summary
                </a>
            </div>
          </tal:has-link>
      </tal:block>
      <tal:block metal:fill-slot="branchname" tal:content="string:${branch/friendly_name}" />
      <tal:block metal:fill-slot="heading">
        <div id="breadcrumbs">
          <tal:has-link condition="branch/branch_link">
            <a tal:attributes="href branch/branch_link"
               tal:content="branch/friendly_name">
              nice/branch/name
            </a>
          </tal:has-link>
          <tal:no-link condition="not: branch/branch_link">
            <span metal:use-macro="breadcrumbs/directory"></span>
          </tal:no-link>
          <span class="breadcrumb">&#187; Revision
            <tal:revno condition="not:specific_path" content="change/revno"></tal:revno>
            <a tal:condition="specific_path" tal:content="change/revno"
               tal:attributes="href python:url(['/revision', change.revno])"
               title="View changes to all files"></a>
                      <tal:compare-to condition="python:compare_revid is not None">
              (compared to revision <tal:block content="python:history.get_revno(compare_revid)" />)
            </tal:compare-to>
          </span>
          <span class="breadcrumb" tal:condition="specific_path">
            : <tal:annotate content="structure python:view_link(url, change.revno, specific_path)" />
          </span>
        </div>
        <tal:branch-info replace="structure python:branchinfo(branch)" />
        <h1 tal:condition="not:specific_path">
          Viewing all changes in revision <tal:revno content="change/revno" />.
        </h1>
        <p tal:condition="specific_path">
          <a tal:attributes="href python:url(['/revision', change.revno])">
            &#xAB; back to all changes in this revision
          </a>
        </p>
        <p tal:condition="specific_path">
          Viewing changes to <tal:annotate content="structure python:view_link(url, change.revno, specific_path)" />
        </p>
        <ul id="submenuTabs">
          <li id="first"><a tal:attributes="href python:url(['/files', change.revno]);
                                            title string:browse files at revision ${change/revno}"
                            tal:content="string:browse files at revision ${change/revno}"></a></li>
          <li tal:condition="python:remember != change.revno">
            <a tal:attributes="href python:url(['/revision', change.revno], remember=change.revno, compare_revid=None);
                               title string:compare with another revision"
               tal:content="string:Compare with another revision"></a></li>
          <li tal:condition="python:(remember is not None) and (compare_revid is None) and (change.revno != remember)" >
            <a tal:attributes="href python:url(['/revision', change.revno], compare_revid=history.get_revno(remember))">
              compare with revision <tal:b content="python:history.get_revno(remember)" />
            </a>
          </li>
          <li>
            <a tal:condition="python:len(change.parents) > 0 and compare_revid is None"
               tal:attributes="href python:url(['/diff', change.revno], clear=1)">download diff</a>
            <a tal:condition="python:compare_revid is not None"
               tal:attributes="href python:url(['/diff', change.revno, history.get_revno(compare_revid)], clear=1)">download diff</a>
          </li>
          <li id="last"><a tal:attributes="href python:url(['/changes', change.revno]);
                                           title string:view history from revision ${change/revno}"
                           tal:content="string:view history from revision ${change/revno}"></a></li>
        </ul>

        <tal:we-are-comparing condition="python:compare_revid is not None">
          <ul id="submenuTabs">
            <li id="first">
              <a tal:attributes="href python:url([ '/revision', history.get_revno(compare_revid) ], remember=change.revno, compare_revid=change.revno)">
                reverse the comparison (<tal:b content="change/revno" /> to <tal:b content="python:history.get_revno(compare_revid)" />)
              </a>
            </li>
            <li id="last">
              <a tal:attributes="href python:url(['/revision', change.revno], remember=None, compare_revid=None)">
                stop comparing with revision <tal:b content="python:history.get_revno(compare_revid)" />
              </a>
            </li>
          </ul>
        </tal:we-are-comparing>

        <tal:revision-info replace="structure python:revisioninfo(url, branch, change, file_changes, specific_path, merged_in)" />
        <tal:specific-path condition="not:specific_path">
          <p class="expand show_if_js" id="expand_all"><a href="#">
              <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png')"
                   alt="expand all" /> expand all</a>
          </p>
          <p class="expand" id="collapse_all" style="display:none;"><a href="#">
              <img tal:attributes="src python:branch.static_url('/static/images/treeExpanded.png')"
                   alt="collapse all" /> collapse all</a>
          </p>
        </tal:specific-path>
        <!-- Table -->
        <p class="expand show_if_js"><a id="toggle_unified_sbs" href="#">Show diffs side-by-side</a></p>
        <p class="codin"><img tal:attributes="src python:branch.static_url('/static/images/newCode.gif')" alt="added" /> added</p>
        <p class="codin"><img tal:attributes="src python:branch.static_url('/static/images/deleteCode.gif')" alt="removed" /> removed</p>
        <div class="clear"><!-- --></div>

      </tal:block>

      <div metal:fill-slot="content">
        <tal:block condition="specific_path">
          <div class="diff">

            <div  class="diffBox">
              <a tal:attributes="href python:url(['/revision', change.revno, specific_path], clear=1);
                                 id string:${specific_path};
                                 title string:View changes to ${specific_path} only"
                 class="the-link">
                <img tal:attributes="src python:branch.static_url('/static/images/treeExpanded.png')"
                     class="expand_diff"/>
                <tal:b content="specific_path" />
              </a>
            </div>
            <div style="overflow: hidden">
              <div class="container">
                <div class="loading" style="display:none">
                  <img tal:attributes="src python:branch.static_url('/static/images/spinner.gif')" />
                </div>
                <div class="diffinfo">
                  <div class="pseudotable unified"
                       tal:repeat="chunk diff_chunks">

                    <tal:block condition="not:repeat/chunk/start">
                      <div class="pseudorow context-row">
                        <div class="lineNumber separate"></div>
                        <div class="lineNumber second separate"></div>
                        <div class="code separate"></div>
                        <div class="clear"><!-- --></div>
                      </div>
                    </tal:block>

                    <div tal:repeat="line chunk/diff"
                         tal:attributes="class string:pseudorow ${line/type}-row">
                      <div class="lineNumber first"
                           tal:content="structure python:util.fill_div(line.old_lineno)"></div>
                      <div class="lineNumber second"
                           tal:content="structure python:util.fill_div(line.new_lineno)"></div>
                      <div tal:attributes="class string:code ${line/type}"
                           tal:content="structure python:util.fill_div(util.html_clean(line.line))"></div>
                      <div class="clear"><!-- --></div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </tal:block>

        <tal:block condition="not:specific_path">
          <div class="diff"
               tal:repeat="item file_changes/text_changes" tal:attributes="id string:diff-${item/index}">

            <div  class="diffBox">
              <a tal:attributes="href python:url(['/revision', change.revno, item.filename], clear=1);
                                 id string:${item/filename};
                                 title string:View changes to ${item/filename} only"
                 class="the-link">
                <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png')"
                     class="expand_diff" />
                <tal:b content="item/filename" />
              </a>
            </div>
            <div class="diffinfo"  style="display:none">
              <div class="loading">
                <img tal:attributes="src python:branch.static_url('/static/images/spinner.gif')" />
              </div>
            </div>
          </div>
        </tal:block>

        <ul tal:condition="python:navigation.prev_page_revid or navigation.next_page_revid"
            id="pages">
          <li tal:condition="navigation/prev_page_revid"
              class="previous">
            <a tal:attributes="href navigation/prev_page_url">&laquo; Newer</a>
          </li>
          <!-- FIXME: Leaving this to eventually show page numbers. Can't show all of them,
               so some magic has to be done to just show the previous and next N page numbers

               <li class="active">1</li>
               <tal:block tal:repeat="page_number python:range(navigation.page_count)">
                 <li><a href="#"
                        tal:content="page_number"></a></li>
               </tal:block>-->
          <li tal:condition="navigation/next_page_revid"
              class="next">
            <a tal:attributes="href navigation/next_page_url">Older &raquo;</a>
          </li>
        </ul>

      </div>
    </body>
  </html>
</tal:block>