~mnordhoff/loggerhead/cheezum

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
<!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:sortCollapseElements()">
  <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} : changes"></title>
      <metal:block fill-slot="header_extras">
        <link rel="alternate" type="application/atom+xml"
              tal:attributes="href python:url(['/atom']);
                              title string:RSS feed for ${branch/friendly_name}" />
      </metal:block>
    </head>

    <body>
        <tal:block metal:fill-slot="heading">
         <h1>
           <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>
           : changes
          <tal:block condition="filter_file_id">to <span tal:content="python:history.get_path(revid, filter_file_id)" /></tal:block>
          <tal:block condition="start_revid">from revision <tal:block content="python:history.get_revno(start_revid)" /></tal:block>
          <tal:block condition="query">matching <tal:block content="query" /></tal:block>
         </h1>
        </tal:block>

       <div metal:fill-slot="content">
           <!-- Something nicer-looking should be done with search -->
        <p tal:condition="search_failed">
          Sorry, no results found for your search.
        </p>

        <p tal:condition="not:changes">
          No revisions!
        </p>

        <p class="fr revnolink">From Revision <a tal:attributes="href #
                                                            title python:'Show revision '+history.get_revno(revid)" 
                                tal:content="python:history.get_revno(revid)"></a>
          <tal:block tal:condition="python:navigation.last_in_page_revid is not None"> to
          <a tal:attributes="href # 
                             title 'Show revision '+history.get_revno(navigation.last_in_page_revid)"
             tal:content="python:history.get_revno(navigation.last_in_page_revid)"></a>
         </tal:block></p>
        <p class="expand" id="expand_all"><a tal:attributes="href string:javascript:toggle_expand_all('open')">
            <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 tal:attributes="href string:javascript:toggle_expand_all('close')">
            <img tal:attributes="src python:branch.static_url('/static/images/treeExpanded.png')"
                  alt="collapse all" /> collapse all</a>
        </p>
        <!-- Table -->        
        <table id="logentries"
               tal:define="subcolspan python:4-bool(all_same_author)">
            <tr class="logheader">
                <td class="revisionnumber">Rev</td>
                <td class="expandcell">&nbsp;</td>
                <td class="summarycell">Summary</td>
                <td class="authorcell">Author</td>
                <td class="datecell">Date</td>
                <td class="diffcell">Diff</td>
                <td class="downloadcell">Files</td>
            </tr>
            <tal:block tal:repeat="entry changes">
            <a tal:attributes="name string:entry-${entry/revno}"/>
                <tr tal:attributes="class string:blueRow${entry/parity} revision_log">
                <td class="revnro revnolink"><a tal:attributes="title python:'Show revision '+entry.revno;
                                                                href  python:url(['/revision', entry.revno], clear=1)"
                                                tal:content="python:util.trunc(entry.revno)"></a>
                </td>            
                <td class="expcell">
                    <div class="expand_revisioninfo">
                        <!-- So, this is interesting. I'm using "alt" to have the correct URL for the image of the expanded icon
                             and "title" tag for the contracted URL of the image. This is a bit of a hack, but it's better than
                             other approaches I tried  :)  -->
                        <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png');
                                             alt python:branch.static_url('/static/images/treeExpanded.png');
                                             title python:branch.static_url('/static/images/treeCollapsed.png')" 
                             class="expand_icon" />
                    </div>
                </td>
                <td class="summcell"><div tal:attributes="class string:short_description">
                                        <a tal:attributes="title python:'Show revision '+entry.revno;
                                                           href  python:url(['/revision', entry.revno], clear=1);
                                                           class string:link"
                                           tal:content="entry/short_comment"></a>
                                     </div>
                                     <div tal:attributes="class string:long_description;
                                                          style string:display:none">
                                        <a tal:attributes="title python:'Show revision '+entry.revno;
                                                           href  python:url(['/revision', entry.revno], clear=1);
                                                           class string:link"
                                           tal:content="entry/comment"></a>
                                     </div>
                                <div class="revisioninfo" style="display:none;">
                                    <ul class="expandrev">
               	                        <li class="mfrom" tal:repeat="parent python:entry.parents[1:]">
                                            <span class="revnolink">
                                                <a tal:attributes="href python:url(['/changes', parent.revno])"
                                                   tal:content="parent/revno"></a>
                                            </span>
                                            <a tal:condition="parent.branch_nick"
                                               tal:attributes="href python:url(['/changes'], start_revid=parent.revno)"
                                               tal:content="python:'(' + parent.branch_nick + ')'"
                                                title="Show history" class="link"></a>
                                        </li>
               	                        <li class="mto" tal:repeat="merge_point entry/merge_points">
                                            <a tal:attributes="href python:url(['/changes'], start_revid=merge_point.revno)"
                                               tal:content="python:revno_with_nick(merge_point)"
                                               title="Show history" class="link"></a>
                                        </li>
                                        <li class="committerli" tal:content="python:util.hide_email(entry.author)"></li>
                                        <tal:block content="structure python:file_change_summary(url, entry, modified_file_link_log)" />
                                    </ul>
                                </div>
                </td>
                <td tal:content="python:util.trunc(util.hide_email(entry.author), 20)"
                    class="autcell"></td>
                <td class="date">
                    <span tal:attributes="title python:util.date_time(entry.date)"
                          tal:content="python:util._approximatedate(entry.date)"></span>
                </td>
                <td class="diffr"><a tal:attributes="title python:'Show diff at revision '+entry.revno;
                                                     href python:url(['/revision', entry.revno], clear=1)">
                                  <img tal:attributes="src python:branch.static_url('/static/images/ico_diff.gif')" alt="Diff" /></a></td>
                <td class="downr"><a tal:attributes="href python:branch.url(['/files', entry.revno]);
                                                     title string:Files at revision ${entry/revno}">
                                   <img tal:attributes="src python:branch.static_url('/static/images/ico_file.gif');
                                                        alt string:Files" /></a>
                </td>
            </tr>
          </tal:block>
        </table>

        <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; Previous</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">Next &raquo;</a>
            </li>
        </ul>

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