mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
add custom firsttext for iphones, linking out to free reddit app
This commit is contained in:
@@ -169,7 +169,11 @@ def read_mod_cookie():
|
||||
set_user_cookie('mod', '')
|
||||
|
||||
def firsttime():
|
||||
if get_redditfirst('firsttime'):
|
||||
if (request.user_agent and 'iphone' in request.user_agent.lower() and
|
||||
not get_redditfirst('iphone')):
|
||||
set_redditfirst('iphone','first')
|
||||
return 'iphone'
|
||||
elif get_redditfirst('firsttime'):
|
||||
return False
|
||||
else:
|
||||
set_redditfirst('firsttime','first')
|
||||
|
||||
@@ -107,8 +107,11 @@ class Reddit(Templated):
|
||||
|
||||
#add the infobar
|
||||
self.infobar = None
|
||||
if self.show_firsttext and c.firsttime and c.site.firsttext and not infotext:
|
||||
infotext = c.site.firsttext
|
||||
if self.show_firsttext and not infotext:
|
||||
if c.firsttime == 'iphone':
|
||||
infotext = strings.iphone_first
|
||||
elif c.firsttime and c.site.firsttext:
|
||||
infotext = c.site.firsttext
|
||||
if infotext:
|
||||
self.infobar = InfoBar(message = infotext)
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@ string_dict = dict(
|
||||
|
||||
submit_link = _("""You are submitting a link. The key to a successful submission is interesting content and a descriptive title."""),
|
||||
submit_text = _("""You are submitting a text-based post. Speak your mind. A title is required, but expanding further in the text field is not. Beginning your title with "vote up if" is violation of intergalactic law."""),
|
||||
iphone_first = _("You should consider using [reddit's free iphone app](http://itunes.com/apps/iredditfree)."),
|
||||
)
|
||||
|
||||
class StringHandler(object):
|
||||
|
||||
Reference in New Issue
Block a user