work in progress
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
|
|
||||||
@import 'blueimp-gallery-all';
|
@import 'blueimp-gallery-all';
|
||||||
|
.left
|
||||||
|
{
|
||||||
|
float: left;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
/* etc. */
|
||||||
|
}
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 23px
|
font-size: 23px
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ class GalleriesController < ApplicationController
|
|||||||
# GET /galleries/1/edit
|
# GET /galleries/1/edit
|
||||||
def edit
|
def edit
|
||||||
@gallery = Gallery.find(params[:id])
|
@gallery = Gallery.find(params[:id])
|
||||||
|
@fotos_old = @gallery.fotos
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /galleries
|
# POST /galleries
|
||||||
@@ -81,6 +82,10 @@ class GalleriesController < ApplicationController
|
|||||||
@foto = Foto.new
|
@foto = Foto.new
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @gallery.update_attributes(params[:gallery])
|
if @gallery.update_attributes(params[:gallery])
|
||||||
|
|
||||||
|
Foto.where(:gallery_id=>nil).each do |tbd|
|
||||||
|
tbd.destroy
|
||||||
|
end
|
||||||
format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }
|
format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
class Gallery < ActiveRecord::Base
|
class Gallery < ActiveRecord::Base
|
||||||
WORD_COUNT = 20
|
WORD_COUNT = 20
|
||||||
attr_accessible :datum, :desc, :name
|
attr_accessible :datum, :desc, :name, :foto_ids
|
||||||
has_many :fotos
|
has_many :fotos
|
||||||
has_many :nlinks, as: :link
|
has_many :nlinks, as: :link
|
||||||
# scope :search, ->(query) {where("name like ? or galleries.desc like ?", "%#{query}%", "%#{query}%")}
|
# scope :search, ->(query) {where("name like ? or galleries.desc like ?", "%#{query}%", "%#{query}%")}
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
<%= semantic_form_for @gallery do |f| %>
|
<div class="container-fluid">
|
||||||
<%= f.inputs do %>
|
<div class="fluid-row">
|
||||||
<%= f.input :name %>
|
<div class="span4">
|
||||||
<%= f.input :desc %>
|
<%= semantic_form_for @gallery do |f| %>
|
||||||
<%= f.input :datum %>
|
<%= f.inputs do %>
|
||||||
<% end %>
|
<%= f.input :name %>
|
||||||
|
<%= f.input :desc %>
|
||||||
|
<%= f.input :datum %>
|
||||||
|
<%= f.input :fotos,:label=>"test", :as=>:check_boxes, :member_label =>Proc.new{|u| u.title.html_safe+"<br>".html_safe+image_tag(u.datei.thumb.url,{:class=>"img-polaroid img-rounded"})}, :wrapper_html => {:class => "left"}%>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= f.actions do %>
|
<%= f.actions do %>
|
||||||
<%= f.action :submit, :as => :input %>
|
<%= f.action :submit, :as => :input %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<%= @fotos_old %>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
production:
|
production:
|
||||||
solr:
|
solr:
|
||||||
hostname: localhost
|
hostname: localhost
|
||||||
port: 8080
|
port: 8983
|
||||||
log_level: WARNING
|
log_level: WARNING
|
||||||
path: /solr-4.10.2/default #production #ollection1 #production
|
path: /solr/production
|
||||||
# solr_home: solr
|
|
||||||
# read_timeout: 2
|
# read_timeout: 2
|
||||||
# open_timeout: 0.5
|
# open_timeout: 0.5
|
||||||
|
|
||||||
|
|||||||
@@ -60,17 +60,11 @@
|
|||||||
<fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>
|
<fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>
|
||||||
<!-- *** This fieldType is used by Sunspot! *** -->
|
<!-- *** This fieldType is used by Sunspot! *** -->
|
||||||
<fieldType name="text" class="solr.TextField" omitNorms="false">
|
<fieldType name="text" class="solr.TextField" omitNorms="false">
|
||||||
<analyzer type="index">
|
<analyzer>
|
||||||
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||||
|
<filter class="solr.StandardFilterFactory"/>
|
||||||
<filter class="solr.LowerCaseFilterFactory"/>
|
<filter class="solr.LowerCaseFilterFactory"/>
|
||||||
<filter class="solr.NGramFilterFactory" minGramSize="2" maxGramSize="30"/>
|
<filter class="solr.PorterStemFilterFactory"/>
|
||||||
<filter class="solr.TrimFilterFactory" />
|
|
||||||
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="30"/>
|
|
||||||
</analyzer>
|
|
||||||
<analyzer type="query">
|
|
||||||
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
|
||||||
<filter class="solr.LowerCaseFilterFactory"/>
|
|
||||||
<filter class="solr.TrimFilterFactory" />
|
|
||||||
</analyzer>
|
</analyzer>
|
||||||
</fieldType>
|
</fieldType>
|
||||||
<!-- *** This fieldType is used by Sunspot! *** -->
|
<!-- *** This fieldType is used by Sunspot! *** -->
|
||||||
|
|||||||
Reference in New Issue
Block a user