PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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