From fe907eb1c406f8d5619e8f436ff79d4decb2dd9c Mon Sep 17 00:00:00 2001 From: Dave Pifke Date: Tue, 13 Mar 2012 07:00:14 +0000 Subject: [PATCH] Navigation for "apps" tab on preferences. Adding some controller code and template for the apps tab. Currently just a skeleton. --- r2/r2/controllers/front.py | 2 ++ r2/r2/lib/menus.py | 1 + r2/r2/lib/pages/pages.py | 9 +++++++-- r2/r2/templates/prefapps.html | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 r2/r2/templates/prefapps.html diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index 1095cb1f4..44cd29a39 100755 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -1116,6 +1116,8 @@ class FormsController(RedditController): content.append(EnemyList()) elif location == 'update': content = PrefUpdate() + elif location == 'apps': + content = PrefApps() elif location == 'feeds' and c.user.pref_private_feeds: content = PrefFeeds() elif location == 'delete': diff --git a/r2/r2/lib/menus.py b/r2/r2/lib/menus.py index 37c018702..70a32c99a 100644 --- a/r2/r2/lib/menus.py +++ b/r2/r2/lib/menus.py @@ -105,6 +105,7 @@ menu = MenuHandler(hot = _('hot'), #preferences options = _('options'), + apps = _("apps"), feeds = _("RSS feeds"), friends = _("friends"), update = _("password/email"), diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index 54e4f510f..078149e26 100755 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -620,7 +620,8 @@ class PrefsPage(Reddit): *a, **kw) def build_toolbars(self): - buttons = [NavButton(menu.options, '')] + buttons = [NavButton(menu.options, ''), + NamedButton('apps')] if c.user.pref_private_feeds: buttons.append(NamedButton('feeds')) @@ -656,8 +657,12 @@ class PrefUpdate(Templated): self.verify = verify Templated.__init__(self) +class PrefApps(Templated): + """Preference form for managing authorized third-party applications.""" + pass + class PrefDelete(Templated): - """preference form for deleting a user's own account.""" + """Preference form for deleting a user's own account.""" pass diff --git a/r2/r2/templates/prefapps.html b/r2/r2/templates/prefapps.html new file mode 100644 index 000000000..9aa57d873 --- /dev/null +++ b/r2/r2/templates/prefapps.html @@ -0,0 +1,5 @@ +
+

${_("Applications")}

+ +

Hello world.

+