diverse fixed

This commit is contained in:
Andreas Stephanides
2014-03-23 21:02:47 +01:00
parent 8f4528f994
commit c235619e31
10 changed files with 46 additions and 32 deletions

View File

@@ -22,6 +22,6 @@ else
end
end
def default_url_options
{locale: I18n.locale, theme: theme_name}
{locale: I18n.locale, theme: theme_name, ansicht: nil}
end
end

View File

@@ -11,13 +11,12 @@ class RubrikenController < ApplicationController
@rubrik = Rubrik.find(params[:id])
@moderatoren=User.with_role(:newsmoderator,@rubrik)
if can?(:showunpublished, Neuigkeit)
@neuigkeiten = @rubrik.neuigkeiten
else
@neuigkeiten = @rubrik.neuigkeiten.published
end
@toolbar_elements << {:text=>I18n.t('neuigkeit.new.title'),:path=> new_rubrik_neuigkeit_path(@rubrik),:hicon=>'icon-plus-sign'} if can? :verwalten, @rubrik
@toolbar_elements << {:text=>I18n.t('common.verwalten'),:path=>verwalten_rubrik_path(@rubrik),:icon=>:pencil} if can? :verwalten, @rubrik
@neuigkeiten = @rubrik.neuigkeiten
else
@neuigkeiten = @rubrik.neuigkeiten.published
end
@toolbar_elements << {:text=>I18n.t('neuigkeit.new.title'), :path=> new_rubrik_neuigkeit_path(@rubrik),:hicon=>'icon-plus-sign'} if can? :verwalten, @rubrik
@toolbar_elements << {:text=>I18n.t('common.verwalten'), :path=>verwalten_rubrik_path(@rubrik),:icon=>:pencil} if can? :verwalten, @rubrik

View File

@@ -51,7 +51,8 @@ class ThemenController < ApplicationController
# POST /themen.json
def create
@thema = Thema.new(params[:thema])
@themen = @thema.themengruppe.themen.order(:priority).reverse
respond_to do |format|
if @thema.save
format.html { redirect_to @thema, notice: 'Thema was successfully created.' }
@@ -75,7 +76,7 @@ class ThemenController < ApplicationController
# PUT /themen/1.json
def update
@thema = Thema.find(params[:id])
@themen = @thema.themengruppe.themen.order(:priority).reverse
respond_to do |format|
if @thema.update_attributes(params[:thema])
format.html { redirect_to @thema, notice: 'Thema was successfully updated.' }