From a8331fd43a1ec1508fa6d99ecc51f8ea1070edbe Mon Sep 17 00:00:00 2001 From: spez Date: Fri, 31 Jul 2009 13:38:30 -0700 Subject: [PATCH] removed some extraneous menus. fixed the 'Send message' link on the moderators page. removed the fancy styling in the subreddit info boxes. --- r2/r2/lib/pages/pages.py | 26 ++++++++++++++------------ r2/r2/public/static/css/reddit.css | 19 +++---------------- r2/r2/templates/usertableitem.html | 2 +- 3 files changed, 18 insertions(+), 29 deletions(-) diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index ec62958bd..135416fdd 100644 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -224,15 +224,10 @@ class Reddit(Templated): if c.user_is_loggedin: if c.user_is_admin: more_buttons.append(NamedButton('admin')) - elif c.site.is_moderator(c.user): - more_buttons.append(NavButton(menu.admin, 'about/edit')) - + if c.user_is_sponsor: more_buttons.append(NamedButton('promote')) - if c.user_is_admin: - more_buttons.append(NamedButton('traffic')) - #if there's only one button in the dropdown, get rid of the dropdown if len(more_buttons) == 1: main_buttons.append(more_buttons[0]) @@ -371,6 +366,7 @@ class SubredditInfoBar(CachedTemplate): the current reddit, including links to the moderator and contributor pages, as well as links to the banning page if the current user is a moderator.""" + def __init__(self, site = None): site = site or c.site self.spam = site._spam @@ -390,6 +386,9 @@ class SubredditInfoBar(CachedTemplate): self.subscribers = site._ups self.date = site._date self.banner = getattr(site, "banner", None) + + #so the menus cache properly + self.path = request.path CachedTemplate.__init__(self) def nav(self): @@ -398,12 +397,15 @@ class SubredditInfoBar(CachedTemplate): buttons.append(NavButton(plurals.contributors, 'contributors')) if self.is_moderator or self.is_admin: - buttons.append(NamedButton('edit')) - buttons.extend([NavButton(menu.banusers, 'banned'), - NamedButton('reports'), - NamedButton('spam')]) - buttons.append(NamedButton('traffic')) - return [NavMenu(buttons, type = "flatlist", base_path = "/about/")] + buttons.extend([ + NamedButton('spam'), + NamedButton('reports'), + NavButton(menu.banusers, 'banned'), + NamedButton('traffic'), + NamedButton('edit'), + ]) + return [NavMenu(buttons, type = "flat_vert", base_path = "/about/", + separator = '')] class SideBox(CachedTemplate): """ diff --git a/r2/r2/public/static/css/reddit.css b/r2/r2/public/static/css/reddit.css index 7cb079319..8424de02f 100644 --- a/r2/r2/public/static/css/reddit.css +++ b/r2/r2/public/static/css/reddit.css @@ -365,22 +365,9 @@ ul.flat-vert {text-align: left;} .subreddit-info .state-button { display:block } .subreddit-info .spacer { margin: 10px 0px 0px 0px } -.raisedbox .flat-list { } -.raisedbox .flat-list .separator { display: none; } -.raisedbox .flat-list a { - background-color: #F0F0F0; - border: 1px solid white; - border-bottom: none; - margin-right: 1px; - padding: 3px 5px 3px 5px; -} - - -.raisedbox .hover a:hover { - background-color: #369; - color: white; - text-decoration: none; -} +.raisedbox .flat-vert { } +.raisedbox .flat-vert .separator { display: none; } +.raisedbox .flat-vert a {font-size: larger;} /* feature disabled. need to go through this to see what's relevant before enabling */ diff --git a/r2/r2/templates/usertableitem.html b/r2/r2/templates/usertableitem.html index b0654623e..a09dffea1 100644 --- a/r2/r2/templates/usertableitem.html +++ b/r2/r2/templates/usertableitem.html @@ -42,7 +42,7 @@  (${thing.user.safe_karma})   - %elif c.user_is_loggedin and name == "sendmessage" and c.user != thing.user: + %elif c.user_is_loggedin and thing.name == "sendmessage" and c.user != thing.user: ${plain_link(_("send message"), "/message/compose?to=%s" % (thing.user.name))}