aboutsummaryrefslogtreecommitdiffhomepage
path: root/themes/default
diff options
context:
space:
mode:
authorMaryana Rozhankivska <mariroz@mr.lviv.ua>2014-02-20 19:28:39 +0200
committerMaryana Rozhankivska <mariroz@mr.lviv.ua>2014-02-20 19:28:39 +0200
commit032e0ca13ab8ebf99b5169f6f733db4184cdde6c (patch)
tree202f259fc3d9157e66195036584211e4c84515c1 /themes/default
parent6203ef8e51c8b2712e54a01a183f30d282926b0b (diff)
downloadwallabag-032e0ca13ab8ebf99b5169f6f733db4184cdde6c.tar.gz
wallabag-032e0ca13ab8ebf99b5169f6f733db4184cdde6c.tar.zst
wallabag-032e0ca13ab8ebf99b5169f6f733db4184cdde6c.zip
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
Diffstat (limited to 'themes/default')
-rw-r--r--themes/default/edit-tags.twig15
-rw-r--r--themes/default/home.twig8
-rw-r--r--themes/default/tag.twig33
-rw-r--r--themes/default/view.twig11
4 files changed, 25 insertions, 42 deletions
diff --git a/themes/default/edit-tags.twig b/themes/default/edit-tags.twig
index 53852d39..83f04aa0 100644
--- a/themes/default/edit-tags.twig
+++ b/themes/default/edit-tags.twig
@@ -4,6 +4,13 @@
4{% include '_menu.twig' %} 4{% include '_menu.twig' %}
5{% endblock %} 5{% endblock %}
6{% block content %} 6{% block content %}
7
8<div id="article">
9 <header class="mbm">
10 <h1>{{ entry.title|raw }}</h1>
11 </header>
12</div>
13
7{% if tags is empty %} 14{% if tags is empty %}
8no tags 15no tags
9{% endif %} 16{% endif %}
@@ -11,10 +18,12 @@ no tags
11{% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&amp;tag_id={{ tag.id }}&amp;id={{ entry_id }}">✘</a></li>{% endfor %} 18{% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&amp;tag_id={{ tag.id }}&amp;id={{ entry_id }}">✘</a></li>{% endfor %}
12</ul> 19</ul>
13<form method="post" action="./?action=add_tag"> 20<form method="post" action="./?action=add_tag">
14 <label for="value">Add tags: </label><input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" />
15 <p>{% trans "You can enter multiple tags, separated by commas." %}</p>
16 <input type="hidden" name="entry_id" value="{{ entry_id }}" /> 21 <input type="hidden" name="entry_id" value="{{ entry_id }}" />
22 <label for="value">Add tags: </label>
23 <input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" />
17 <input type="submit" value="Tag" /> 24 <input type="submit" value="Tag" />
25 <p>{% trans "You can enter multiple tags, separated by commas." %}</p>
26
18</form> 27</form>
19<a href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a> 28<a href="./?view=view&id={{ entry_id }}">&laquo; {% trans "return to article" %}</a>
20{% endblock %} 29{% endblock %}
diff --git a/themes/default/home.twig b/themes/default/home.twig
index 21013ec8..165fecc6 100644
--- a/themes/default/home.twig
+++ b/themes/default/home.twig
@@ -14,12 +14,16 @@
14{% block precontent %} 14{% block precontent %}
15 {% if entries|length > 1 %} 15 {% if entries|length > 1 %}
16 <ul id="sort"> 16 <ul id="sort">
17 <li><a href="./?sort=ia&amp;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&amp;view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li> 17 <li><a href="./?sort=ia&amp;view={{ view }}&amp;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&amp;view={{ view }}&amp;id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li>
18 <li><a href="./?sort=ta&amp;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&amp;view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li> 18 <li><a href="./?sort=ta&amp;view={{ view }}&amp;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&amp;view={{ view }}&amp;id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li>
19 </ul> 19 </ul>
20 {% endif %} 20 {% endif %}
21{% endblock %} 21{% endblock %}
22{% block content %} 22{% block content %}
23 {% if tag %}
24 <h3>{% trans "Tag" %}: <b>{{ tag.value }}</b></h3>
25 {% endif %}
26
23 {% if entries is empty %} 27 {% if entries is empty %}
24 <div class="messages warning"><p>{% trans "No articles found." %}</p></div> 28 <div class="messages warning"><p>{% trans "No articles found." %}</p></div>
25 {% else %} 29 {% else %}
diff --git a/themes/default/tag.twig b/themes/default/tag.twig
deleted file mode 100644
index 364c7cd4..00000000
--- a/themes/default/tag.twig
+++ /dev/null
@@ -1,33 +0,0 @@
1{% extends "layout.twig" %}
2{% block title %}tag {% endblock %}
3{% block menu %}
4{% include '_menu.twig' %}
5{% endblock %}
6{% block content %}
7 <h3>{% trans "Tag" %} {{ tag.value }}</h3>
8 {% if entries is empty %}
9 <div class="messages warning"><p>{% trans "No link available here!" %}</p></div>
10 {% else %}
11 {% block pager %}
12 {% if nb_results > 1 %}
13 <div class="results">
14 <div class="nb-results">{{ nb_results }} {% trans "results" %}</div>
15 {{ page_links | raw }}
16 </div>
17 {% endif %}
18 {% endblock %}
19 {% for entry in entries %}
20 <div id="entry-{{ entry.id|e }}" class="entrie">
21 <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
22 <ul class="tools">
23 <li><a title="{% trans "toggle mark as read" %}" class="tool {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&amp;id={{ entry.id|e }}"><span>{% trans "toggle mark as read" %}</span></a></li>
24 <li><a title="{% trans "toggle favorite" %}" class="tool {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&amp;id={{ entry.id|e }}"><span>{% trans "toggle favorite" %}</span></a></li>
25 <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
26 <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>
27 <li><a target="_blank" title="{% trans "estimated reading time:" %} {{ entry.content| getReadingTime }} min" class="reading-time"><span>{{ entry.content| getReadingTime }} min</span></a></li>
28 </ul>
29 <p>{{ entry.content|striptags|slice(0, 300) }}...</p>
30 </div>
31 {% endfor %}
32 {% endif %}
33{% endblock %} \ No newline at end of file
diff --git a/themes/default/view.twig b/themes/default/view.twig
index 9858996f..916abe0d 100644
--- a/themes/default/view.twig
+++ b/themes/default/view.twig
@@ -20,12 +20,15 @@
20 <header class="mbm"> 20 <header class="mbm">
21 <h1>{{ entry.title|raw }}</h1> 21 <h1>{{ entry.title|raw }}</h1>
22 </header> 22 </header>
23 <aside class="tags"> 23 {% block tags %}
24 {% trans "tags:" %} {% for tag in tags %}<a href="./?view=tag&amp;id={{ tag.id }}">{{ tag.value }}</a> {% endfor %}<a href="./?view=edit-tags&amp;id={{ entry.id|e }}" title="{% trans "Edit tags" %}">✎</a> 24 <aside class="tags">
25 </aside> 25 {% trans "tags:" %} {% for tag in tags %}<a href="./?view=tag&amp;id={{ tag.id }}">{{ tag.value }}</a> {% endfor %}<a href="./?view=edit-tags&amp;id={{ entry.id|e }}" title="{% trans "Edit tags" %}">✎</a>
26 </aside>
27 {% endblock %}
26 <article> 28 <article>
27 {{ content | raw }} 29 {{ content | raw }}
28 </article> 30 </article>
31 {{ block('tags') }}
29 </div> 32 </div>
30 <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/restoreScroll.js"></script> 33 <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/restoreScroll.js"></script>
31 <script type="text/javascript"> 34 <script type="text/javascript">
@@ -50,5 +53,5 @@
50 $('#article_toolbar .tool.top').parent().hide(); 53 $('#article_toolbar .tool.top').parent().hide();
51 } 54 }
52 }); 55 });
53 </script> 56 </script>
54{% endblock %} 57{% endblock %}