mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-22 17:18:37 +00:00
a lot of refactoring: tag action is now handled by home view and uses sorting and pagination. Some small view enhacenments. Fix of #476, #461 for baggy and other themes
This commit is contained in:
parent
6203ef8e51
commit
032e0ca13a
15 changed files with 143 additions and 130 deletions
|
@ -4,6 +4,13 @@
|
|||
{% include '_menu.twig' %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div id="article">
|
||||
<header class="mbm">
|
||||
<h1>{{ entry.title|raw }}</h1>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
{% if tags is empty %}
|
||||
no tags
|
||||
{% endif %}
|
||||
|
@ -11,10 +18,12 @@ no tags
|
|||
{% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&tag_id={{ tag.id }}&id={{ entry_id }}">✘</a></li>{% endfor %}
|
||||
</ul>
|
||||
<form method="post" action="./?action=add_tag">
|
||||
<label for="value">Add tags: </label><input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" />
|
||||
<p>{% trans "You can enter multiple tags, separated by commas." %}</p>
|
||||
<input type="hidden" name="entry_id" value="{{ entry_id }}" />
|
||||
<label for="value">Add tags: </label>
|
||||
<input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" />
|
||||
<input type="submit" value="Tag" />
|
||||
<p>{% trans "You can enter multiple tags, separated by commas." %}</p>
|
||||
|
||||
</form>
|
||||
<a href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a>
|
||||
<a href="./?view=view&id={{ entry_id }}">« {% trans "return to article" %}</a>
|
||||
{% endblock %}
|
||||
|
|
|
@ -14,12 +14,16 @@
|
|||
{% block precontent %}
|
||||
{% if entries|length > 1 %}
|
||||
<ul id="sort">
|
||||
<li><a href="./?sort=ia&view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/top.png" alt="{% trans "by date asc" %}" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id&view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li>
|
||||
<li><a href="./?sort=ta&view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/top.png" alt="{% trans "by title asc" %}" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td&view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li>
|
||||
<li><a href="./?sort=ia&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/top.png" alt="{% trans "by date asc" %}" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li>
|
||||
<li><a href="./?sort=ta&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/top.png" alt="{% trans "by title asc" %}" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% if tag %}
|
||||
<h3>{% trans "Tag" %}: <b>{{ tag.value }}</b></h3>
|
||||
{% endif %}
|
||||
|
||||
{% if entries is empty %}
|
||||
<div class="messages warning"><p>{% trans "No articles found." %}</p></div>
|
||||
{% else %}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
{% extends "layout.twig" %}
|
||||
{% block title %}tag {% endblock %}
|
||||
{% block menu %}
|
||||
{% include '_menu.twig' %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<h3>{% trans "Tag" %} {{ tag.value }}</h3>
|
||||
{% if entries is empty %}
|
||||
<div class="messages warning"><p>{% trans "No link available here!" %}</p></div>
|
||||
{% else %}
|
||||
{% block pager %}
|
||||
{% if nb_results > 1 %}
|
||||
<div class="results">
|
||||
<div class="nb-results">{{ nb_results }} {% trans "results" %}</div>
|
||||
{{ page_links | raw }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% for entry in entries %}
|
||||
<div id="entry-{{ entry.id|e }}" class="entrie">
|
||||
<h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
|
||||
<ul class="tools">
|
||||
<li><a title="{% trans "toggle mark as read" %}" class="tool {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&id={{ entry.id|e }}"><span>{% trans "toggle mark as read" %}</span></a></li>
|
||||
<li><a title="{% trans "toggle favorite" %}" class="tool {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span>{% trans "toggle favorite" %}</span></a></li>
|
||||
<li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
|
||||
<li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link"><span>{{ entry.url | e | getDomain }}</span></a></li>
|
||||
<li><a target="_blank" title="{% trans "estimated reading time:" %} {{ entry.content| getReadingTime }} min" class="reading-time"><span>{{ entry.content| getReadingTime }} min</span></a></li>
|
||||
</ul>
|
||||
<p>{{ entry.content|striptags|slice(0, 300) }}...</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -20,12 +20,15 @@
|
|||
<header class="mbm">
|
||||
<h1>{{ entry.title|raw }}</h1>
|
||||
</header>
|
||||
<aside class="tags">
|
||||
{% trans "tags:" %} {% for tag in tags %}<a href="./?view=tag&id={{ tag.id }}">{{ tag.value }}</a> {% endfor %}<a href="./?view=edit-tags&id={{ entry.id|e }}" title="{% trans "Edit tags" %}">✎</a>
|
||||
</aside>
|
||||
{% block tags %}
|
||||
<aside class="tags">
|
||||
{% trans "tags:" %} {% for tag in tags %}<a href="./?view=tag&id={{ tag.id }}">{{ tag.value }}</a> {% endfor %}<a href="./?view=edit-tags&id={{ entry.id|e }}" title="{% trans "Edit tags" %}">✎</a>
|
||||
</aside>
|
||||
{% endblock %}
|
||||
<article>
|
||||
{{ content | raw }}
|
||||
</article>
|
||||
{{ block('tags') }}
|
||||
</div>
|
||||
<script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/restoreScroll.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
@ -50,5 +53,5 @@
|
|||
$('#article_toolbar .tool.top').parent().hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue