diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views')
4 files changed, 175 insertions, 69 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig index cf439408..93f8ddf8 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig | |||
@@ -168,48 +168,41 @@ | |||
168 | </div> | 168 | </div> |
169 | </fieldset> | 169 | </fieldset> |
170 | 170 | ||
171 | {{ form_widget(form.user.save) }} | ||
172 | |||
171 | {% if twofactor_auth %} | 173 | {% if twofactor_auth %} |
174 | <h5>{{ 'config.otp.page_title'|trans }}</h5> | ||
175 | |||
172 | <div class="row"> | 176 | <div class="row"> |
173 | {{ 'config.form_user.two_factor_description'|trans }} | 177 | {{ 'config.form_user.two_factor_description'|trans }} |
174 | </div> | 178 | </div> |
175 | 179 | ||
176 | <fieldset class="w500p inline"> | 180 | <table> |
177 | <div class="row"> | 181 | <thead> |
178 | {{ form_label(form.user.emailTwoFactor) }} | 182 | <tr> |
179 | {{ form_errors(form.user.emailTwoFactor) }} | 183 | <th>{{ 'config.form_user.two_factor.table_method'|trans }}</th> |
180 | {{ form_widget(form.user.emailTwoFactor) }} | 184 | <th>{{ 'config.form_user.two_factor.table_state'|trans }}</th> |
181 | </div> | 185 | <th>{{ 'config.form_user.two_factor.table_action'|trans }}</th> |
182 | <br/> | 186 | </tr> |
183 | <div class="row"> | 187 | </thead> |
184 | {{ form_label(form.user.googleTwoFactor) }} | 188 | |
185 | {{ form_widget(form.user.googleTwoFactor) }} | 189 | <tbody> |
186 | {{ form_errors(form.user.googleTwoFactor) }} | 190 | <tr> |
187 | </div> | 191 | <td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td> |
188 | {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %} | 192 | <td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td> |
189 | <div class="row"> | 193 | <td><a href="{{ path('config_otp_email') }}" class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_email'|trans }}</a></td> |
190 | {{ 'config.form_user.two_factor_code_description_1'|trans }} | 194 | </tr> |
191 | <br/> | 195 | <tr> |
192 | {{ 'config.form_user.two_factor_code_description_2'|trans }} | 196 | <td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td> |
193 | <br/><br/> | 197 | <td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td> |
194 | <img id="2faQrcode" class="hide-on-med-and-down" /> | 198 | <td><a href="{{ path('config_otp_app') }}" class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_app'|trans }}</a></td> |
195 | <script> | 199 | </tr> |
196 | document.getElementById('2faQrcode').src = jrQrcode.getQrBase64('{{ OtpQrCode }}'); | 200 | </tbody> |
197 | </script> | 201 | </table> |
198 | <br/><br/> | 202 | |
199 | {{ 'config.form_user.two_factor_code_description_3'|trans }} | ||
200 | <br/><br/> | ||
201 | <strong>{{ app.user.getGoogleAuthenticatorSecret }}</strong> | ||
202 | <br/><br/> | ||
203 | {{ 'config.form_user.two_factor_code_description_4'|trans }} | ||
204 | <br/><br/> | ||
205 | <strong>{{ app.user.getBackupCodes|join("\n")|nl2br }}</strong> | ||
206 | </div> | ||
207 | {% endfor %} | ||
208 | </fieldset> | ||
209 | {% endif %} | 203 | {% endif %} |
210 | 204 | ||
211 | {{ form_widget(form.user._token) }} | 205 | {{ form_widget(form.user._token) }} |
212 | {{ form_widget(form.user.save) }} | ||
213 | </form> | 206 | </form> |
214 | 207 | ||
215 | {% if enabled_users > 1 %} | 208 | {% if enabled_users > 1 %} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig new file mode 100644 index 00000000..2e4442e3 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig | |||
@@ -0,0 +1,55 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ 'config.page_title'|trans }} > {{ 'config.otp.page_title'|trans }}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | <h5>{{ 'config.otp.page_title'|trans }}</h5> | ||
7 | |||
8 | <ol> | ||
9 | <li> | ||
10 | <p>{{ 'config.otp.app.two_factor_code_description_1'|trans }}</p> | ||
11 | <p>{{ 'config.otp.app.two_factor_code_description_2'|trans }}</p> | ||
12 | |||
13 | <p> | ||
14 | <img id="2faQrcode" class="hide-on-med-and-down" /> | ||
15 | <script> | ||
16 | document.getElementById('2faQrcode').src = jrQrcode.getQrBase64('{{ qr_code }}'); | ||
17 | </script> | ||
18 | </p> | ||
19 | </li> | ||
20 | <li> | ||
21 | <p>{{ 'config.otp.app.two_factor_code_description_3'|trans }}</p> | ||
22 | |||
23 | <p><strong>{{ app.user.getBackupCodes|join("\n")|nl2br }}</strong></p> | ||
24 | </li> | ||
25 | <li> | ||
26 | <p>{{ 'config.otp.app.two_factor_code_description_4'|trans }}</p> | ||
27 | |||
28 | {% for flashMessage in app.session.flashbag.get("two_factor") %} | ||
29 | <div class="card-panel red darken-1 black-text"> | ||
30 | {{ flashMessage|trans }} | ||
31 | </div> | ||
32 | {% endfor %} | ||
33 | |||
34 | <form class="form" action="{{ path("config_otp_app_check") }}" method="post"> | ||
35 | <div class="card-content"> | ||
36 | <div class="row"> | ||
37 | <div class="input-field col s12"> | ||
38 | <label for="_auth_code">{{ "scheb_two_factor.auth_code"|trans }}</label> | ||
39 | <input id="_auth_code" type="text" autocomplete="off" name="_auth_code" /> | ||
40 | </div> | ||
41 | </div> | ||
42 | </div> | ||
43 | <div class="card-action"> | ||
44 | <a href="{{ path('config_otp_app_cancel') }}" class="waves-effect waves-light grey btn"> | ||
45 | {{ 'config.otp.app.cancel'|trans }} | ||
46 | </a> | ||
47 | <button class="btn waves-effect waves-light" type="submit" name="send"> | ||
48 | {{ 'config.otp.app.enable'|trans }} | ||
49 | <i class="material-icons right">send</i> | ||
50 | </button> | ||
51 | </div> | ||
52 | </form> | ||
53 | </li> | ||
54 | </ol> | ||
55 | {% endblock %} | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig index 5b00eb7b..412c18f4 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig | |||
@@ -196,45 +196,40 @@ | |||
196 | </div> | 196 | </div> |
197 | </div> | 197 | </div> |
198 | 198 | ||
199 | {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} | ||
200 | |||
199 | {% if twofactor_auth %} | 201 | {% if twofactor_auth %} |
202 | <br/> | ||
203 | <br/> | ||
200 | <div class="row"> | 204 | <div class="row"> |
201 | {{ 'config.form_user.two_factor_description'|trans }} | 205 | <h5>{{ 'config.otp.page_title'|trans }}</h5> |
202 | 206 | ||
203 | <div class="input-field col s11"> | 207 | <p>{{ 'config.form_user.two_factor_description'|trans }}</p> |
204 | {{ form_widget(form.user.emailTwoFactor) }} | 208 | |
205 | {{ form_label(form.user.emailTwoFactor) }} | 209 | <table> |
206 | {{ form_errors(form.user.emailTwoFactor) }} | 210 | <thead> |
207 | </div> | 211 | <tr> |
208 | <div class="input-field col s11"> | 212 | <th>{{ 'config.form_user.two_factor.table_method'|trans }}</th> |
209 | {{ form_widget(form.user.googleTwoFactor) }} | 213 | <th>{{ 'config.form_user.two_factor.table_state'|trans }}</th> |
210 | {{ form_label(form.user.googleTwoFactor) }} | 214 | <th>{{ 'config.form_user.two_factor.table_action'|trans }}</th> |
211 | {{ form_errors(form.user.googleTwoFactor) }} | 215 | </tr> |
212 | </div> | 216 | </thead> |
217 | |||
218 | <tbody> | ||
219 | <tr> | ||
220 | <td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td> | ||
221 | <td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td> | ||
222 | <td><a href="{{ path('config_otp_email') }}" class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_email'|trans }}</a></td> | ||
223 | </tr> | ||
224 | <tr> | ||
225 | <td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td> | ||
226 | <td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td> | ||
227 | <td><a href="{{ path('config_otp_app') }}" class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_app'|trans }}</a></td> | ||
228 | </tr> | ||
229 | </tbody> | ||
230 | </table> | ||
213 | </div> | 231 | </div> |
214 | |||
215 | {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %} | ||
216 | <div class="card-panel yellow darken-1 black-text"> | ||
217 | {{ 'config.form_user.two_factor_code_description_1'|trans }} | ||
218 | <br/> | ||
219 | {{ 'config.form_user.two_factor_code_description_2'|trans }} | ||
220 | <br/><br/> | ||
221 | <img id="2faQrcode" class="hide-on-med-and-down" /> | ||
222 | <script> | ||
223 | document.getElementById('2faQrcode').src = jrQrcode.getQrBase64('{{ OtpQrCode }}'); | ||
224 | </script> | ||
225 | <br/><br/> | ||
226 | {{ 'config.form_user.two_factor_code_description_3'|trans }} | ||
227 | <br/><br/> | ||
228 | <strong>{{ app.user.getGoogleAuthenticatorSecret }}</strong> | ||
229 | <br/><br/> | ||
230 | {{ 'config.form_user.two_factor_code_description_4'|trans }} | ||
231 | <br/><br/> | ||
232 | <strong>{{ app.user.getBackupCodes|join("\n")|nl2br }}</strong> | ||
233 | </div> | ||
234 | {% endfor %} | ||
235 | {% endif %} | 232 | {% endif %} |
236 | |||
237 | {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} | ||
238 | {{ form_widget(form.user._token) }} | 233 | {{ form_widget(form.user._token) }} |
239 | </form> | 234 | </form> |
240 | </div> | 235 | </div> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig new file mode 100644 index 00000000..6aef355e --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig | |||
@@ -0,0 +1,63 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ 'config.page_title'|trans }} > {{ 'config.otp.page_title'|trans }}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | <div class="row"> | ||
7 | <div class="col s12"> | ||
8 | <div class="card-panel settings"> | ||
9 | <div class="row"> | ||
10 | <h5>{{ 'config.otp.page_title'|trans }}</h5> | ||
11 | |||
12 | <ol> | ||
13 | <li> | ||
14 | <p>{{ 'config.otp.app.two_factor_code_description_1'|trans }}</p> | ||
15 | <p>{{ 'config.otp.app.two_factor_code_description_2'|trans }}</p> | ||
16 | |||
17 | <p> | ||
18 | <img id="2faQrcode" class="hide-on-med-and-down" /> | ||
19 | <script> | ||
20 | document.getElementById('2faQrcode').src = jrQrcode.getQrBase64('{{ qr_code }}'); | ||
21 | </script> | ||
22 | </p> | ||
23 | </li> | ||
24 | <li> | ||
25 | <p>{{ 'config.otp.app.two_factor_code_description_3'|trans }}</p> | ||
26 | |||
27 | <p><strong>{{ app.user.getBackupCodes|join("\n")|nl2br }}</strong></p> | ||
28 | </li> | ||
29 | <li> | ||
30 | <p>{{ 'config.otp.app.two_factor_code_description_4'|trans }}</p> | ||
31 | |||
32 | {% for flashMessage in app.session.flashbag.get("two_factor") %} | ||
33 | <div class="card-panel red darken-1 black-text"> | ||
34 | {{ flashMessage|trans }} | ||
35 | </div> | ||
36 | {% endfor %} | ||
37 | |||
38 | <form class="form" action="{{ path("config_otp_app_check") }}" method="post"> | ||
39 | <div class="card-content"> | ||
40 | <div class="row"> | ||
41 | <div class="input-field col s12"> | ||
42 | <label for="_auth_code">{{ "scheb_two_factor.auth_code"|trans }}</label> | ||
43 | <input id="_auth_code" type="text" autocomplete="off" name="_auth_code" /> | ||
44 | </div> | ||
45 | </div> | ||
46 | </div> | ||
47 | <div class="card-action"> | ||
48 | <a href="{{ path('config_otp_app_cancel') }}" class="waves-effect waves-light grey btn"> | ||
49 | {{ 'config.otp.app.cancel'|trans }} | ||
50 | </a> | ||
51 | <button class="btn waves-effect waves-light" type="submit" name="send"> | ||
52 | {{ 'config.otp.app.enable'|trans }} | ||
53 | <i class="material-icons right">send</i> | ||
54 | </button> | ||
55 | </div> | ||
56 | </form> | ||
57 | </li> | ||
58 | </ol> | ||
59 | </div> | ||
60 | </div> | ||
61 | </div> | ||
62 | </div> | ||
63 | {% endblock %} | ||