broken_links.html 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {% if c.options['organization'] == None %}
  2. <ul>
  3. <li>{% trans %}Broken datasets{% endtrans %}: {{ c.data['num_broken_packages'] }} / {{ c.data['num_packages'] }} ({{ c.data.get('broken_package_percent') }}%)</li>
  4. <li>{% trans %}Broken links{% endtrans %}: {{ c.data['num_broken_resources'] }} / {{ c.data['num_resources'] }} ({{ c.data.get('broken_resource_percent') }}%)</li>
  5. </ul>
  6. <table class="table table-striped table-bordered table-condensed" id="report-table">
  7. <col style="width: 60%" />
  8. <col style="width: 10%" />
  9. <col style="width: 10%" />
  10. <col style="width: 10%" />
  11. <thead>
  12. <tr>
  13. <th class="header">{% trans %}Organization{% endtrans %}</th>
  14. <th class="header">{% trans %}Broken datasets{% endtrans %}</th>
  15. <th class="header">{% trans %}Broken links{% endtrans %}</th>
  16. <th class="header">% {% trans %}Broken links{% endtrans %}</th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. {% for row in c.data['table'] %}
  21. <tr>
  22. <td>{{ h.link_to(row['organization_title'], h.report__relative_url_for(organization=row['organization_name'])) }}</td>
  23. <td>{{ row['broken_package_count'] }}</td>
  24. <td>{{ row['broken_resource_count'] }}</td>
  25. <td>{{ row.get('broken_resource_percent') }}%</td>
  26. </tr>
  27. {% endfor %}
  28. </tbody>
  29. </table>
  30. {% else %}
  31. <ul>
  32. <li>{% trans %}Broken datasets{% endtrans %}: {{ c.data['num_broken_packages'] }} / {{ c.data['num_packages'] }} ({{ c.data.get('broken_package_percent') }}%)</li>
  33. <li>{% trans %}Broken links{% endtrans %}: {{ c.data['num_broken_resources'] }} / {{ c.data['num_resources'] }} ({{ c.data.get('broken_resource_percent') }}%)</li>
  34. </ul>
  35. <table class="table table-striped table-bordered table-condensed" id="report-table" style="width: 100%">
  36. <thead>
  37. <tr class="js-tooltip" style="letter-spacing: -1px; font-size: 13px;">
  38. <th>{% trans %}Dataset{% endtrans %}</th>
  39. {% if c.options['include_sub_organizations'] %}
  40. <th>{% trans %}Organization{% endtrans %}</th>
  41. {% endif %}
  42. <th title="{% trans %}Index/position of the resource in the dataset{% endtrans %}">{% trans %}Res{% endtrans %}</th>
  43. <th>{% trans %}URL{% endtrans %}</th>
  44. <th>{% trans %}Status{% endtrans %}</th>
  45. <th>{% trans %}Reason{% endtrans %}</th>
  46. <th title="{% trans %}Failed download attempts{% endtrans %}">{% trans %}No. of fails{% endtrans %}</th>
  47. <th title="{% trans %}First failed attempt{% endtrans %}">{% trans %}First fail{% endtrans %}</th>
  48. <th title="{% trans %}Most recent failed attempt{% endtrans %}">{% trans %}Latest fail{% endtrans %}</th>
  49. <th title="{% trans %}The last time it was successfully obtained{% endtrans %}">{% trans %}Last success{% endtrans %}</th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. {% for row_dict in c.data['table'] %}
  54. <tr>
  55. <td><a href="{{ h.url_for(controller='package', action='read', id=row_dict['dataset_name']) }}">{{ row_dict['dataset_title'] }}</a></td>
  56. {% if c.options['include_sub_organizations'] %}
  57. <td><a href="/publisher/{{ row_dict['organization_name'] }}">{{ row_dict['organization_title'] }}</a></td>
  58. {% endif %}
  59. <td><a href="/dataset/{{ row_dict['dataset_name'] }}/resource/{{ row_dict['resource_id'] }}">{{ row_dict['resource_position'] }}</a></td>
  60. <td><a href="{{ row_dict['resource_url'] }}" style="word-wrap:break-word;">{{ row_dict['resource_url'] }}</a></td>
  61. <td>{{ row_dict.get('status', 'not recorded') }}</td>
  62. <td style="word-wrap: anywhere">{{ row_dict.get('reason', 'not recorded') }}</td>
  63. <td>{{ row_dict.get('failure_count', 'not recorded') }}</td>
  64. <td>{{ h.render_datetime(row_dict.get('first_failure')) if row_dict.get('first_failure') else 'not recorded' }}</td>
  65. <td>{{ h.render_datetime(row_dict.get('last_updated')) if row_dict.get('last_updated') else 'not recorded' }}</td>
  66. <td>{{ h.render_datetime(row_dict.get('last_success')) if row_dict.get('last_success') else 'not recorded' }}</td>
  67. </tr>
  68. {% endfor %}
  69. </tbody>
  70. </table>
  71. {% endif %}