shareable

This commit is contained in:
Andreas Stephanides
2015-02-28 16:22:01 +01:00
parent bf774d27eb
commit c55a2479e8
3 changed files with 23 additions and 8 deletions

View File

@@ -122,3 +122,5 @@ gem 'opengraph_parser'
# Image gallery # Image gallery
gem 'blueimp-gallery' gem 'blueimp-gallery'
gem 'blueimp-gallery-rails' gem 'blueimp-gallery-rails'
gem 'shareable'

View File

@@ -3,14 +3,14 @@
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 40pt;
top: 0;" %> top: 0" %>
<% #, gallery_foto_path(@foto.gallery, ((@foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil?) ? (@foto.gallery.fotos[0].try(:id).to_i) : @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) ) %> <% #, gallery_foto_path(@foto.gallery, ((@foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil?) ? (@foto.gallery.fotos[0].try(:id).to_i) : @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) ) %>
<div style="position:absolute; bottom:0"> <div style="position:absolute; bottom:0; ">
<%= link_to ff_icon('icon-circle-arrow-down').html_safe, @foto.datei.url, <%= link_to ff_icon('icon-circle-arrow-down').html_safe, @foto.datei.url,
:class=>"btn",title: I18n.t('fotos.download')+': '+@foto.title,:target=>:blank, :style=>"" %> :class=>"btn",title: I18n.t('fotos.download')+': '+@foto.title,:target=>:blank, :style=>"" %>
<div class="fb-like" data-href"<%= gallery_path(@foto.gallery, {fotoid:@foto.id,theme: nil, locale: nil})%>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div> <!-- <div class="fb-like" data-href"<%= gallery_foto_path(@foto.gallery,@foto, {fotoid:@foto.id,theme: nil, locale: nil})%>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>-->
<%= render_shareable :url=>gallery_foto_url(@foto.gallery,@foto, {theme: nil, locale: nil}) %>
<p id="notice"><%= notice %></p> <p id="notice"><%= notice %></p>
</div> </div>

View File

@@ -99,7 +99,7 @@ end
<a class="next"></a> <a class="next"></a>
<a class="close">×</a> <a class="close">×</a>
<a class="play-pause"></a> <a class="play-pause"></a>
<ol class="indicator"></ol> <ol class="noindicator"></ol>
<!-- The modal dialog, which will be used to wrap the lightbox content --> <!-- The modal dialog, which will be used to wrap the lightbox content -->
<div class="modal fade"> <div class="modal fade">
<div class="modal-dialog"> <div class="modal-dialog">
@@ -131,6 +131,9 @@ end
<div id="links"> <div id="links">
<!-- <a href="<%= f.datei.resized.url%>" title="<%=f.title%>" data-gallery> <!-- <a href="<%= f.datei.resized.url%>" title="<%=f.title%>" data-gallery>
<%=image_tag(f.datei.thumb.url,{:class=>"img-polaroid img-rounded"}) %></a>--> <%=image_tag(f.datei.thumb.url,{:class=>"img-polaroid img-rounded"}) %></a>-->
<% if (@openfotoid.to_i==f.id) %>
<meta itemprop="image" content="<%= f.datei.resized.url %>"/>
<% end %>
<div <% if (@openfotoid.to_i==f.id) %> itemprop="primaryImageOfPage"<% else %> itemprop="hasPart" <% end %> itemscope itemtype="http://schema.org/ImageObject"> <div <% if (@openfotoid.to_i==f.id) %> itemprop="primaryImageOfPage"<% else %> itemprop="hasPart" <% end %> itemscope itemtype="http://schema.org/ImageObject">
<a href="<%= gallery_foto_path(f.gallery, f,:params=>{plain: true}) %>" data-type="text/html" type="text/html" title="<%=f.title%>" histItem="<%= gallery_foto_path(f.gallery, f,:params=>{plain: nil, theme: nil}) %>" data-gallery <% if (@openfotoid.to_i==f.id) %>id="openpic" <% end %>> <a href="<%= gallery_foto_path(f.gallery, f,:params=>{plain: true}) %>" data-type="text/html" type="text/html" title="<%=f.title%>" histItem="<%= gallery_foto_path(f.gallery, f,:params=>{plain: nil, theme: nil}) %>" data-gallery <% if (@openfotoid.to_i==f.id) %>id="openpic" <% end %>>
<%= image_tag(f.datei.thumb.url,{:class=>"img-polaroid img-rounded"}) %> <%= image_tag(f.datei.thumb.url,{:class=>"img-polaroid img-rounded"}) %>
@@ -207,6 +210,16 @@ blueimp.Gallery.prototype.onslide = (function(_super) {
}; };
})(blueimp.Gallery.prototype.onslide); })(blueimp.Gallery.prototype.onslide);
</script> </script>
<style>
nav.share {display:inline-block;} /* shareable's nav tag */
nav.share div {float:left;}
nav.share iframe {border:0; margin-top:0; padding-top:0;} /* if using medium sized buttons */
#___plusone_0 {font-size: default !important;}
.fb_iframe_widget span { vertical-align: top; }
.fb_edge_widget_with_comment { vertical-align: top;}
.fb-like{display:inline-block}
* html .fb-like{display:inline}/* ie6 inline block fix*/
*+html .fb-like{display:inline}/* ie7 inline block fix*/
</style>
</div> </div>