broken_links.html 3.94 KB
Newer Older
1

Ross Jones's avatar
Ross Jones committed
2
    {% if c.options['organization'] == None %}
3
      <ul>
Ross Jones's avatar
Ross Jones committed
4
5
          <li>Broken datasets: {{c.data['num_broken_packages']}} / {{c.data['num_packages']}} ({{c.data.get('broken_package_percent')}}%)</li>
          <li>Broken links: {{c.data['num_broken_resources']}} / {{c.data['num_resources']}} ({{c.data.get('broken_resource_percent')}}%)</li>
6
      </ul>
7
8
9
10
      <table class="table table-striped table-bordered table-condensed tablesorter" id="report-table">
       <thead>
        <tr>
          <th>Publisher</th>
11
12
          <th>Datasets with broken links</th>
          <th>Broken links</th>
13
          <th>% Broken links</th>
14
15
16
        </tr>
       </thead>
       <tbody>
Ross Jones's avatar
Ross Jones committed
17
18
19
20
21
22
       {% for row in c.data['table']%}
        <tr>
          <td>{{h.link_to(row['organization_title'], h.relative_url_for(organization=row['organization_name']))}}</td>
          <td>{{row['broken_package_count']}}</td>
          <td>{{row['broken_resource_count']}}</td>
          <td>{{row.get('broken_resource_percent')}}</td>
23
        </tr>
Ross Jones's avatar
Ross Jones committed
24
        {% endfor %}
25
26
       </tbody>
      </table>
Ross Jones's avatar
Ross Jones committed
27
    {% endif %}
28

Ross Jones's avatar
Ross Jones committed
29
    {% if c.options['organization'] != None %}
30
        <ul>
Ross Jones's avatar
Ross Jones committed
31
32
          <li>Broken datasets: {{c.data['num_broken_packages']}} / {{c.data['num_packages']}} ({{c.data.get('broken_package_percent')}}%)</li>
          <li>Broken links: {{c.data['num_broken_resources']}} / {{c.data['num_resources']}} ({{c.data.get('broken_resource_percent')}}%)</li>
33
34
35
        </ul>
        <table class="table table-striped table-bordered table-condensed tablesorter" id="report-table" style="width: 100%; table-layout: fixed;">
         <thead>
36
            <tr class="js-tooltip" style="letter-spacing: -1px; font-size: 13px;">
37
              <th style="width: 100px">Dataset</th>
38
              <th style="width: 45px">Notes</th>
Ross Jones's avatar
Ross Jones committed
39
40
41
              {% if c.options['include_sub_organizations'] %}
              <th style="width: 85px">Publisher</th>
              {% endif %}
42
              <th style="width: 20px" title="Index/position of the resource in the dataset">Res</th>
43
              <th style="width: 190px">URL</th>
44
              <th style="width: 75px">Status</th>
45
46
              <th style="width: 120px">Reason</th>
              <th style="width: 25px" title="Failed download attempts">No. of fails</th>
47
48
49
              <th style="width: 75px" title="First failed attempt">First fail</th>
              <th style="width: 75px" title="Most recent failed attempt">Latest fail</th>
              <th style="width: 75px" title="The last time it was successfully obtained">Last success</th>
50
51
52
            </tr>
         </thead>
         <tbody>
Ross Jones's avatar
Ross Jones committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
            {% for row_dict in c.data['table'] %}
            <tr>
              <td><a href="{{h.url_for(controller='package', action='read', id=row_dict['dataset_name'])}}">{{row_dict['dataset_title']}}</a></td>
              <td>{{row_dict['dataset_notes']}}</td>
              {% if c.options['include_sub_organizations']%}
              <td><a href="/publisher/{{row_dict['organization_name']}}">{{row_dict['organization_title']}}</a></td>
              {% endif %}
              <td><a href="/dataset/{{row_dict['dataset_name']}}/resource/{{row_dict['resource_id']}}">{{row_dict['resource_position']}}</a></td>
              <td><a href="{{row_dict['resource_url']}}" style="word-wrap:break-word;">{{row_dict['resource_url']}}</a></td>
              <td>{{row_dict.get('status', 'not recorded')}}</td>
              <td>{{row_dict.get('reason', 'not recorded')}}</td>
              <td>{{row_dict.get('failure_count', 'not recorded')}}</td>
              <td>{{h.render_datetime(row_dict.get('first_failure')) if row_dict.get('first_failure') else 'not recorded'}}</td>
              <td>{{h.render_datetime(row_dict.get('last_updated')) if row_dict.get('last_updated') else 'not recorded'}}</td>
              <td>{{h.render_datetime(row_dict.get('last_success')) if row_dict.get('last_success') else 'not recorded'}}</td>
68
            </tr>
Ross Jones's avatar
Ross Jones committed
69
            {% endfor %}
70
71
          </tbody>
        </table>
Ross Jones's avatar
Ross Jones committed
72
      {% endif %}