allura
リビジョン | e430ceeb5a9c12443df6014e98fb0cb81e642c2e (tree) |
---|---|
日時 | 2012-06-07 22:23:25 |
作者 | Cory Johns <johnsca@geek...> |
コミッター | Yaroslav Luzin |
[#3944] Added account preferences menu to subscriptions page
Signed-off-by: Cory Johns <johnsca@geek.net>
@@ -318,10 +318,13 @@ class PreferencesController(BaseController): | ||
318 | 318 | frequency=mb.frequency.unit, |
319 | 319 | artifact=mb.artifact_index_id)) |
320 | 320 | api_token = M.ApiToken.query.get(user_id=c.user._id) |
321 | + provider = plugin.AuthenticationProvider.get(request) | |
322 | + menu = provider.account_navigation() | |
321 | 323 | return dict( |
322 | 324 | subscriptions=subscriptions, |
323 | 325 | api_token=api_token, |
324 | - authorized_applications=M.OAuthAccessToken.for_user(c.user)) | |
326 | + authorized_applications=M.OAuthAccessToken.for_user(c.user), | |
327 | + menu=menu) | |
325 | 328 | |
326 | 329 | @h.vardec |
327 | 330 | @expose() |
@@ -129,6 +129,16 @@ class AuthenticationProvider(object): | ||
129 | 129 | ''' |
130 | 130 | raise NotImplemented, 'upload_sshkey' |
131 | 131 | |
132 | + def account_navigation(self): | |
133 | + return [ | |
134 | + { | |
135 | + 'tabid': 'account_sfnet_beta_index', | |
136 | + 'title': 'Subscriptions', | |
137 | + 'target': "/auth/prefs", | |
138 | + 'alt': 'Manage Subscription Preferences', | |
139 | + }, | |
140 | + ] | |
141 | + | |
132 | 142 | class LocalAuthenticationProvider(AuthenticationProvider): |
133 | 143 | ''' |
134 | 144 | Stores user passwords on the User model, in mongo. Uses per-user salt and |
@@ -6,6 +6,17 @@ | ||
6 | 6 | {% block header %}User Preferences for {{c.user.username}}{% endblock %} |
7 | 7 | |
8 | 8 | {% block content %} |
9 | + <ul id="account-nav-menu" class="b-hornav droppy"> | |
10 | + {% for item in menu -%} | |
11 | + <li id="{{ item.tabid }}"> | |
12 | + <a href="{{ item.target }}"> | |
13 | + {{ item.title }} | |
14 | + <div class="marker{% if item.target.rstrip('/') == request.path.rstrip('/') %} current{% endif %}"></div> | |
15 | + </a> | |
16 | + </li> | |
17 | + {%- endfor %} | |
18 | + </ul> | |
19 | + | |
9 | 20 | {% if g.theme.password_change_form %} |
10 | 21 | <div class="grid-20"> |
11 | 22 | <h2>Change Password</h2> |