diff --git a/app/assets/stylesheets/themes/2003/application.css.scss b/app/assets/stylesheets/themes/2003/application.css.scss index c825d1f..ede60a5 100755 --- a/app/assets/stylesheets/themes/2003/application.css.scss +++ b/app/assets/stylesheets/themes/2003/application.css.scss @@ -10,11 +10,11 @@ * compiled file, but it's generally better to create a new file per style scope. * *= require_self - *= require_tree . + * require_tree . *= require jquery.fileupload-ui * require 'bootstrap' - *= require 'neuigkeiten' + * require 'neuigkeiten' */ // Colorshema #0A64A4 $color_prim: #7070a0; @@ -31,11 +31,17 @@ $white: #FFFFFF; $bodyBackground: #EEE; + + $navbarBackground: $color_prim; $navbarText: black; -$navbarLinkColor: black; +$navbarLinkColor: $color_prim_vdark; $navbarLinkColorHover: black; $dropdownLinkColor: black; +$navbar-default-brand-color: black; +$navbarBrandColor:black; + + $navbarBackgroundHighlight: $color_prim; //$navbarBackgroundHighlight:#FFFFFF; @@ -50,6 +56,7 @@ $sansFontFamily: Helvetica, Arial; @import 'bootstrap-responsive'; @import 'bootstrap/image-gallery'; +@import 'neuigkeiten'; h1 { font-size: 23px diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ecbcadf..352a845 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,4 @@ -class ApplicationController < ActionController::Base + class ApplicationController < ActionController::Base protect_from_forgery before_filter :set_i18n_locale_from_params protected @@ -14,11 +14,11 @@ class ApplicationController < ActionController::Base end end def get_theme - set_theme(params[:theme]) -if valid_theme? -theme_name + if ThemesForRails.available_theme_names.include?(params[:theme]) + params[:theme] + else -nil +"2003" end end def default_url_options diff --git a/app/controllers/fotos_controller.rb b/app/controllers/fotos_controller.rb index 6b3ba2b..5d762b3 100644 --- a/app/controllers/fotos_controller.rb +++ b/app/controllers/fotos_controller.rb @@ -45,8 +45,7 @@ class FotosController < ApplicationController # POST /fotos.json def create @foto = Foto.new(params[:foto]) - - @foto.gallery_id = (params[:gallery_id]) + @foto.gallery_id = (params[:gallery_id]) @gallery = @foto.gallery respond_to do |format| @foto.title = @foto.datei.filename diff --git a/app/controllers/neuigkeiten_controller.rb b/app/controllers/neuigkeiten_controller.rb index bf693b7..df2bd33 100755 --- a/app/controllers/neuigkeiten_controller.rb +++ b/app/controllers/neuigkeiten_controller.rb @@ -4,10 +4,11 @@ class NeuigkeitenController < ApplicationController def show @neuigkeit = Neuigkeit.find(params[:id]) -@rubrik=@neuigkeit.rubrik + @rubrik=@neuigkeit.rubrik if !params[:version].nil? - @neuigkeit.versions.reverse[params[:version].to_i].reify.save! - @neuigkeit=Neuigkeit.find(params[:id]) + @neuigkeit.assign_attributes(@neuigkeit.translation.versions.reverse[params[:version].to_i].reify.attributes.select{|k,v| @neuigkeit.translated_attribute_names.include? k.to_sym }) + + # @neuigkeit=Neuigkeit.find(params[:id]) end @calentries1=@neuigkeit.calentries @@ -15,7 +16,7 @@ class NeuigkeitenController < ApplicationController @toolbar_elements << {:hicon=>'icon-minus', :text=> I18n.t('neuigkeit.unpublish'),:path => unpublish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>"Sure?" } if can?(:unpublish, @neuigkeit) && !@neuigkeit.published? @toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:icon=>:pencil} if can? :edit, @neuigkeit.rubrik - @versions= @neuigkeit.versions.select([:created_at]).reverse + @versions= @neuigkeit.translation.versions.select([:created_at]).reverse @toolbar_elements <<{:path=>rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:method=>:versions,:versions=>@versions} @toolbar_elements << {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit), :method=> :delete,:confirm=>'Sure?' } if can? :delete, @neuigkeit diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index 9e2eb50..ebc0fe4 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -19,7 +19,8 @@ class Neuigkeit < ActiveRecord::Base belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id" validates :rubrik, :presence=>true validates :author, :presence=>true - translates :title,:text, :versioning=>true, :fallbacks_for_empty_translations => true + translates :title,:text, :versioning=>{:gem=>:paper_trail, :options=>{:fallbacks_for_empty_translations => true}} + has_many :calentries, as: :object mount_uploader :picture, PictureUploader scope :published, -> {where("datum <= ? AND datum IS NOT NULL", Time.now.to_date).order(:datum).reverse_order} diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 1e4bd1e..a07527d 100755 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -11,7 +11,7 @@ Fehlermeldungen auf GitHub melden.

Bezüglich Design und Steuerung sind Vorschläge erwünscht.

-

<%= link_to "Steuerelemente und Komponenten", "http://getbootst

+

<%= link_to "Steuerelemente und Komponenten", "http://getbootstrap.com/2.3.2/index.html" %>

Um bei der Entwicklung mitzuhelfen braucht nur Ruby on Rails installiert werden

<%= link_to "Getting Started" , home_startdev_path%>

Das Kalender Feature wird überarbeitet, in Zukunft soll folgender Link nicht mehr funktionieren <%= link_to "Kalender", calendars_path %> diff --git a/config/initializers/themes_for_rails.rb b/config/initializers/themes_for_rails.rb index 91ea569..6800331 100644 --- a/config/initializers/themes_for_rails.rb +++ b/config/initializers/themes_for_rails.rb @@ -1,7 +1,7 @@ ThemesForRails.config do |config| # # If you have placed your themes like the example path above within the asset pipeline: - config.themes_dir = 'app/assets/themes' + config.themes_dir = 'app/views/themes' config.assets_dir = 'app/assets/assets/themes/:name' config.views_dir = 'app/views/themes/:name' config.use_sass=true