Sfoglia il codice sorgente

Minor changes to the 2FA template headers

Fixes:
  - https://github.com/composer/packagist/pull/1031#discussion_r332588127
  - https://github.com/composer/packagist/pull/1031#discussion_r332588385
Colin O'Dell 5 anni fa
parent
commit
df0d4f5303

+ 6 - 6
src/Packagist/WebBundle/Resources/views/user/configure_two_factor_auth.html.twig

@@ -2,9 +2,9 @@
 
 {% import "PackagistWebBundle::macros.html.twig" as macros %}
 
-{% set isActualUser = app.user and app.user.username is same as(user.username) %}
-
 {% block content %}
+    {% set isActualUser = app.user and app.user.username is same as(user.username) %}
+
     {% if backup_code %}
         <div class="alert alert-info">
             <p>If you lose your phone or otherwise can't get codes via your authenticator app, you can this one-time backup code to sign in: <code>{{ backup_code }}</code></p>
@@ -14,14 +14,14 @@
 
     <h2 class="title">
         {{ user.username }}
-        <small>
-            {%- if not isActualUser %}
+        {%- if not isActualUser %}
+            <small>
                 member since: {{ user.createdAt|date('M d, Y') }}
                 {%- if is_granted('ROLE_ADMIN') %}
                     <a href="mailto:{{ user.email }}">{{ user.email }}</a>
                 {%- endif %}
-            {%- endif %}
-        </small>
+            </small>
+        {%- endif %}
     </h2>
 
     <section class="row">

+ 6 - 6
src/Packagist/WebBundle/Resources/views/user/disable_two_factor_auth.html.twig

@@ -2,19 +2,19 @@
 
 {% import "PackagistWebBundle::macros.html.twig" as macros %}
 
-{% set isActualUser = app.user and app.user.username is same as(user.username) %}
-
 {% block content %}
+    {% set isActualUser = app.user and app.user.username is same as(user.username) %}
+
     <h2 class="title">
         {{ user.username }}
-        <small>
-            {%- if not isActualUser %}
+        {%- if not isActualUser %}
+            <small>
                 member since: {{ user.createdAt|date('M d, Y') }}
                 {%- if is_granted('ROLE_ADMIN') %}
                     <a href="mailto:{{ user.email }}">{{ user.email }}</a>
                 {%- endif %}
-            {%- endif %}
-        </small>
+            </small>
+        {%- endif %}
     </h2>
 
     <section class="row">

+ 6 - 6
src/Packagist/WebBundle/Resources/views/user/enable_two_factor_auth.html.twig

@@ -2,19 +2,19 @@
 
 {% import "PackagistWebBundle::macros.html.twig" as macros %}
 
-{% set isActualUser = app.user and app.user.username is same as(user.username) %}
-
 {% block content %}
+    {% set isActualUser = app.user and app.user.username is same as(user.username) %}
+
     <h2 class="title">
         {{ user.username }}
-        <small>
-            {%- if not isActualUser %}
+        {%- if not isActualUser %}
+            <small>
                 member since: {{ user.createdAt|date('M d, Y') }}
                 {%- if is_granted('ROLE_ADMIN') %}
                     <a href="mailto:{{ user.email }}">{{ user.email }}</a>
                 {%- endif %}
-            {%- endif %}
-        </small>
+            </small>
+        {%- endif %}
     </h2>
 
     <section class="row">