diff --git a/Gemfile b/Gemfile index fefe5f6..39c0935 100755 --- a/Gemfile +++ b/Gemfile @@ -13,8 +13,8 @@ gem 'webrick', '1.3.1' # Gems used only for assets and not required # in production environments by default. - gem 'sass-rails', '~> 4.0.0' - gem 'coffee-rails', '~> 4.0.0' + gem 'sass-rails', '~> 3.0' + gem 'coffee-rails', '~> 3.0' gem 'bootstrap-sass','~> 2.3.2.1' group :assets do @@ -102,7 +102,7 @@ gem 'rmagick' gem 'bootstrap-addons-rails' gem "jquery-fileupload-rails", "0.4.1" -gem "jquery-ui-rails","~> 4.2.0" +gem "jquery-ui-rails","~> 4.1.0" gem "font-awesome-rails" gem "jquery-datetimepicker-rails" # gem "jquery-sortable-rails" diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index ebf2870..28fd237 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -22,7 +22,7 @@ class HomeController < ApplicationController end def infoscreen authorize! :doadmin, User - @neuigkeiten = Neuigkeit.accessible_by(current_ability, :show).limit(10) + @neuigkeiten = Neuigkeit.accessible_by(current_ability, :show).where(flag_infoscreen: true) render layout: false end def kontakt diff --git a/app/controllers/neuigkeiten_controller.rb b/app/controllers/neuigkeiten_controller.rb index 6410924..ce08d18 100755 --- a/app/controllers/neuigkeiten_controller.rb +++ b/app/controllers/neuigkeiten_controller.rb @@ -3,6 +3,7 @@ class NeuigkeitenController < ApplicationController before_filter :load_toolbar_elements, :only=>[:show,:find_link] before_filter :load_toolbar_elements_edit, :only=>[:edit] + acts_as_flagable diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index 6bab7a0..a89812a 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -44,6 +44,12 @@ class Neuigkeit < ActiveRecord::Base before_validation :sanitize after_save :update_cache attr_accessor :no_fallbacks + + acts_as_flagable + + FLAG_ICONS={"infoscreen" => "fa fa-flag"} + FLAG_CONFIRM={"infoscreen" => "Neuigkeit am Infoscreen anzeigen"} + def globalize_fallbacks(locale) if self.no_fallbacks [locale] diff --git a/app/views/home/infoscreen.html.erb b/app/views/home/infoscreen.html.erb index 732abb8..6100f27 100644 --- a/app/views/home/infoscreen.html.erb +++ b/app/views/home/infoscreen.html.erb @@ -13,8 +13,8 @@ <% i=1 %> <% @neuigkeiten.each do |n| %> -
<%= link_to image_tag(n.picture_robust.big_thumb),n.picture_robust.try(:url) %>
@@ -54,7 +54,7 @@