forked from bofh/fetsite
merge Merge branch 'master' of https://github.com/fetsite/fetsite
Conflicts: app/views/galleries/show.html.erb
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
/db/data.yml
|
/db/data.yml
|
||||||
|
/db/data_*.yml
|
||||||
/db/.#initdebug.rb
|
/db/.#initdebug.rb
|
||||||
/usergroup.ldif
|
/usergroup.ldif
|
||||||
/newuser.ldif
|
/newuser.ldif
|
||||||
@@ -40,3 +41,4 @@ console
|
|||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
/config/database.yml
|
/config/database.yml
|
||||||
/config/start_topic.yml
|
/config/start_topic.yml
|
||||||
|
/config/contact_topic.yml
|
||||||
@@ -16,13 +16,20 @@ class FotosController < ApplicationController
|
|||||||
# GET /fotos/1.json
|
# GET /fotos/1.json
|
||||||
def show
|
def show
|
||||||
@foto = Foto.find(params[:id])
|
@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|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
if params[:plain]
|
if params[:plain]
|
||||||
render "show", layout: false
|
render "show", layout: false
|
||||||
else
|
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
|
end
|
||||||
}
|
}
|
||||||
format.json { render json: @foto }
|
format.json { render json: @foto }
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class GalleriesController < ApplicationController
|
|||||||
def show
|
def show
|
||||||
@gallery = Gallery.find(params[:id])
|
@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
|
@pppage = 0 #starting index of pppage_array
|
||||||
|
|
||||||
if !params[:pppage].nil? && params[:pppage].to_i <= 3 && params[:pppage].to_i >= 0
|
if !params[:pppage].nil? && params[:pppage].to_i <= 3 && params[:pppage].to_i >= 0
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class ThemenController < ApplicationController
|
|||||||
@thema = Thema.find(params[:id])
|
@thema = Thema.find(params[:id])
|
||||||
@themen = @thema.themengruppe.themen.order(:priority).reverse
|
@themen = @thema.themengruppe.themen.order(:priority).reverse
|
||||||
@thema.assign_attributes(params[:thema])
|
@thema.assign_attributes(params[:thema])
|
||||||
@thema.fix_links(request.host_with_port)
|
# @thema.fix_links(request.host_with_port)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @thema.save
|
if @thema.save
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ top: 0;" %>
|
|||||||
<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=>"" %>
|
||||||
<p id="notice"><%= notice %></p>
|
<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>
|
|
||||||
|
<p id="notice"><%= notice %></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -32,9 +32,19 @@ end
|
|||||||
|
|
||||||
|
|
||||||
<% 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">
|
<div itemscope itemtype="http://schema.org/ImageGallery">
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<small class="pull-left"><%= @gallery.fotos.size.to_s + " " + I18n.t('fotos.bilder')%> </small>
|
<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>
|
<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>
|
</style>
|
||||||
<div class="fluid-row">
|
<div class="fluid-row">
|
||||||
<div class="span9"> <!-- pagination-->
|
<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>
|
<ul>
|
||||||
<li><a href="<%= gallery_path @gallery, {:pppage => @pppage, :page => (@page==1 ? @page : @page-1)} %>"><%=I18n.t('fotos.prev')%></a></li>
|
<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>
|
<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>
|
<li><a href="<%= gallery_path @gallery, {:pppage => @pppage, :page => (@page==@pages ? @page : @page+1)} %>"><%=I18n.t('fotos.next')%></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="span3"> <!-- size selector -->
|
<div class="span3"> <!-- size selector -->
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
@@ -117,17 +129,18 @@ end
|
|||||||
<% @fotos_p.each do |f| %>
|
<% @fotos_p.each do |f| %>
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<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>-->
|
||||||
<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%>" 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"}) %>
|
||||||
<meta itemprop="thumbnailUrl" content="<%= f.datei.thumb.url %>"/>
|
<meta itemprop="thumbnailUrl" content="<%= f.datei.thumb.url %>"/>
|
||||||
<meta itemprop="dateModified" content="<%= f.updated_at %>"/>
|
<meta itemprop="dateModified" content="<%= f.updated_at %>"/>
|
||||||
<meta itemprop="image" content="<%= f.datei.url %>"/>
|
<meta itemprop="image" content="<%= f.datei.url %>"/>
|
||||||
<meta itemprop="sameAs" content="<%= gallery_foto_path(f.gallery, f,:params=>{:plain=>nil, :theme=>nil})%>"/>
|
<meta itemprop="sameAs" content="<%= gallery_foto_path(f.gallery, f,:params=>{:plain=>nil, :theme=>nil})%>"/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<%= link_to ff_icon('icon-circle-arrow-down').html_safe, f.datei.url,
|
<%= 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' %>
|
:class=>"btn-small",title: I18n.t('fotos.download')+': '+f.title, rel: 'tooltip' %>
|
||||||
@@ -158,13 +171,16 @@ end
|
|||||||
<% end %>
|
<% end %>
|
||||||
<%= render 'layouts/pretty_toolbar' %>
|
<%= render 'layouts/pretty_toolbar' %>
|
||||||
</div>
|
</div>
|
||||||
<%= @pppage_array[@pppage] %>
|
|
||||||
<%= javascript_include_tag "blueimp-gallery-all" %>
|
<%= javascript_include_tag "blueimp-gallery-all" %>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
blueimp.Gallery.prototype.textFactory = function (obj, callback) {
|
blueimp.Gallery.prototype.textFactory = function (obj, callback) {
|
||||||
var $element = $('<div>')
|
var $element = $('<div>')
|
||||||
.addClass('slide-content')
|
.addClass('slide-content')
|
||||||
.attr('title', obj.title);
|
.attr('title', obj.title)
|
||||||
|
.attr('histItem',obj.getAttribute('histitem'));
|
||||||
|
|
||||||
$.get(obj.href)
|
$.get(obj.href)
|
||||||
.done(function (result) {
|
.done(function (result) {
|
||||||
$element.html(result);
|
$element.html(result);
|
||||||
@@ -182,6 +198,14 @@ blueimp.Gallery.prototype.textFactory = function (obj, callback) {
|
|||||||
return $element[0];
|
return $element[0];
|
||||||
};
|
};
|
||||||
$('#openpic').click()
|
$('#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>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,3 +29,4 @@ formats:
|
|||||||
setup: function(ed) {
|
setup: function(ed) {
|
||||||
ed.addButton('boldred_btn', {title:'Bold-Red',icon:"fa fa-red fa-bold", onclick:function() {ed.focus();ed.formatter.toggle('boldred'); }});
|
ed.addButton('boldred_btn', {title:'Bold-Red',icon:"fa fa-red fa-bold", onclick:function() {ed.focus();ed.formatter.toggle('boldred'); }});
|
||||||
}
|
}
|
||||||
|
relative_urls: false
|
||||||
Reference in New Issue
Block a user