Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added navigation bar to Dashboard.
  • Loading branch information
LucasSloan committed Aug 20, 2013
commit 1020bf9aa42f17b2c5f043d4791beddaf624630c
2 changes: 1 addition & 1 deletion r2/r2/config/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def make_map(global_conf={}, app_conf={}):
mc('/dashboard/comments', action='listing', controller='interestingcomments')
mc('/dashboard/subscribed', action='listing', controller='interestingsubscribed')
mc('/dashboard/posts', action='listing', controller='interestingposts')
mc('/dashboard', action='listing', controller='listingtest')
mc('/dashboard/', action='listing', controller='listingtest')

# Can't use map.resource because the version of the Routing module we're
# using doesn't support the controller_action kw arg
Expand Down
18 changes: 14 additions & 4 deletions r2/r2/controllers/dashboardcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class InterestingcommentsController(CommentsController):

@property
def header_sub_nav(self):
return [NamedButton("leadingsubscribed", dest="dashboard/subscribed"),
return [NamedButton("dashboard", dest="dashboard"),
NamedButton("leadingsubscribed", dest="dashboard/subscribed"),
NamedButton("leadingposts", dest="dashboard/posts"),
NamedButton("leadingcomments", dest="dashboard/comments")]

Expand Down Expand Up @@ -84,7 +85,8 @@ class InterestingsubscribedController(CommentsController):

@property
def header_sub_nav(self):
return [NamedButton("leadingsubscribed", dest="dashboard/subscribed"),
return [NamedButton("dashboard", dest="dashboard"),
NamedButton("leadingsubscribed", dest="dashboard/subscribed"),
NamedButton("leadingposts", dest="dashboard/posts"),
NamedButton("leadingcomments", dest="dashboard/comments")]

Expand Down Expand Up @@ -153,7 +155,8 @@ class InterestingpostsController(CommentsController):

@property
def header_sub_nav(self):
return [NamedButton("leadingsubscribed", dest="dashboard/subscribed"),
return [NamedButton("dashboard", dest="dashboard"),
NamedButton("leadingsubscribed", dest="dashboard/subscribed"),
NamedButton("leadingposts", dest="dashboard/posts"),
NamedButton("leadingcomments", dest="dashboard/comments")]

Expand Down Expand Up @@ -205,6 +208,13 @@ def GET_listing(self, time, **env):
return CommentsController.GET_listing(self, **env)

class ListingtestController(CommentsController):
@property
def header_sub_nav(self):
return [NamedButton("dashboard", dest="dashboard"),
NamedButton("leadingsubscribed", dest="dashboard/subscribed"),
NamedButton("leadingposts", dest="dashboard/posts"),
NamedButton("leadingcomments", dest="dashboard/comments")]

render_cls = FormPage
builder_cls = UnbannedCommentBuilder

Expand Down Expand Up @@ -266,5 +276,5 @@ def content(self):
def GET_listing(self, time, **env):
self.time = time
content = self.content()
res = FormPage("Dashboard", content = content).render()
res = FormPage("Dashboard", content = content, header_sub_nav = self.header_sub_nav).render()
return res
1 change: 1 addition & 0 deletions r2/r2/lib/menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __getattr__(self, attr):
posts = _('Posts'),
topcomments = _('Top Comments'),
newcomments = _('New Comments'),
dashboard = _('Dashboard'),
leadingsubscribed = _('Leading Subscribed'),
leadingcomments = _('Leading Comments'),
leadingposts = _('Leading Posts'),
Expand Down