Allow gold users to optionally receive inbox replies to posts.

This commit is contained in:
Jason Harvey
2013-02-26 08:04:04 -08:00
parent 71f274762e
commit d1b2541c4a
4 changed files with 19 additions and 3 deletions

View File

@@ -374,7 +374,8 @@ class ApiController(RedditController, OAuth2ResourceController):
form.set_error(errors.QUOTA_FILLED, None)
return
sendreplies = kind == 'self'
if not c.user.gold or not hasattr(request.post, 'sendreplies'):
sendreplies = kind == 'self'
# well, nothing left to do but submit it
l = Link._submit(request.post.title, url if kind == 'link' else 'self',

View File

@@ -67,7 +67,6 @@ class Link(Thing, Printable):
pending=False,
disable_comments=False,
selftext='',
noselfreply=False,
sendreplies=True,
ip='0.0.0.0',
flair_text=None,
@@ -744,7 +743,7 @@ class Comment(Thing, Printable):
name = 'inbox'
if parent:
to = Account._byID(parent.author_id, True)
elif link.is_self and not link.noselfreply:
elif link.sendreplies:
to = Account._byID(link.author_id, True)
name = 'selfreply'

View File

@@ -5333,6 +5333,10 @@ body:not(.gold) .allminus-link {
max-width: 550px;
}
.gold-accent.roundfield {
margin-top: 0px;
}
.gold-form {
font-family: "Hoefler Text","Palatino Linotype","Book Antiqua", Palatino,georgia,garamond,FreeSerif,serif;
min-height: 600px;

View File

@@ -103,6 +103,18 @@ ${thing.formtabs_menu}
</%utils:round_field>
</div>
%if c.user.gold:
<div class="spacer">
<%utils:round_field title="${_('options')}" css_class="gold-accent">
<input class="nomargin" type="checkbox" checked="checked" name="sendreplies" id="sendreplies" data-send-checked="true"/>
<label for="sendreplies">
${_("send replies to my inbox")}
</label>
&#32;<span class="little gray">(${_("beta")})</span>
</%utils:round_field>
</div>
%endif
${thing.captcha}
</div>