AutoCommit Son Sep 13 12:03:20 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-09-13 12:03:21 +02:00
parent d85a01c810
commit b073a1a098
8 changed files with 39 additions and 10 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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]

View File

@@ -13,8 +13,8 @@
<% i=1 %>
<% @neuigkeiten.each do |n| %>
<div class="step contentbox" id="step-<%=i%>" data-x="<%= i *2000 %>" data-y="<%= Random.rand(0..5)*200 %>" data-rotate="<%= Random.rand(0..18)*10 %>" style="width:1024px; height:500px; padding: 50px; display:block" data-duration="10000"><% @toolbar_elements=[];@questions=[] %>
<div class="media">
<div class="step contentbox" id="step-<%=i%>" data-x="<%= i *2000 %>" data-y="<%= Random.rand(0..5)*200 %>" data-rotate="<%= Random.rand(0..18)*10 %>" style="width:1000px; height:500px; padding: 50px; display:block" data-duration="10000"><% @toolbar_elements=[];@questions=[] %>
<div class="media" style="width: 500px; height:250px; transform: scale(1.5) translate(60px,0)" >
<% unless n.picture_robust.big_thumb.to_s.empty? %>
<div class="pull-left" href="#">
<p><br><%= link_to image_tag(n.picture_robust.big_thumb),n.picture_robust.try(:url) %>
@@ -54,7 +54,7 @@
</div>
<div class="ui-progressbar ui-widget ui-widget-content ui-corner-all" style="height:10px; z-index: 2000; left: 5px; right: 5px; bottom: 5px; height: 10px; position:absolute">
<div id="my-progress-bar" class="ui-progressbar-value ui-widget-header ui-corner-left" style="width:0;height:100%"></div>
<div id="" class="ui-progressbar-value ui-widget-header ui-corner-left" style="width:0;height:100%"></div>
</div>
<script>
@@ -62,9 +62,22 @@ $(function () {
$('#jmpress').jmpress({
duration: {
barPropertyStart: '0',
barSelector: '#my-progress-bar'
barSelector: '.ui-progressbar-value'
},
beforeChange: function(element, eventData) {
console.log('We\'re changing to step: #' + $(element).attr('id') + '!');
}
});
setTimeout(function(){
window.location.reload();
/* or window.location = window.location.href; */
}, 100000);
});
</script>
</body>

View File

@@ -14,6 +14,8 @@
<%= new_question_for(menu, fa_icon("question")) if can? :new, Survey::Question %>
<span class=" pull-right">
<%= flag_link(menu, "infoscreen")%>
<%= link_to(fa_icon("globe"), publish_rubrik_neuigkeit_path(menu.rubrik,menu), title: I18n.t('neuigkeit.publish'), class: "btn") if can?(:publish, menu) && !menu.published?
%>
<%= link_to(fa_stack("globe","ban"), unpublish_rubrik_neuigkeit_path(menu.rubrik,menu), :remote=>true, class: "btn stacked") if can?(:unpublish, menu) && menu.published?

View File

@@ -184,7 +184,7 @@ end
get 'publish_to_facebook'
get 'mail_to_fet'
get 'mail_preview'
get 'flag'
end
collection do
get 'newsletter_preview'

View File

@@ -0,0 +1,7 @@
class AddInfoscreenToNeuigkeit < ActiveRecord::Migration
def change
add_column :neuigkeiten, :flag_infoscreen, :boolean, default: false
add_column :themen, :flag_infoscreen, :boolean, default: false
end
end