Extend from layout.html.tera
This commit is contained in:
parent
2e8016d23c
commit
5d7a9ca782
@ -1,74 +1,52 @@
|
|||||||
<!DOCTYPE html>
|
{% extends "layout.html.tera" %} {% block content %}
|
||||||
<html lang="en">
|
<div class="container">
|
||||||
<head>
|
<p><!--Nothing to see here --></p>
|
||||||
<meta charset="utf-8" />
|
<h1>Posts</h1>
|
||||||
<title>Actix Example</title>
|
{# {% if flash %}
|
||||||
<meta name="description" content="Actix - SeaOrm integration example" />
|
<small class="field-{{ flash.0 }}-flash">
|
||||||
<meta name="author" content="Sam Samai" />
|
{{ flash.1 }}
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
</small>
|
||||||
|
{% endif %} #}
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Title</th>
|
||||||
|
<th>Text</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
{% for post in posts %}
|
||||||
|
<tr class="post" onclick="window.location='/{{ post.id }}';">
|
||||||
|
<td>{{ post.id }}</td>
|
||||||
|
<td>{{ post.title }}</td>
|
||||||
|
<td>{{ post.text }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
{% if page == 0 %} Previous {% else %}
|
||||||
|
<a href="/?page={{ page - 1 }}&posts_per_page={{ posts_per_page }}"
|
||||||
|
>Previous</a
|
||||||
|
>
|
||||||
|
{% endif %} | {% if page == num_pages - 1 %} Next {% else %}
|
||||||
|
<a href="/?page={{ page + 1 }}&posts_per_page={{ posts_per_page }}"
|
||||||
|
>Next</a
|
||||||
|
>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
|
||||||
<link
|
<div class="twelve columns">
|
||||||
href="//fonts.googleapis.com/css?family=Raleway:400,300,600"
|
<a href="/new">
|
||||||
rel="stylesheet"
|
<input type="button" value="add post" />
|
||||||
type="text/css"
|
</a>
|
||||||
/>
|
</div>
|
||||||
<link rel="stylesheet" href="/static/css/normalize.css" />
|
</div>
|
||||||
<link rel="stylesheet" href="/static/css/skeleton.css" />
|
{% endblock content %}
|
||||||
<link rel="stylesheet" href="/static/css/style.css" />
|
|
||||||
<link rel="icon" type="image/png" href="/static/images/favicon.png" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<p><!--Nothing to see here --></p>
|
|
||||||
<h1>Posts</h1>
|
|
||||||
{# {% if flash %}
|
|
||||||
<small class="field-{{ flash.0 }}-flash">
|
|
||||||
{{ flash.1 }}
|
|
||||||
</small>
|
|
||||||
{% endif %} #}
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>ID</th>
|
|
||||||
<th>Title</th>
|
|
||||||
<th>Text</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
{% for post in posts %}
|
|
||||||
<tr class="post" onclick="window.location='/{{ post.id }}';">
|
|
||||||
<td>{{ post.id }}</td>
|
|
||||||
<td>{{ post.title }}</td>
|
|
||||||
<td>{{ post.text }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td>
|
|
||||||
{% if page == 0 %} Previous {% else %}
|
|
||||||
<a
|
|
||||||
href="/?page={{ page - 1 }}&posts_per_page={{ posts_per_page }}"
|
|
||||||
>Previous</a
|
|
||||||
>
|
|
||||||
{% endif %} | {% if page == num_pages - 1 %} Next {% else %}
|
|
||||||
<a
|
|
||||||
href="/?page={{ page + 1 }}&posts_per_page={{ posts_per_page }}"
|
|
||||||
>Next</a
|
|
||||||
>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div class="twelve columns">
|
|
||||||
<a href="/new">
|
|
||||||
<input type="button" value="add post" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
26
examples/actix_example/templates/layout.html.tera
Normal file
26
examples/actix_example/templates/layout.html.tera
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Actix Example</title>
|
||||||
|
<meta name="description" content="Actix - SeaOrm integration example" />
|
||||||
|
<meta name="author" content="Sam Samai" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
||||||
|
<link
|
||||||
|
href="//fonts.googleapis.com/css?family=Raleway:400,300,600"
|
||||||
|
rel="stylesheet"
|
||||||
|
type="text/css"
|
||||||
|
/>
|
||||||
|
<link rel="stylesheet" href="/static/css/normalize.css" />
|
||||||
|
<link rel="stylesheet" href="/static/css/skeleton.css" />
|
||||||
|
<link rel="stylesheet" href="/static/css/style.css" />
|
||||||
|
<link rel="icon" type="image/png" href="/static/images/favicon.png" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<p><!--Nothing to see here --></p>
|
||||||
|
{% block content %}{% endblock content %}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
x
Reference in New Issue
Block a user