• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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>

変更サマリ

差分

--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -318,10 +318,13 @@ class PreferencesController(BaseController):
318318 frequency=mb.frequency.unit,
319319 artifact=mb.artifact_index_id))
320320 api_token = M.ApiToken.query.get(user_id=c.user._id)
321+ provider = plugin.AuthenticationProvider.get(request)
322+ menu = provider.account_navigation()
321323 return dict(
322324 subscriptions=subscriptions,
323325 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)
325328
326329 @h.vardec
327330 @expose()
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -129,6 +129,16 @@ class AuthenticationProvider(object):
129129 '''
130130 raise NotImplemented, 'upload_sshkey'
131131
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+
132142 class LocalAuthenticationProvider(AuthenticationProvider):
133143 '''
134144 Stores user passwords on the User model, in mongo. Uses per-user salt and
--- a/Allura/allura/templates/user_preferences.html
+++ b/Allura/allura/templates/user_preferences.html
@@ -6,6 +6,17 @@
66 {% block header %}User Preferences for {{c.user.username}}{% endblock %}
77
88 {% 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+
920 {% if g.theme.password_change_form %}
1021 <div class="grid-20">
1122 <h2>Change Password</h2>