diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2015-01-22 21:11:22 +0100 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2015-01-22 21:11:22 +0100 |
commit | bd9f08157cc10619e9bb9dace6df43090dde44a9 (patch) | |
tree | 840b9f6819758ad0493c116ef3def2936358c891 /src/WallabagBundle/Resources/views | |
parent | 9d50517ceaeadaba227ccdbaa43a5918abd16728 (diff) | |
download | wallabag-bd9f08157cc10619e9bb9dace6df43090dde44a9.tar.gz wallabag-bd9f08157cc10619e9bb9dace6df43090dde44a9.tar.zst wallabag-bd9f08157cc10619e9bb9dace6df43090dde44a9.zip |
article view, fav list, archive list
Diffstat (limited to 'src/WallabagBundle/Resources/views')
4 files changed, 147 insertions, 20 deletions
diff --git a/src/WallabagBundle/Resources/views/Entry/entries.html.twig b/src/WallabagBundle/Resources/views/Entry/entries.html.twig index f4d7a7ab..81177298 100644 --- a/src/WallabagBundle/Resources/views/Entry/entries.html.twig +++ b/src/WallabagBundle/Resources/views/Entry/entries.html.twig | |||
@@ -2,25 +2,32 @@ | |||
2 | 2 | ||
3 | {% block title "Unread" %} | 3 | {% block title "Unread" %} |
4 | 4 | ||
5 | {% block content_header '' %} | 5 | {% block menu %} |
6 | {% include "WallabagBundle::_menu.html.twig" %} | ||
7 | {% endblock %} | ||
6 | 8 | ||
7 | {% block content %} | 9 | {% block content %} |
8 | {% for entry in entries %} | ||
9 | <div id="entry-{{ entry.id|e }}" class="entrie"> | ||
10 | <h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2> | ||
11 | {% if entry.content| readingTime > 0 %} | ||
12 | <div class="estimatedTime"><span class="tool reading-time">{% trans %}estimated reading time :{% endtrans %} {{ entry.content| readingTime }} min</span></div> | ||
13 | {% else %} | ||
14 | <div class="estimatedTime"><span class="tool reading-time">{% trans %}estimated reading time :{% endtrans %} <small class="inferieur"><</small> 1 min</span></div> | ||
15 | {% endif %} | ||
16 | 10 | ||
17 | <ul class="tools links"> | 11 | {% if entries is empty %} |
18 | <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&id={{ entry.id|e }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li> | 12 | <div class="messages warning"><p>{% trans %}No articles found.{% endtrans %}</p></div> |
19 | <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li> | 13 | {% else %} |
20 | <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans %}delete{% endtrans %}</span></a></li> | 14 | {% for entry in entries %} |
21 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.url | e | domainName }}</span></a></li> | 15 | <div id="entry-{{ entry.id|e }}" class="entrie"> |
22 | </ul> | 16 | <h2><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></h2> |
23 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> | 17 | {% if entry.content| readingTime > 0 %} |
24 | </div> | 18 | <div class="estimatedTime"><span class="tool reading-time">{% trans %}estimated reading time :{% endtrans %} {{ entry.content| readingTime }} min</span></div> |
25 | {% endfor %} | 19 | {% else %} |
20 | <div class="estimatedTime"><span class="tool reading-time">{% trans %}estimated reading time :{% endtrans %} <small class="inferieur"><</small> 1 min</span></div> | ||
21 | {% endif %} | ||
22 | |||
23 | <ul class="tools links"> | ||
24 | <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&id={{ entry.id|e }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li> | ||
25 | <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li> | ||
26 | <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans %}delete{% endtrans %}</span></a></li> | ||
27 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.url | e | domainName }}</span></a></li> | ||
28 | </ul> | ||
29 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> | ||
30 | </div> | ||
31 | {% endfor %} | ||
32 | {% endif %} | ||
26 | {% endblock %} | 33 | {% endblock %} |
diff --git a/src/WallabagBundle/Resources/views/Entry/entry.html.twig b/src/WallabagBundle/Resources/views/Entry/entry.html.twig new file mode 100644 index 00000000..19d4650e --- /dev/null +++ b/src/WallabagBundle/Resources/views/Entry/entry.html.twig | |||
@@ -0,0 +1,104 @@ | |||
1 | {% extends "WallabagBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ entry.title|raw }} ({{ entry.url | e | domainName }}){% endblock %} | ||
4 | |||
5 | {% block menu %} | ||
6 | {% include "WallabagBundle::_menu.html.twig" %} | ||
7 | {% endblock %} | ||
8 | |||
9 | {% block content %} | ||
10 | <div id="article_toolbar"> | ||
11 | <ul class="links"> | ||
12 | <li class="topPosF"><a href="#top" title="{% trans %}Back to top{% endtrans %}" class="tool top icon icon-arrow-up-thick"><span>{% trans %}Back to top{% endtrans %}</span></a></li> | ||
13 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.url | e | domainName }}</span></a></li> | ||
14 | <li><a title="{% trans %}Mark as read{% endtrans %}" class="tool icon icon-check {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="javascript: void(null);" id="markAsRead"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li> | ||
15 | <li><a title="{% trans %}Favorite{% endtrans %}" class="tool icon icon-star {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="javascript: void(null);" id="setFav"><span>{% trans %}Toggle favorite{% endtrans %}</span></a></li> | ||
16 | <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans %}Delete{% endtrans %}</span></a></li> | ||
17 | {% if share_twitter %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}Tweet{% endtrans %}"><span>{% trans %}Tweet{% endtrans %}</span></a></li>{% endif %} | ||
18 | {% if share_mail %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %} | ||
19 | {% if share_shaarli %}<li><a href="{{ shaarli_url }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %} | ||
20 | {% if share_diaspora %}<li><a href="{{ diaspora_url }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}¬es=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans %}diaspora{% endtrans %}"><span>{% trans %}diaspora{% endtrans %}</span></a></li>{% endif %} | ||
21 | {# {% if flattr %}{% if flattr.status == flattrable %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}"><span>{% trans %}flattr{% endtrans %}</span></a></li>{% elseif flattr.status == flattred %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}><span>{% trans %}flattr{% endtrans %}</span> ({{ flattr.numFlattrs }})</a></li>{% endif %}{% endif %} #} | ||
22 | {% if carrot %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans %}carrot{% endtrans %}"><span>Carrot</span></a></li>{% endif %} | ||
23 | {% if show_printlink %}<li><a title="{% trans %}Print{% endtrans %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans %}Print{% endtrans %}</span></a></li>{% endif %} | ||
24 | {% if export_epub %}<li><a href="./?epub&method=id&value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %} | ||
25 | {% if export_mobi %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} | ||
26 | {% if export_pdf %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} | ||
27 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans %}Does this article appear wrong?{% endtrans %}" class="tool bad-display icon icon-delete"><span>{% trans %}Does this article appear wrong?{% endtrans %}</span></a></li> | ||
28 | </ul> | ||
29 | </div> | ||
30 | <div id="article"> | ||
31 | <header class="mbm"> | ||
32 | <h1>{{ entry.title|raw }}</h1> | ||
33 | </header> | ||
34 | <aside class="tags"> | ||
35 | 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{% endtrans %}">✎</a> #} | ||
36 | </aside> | ||
37 | <article> | ||
38 | {{ entry.content | raw }} | ||
39 | </article> | ||
40 | </div> | ||
41 | <script src="{{ asset('themes/_global/js/restoreScroll.js')}}"></script> | ||
42 | <script type="text/javascript"> | ||
43 | $(document).ready(function() { | ||
44 | |||
45 | // toggle read property of current article | ||
46 | $('#markAsRead').click(function(){ | ||
47 | $("body").css("cursor", "wait"); | ||
48 | $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done( | ||
49 | function( data ) { | ||
50 | if ( data == '1' ) { | ||
51 | if ( $('#markAsRead').hasClass("archive-off") ) { | ||
52 | $('#markAsRead').removeClass("archive-off"); | ||
53 | $('#markAsRead').addClass("archive"); | ||
54 | } | ||
55 | else { | ||
56 | $('#markAsRead').removeClass("archive"); | ||
57 | $('#markAsRead').addClass("archive-off"); | ||
58 | } | ||
59 | } | ||
60 | else { | ||
61 | alert('Error! Pls check if you are logged in.'); | ||
62 | } | ||
63 | }); | ||
64 | $("body").css("cursor", "auto"); | ||
65 | }); | ||
66 | |||
67 | // toggle favorite property of current article | ||
68 | $('#setFav').click(function(){ | ||
69 | $("body").css("cursor", "wait"); | ||
70 | $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done( | ||
71 | function( data ) { | ||
72 | if ( data == '1' ) { | ||
73 | if ( $('#setFav').hasClass("fav-off") ) { | ||
74 | $('#setFav').removeClass("fav-off"); | ||
75 | $('#setFav').addClass("fav"); | ||
76 | } | ||
77 | else { | ||
78 | $('#setFav').removeClass("fav"); | ||
79 | $('#setFav').addClass("fav-off"); | ||
80 | } | ||
81 | } | ||
82 | else { | ||
83 | alert('Error! Pls check if you are logged in.'); | ||
84 | } | ||
85 | }); | ||
86 | $("body").css("cursor", "auto"); | ||
87 | }); | ||
88 | |||
89 | $(window).scroll(function(e){ | ||
90 | var scrollTop = $(window).scrollTop(); | ||
91 | var docHeight = $(document).height(); | ||
92 | var scrollPercent = (scrollTop) / (docHeight); | ||
93 | var scrollPercentRounded = Math.round(scrollPercent*100)/100; | ||
94 | savePercent({{ entry.id|e }}, scrollPercentRounded); | ||
95 | }); | ||
96 | |||
97 | retrievePercent({{ entry.id|e }}); | ||
98 | |||
99 | $(window).resize(function(){ | ||
100 | retrievePercent({{ entry.id|e }}); | ||
101 | }); | ||
102 | }); | ||
103 | </script> | ||
104 | {% endblock %} \ No newline at end of file | ||
diff --git a/src/WallabagBundle/Resources/views/_menu.html.twig b/src/WallabagBundle/Resources/views/_menu.html.twig new file mode 100644 index 00000000..b001aec5 --- /dev/null +++ b/src/WallabagBundle/Resources/views/_menu.html.twig | |||
@@ -0,0 +1,17 @@ | |||
1 | <button id="menu" class="icon icon-menu desktopHide"><span>Menu</span></button> | ||
2 | <ul id="links" class="links"> | ||
3 | <li><a href="{{ path('unread') }}">{% trans %}unread{% endtrans %}</a></li> | ||
4 | <li><a href="{{ path('starred') }}">{% trans %}favorites{% endtrans %}</a></li> | ||
5 | <li><a href="{{ path('archive') }}"}>{% trans %}archive{% endtrans %}</a></li> | ||
6 | <li><a href="./?view=tags">{% trans %}tags{% endtrans %}</a></li> | ||
7 | <li style="position: relative;"><a href="javascript: void(null);" id="bagit">{% trans %}save a link{% endtrans %}</a> | ||
8 | |||
9 | </li> | ||
10 | <li style="position: relative;"><a href="javascript: void(null);" id="search">{% trans %}search{% endtrans %}</a> | ||
11 | |||
12 | </li> | ||
13 | <li><a href="./?view=config">{% trans %}config{% endtrans %}</a></li> | ||
14 | <li><a href="./?view=about">{% trans %}about{% endtrans %}</a></li> | ||
15 | <li><a class="icon icon-power" href="./?logout" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li> | ||
16 | </ul> | ||
17 | |||
diff --git a/src/WallabagBundle/Resources/views/_top.html.twig b/src/WallabagBundle/Resources/views/_top.html.twig index 576df806..34d925df 100755 --- a/src/WallabagBundle/Resources/views/_top.html.twig +++ b/src/WallabagBundle/Resources/views/_top.html.twig | |||
@@ -1,6 +1,5 @@ | |||
1 | <header class="w600p center mbm"> | 1 | <header class="w600p center mbm"> |
2 | <h1> | 2 | <h1> |
3 | {% block logo %}<img width="100" height="100" src="{{ asset('themes/baggy/img/logo-other_themes.png') }}" alt="wallabag logo" />{% endblock %} | 3 | {% block logo %}<img width="100" height="100" src="{{ asset('themes/baggy/img/logo-w.png') }}" alt="wallabag logo" />{% endblock %} |
4 | |||
5 | </h1> | 4 | </h1> |
6 | </header> | 5 | </header> |