/modules/mod_base/templates/error.tpl

http://github.com/zotonic/zotonic · Smarty Template · 104 lines · 97 code · 7 blank · 0 comment · 12 complexity · bd8a27a866d4b6537ec9ea04b1eec20e MD5 · raw file

  1. {% extends "base.tpl" %}
  2. {% block title %} {{ error_code }} Error {% endblock %}
  3. {% block content %}
  4. {% if error_code == 403 %}
  5. <h1>{_ No Access _}</h1>
  6. <p>{_ Sorry, you don’t have access to this page. _}</p>
  7. {% elseif error_code == 410 %}
  8. <h1>{_ Gone_}</h1>
  9. <p>{_ Sorry, this page has been deleted. _}</p>
  10. {% elseif error_code == 404 %}
  11. <h1>{_ That page does not exist _}</h1>
  12. <p><a href="/">{_ Return to the homepage _}</a></p>
  13. {% else %}
  14. <h1>{{ error_code }} {_ error _}</h1>
  15. {% if error_erlang %}
  16. <p><strong>{{ error_erlang|escape }}</strong></p>
  17. {% endif %}
  18. {% if error_table %}
  19. <h2>{_ Stack trace _}</h2>
  20. <style type="text/css">
  21. table {
  22. background-color: transparent;
  23. border-collapse: collapse;
  24. border-spacing: 0;
  25. }
  26. .tablex {
  27. width: auto;
  28. margin-bottom: 18px;
  29. }
  30. .tablex th,
  31. .tablex td {
  32. padding: 8px;
  33. line-height: 18px;
  34. text-align: left;
  35. vertical-align: top;
  36. border-top: 1px solid #dddddd;
  37. }
  38. .tablex th {
  39. font-weight: bold;
  40. color: white;
  41. }
  42. .tablex thead th {
  43. vertical-align: bottom;
  44. background-color: #0778B0;
  45. }
  46. .table-striped tbody tr:nth-child(odd) td,
  47. .table-striped tbody tr:nth-child(odd) th {
  48. background-color: #f9f9f9;
  49. }
  50. .tablex tbody tr:hover td,
  51. .tablex tbody tr:hover th {
  52. background-color: #f5f5f5;
  53. }
  54. .template-error td {
  55. background-color: #fff9f9 !important;
  56. }
  57. .template-error td:nth-child(1),
  58. .template-error td:nth-child(2) {
  59. font-weight: bold;
  60. }
  61. </style>
  62. <table class="tablex table-striped" style="border-collapse: transparent; border-spacing: 0;">
  63. <thead>
  64. <tr>
  65. <th align="left">{_ Module _}</th>
  66. <th align="left">{_ Function/ template _}</th>
  67. <th align="left">{_ Arguments _}</th>
  68. <th align="left">{_ File _}</th>
  69. </tr>
  70. </thead>
  71. <tbody>
  72. {% for is_template,mod,func,arg,file in error_table %}
  73. {% if is_template %}
  74. <tr class="template-error">
  75. <td>{{ mod|escape }}</td>
  76. <td>{{ func|escape }}</td>
  77. <td>{{ arg|escape }}</td>
  78. <td>{{ file|escape}}</td>
  79. </tr>
  80. {% else %}
  81. <tr>
  82. <td>{{ mod|escape }}</td>
  83. <td>{{ func|escape }}</td>
  84. <td>{{ arg|escape }}</td>
  85. <td>{{ file|escape}}</td>
  86. </tr>
  87. {% endif %}
  88. {% endfor %}
  89. </tbody>
  90. </table>
  91. {% else %}
  92. {% if error_dump %}
  93. <pre>{{ error_dump }}</pre>
  94. {% endif %}
  95. {% endif %}
  96. {% endif %}
  97. {% endblock %}