You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2017/11/01 14:39:53 UTC

allura git commit: Adds subnav to some account pages, allow explicit selection of current nav item

Repository: allura
Updated Branches:
  refs/heads/kt/account_subnav [created] aba15aaec


Adds subnav to some account pages, allow explicit selection of current nav item


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/aba15aae
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/aba15aae
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/aba15aae

Branch: refs/heads/kt/account_subnav
Commit: aba15aaec5a058f8aa8787de4e017e944df48ebd
Parents: fac64c6
Author: Kenton Taylor <kt...@slashdotmedia.com>
Authored: Wed Nov 1 14:18:15 2017 +0000
Committer: Kenton Taylor <kt...@slashdotmedia.com>
Committed: Wed Nov 1 14:18:15 2017 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/auth.py                | 9 +++++++++
 Allura/allura/templates/user_account_base.html   | 2 +-
 Allura/allura/templates/user_availability.html   | 1 +
 Allura/allura/templates/user_contacts.html       | 1 +
 Allura/allura/templates/user_recovery_codes.html | 3 ++-
 Allura/allura/templates/user_skills.html         | 1 +
 Allura/allura/templates/user_totp.html           | 3 ++-
 7 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/aba15aae/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 81ef645..5aa0a7e 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -701,7 +701,10 @@ class PreferencesController(BaseController):
 
         qr = totp_service.get_qr_code(totp, c.user)
         h.auditlog_user('Visited multifactor new TOTP page')
+        provider = plugin.AuthenticationProvider.get(request)
+
         return dict(
+            menu = provider.account_navigation(),
             qr=qr,
             setup=True,
         )
@@ -717,9 +720,12 @@ class PreferencesController(BaseController):
         totp = totp_service.get_totp(c.user)
         qr = totp_service.get_qr_code(totp, c.user)
         h.auditlog_user('Viewed multifactor TOTP config page')
+        provider = plugin.AuthenticationProvider.get(request)
+
         return dict(
             qr=qr,
             setup=False,
+            menu = provider.account_navigation(),
         )
 
     @expose('jinja:allura:templates/user_totp.html')
@@ -803,8 +809,11 @@ class PreferencesController(BaseController):
         if not codes:
             codes = recovery.regenerate_codes(c.user)
         h.auditlog_user('Viewed multifactor recovery codes')
+        provider = plugin.AuthenticationProvider.get(request)
+
         return dict(
             codes=codes,
+            menu = provider.account_navigation(),
         )
 
     @expose()

http://git-wip-us.apache.org/repos/asf/allura/blob/aba15aae/Allura/allura/templates/user_account_base.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_account_base.html b/Allura/allura/templates/user_account_base.html
index 71442ee..87edaf1 100644
--- a/Allura/allura/templates/user_account_base.html
+++ b/Allura/allura/templates/user_account_base.html
@@ -26,7 +26,7 @@
       <li id="{{ item.tabid }}">
       <a href="{{ item.target }}">
           {{ item.title }}
-          <div class="marker{% if item.target.rstrip('/') == request.path.rstrip('/') %} current{% endif %}"></div>
+          <div class="marker{% if current_menu_item|default == item.target or item.target.rstrip('/') == request.path.rstrip('/') %} current{% endif %}"></div>
       </a>
       </li>
       {%- endfor %}

http://git-wip-us.apache.org/repos/asf/allura/blob/aba15aae/Allura/allura/templates/user_availability.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_availability.html b/Allura/allura/templates/user_availability.html
index aa6b90b..bb63c2c 100644
--- a/Allura/allura/templates/user_availability.html
+++ b/Allura/allura/templates/user_availability.html
@@ -17,6 +17,7 @@
        under the License.
 -#}
 {% set hide_left_bar = True %}
+{% set current_menu_item = '/auth/user_info' %}
 {% extends "allura:templates/user_account_base.html" %}
 
 {% block title %}{{c.user.username}} / Availability{% endblock %}

http://git-wip-us.apache.org/repos/asf/allura/blob/aba15aae/Allura/allura/templates/user_contacts.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_contacts.html b/Allura/allura/templates/user_contacts.html
index 399a5c6..20d6533 100644
--- a/Allura/allura/templates/user_contacts.html
+++ b/Allura/allura/templates/user_contacts.html
@@ -17,6 +17,7 @@
        under the License.
 -#}
 {% set hide_left_bar = True %}
+{% set current_menu_item = '/auth/user_info' %}
 {% extends "allura:templates/user_account_base.html" %}
 
 {% block title %}{{c.user.username}} / Contacts{% endblock %}

http://git-wip-us.apache.org/repos/asf/allura/blob/aba15aae/Allura/allura/templates/user_recovery_codes.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_recovery_codes.html b/Allura/allura/templates/user_recovery_codes.html
index 52b713a..5039dd0 100644
--- a/Allura/allura/templates/user_recovery_codes.html
+++ b/Allura/allura/templates/user_recovery_codes.html
@@ -17,6 +17,7 @@
        under the License.
 -#}
 {% set hide_left_bar = True %}
+{% set current_menu_item = '/auth/preferences' %}
 {% extends "allura:templates/user_account_base.html" %}
 
 {% block title %}{{c.user.username}} / Recovery Codes for Multifactor Authentication{% endblock %}
@@ -111,4 +112,4 @@ $(function() {
     }
 });
 </script>
-{% endblock %}
\ No newline at end of file
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/allura/blob/aba15aae/Allura/allura/templates/user_skills.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_skills.html b/Allura/allura/templates/user_skills.html
index 4ed52bb..499c0e5 100644
--- a/Allura/allura/templates/user_skills.html
+++ b/Allura/allura/templates/user_skills.html
@@ -17,6 +17,7 @@
        under the License.
 -#}
 {% set hide_left_bar = True %}
+{% set current_menu_item = '/auth/user_info' %}
 {% extends "allura:templates/user_account_base.html" %}
 
 {% block title %}{{c.user.username}} / Skills{% endblock %}

http://git-wip-us.apache.org/repos/asf/allura/blob/aba15aae/Allura/allura/templates/user_totp.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_totp.html b/Allura/allura/templates/user_totp.html
index c404857..6ec9bee 100644
--- a/Allura/allura/templates/user_totp.html
+++ b/Allura/allura/templates/user_totp.html
@@ -17,6 +17,7 @@
        under the License.
 -#}
 {% set hide_left_bar = True %}
+{% set current_menu_item = '/auth/preferences' %}
 {% extends "allura:templates/user_account_base.html" %}
 
 {% block title %}{{c.user.username}} / Multifactor Authentication Setup{% endblock %}
@@ -106,4 +107,4 @@ $(function() {
       });
 });
 </script>
-{% endblock %}
\ No newline at end of file
+{% endblock %}