You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.6 KiB

  1. {% extends "base.html" %}
  2. {% load compress static hc_extras %}
  3. {% block title %}Status Badges - {{ site_name }}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-10">
  7. <h1>Status Badges</h1>
  8. <p id="badges-description">
  9. {{ site_name }} provides status badges for each of the tags
  10. you have used. Additionally, the "{{ site_name }}"
  11. badge shows the overall status of all checks in a
  12. project. The badges have public, but hard-to-guess
  13. URLs. You can use them in your READMEs,
  14. dashboards or status pages.
  15. </p>
  16. <div id="b-format" class="btn-group" data-toggle="buttons">
  17. <label id="show-svg" class="btn btn-default active">
  18. <input type="radio" autocomplete="off" checked> SVG
  19. </label>
  20. <label id="show-json" class="btn btn-default">
  21. <input type="radio" autocomplete="off"> JSON
  22. </label>
  23. <label id="show-shields" class="btn btn-default">
  24. <input type="radio" autocomplete="off"> Shields.io
  25. </label>
  26. </div>
  27. <table id="badges-svg" class="badges table">
  28. {% if have_tags %}
  29. <tr>
  30. <th colspan="2">Tags</th>
  31. </tr>
  32. {% endif %}
  33. {% for urldict in badges %}
  34. {% if urldict.tag == "*" %}
  35. <tr>
  36. <th colspan="2">Overall Status</th>
  37. </tr>
  38. {% endif %}
  39. <tr>
  40. <td>
  41. <img src="{{ urldict.svg }}" alt="" />
  42. </td>
  43. <td>
  44. <code>{{ urldict.svg }}</code>
  45. </td>
  46. </tr>
  47. {% endfor %}
  48. </table>
  49. <table id="badges-json" class="badges table">
  50. {% if have_tags %}
  51. <tr>
  52. <th colspan="2">Tags</th>
  53. </tr>
  54. {% endif %}
  55. {% for urldict in badges %}
  56. {% if urldict.tag == "*" %}
  57. <tr>
  58. <th colspan="2">Overall Status</th>
  59. </tr>
  60. {% endif %}
  61. <tr>
  62. <td class="json-response" data-url="{{ urldict.json }}">
  63. </td>
  64. <td>
  65. <code>{{ urldict.json }}</code>
  66. </td>
  67. </tr>
  68. {% endfor %}
  69. </table>
  70. <div id="badges-shields">
  71. <table class="badges table">
  72. {% if have_tags %}
  73. <tr>
  74. <th>Shields.io badge</th>
  75. <th>JSON endpoint for Shields.io <a href="https://shields.io/endpoint">(how to use)</a></th>
  76. </tr>
  77. {% endif %}
  78. {% for urldict in badges %}
  79. {% if urldict.tag == "*" %}
  80. <tr>
  81. <th colspan="2">Overall Status</th>
  82. </tr>
  83. {% endif %}
  84. <tr>
  85. <td>
  86. <img src="https://img.shields.io/endpoint?url={{ urldict.shields|urlencode:"" }}" alt="" />
  87. </td>
  88. <td>
  89. <code>{{ urldict.shields }}</code>
  90. </td>
  91. </tr>
  92. {% endfor %}
  93. </table>
  94. </div>
  95. </div>
  96. </div>
  97. {% endblock %}
  98. {% block scripts %}
  99. {% compress js %}
  100. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  101. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  102. <script src="{% static 'js/badges.js' %}"></script>
  103. {% endcompress %}
  104. {% endblock %}