Conflicts:
	app/views/galleries/show.html.erb
This commit is contained in:
2015-02-28 15:07:50 +01:00
7 changed files with 60 additions and 24 deletions

2
.gitignore vendored
View File

@@ -1,4 +1,5 @@
/db/data.yml
/db/data_*.yml
/db/.#initdebug.rb
/usergroup.ldif
/newuser.ldif
@@ -40,3 +41,4 @@ console
Gemfile.lock
/config/database.yml
/config/start_topic.yml
/config/contact_topic.yml

View File

@@ -16,13 +16,20 @@ class FotosController < ApplicationController
# GET /fotos/1.json
def show
@foto = Foto.find(params[:id])
@gallery=@foto.gallery
@openfotoid=@foto.id
@pppage=params[:pppage].to_i % 4
@pppage_array = [ 25 , 50 , 100, 10000]
@page = params[:page].nil? ? 1 : params[:page].to_i
@fotos_p = @gallery.fotos.page(@page).per(@pppage_array[@pppage])
@fotos_n = @gallery.fotos- @fotos_p
respond_to do |format|
format.html {
if params[:plain]
render "show", layout: false
else
redirect_to gallery_path(@foto.gallery,:params=>{fotoid: @foto.id})
render "galleries/show" #controller: :galleries, action: :show #gallery_path(@foto.gallery,:params=>{fotoid: @foto.id})
end
}
format.json { render json: @foto }

View File

@@ -19,7 +19,7 @@ class GalleriesController < ApplicationController
def show
@gallery = Gallery.find(params[:id])
@pppage_array = [ 25 , 50 , 100, "all"] #defines number & size of picture chunks
@pppage_array = [ 25 , 50 , 100, 10000] #defines number & size of picture chunks
@pppage = 0 #starting index of pppage_array
if !params[:pppage].nil? && params[:pppage].to_i <= 3 && params[:pppage].to_i >= 0

View File

@@ -137,7 +137,7 @@ class ThemenController < ApplicationController
@thema = Thema.find(params[:id])
@themen = @thema.themengruppe.themen.order(:priority).reverse
@thema.assign_attributes(params[:thema])
@thema.fix_links(request.host_with_port)
# @thema.fix_links(request.host_with_port)
respond_to do |format|
if @thema.save

View File

@@ -9,6 +9,8 @@ top: 0;" %>
<div style="position:absolute; bottom:0">
<%= 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=>"" %>
<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>
<p id="notice"><%= notice %></p>
</div>

View File

@@ -32,9 +32,19 @@ end
<% end %>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&appId=120379864660921&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div itemscope itemtype="http://schema.org/ImageGallery">
<p id="notice"><%= notice %></p>
<div>
<small class="pull-left"><%= @gallery.fotos.size.to_s + " " + I18n.t('fotos.bilder')%> </small>
<small class="pull-right" itemprop="dateCreated" datetime="<%= @gallery.try(:datum).try(:to_date) unless @gallery.try(:datum).try(:to_date).nil?%>"><%=I18n.l(@gallery.try(:datum).try(:to_date)) unless @gallery.try(:datum).try(:to_date).nil? %></small></br>
@@ -54,15 +64,17 @@ end
</style>
<div class="fluid-row">
<div class="span9"> <!-- pagination-->
<div class="pagination pull_left" style="margin:0px 0px 0px 0px">
<%= paginate @fotos_p , theme:'twitter-bootstrap' %>
<!-- <div class="pagination pull_left" style="margin:0px 0px 0px 0px">
<ul>
<li><a href="<%= gallery_path @gallery, {:pppage => @pppage, :page => (@page==1 ? @page : @page-1)} %>"><%=I18n.t('fotos.prev')%></a></li>
<% for i in 1..@pages do %>
<% # for i in 1..@pages do
i=1 %>
<li><a href="<%= gallery_path @gallery, {:pppage => @pppage, :page => i} %>"><%=i%></a></li>
<% end %>
<% # end %>
<li><a href="<%= gallery_path @gallery, {:pppage => @pppage, :page => (@page==@pages ? @page : @page+1)} %>"><%=I18n.t('fotos.next')%></a></li>
</ul>
</div>
</div>-->
</div>
<div class="span3"> <!-- size selector -->
<div class="pull-right">
@@ -120,7 +132,7 @@ end
<!-- <a href="<%= f.datei.resized.url%>" title="<%=f.title%>" data-gallery>
<%=image_tag(f.datei.thumb.url,{:class=>"img-polaroid img-rounded"}) %></a>-->
<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%>" 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"}) %>
<meta itemprop="thumbnailUrl" content="<%= f.datei.thumb.url %>"/>
<meta itemprop="dateModified" content="<%= f.updated_at %>"/>
@@ -128,6 +140,7 @@ end
<meta itemprop="sameAs" content="<%= gallery_foto_path(f.gallery, f,:params=>{:plain=>nil, :theme=>nil})%>"/>
</a>
</div>
</div>
<%= link_to ff_icon('icon-circle-arrow-down').html_safe, f.datei.url,
:class=>"btn-small",title: I18n.t('fotos.download')+': '+f.title, rel: 'tooltip' %>
@@ -158,13 +171,16 @@ end
<% end %>
<%= render 'layouts/pretty_toolbar' %>
</div>
<%= @pppage_array[@pppage] %>
<%= javascript_include_tag "blueimp-gallery-all" %>
<script>
blueimp.Gallery.prototype.textFactory = function (obj, callback) {
var $element = $('<div>')
.addClass('slide-content')
.attr('title', obj.title);
.attr('title', obj.title)
.attr('histItem',obj.getAttribute('histitem'));
$.get(obj.href)
.done(function (result) {
$element.html(result);
@@ -182,6 +198,14 @@ blueimp.Gallery.prototype.textFactory = function (obj, callback) {
return $element[0];
};
$('#openpic').click()
blueimp.Gallery.prototype.onslide = (function(_super) {
return function(index) {
history.pushState({},"Foto",String(this.list[index].getAttribute('histitem')));
return _super.apply(this, arguments);
};
})(blueimp.Gallery.prototype.onslide);
</script>

View File

@@ -29,3 +29,4 @@ formats:
setup: function(ed) {
ed.addButton('boldred_btn', {title:'Bold-Red',icon:"fa fa-red fa-bold", onclick:function() {ed.focus();ed.formatter.toggle('boldred'); }});
}
relative_urls: false