From 3229d272512515f4df3fef22ceb98b8ab79f6722 Mon Sep 17 00:00:00 2001 From: Matt Lee Date: Fri, 24 Jul 2015 11:10:05 -0700 Subject: [PATCH] Quarantine: Disable share feature on quarantined links. --- r2/r2/lib/pages/things.py | 4 ++++ r2/r2/templates/printablebuttons.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/r2/r2/lib/pages/things.py b/r2/r2/lib/pages/things.py index 8387eb613..213fbfffa 100644 --- a/r2/r2/lib/pages/things.py +++ b/r2/r2/lib/pages/things.py @@ -87,6 +87,9 @@ class LinkButtons(PrintableButtons): # do we show the report button? show_report = not is_author and report + show_share = ((c.user_is_loggedin or not g.read_only_mode) and + not thing.subreddit.quarantine) + # if they are the author, can they edit it? thing_editable = getattr(thing, 'editable', True) thing_takendown = getattr(thing, 'admin_takedown', False) @@ -158,6 +161,7 @@ class LinkButtons(PrintableButtons): show_rescrape=show_rescrape, show_givegold=show_givegold, show_comments = comments, + show_share=show_share, # promotion promoted = thing.promoted, is_link = True, diff --git a/r2/r2/templates/printablebuttons.html b/r2/r2/templates/printablebuttons.html index 8acf80a3e..7b6b1f98a 100644 --- a/r2/r2/templates/printablebuttons.html +++ b/r2/r2/templates/printablebuttons.html @@ -236,7 +236,7 @@ ${self.simple_button(_("edit"), "edit_usertext", css_class="edit-usertext")} %endif - % if c.user_is_loggedin or not g.read_only_mode: + % if thing.show_share:
  • %if thing.show_new_post_sharing: ${_("share")}