Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add gold-specific sidebar message.

  • Loading branch information...
commit ae2b646e28720089ba08c5633029ebdc215bd7d2 1 parent 757ee7e
Max Goodman authored
View
2  r2/example.ini
@@ -576,6 +576,8 @@ fastlane_links =
announcement_message =
# an info message placed in the sidebar
sidebar_message =
+# an info message placed in the sidebar for gold users
+gold_sidebar_message =
# spotlight links for subreddit discovery
sr_discovery_links =
# probability of the subreddit suggester showing up in the spotlight box
View
1  r2/r2/lib/app_globals.py
@@ -229,6 +229,7 @@ class Globals(object):
'goldvertisement_has_gold_blurbs',
'welcomebar_messages',
'sidebar_message',
+ 'gold_sidebar_message',
],
}
View
10 r2/r2/lib/pages/pages.py
@@ -332,6 +332,12 @@ def rightbox(self):
if sidebar_message and isinstance(c.site, DefaultSR):
ps.append(SidebarMessage(sidebar_message[0]))
+ gold_sidebar_message = g.live_config.get("gold_sidebar_message")
+ if (c.user_is_loggedin and c.user.gold and
+ gold_sidebar_message and isinstance(c.site, DefaultSR)):
+ ps.append(SidebarMessage(gold_sidebar_message[0],
+ extra_class="gold"))
+
if not c.user_is_loggedin and self.loginbox and not g.read_only_mode:
ps.append(LoginFormWide())
@@ -1636,8 +1642,8 @@ def __init__(self, client, *args, **kwargs):
class SidebarMessage(Templated):
"""An info message box on the sidebar."""
- def __init__(self, message):
- Templated.__init__(self, message=message)
+ def __init__(self, message, extra_class=None):
+ Templated.__init__(self, message=message, extra_class=extra_class)
class RedditError(BoringPage):
site_tracking = False
View
14 r2/r2/public/static/css/reddit.less
@@ -433,6 +433,20 @@ ul.flat-vert {text-align: left;}
p + p {
margin-top: .25em;
}
+
+ &.gold {
+ font-family: serif;
+ border: 1px solid lighten(#c4b487, 10%);
+ box-shadow: 0 0 10px lighten(#dad0b3, 10%) inset;
+ border-radius: 0;
+
+ &:before {
+ background-image: url(../gold-coin.png); /* SPRITE */
+ width: 13px;
+ height: 14px;
+ margin-top: 1px;
+ }
+ }
}
.morelink {
View
4 r2/r2/templates/sidebarmessage.html
@@ -24,6 +24,8 @@
from r2.lib.filters import safemarkdown
%>
-<div class="side-message">
+<%namespace file="utils.html" import="classes"/>
+
+<div ${classes('side-message', thing.extra_class)}>
${unsafe(safemarkdown(thing.message))}
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.