~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/view.pt

  • Committer: Danilo Segan
  • Date: 2011-09-02 10:22:52 UTC
  • mfrom: (455.1.2 bug-839395)
  • Revision ID: danilo@canonical.com-20110902102252-phc11upmjw8tz1mg
[r=jam][bug=839395] Do not crash when someone asks to look at per-revision changes for a file when file is not changed in a certain revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
<html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="macros/main">
4
4
  <head>
5
5
    <title metal:fill-slot="title"
6
 
           tal:content="string:${branch/friendly_name} : contents of ${path}
 
6
           tal:content="string:${branch/friendly_name} : contents of ${file_path}
7
7
                        at revision ${change/revno}">
8
8
    </title>
 
9
    <metal:block fill-slot="header_extras">
 
10
        <link rel="stylesheet" type="text/css" media="all"
 
11
              tal:attributes="href python:branch.static_url('/static/css/view.css')"/>
 
12
        <link rel="stylesheet" type="text/css" media="all"
 
13
              tal:attributes="href python:branch.static_url('/static/css/highlight.css')"/>
 
14
    </metal:block>
9
15
  </head>
10
16
 
11
17
  <body>
12
 
 
13
 
    <h1 metal:fill-slot="heading">
14
 
      <span class="branch-name" tal:content="branch/friendly_name"></span>
15
 
      :
16
 
      <span class="annotate-path" tal:content="path"></span>
17
 
      (revision <tal:revno content="change/revno"></tal:revno>)
18
 
    </h1>
 
18
      <tal:block metal:fill-slot="backlink">
 
19
          <tal:has-link condition="branch/branch_link">
 
20
            <div class="black-link">
 
21
                <a tal:attributes="href branch/branch_link">
 
22
                  &#8592; Back to branch summary
 
23
                </a>
 
24
            </div>
 
25
          </tal:has-link>
 
26
      </tal:block>
 
27
      <tal:block metal:fill-slot="branchname" tal:content="string:${branch/friendly_name}" />
 
28
          <tal:block metal:fill-slot="heading">
 
29
          <div id="breadcrumbs">
 
30
          <tal:has-link condition="branch/branch_link">
 
31
            <a tal:attributes="href branch/branch_link"
 
32
               tal:content="branch/friendly_name">
 
33
              nice/branch/name
 
34
            </a>
 
35
          </tal:has-link>
 
36
          <tal:no-link condition="not: branch/branch_link">
 
37
            <span metal:use-macro="breadcrumbs/directory"></span>
 
38
          </tal:no-link>
 
39
          <span>: <span metal:use-macro="breadcrumbs/branch" /> (revision <tal:revno content="change/revno"></tal:revno>)</span>
 
40
        </div>
 
41
      </tal:block>
19
42
 
20
43
    <div metal:fill-slot="content">
21
 
      <div class="links">
22
 
        <div>
23
 
          <b>&#8594;</b>
24
 
          <a tal:attributes="href python:url(['/files', change.revno], clear=1)">browse files</a>
25
 
        </div>
26
 
        <div>
27
 
          <b>&#8594;</b>
28
 
          <a tal:attributes="href python:url(['/revision'], clear=1, start_revid=change.revno)">view revision</a>
29
 
        </div>
30
 
        <div>
31
 
          <b>&#8594;</b>
32
 
          <a tal:attributes="href python:url(['/changes'], clear=1, start_revid=change.revno, filter_file_id=file_id)">view changes to this file</a>
33
 
        </div>
34
 
        <div>
35
 
          <b>&#8594;</b>
36
 
          <a tal:attributes="href python:url(['/download', change.revno, file_id, filename])">download file</a>
37
 
        </div>
38
 
      </div>
39
 
 
40
 
      <div class="annotate">
41
 
        <table>
42
 
          <tr>
43
 
            <th class="lineno"> Line# </th>
44
 
            <th class="revision"> Revision </th>
45
 
            <th class="text"> Contents </th>
46
 
          </tr>
47
 
 
48
 
          <tr tal:repeat="line contents"
49
 
              tal:attributes="class string:parity${line/parity}">
50
 
            <td tal:attributes="class string:lineno ${line/status}">
51
 
              <a tal:attributes="name string:L${line/lineno}"
52
 
                 tal:content="line/lineno"></a>
53
 
            </td>
54
 
            <td tal:attributes="class string:revno ${line/status}">
55
 
              <a tal:condition="python:line.status=='changed'"
56
 
                 tal:content="python:util.trunc(line.change.revno)"
57
 
                 tal:attributes="href python:url(['/revision'], clear=1, start_revid=line.change.revno, filter_file_id=file_id);
58
 
                                 title python:'%s by %s, on %s (%s)'%(line.change.revno, util.hide_email(line.change.author), line.change.date.strftime('%d %b %Y %H:%M'), util.date_time(line.change.date))"></a>
59
 
            </td>
60
 
            <td tal:attributes="class string:text ${line/status}"
61
 
                tal:content="line/text">
62
 
            </td>
63
 
          </tr>
 
44
      <tal:branch-info replace="structure python:branchinfo(branch)" />
 
45
 
 
46
        <ul id="submenuTabs">
 
47
            <li id="first">
 
48
                <a tal:attributes="href python:url(['/files', change.revno], clear=1)">browse files</a>
 
49
            </li>
 
50
            <li tal:condition="not:annotated">
 
51
              <a tal:attributes="href python:url(['/annotate', revno_url, file_path], clear=1)"
 
52
              >view with revision information</a>
 
53
            </li>
 
54
            <li tal:condition="annotated">
 
55
              <a tal:attributes="href python:url(['/view', revno_url, file_path], clear=1)"
 
56
              >view without revision information</a>
 
57
            </li>
 
58
            <li>
 
59
                <a tal:attributes="href python:url(['/revision', change.revno], clear=1)">view revision</a>
 
60
            </li>
 
61
            <li>
 
62
                <a tal:attributes="href python:url(['/changes'], clear=1, filter_file_id=file_id)"
 
63
                >view changes to this file</a>
 
64
            </li>
 
65
            <li id="last">
 
66
                <a tal:attributes="href python:url(['/download',
 
67
                                    revno_url, file_id, filename])"
 
68
                >download file</a>
 
69
            </li>
 
70
        </ul>
 
71
 
 
72
      <div class="view">
 
73
        <table id="logentries">
 
74
          <tal:rep tal:repeat="line contents">
 
75
            <tr>
 
76
              <td tal:condition="python:path('repeat/line/number') in annotated"
 
77
                  tal:define="anno python:annotated.get(path('repeat/line/number'), None)"
 
78
                  tal:attributes="rowspan python:anno.revspan"
 
79
                  class="viewRev">
 
80
                <a tal:content="python:'%s' % (anno.change.revno,)"
 
81
                   tal:attributes="href python:url(['/revision', anno.change.revno], clear=1);
 
82
                                   title python:'%s by %s, on %s (%s)' % (anno.change.revno, ', '.join(util.hide_emails(anno.change.authors)), anno.change.date.strftime('%d %b %Y %H:%M'), util.date_time(anno.change.date))"></a>
 
83
                <span class="viewAuthors" tal:content="python:'by ' + ', '.join(util.hide_emails(anno.change.authors))" />
 
84
                <br />
 
85
 
 
86
                <span tal:content="python:anno.message"></span>
 
87
              </td>
 
88
              <td tal:attributes="class python:path('repeat/line/number') in annotated and 'viewLine first' or 'viewLine'">
 
89
                <a tal:attributes="id string:L${repeat/line/number}; href string:#L${repeat/line/number}"
 
90
                   tal:content="repeat/line/number">1</a>
 
91
              </td>
 
92
              <td class="viewCont"><pre tal:content="structure line"></pre></td>
 
93
            </tr>
 
94
          </tal:rep>
64
95
        </table>
65
96
      </div>
66
97