Fixed out-dated template in documentation

pull/232/head
Simon Willison 2018-04-18 22:57:31 -07:00
rodzic b52171db1e
commit 1e4c295012
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 17E2DEA2588B7F52
1 zmienionych plików z 3 dodań i 21 usunięć

Wyświetl plik

@ -190,26 +190,8 @@ Note the ``default:row.html`` template name, which ensures Jinja will inherit
from the default template. from the default template.
The ``_rows_and_columns.html`` template is included on both the row and the table The ``_rows_and_columns.html`` template is included on both the row and the table
page, and displays the content of the row. The default template looks like this:: page, and displays the content of the row. The default ``_rows_and_columns.html`` template
`can be seen here <https://github.com/simonw/datasette/blob/master/datasette/templates/_rows_and_columns.html>`_.
<table>
<thead>
<tr>
{% for column in display_columns %}
<th scope="col">{{ column }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in display_rows %}
<tr>
{% for cell in row %}
<td>{{ cell.value }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
You can provide a custom template that applies to all of your databases and You can provide a custom template that applies to all of your databases and
tables, or you can provide custom templates for specific tables using the tables, or you can provide custom templates for specific tables using the
@ -232,7 +214,7 @@ provide a custom ``_rows_and_columns.html`` template like this::
{% for cell in row %} {% for cell in row %}
<td> <td>
{% if cell.column == 'description' %} {% if cell.column == 'description' %}
!!{{ cell.value|safe }} {{ cell.value|safe }}
{% else %} {% else %}
{{ cell.value }} {{ cell.value }}
{% endif %} {% endif %}