refactor share buttons
This commit is contained in:
@@ -12,6 +12,11 @@
|
||||
<%= @post_set.presenter.tag_list_html(current_query: params[:tags], show_extra_links: CurrentUser.user.is_gold?) %>
|
||||
</section>
|
||||
|
||||
<section id="tag-box">
|
||||
<h1>Share</h1>
|
||||
<%= render "posts/partials/index/share" %>
|
||||
</section>
|
||||
|
||||
<%= render "posts/partials/index/options" %>
|
||||
|
||||
<%= render "posts/partials/index/related" %>
|
||||
|
||||
19
app/views/posts/partials/index/_share.html.erb
Normal file
19
app/views/posts/partials/index/_share.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<% if Danbooru.config.addthis_key %>
|
||||
|
||||
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
|
||||
<a class="addthis_button_twitter"></a>
|
||||
<a class="addthis_button_facebook"></a>
|
||||
<a class="addthis_button_reddit"></a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var addthis_config = {"data_track_addressbar": false, "pubid": "<%= Danbooru.config.addthis_key %>"};
|
||||
var addthis_share = {
|
||||
"url":"<%= j posts_url(tags: params[:tags]) %>",
|
||||
"title": "<%= escape_javascript @post_set.humanized_tag_string %> - <%= Danbooru.config.app_name %>"
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#async=1"></script>
|
||||
|
||||
<% end %>
|
||||
@@ -1,21 +1,19 @@
|
||||
<div style="height: 25em;">
|
||||
<!-- AddThis Button BEGIN -->
|
||||
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
|
||||
<% if Danbooru.config.addthis_key %>
|
||||
|
||||
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
|
||||
<a class="addthis_button_twitter"></a>
|
||||
<a class="addthis_button_facebook"></a>
|
||||
<a class="addthis_button_tumblr"></a>
|
||||
<a class="addthis_button_compact"></a>
|
||||
<a class="addthis_counter addthis_bubble_style"></a>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var addthis_config = {"data_track_addressbar": false, "pubid": "<%= Danbooru.config.addthis_key %>"};
|
||||
var addthis_share = {
|
||||
"url":"<%= j post_url(post, :only_path => false, :host => Danbooru.config.hostname) %>",
|
||||
"title": "<%= '#r_18 ' unless post.rating == 's' %><%= escape_javascript post.presenter.humanized_essential_tag_string.html_safe %>"
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#async=1"></script>
|
||||
|
||||
<!-- AddThis Button END -->
|
||||
<a class="addthis_button_reddit"></a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var addthis_config = {"data_track_addressbar": false, "pubid": "<%= Danbooru.config.addthis_key %>"};
|
||||
var addthis_share = {
|
||||
"url":"<%= j post_url(post) %>",
|
||||
"title": "<%= '#r_18 ' unless post.rating == 's' %><%= escape_javascript post.presenter.humanized_essential_tag_string.html_safe %> - <%= Danbooru.config.app_name %>"
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#async=1"></script>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -14,6 +14,11 @@
|
||||
<%= render "posts/partials/show/information", :post => @post %>
|
||||
</section>
|
||||
|
||||
<section id="post-share">
|
||||
<h1>Share</h1>
|
||||
<%= render "posts/partials/show/share", :post => @post %>
|
||||
</section>
|
||||
|
||||
<section id="post-options">
|
||||
<h1>Options</h1>
|
||||
<%= render "posts/partials/show/options", :post => @post %>
|
||||
@@ -98,8 +103,6 @@
|
||||
<% if CurrentUser.is_member? && @post.visible? %>
|
||||
<li><a href="#edit" id="post-edit-link" data-shortcut="e">Edit</a></li>
|
||||
<% end %>
|
||||
|
||||
<li><a href="#share">Share</a></li>
|
||||
</menu>
|
||||
|
||||
<% if RecommenderService.available_for_post?(@post) %>
|
||||
@@ -128,10 +131,6 @@
|
||||
<%= render "posts/partials/show/edit", :post => @post %>
|
||||
</section>
|
||||
<% end %>
|
||||
|
||||
<section id="share" style="display: none;">
|
||||
<%= render "posts/partials/show/share", :post => @post %>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user