mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
Simple multi "share in explore subreddit" button.
This commit is contained in:
committed by
Neil Williams
parent
4d17b32801
commit
92da469504
@@ -1865,6 +1865,15 @@ class MultiInfoBar(Templated):
|
||||
self.description_md = multi.description_md
|
||||
self.srs = srs
|
||||
|
||||
explore_sr = g.live_config["listing_chooser_explore_sr"]
|
||||
if explore_sr:
|
||||
self.share_url = "/r/%(sr)s/submit?url=%(url)s" % {
|
||||
"sr": explore_sr,
|
||||
"url": add_sr(self.multi.path, sr_path=False),
|
||||
}
|
||||
else:
|
||||
self.share_url = None
|
||||
|
||||
|
||||
class SubscriptionBox(Templated):
|
||||
"""The list of reddits a user is currently subscribed to to go in
|
||||
|
||||
@@ -5308,7 +5308,7 @@ table.calendar {
|
||||
}
|
||||
|
||||
.gray-buttons {
|
||||
button {
|
||||
button, a {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
@@ -5458,6 +5458,15 @@ table.calendar {
|
||||
}
|
||||
}
|
||||
|
||||
.share-in-sr {
|
||||
display: none;
|
||||
}
|
||||
&.public {
|
||||
.share-in-sr {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
form.add-sr {
|
||||
.sr-name, button.add {
|
||||
vertical-align: middle;
|
||||
|
||||
@@ -338,6 +338,7 @@ r.multi.MultiDetails = Backbone.View.extend({
|
||||
}
|
||||
|
||||
this.$el.toggleClass('readonly', !canEdit)
|
||||
this.$el.toggleClass('public', this.model.get('visibility') == 'public')
|
||||
|
||||
if (this.model.description.has('body_html')) {
|
||||
this.$('.description .usertext-body').html(
|
||||
|
||||
@@ -75,6 +75,10 @@
|
||||
%if thing.can_edit:
|
||||
<div class="gray-buttons settings">
|
||||
<button class="edit-description">${_('edit description')}</button>
|
||||
|
||||
%if thing.share_url:
|
||||
<a class="share-in-sr" href="${thing.share_url}">${_('share')} ›</a>
|
||||
%endif
|
||||
</div>
|
||||
%endif
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user