diff options
author | Jeremy <jeremy.benoist@gmail.com> | 2015-03-28 14:27:45 +0100 |
---|---|---|
committer | Jeremy <jeremy.benoist@gmail.com> | 2015-03-31 22:47:43 +0200 |
commit | 0c83fd5994861efa728097dd151c994796c39ae1 (patch) | |
tree | 925520c0bb62d2b9ba7270020fc2ebcebb520f8c /src/Wallabag/CoreBundle/Resources | |
parent | f98a2a0fc3ae8a5955bb811f083c3d2535f96791 (diff) | |
download | wallabag-0c83fd5994861efa728097dd151c994796c39ae1.tar.gz wallabag-0c83fd5994861efa728097dd151c994796c39ae1.tar.zst wallabag-0c83fd5994861efa728097dd151c994796c39ae1.zip |
Add rss for entries
will fix #1000
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources')
3 files changed, 129 insertions, 48 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 062e1651..0f4db94e 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml | |||
@@ -36,3 +36,10 @@ services: | |||
36 | - @doctrine | 36 | - @doctrine |
37 | tags: | 37 | tags: |
38 | - { name: form.type, alias: forgot_password } | 38 | - { name: form.type, alias: forgot_password } |
39 | |||
40 | wallabag_core.param_converter.username_rsstoken_converter: | ||
41 | class: Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter | ||
42 | tags: | ||
43 | - { name: request.param_converter, converter: username_rsstoken_converter } | ||
44 | arguments: | ||
45 | - @doctrine | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Config/index.html.twig index 1835d26e..b134b6ca 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Config/index.html.twig | |||
@@ -5,129 +5,169 @@ | |||
5 | {% block content %} | 5 | {% block content %} |
6 | <h2>{% trans %}Wallabag configuration{% endtrans %}</h2> | 6 | <h2>{% trans %}Wallabag configuration{% endtrans %}</h2> |
7 | 7 | ||
8 | <form action="{{ path('config') }}" method="post" {{ form_enctype(configForm) }}> | 8 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.config) }}> |
9 | {{ form_errors(configForm) }} | 9 | {{ form_errors(form.config) }} |
10 | 10 | ||
11 | <fieldset class="w500p inline"> | 11 | <fieldset class="w500p inline"> |
12 | <div class="row"> | 12 | <div class="row"> |
13 | {{ form_label(configForm.theme) }} | 13 | {{ form_label(form.config.theme) }} |
14 | {{ form_errors(configForm.theme) }} | 14 | {{ form_errors(form.config.theme) }} |
15 | {{ form_widget(configForm.theme) }} | 15 | {{ form_widget(form.config.theme) }} |
16 | </div> | 16 | </div> |
17 | </fieldset> | 17 | </fieldset> |
18 | 18 | ||
19 | <fieldset class="w500p inline"> | 19 | <fieldset class="w500p inline"> |
20 | <div class="row"> | 20 | <div class="row"> |
21 | {{ form_label(configForm.items_per_page) }} | 21 | {{ form_label(form.config.items_per_page) }} |
22 | {{ form_errors(configForm.items_per_page) }} | 22 | {{ form_errors(form.config.items_per_page) }} |
23 | {{ form_widget(configForm.items_per_page) }} | 23 | {{ form_widget(form.config.items_per_page) }} |
24 | </div> | 24 | </div> |
25 | </fieldset> | 25 | </fieldset> |
26 | 26 | ||
27 | <fieldset class="w500p inline"> | 27 | <fieldset class="w500p inline"> |
28 | <div class="row"> | 28 | <div class="row"> |
29 | {{ form_label(configForm.language) }} | 29 | {{ form_label(form.config.language) }} |
30 | {{ form_errors(configForm.language) }} | 30 | {{ form_errors(form.config.language) }} |
31 | {{ form_widget(configForm.language) }} | 31 | {{ form_widget(form.config.language) }} |
32 | </div> | 32 | </div> |
33 | </fieldset> | 33 | </fieldset> |
34 | 34 | ||
35 | {{ form_rest(configForm) }} | 35 | {{ form_rest(form.config) }} |
36 | </form> | ||
37 | |||
38 | <h2>{% trans %}RSS configuration{% endtrans %}</h2> | ||
39 | |||
40 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.rss) }}> | ||
41 | {{ form_errors(form.rss) }} | ||
42 | |||
43 | <fieldset class="w500p inline"> | ||
44 | <div class="row"> | ||
45 | <label>Rss token</label> | ||
46 | {% if rss.token %} | ||
47 | {{ rss.token }} | ||
48 | {% else %} | ||
49 | <em>No token</em> | ||
50 | {% endif %} | ||
51 | – | ||
52 | <a href="{{ path('generate_token') }}">Regenerate ?</a> | ||
53 | </div> | ||
54 | </fieldset> | ||
55 | |||
56 | <fieldset class="w500p inline"> | ||
57 | <div class="row"> | ||
58 | <label>Rss links:</label> | ||
59 | <ul> | ||
60 | <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">unread</a></li> | ||
61 | <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">fav</a></li> | ||
62 | <li><a href="{{ path('archive_rss', {'username': rss.username, 'token': rss.token}) }}">archives</a></li> | ||
63 | </ul> | ||
64 | </div> | ||
65 | </fieldset> | ||
66 | |||
67 | <fieldset class="w500p inline"> | ||
68 | <div class="row"> | ||
69 | {{ form_label(form.rss.rss_limit) }} | ||
70 | {{ form_errors(form.rss.rss_limit) }} | ||
71 | {{ form_widget(form.rss.rss_limit) }} | ||
72 | </div> | ||
73 | </fieldset> | ||
74 | |||
75 | {{ form_rest(form.rss) }} | ||
36 | </form> | 76 | </form> |
37 | 77 | ||
38 | <h2>{% trans %}User information{% endtrans %}</h2> | 78 | <h2>{% trans %}User information{% endtrans %}</h2> |
39 | 79 | ||
40 | <form action="{{ path('config') }}" method="post" {{ form_enctype(userForm) }}> | 80 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.user) }}> |
41 | {{ form_errors(userForm) }} | 81 | {{ form_errors(form.user) }} |
42 | 82 | ||
43 | <fieldset class="w500p inline"> | 83 | <fieldset class="w500p inline"> |
44 | <div class="row"> | 84 | <div class="row"> |
45 | {{ form_label(userForm.username) }} | 85 | {{ form_label(form.user.username) }} |
46 | {{ form_errors(userForm.username) }} | 86 | {{ form_errors(form.user.username) }} |
47 | {{ form_widget(userForm.username) }} | 87 | {{ form_widget(form.user.username) }} |
48 | </div> | 88 | </div> |
49 | </fieldset> | 89 | </fieldset> |
50 | 90 | ||
51 | <fieldset class="w500p inline"> | 91 | <fieldset class="w500p inline"> |
52 | <div class="row"> | 92 | <div class="row"> |
53 | {{ form_label(userForm.name) }} | 93 | {{ form_label(form.user.name) }} |
54 | {{ form_errors(userForm.name) }} | 94 | {{ form_errors(form.user.name) }} |
55 | {{ form_widget(userForm.name) }} | 95 | {{ form_widget(form.user.name) }} |
56 | </div> | 96 | </div> |
57 | </fieldset> | 97 | </fieldset> |
58 | 98 | ||
59 | <fieldset class="w500p inline"> | 99 | <fieldset class="w500p inline"> |
60 | <div class="row"> | 100 | <div class="row"> |
61 | {{ form_label(userForm.email) }} | 101 | {{ form_label(form.user.email) }} |
62 | {{ form_errors(userForm.email) }} | 102 | {{ form_errors(form.user.email) }} |
63 | {{ form_widget(userForm.email) }} | 103 | {{ form_widget(form.user.email) }} |
64 | </div> | 104 | </div> |
65 | </fieldset> | 105 | </fieldset> |
66 | 106 | ||
67 | {{ form_rest(userForm) }} | 107 | {{ form_rest(form.user) }} |
68 | </form> | 108 | </form> |
69 | 109 | ||
70 | <h2>{% trans %}Change your password{% endtrans %}</h2> | 110 | <h2>{% trans %}Change your password{% endtrans %}</h2> |
71 | 111 | ||
72 | <form action="{{ path('config') }}" method="post" {{ form_enctype(pwdForm) }}> | 112 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.pwd) }}> |
73 | {{ form_errors(pwdForm) }} | 113 | {{ form_errors(form.pwd) }} |
74 | 114 | ||
75 | <fieldset class="w500p inline"> | 115 | <fieldset class="w500p inline"> |
76 | <div class="row"> | 116 | <div class="row"> |
77 | {{ form_label(pwdForm.old_password) }} | 117 | {{ form_label(form.pwd.old_password) }} |
78 | {{ form_errors(pwdForm.old_password) }} | 118 | {{ form_errors(form.pwd.old_password) }} |
79 | {{ form_widget(pwdForm.old_password) }} | 119 | {{ form_widget(form.pwd.old_password) }} |
80 | </div> | 120 | </div> |
81 | </fieldset> | 121 | </fieldset> |
82 | 122 | ||
83 | <fieldset class="w500p inline"> | 123 | <fieldset class="w500p inline"> |
84 | <div class="row"> | 124 | <div class="row"> |
85 | {{ form_label(pwdForm.new_password.first) }} | 125 | {{ form_label(form.pwd.new_password.first) }} |
86 | {{ form_errors(pwdForm.new_password.first) }} | 126 | {{ form_errors(form.pwd.new_password.first) }} |
87 | {{ form_widget(pwdForm.new_password.first) }} | 127 | {{ form_widget(form.pwd.new_password.first) }} |
88 | </div> | 128 | </div> |
89 | </fieldset> | 129 | </fieldset> |
90 | 130 | ||
91 | <fieldset class="w500p inline"> | 131 | <fieldset class="w500p inline"> |
92 | <div class="row"> | 132 | <div class="row"> |
93 | {{ form_label(pwdForm.new_password.second) }} | 133 | {{ form_label(form.pwd.new_password.second) }} |
94 | {{ form_errors(pwdForm.new_password.second) }} | 134 | {{ form_errors(form.pwd.new_password.second) }} |
95 | {{ form_widget(pwdForm.new_password.second) }} | 135 | {{ form_widget(form.pwd.new_password.second) }} |
96 | </div> | 136 | </div> |
97 | </fieldset> | 137 | </fieldset> |
98 | 138 | ||
99 | {{ form_rest(pwdForm) }} | 139 | {{ form_rest(form.pwd) }} |
100 | </form> | 140 | </form> |
101 | 141 | ||
102 | <h2>{% trans %}Add a user{% endtrans %}</h2> | 142 | <h2>{% trans %}Add a user{% endtrans %}</h2> |
103 | 143 | ||
104 | <form action="{{ path('config') }}" method="post" {{ form_enctype(newUserForm) }}> | 144 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.new_user) }}> |
105 | {{ form_errors(newUserForm) }} | 145 | {{ form_errors(form.new_user) }} |
106 | 146 | ||
107 | <fieldset class="w500p inline"> | 147 | <fieldset class="w500p inline"> |
108 | <div class="row"> | 148 | <div class="row"> |
109 | {{ form_label(newUserForm.username) }} | 149 | {{ form_label(form.new_user.username) }} |
110 | {{ form_errors(newUserForm.username) }} | 150 | {{ form_errors(form.new_user.username) }} |
111 | {{ form_widget(newUserForm.username) }} | 151 | {{ form_widget(form.new_user.username) }} |
112 | </div> | 152 | </div> |
113 | </fieldset> | 153 | </fieldset> |
114 | 154 | ||
115 | <fieldset class="w500p inline"> | 155 | <fieldset class="w500p inline"> |
116 | <div class="row"> | 156 | <div class="row"> |
117 | {{ form_label(newUserForm.password) }} | 157 | {{ form_label(form.new_user.password) }} |
118 | {{ form_errors(newUserForm.password) }} | 158 | {{ form_errors(form.new_user.password) }} |
119 | {{ form_widget(newUserForm.password) }} | 159 | {{ form_widget(form.new_user.password) }} |
120 | </div> | 160 | </div> |
121 | </fieldset> | 161 | </fieldset> |
122 | 162 | ||
123 | <fieldset class="w500p inline"> | 163 | <fieldset class="w500p inline"> |
124 | <div class="row"> | 164 | <div class="row"> |
125 | {{ form_label(newUserForm.email) }} | 165 | {{ form_label(form.new_user.email) }} |
126 | {{ form_errors(newUserForm.email) }} | 166 | {{ form_errors(form.new_user.email) }} |
127 | {{ form_widget(newUserForm.email) }} | 167 | {{ form_widget(form.new_user.email) }} |
128 | </div> | 168 | </div> |
129 | </fieldset> | 169 | </fieldset> |
130 | 170 | ||
131 | {{ form_rest(newUserForm) }} | 171 | {{ form_rest(form.new_user) }} |
132 | </form> | 172 | </form> |
133 | {% endblock %} | 173 | {% endblock %} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.xml.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.xml.twig new file mode 100644 index 00000000..6eebc80d --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.xml.twig | |||
@@ -0,0 +1,34 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/"> | ||
3 | <channel> | ||
4 | <title>wallabag — {{type}} feed</title> | ||
5 | <link>{{ url('unread') }}</link> | ||
6 | <pubDate>{{ "now"|date('D, d M Y H:i:s') }}</pubDate> | ||
7 | <generator>wallabag</generator> | ||
8 | <description>wallabag {{type}} elements</description> | ||
9 | |||
10 | {% for entry in entries %} | ||
11 | |||
12 | <item> | ||
13 | <title><![CDATA[{{ entry.title }}]]></title> | ||
14 | <source url="{{ url('view', { 'id': entry.id }) }}">wallabag</source> | ||
15 | <link>{{ url('view', { 'id': entry.id }) }}</link> | ||
16 | <guid>{{ url('view', { 'id': entry.id }) }}</guid> | ||
17 | <pubDate>{{ entry.createdAt|date('D, d M Y H:i:s') }}</pubDate> | ||
18 | <description> | ||
19 | <![CDATA[ | ||
20 | {%- if entry.content| readingTime > 0 %} | ||
21 | {% trans %}estimated reading time :{% endtrans %} {{ entry.content| readingTime }} min | ||
22 | {% else -%} | ||
23 | {% trans %}estimated reading time :{% endtrans %} < 1 min | ||
24 | {% endif -%} | ||
25 | |||
26 | {{ entry.content -}} | ||
27 | ]]> | ||
28 | </description> | ||
29 | </item> | ||
30 | |||
31 | {% endfor %} | ||
32 | |||
33 | </channel> | ||
34 | </rss> | ||