]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
Change the way to enable 2FA
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / baggy / Config / index.html.twig
index cf4394081b867875bacdd35027903bd1d61a8bc8..93f8ddf8ace6fd319e8031e13389e92283a5c883 100644 (file)
             </div>
         </fieldset>
 
+        {{ form_widget(form.user.save) }}
+
         {% if twofactor_auth %}
+        <h5>{{ 'config.otp.page_title'|trans }}</h5>
+
         <div class="row">
             {{ 'config.form_user.two_factor_description'|trans }}
         </div>
 
-        <fieldset class="w500p inline">
-            <div class="row">
-                {{ form_label(form.user.emailTwoFactor) }}
-                {{ form_errors(form.user.emailTwoFactor) }}
-                {{ form_widget(form.user.emailTwoFactor) }}
-            </div>
-            <br/>
-            <div class="row">
-                {{ form_label(form.user.googleTwoFactor) }}
-                {{ form_widget(form.user.googleTwoFactor) }}
-                {{ form_errors(form.user.googleTwoFactor) }}
-            </div>
-            {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %}
-                <div class="row">
-                    {{ 'config.form_user.two_factor_code_description_1'|trans }}
-                    <br/>
-                    {{ 'config.form_user.two_factor_code_description_2'|trans }}
-                    <br/><br/>
-                    <img id="2faQrcode" class="hide-on-med-and-down" />
-                    <script>
-                        document.getElementById('2faQrcode').src = jrQrcode.getQrBase64('{{ OtpQrCode }}');
-                    </script>
-                    <br/><br/>
-                    {{ 'config.form_user.two_factor_code_description_3'|trans }}
-                    <br/><br/>
-                    <strong>{{ app.user.getGoogleAuthenticatorSecret }}</strong>
-                    <br/><br/>
-                    {{ 'config.form_user.two_factor_code_description_4'|trans }}
-                    <br/><br/>
-                    <strong>{{ app.user.getBackupCodes|join("\n")|nl2br }}</strong>
-                </div>
-            {% endfor %}
-        </fieldset>
+        <table>
+            <thead>
+                <tr>
+                    <th>{{ 'config.form_user.two_factor.table_method'|trans }}</th>
+                    <th>{{ 'config.form_user.two_factor.table_state'|trans }}</th>
+                    <th>{{ 'config.form_user.two_factor.table_action'|trans }}</th>
+                </tr>
+            </thead>
+
+            <tbody>
+                <tr>
+                    <td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td>
+                    <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>
+                    <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>
+                </tr>
+                <tr>
+                    <td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td>
+                    <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>
+                    <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>
+                </tr>
+            </tbody>
+        </table>
+
         {% endif %}
 
         {{ form_widget(form.user._token) }}
-        {{ form_widget(form.user.save) }}
     </form>
 
     {% if enabled_users > 1 %}