Skip to content

Commit

Permalink
Ads: Hide accept/reject buttons of deleted ads
Browse files Browse the repository at this point in the history
  • Loading branch information
dwick committed Dec 9, 2015
1 parent d206bce commit 88ebd94
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
1 change: 1 addition & 0 deletions r2/r2/lib/pages/things.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def __init__(self, thing, comments = True, delete = True, report = True):
kw["is_awaiting_fraud_review"] = is_awaiting_fraud_review(thing)
kw["payment_flagged_reason"] = thing.payment_flagged_reason
kw["hide_after_seen"] = getattr(thing, "hide_after_seen", False)
kw["show_approval"] = thing.promoted and not thing._deleted

PrintableButtons.__init__(self, 'linkbuttons', thing,
# user existence and preferences
Expand Down
36 changes: 19 additions & 17 deletions r2/r2/templates/printablebuttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,33 +303,35 @@
</li>
%endif
%if c.user_is_sponsor:
<li>
<form action="/post/reject" class="rejection-form"
%if thing.show_approval:
<li>
<form action="/post/reject" class="rejection-form"
style="display:none"
%if getattr(thing, "hide_after_seen", False):
data-hide-after-seen="true"
%endif
method="post" onsubmit="reject post_form(this, 'unpromote')">
<br/>
<input type="hidden" name="executed" value="rejected" />
<label>Reason:</label><br/>
<textarea name="reason" value="" ></textarea>
<br/>
<a href="javascript: void 0;"
<br/>
<input type="hidden" name="executed" value="rejected" />
<label>Reason:</label><br/>
<textarea name="reason" value="" ></textarea>
<br/>
<a href="javascript: void 0;"
onclick="change_state(this, 'unpromote', complete_reject_promo)">
submit
</a>/
</form>
${toggle_button("reject_promo", \
</a>/
</form>
${toggle_button("reject_promo", \
_("reject"), _("cancel"), \
"reject_promo", "cancel_reject_promo")}
</li>
%if thing.promote_status in (PROMOTE_STATUS.unpaid, PROMOTE_STATUS.unseen, PROMOTE_STATUS.rejected):
<li>
${ynbutton(_("accept"), \
_("accepted"), "promote", \
callback="hide_thing" if getattr(thing, "hide_after_seen", False) else "null")}
</li>
%if thing.promote_status in (PROMOTE_STATUS.unpaid, PROMOTE_STATUS.unseen, PROMOTE_STATUS.rejected):
<li>
${ynbutton(_("accept"), \
_("accepted"), "promote", \
callback="hide_thing" if getattr(thing, "hide_after_seen", False) else "null")}
</li>
%endif
%endif
%if thing.is_awaiting_fraud_review:
<li class="fraud-button">
Expand Down

0 comments on commit 88ebd94

Please sign in to comment.