mirror of
https://github.com/moparisthebest/wallabag
synced 2025-01-05 18:58:09 -05:00
[change] refactor templates for entries
This commit is contained in:
parent
9d0b1712be
commit
3137b854fa
@ -1,17 +1,5 @@
|
||||
{% extends layout %}
|
||||
|
||||
{% block menu %}
|
||||
{% set count = entries|length %}
|
||||
|
||||
<nav role="navigation">
|
||||
<ul>
|
||||
<li><a href="/">{{ 'unread'|trans }}</a></li>
|
||||
<li>{{ 'starred'|trans }}</li>
|
||||
<li><a href="/archive">{{ 'archive'|trans }}</a> ({{count}})</li>
|
||||
<li><a href="{{ path('add') }}">{{ 'entry.add'|trans }}</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
{% block title %}archive{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if entries is empty %}
|
||||
@ -19,16 +7,7 @@
|
||||
{% else %}
|
||||
<ul>
|
||||
{% for entry in entries %}
|
||||
<li>
|
||||
<h2><a href="{{ path('view_entry', {'id': entry.id}) }}">{{ entry.title }}</a></h2>
|
||||
<p>{{ entry.content|striptags|slice(0, 300) }}…</p>
|
||||
<ul>
|
||||
<li>{% if entry.status == "read" %}<a href="{{ path('mark_entry_unread', {'id': entry.id}) }}">{{ 'mark as unread'|trans }}</a>{% else %}<a href="{{ path('mark_entry_read', {'id': entry.id}) }}">{{ 'mark as read'|trans }}</a>{% endif %}</li>
|
||||
<li><a href="#">{{ 'star'|trans }}</a></li>
|
||||
<li><a href="#">{{ 'delete'|trans }}</a></li>
|
||||
<li><a href="{{ entry.url }}">{{ 'view original'|trans }}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% include "entry.twig" %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
16
app/views/bookmarks.twig
Normal file
16
app/views/bookmarks.twig
Normal file
@ -0,0 +1,16 @@
|
||||
{% extends layout %}
|
||||
{% block title %}bookmarks{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if entries is empty %}
|
||||
<div class="messages warning"><p>{{ 'No link available here!'|trans }}</p></div>
|
||||
{% else %}
|
||||
<ul>
|
||||
{% for entry in entries %}
|
||||
{% include "entry.twig" %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
10
app/views/entry.twig
Normal file
10
app/views/entry.twig
Normal file
@ -0,0 +1,10 @@
|
||||
<li>
|
||||
<h2><a href="{{ path('view_entry', {'id': entry.id}) }}">{{ entry.title }}</a></h2>
|
||||
<p>{{ entry.content|striptags|slice(0, 300) }}…</p>
|
||||
<ul>
|
||||
<li>{% if entry.status == "read" %}<a href="{{ path('mark_entry_unread', {'id': entry.id}) }}">{{ 'mark as unread'|trans }}</a>{% else %}<a href="{{ path('mark_entry_read', {'id': entry.id}) }}">{{ 'mark as read'|trans }}</a>{% endif %}</li>
|
||||
<li><a href="#">{% if entry.bookmark == 1 %}<a href="{{ path('unstar_entry', {'id': entry.id}) }}">{{ 'unstar'|trans }}</a>{% else %}<a href="{{ path('star_entry', {'id': entry.id}) }}">{{ 'star'|trans }}</a>{% endif %}</a></li>
|
||||
<li><a href="#">{{ 'delete'|trans }}</a></li>
|
||||
<li><a href="{{ entry.url }}">{{ 'view original'|trans }}</a></li>
|
||||
</ul>
|
||||
</li>
|
@ -1,17 +1,5 @@
|
||||
{% extends layout %}
|
||||
|
||||
{% block menu %}
|
||||
{% set count = entries|length %}
|
||||
|
||||
<nav role="navigation">
|
||||
<ul>
|
||||
<li><a href="/">{{ 'unread'|trans }}</a> ({{count}})</li>
|
||||
<li>{{ 'starred'|trans }}</li>
|
||||
<li><a href="/archive">{{ 'archive'|trans }}</a></li>
|
||||
<li><a href="{{ path('add') }}">{{ 'entry.add'|trans }}</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
{% block title %}unread{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if entries is empty %}
|
||||
@ -19,16 +7,7 @@
|
||||
{% else %}
|
||||
<ul>
|
||||
{% for entry in entries %}
|
||||
<li>
|
||||
<h2><a href="{{ path('view_entry', {'id': entry.id}) }}">{{ entry.title }}</a></h2>
|
||||
<p>{{ entry.content|striptags|slice(0, 300) }}…</p>
|
||||
<ul>
|
||||
<li>{% if entry.status == "read" %}<a href="{{ path('mark_entry_unread', {'id': entry.id}) }}">{{ 'mark as unread'|trans }}</a>{% else %}<a href="{{ path('mark_entry_read', {'id': entry.id}) }}">{{ 'mark as read'|trans }}</a>{% endif %}</li>
|
||||
<li><a href="#">{% if entry.bookmark == 1 %}<a href="{{ path('unstar_entry', {'id': entry.id}) }}">{{ 'unstar'|trans }}</a>{% else %}<a href="{{ path('star_entry', {'id': entry.id}) }}">{{ 'star'|trans }}</a>{% endif %}</a></li>
|
||||
<li><a href="#">{{ 'delete'|trans }}</a></li>
|
||||
<li><a href="{{ entry.url }}">{{ 'view original'|trans }}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% include "entry.twig" %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
<!--[if IE]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=10">
|
||||
<![endif]-->
|
||||
<title>poche</title>
|
||||
<title>{% block title %}{% endblock %} – poche</title>
|
||||
<link rel="stylesheet" href="/assets/css/knacss.css" media="all">
|
||||
<link rel="stylesheet" href="/assets/css/style.css" media="all">
|
||||
</head>
|
||||
@ -18,7 +18,7 @@
|
||||
{% include '_top.twig' %}
|
||||
<div id="main">
|
||||
<div id="content" class="w600p center">
|
||||
{% block menu %}{% endblock %}
|
||||
{% include "menu.twig" %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
11
app/views/menu.twig
Normal file
11
app/views/menu.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% if entries is defined %}
|
||||
{% set count = entries|length %}
|
||||
{% endif %}
|
||||
<nav role="navigation">
|
||||
<ul>
|
||||
<li><a href="/">{{ 'unread'|trans }}</a>{% if app.request.requesturi == '/' %} ({{count}}){% endif %}</li>
|
||||
<li><a href="/bookmarks">{{ 'bookmarks'|trans }}</a>{% if app.request.requesturi == '/bookmarks' %} ({{count}}){% endif %}</li>
|
||||
<li><a href="/archive">{{ 'archive'|trans }}</a>{% if app.request.requesturi == '/archive' %} ({{count}}){% endif %}</li>
|
||||
<li><a href="{{ path('add') }}">{{ 'entry.add'|trans }}</a></li>
|
||||
</ul>
|
||||
</nav>
|
Loading…
Reference in New Issue
Block a user