#143 fixed
themen fixed
This commit is contained in:
2014-06-10 18:47:16 +05:30
parent 6451c0f175
commit 67ccecaf51
10 changed files with 49 additions and 24 deletions

View File

@@ -33,9 +33,7 @@ class ThemenController < ApplicationController
def verwalten
@thema = Thema.find(params[:id])
@attachment=Attachment.new
unless (@thema.is_wiki?)
redirect_to verwalten_wiki_path(Wiki.find(@thema.id))
end
@fragen=@thema.fragen
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}]

View File

@@ -24,10 +24,7 @@ class ThemengruppenController < ApplicationController
@themen = @themengruppe.themen.order(:priority).reverse
@toolbar_elements = []
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)} if can? :new, Themengruppe
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} if can? :edit, @themengruppe
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("themengruppe.manage"), :path=>themengruppe_verwalten_path(@themengruppe)} if can? :edit, @themengruppe
@toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe
respond_to do |format|
format.html # show.html.erb
@@ -58,6 +55,12 @@ class ThemengruppenController < ApplicationController
def verwalten
@themengruppe = Themengruppe.find(params[:themengruppe_id])
@themen = @themengruppe.themen.order(:priority).reverse
@toolbar_elements =[]
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} if can? :edit, @themengruppe
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)} if can? :new, Themengruppe
@toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe
end
def sort_themengruppen

View File

@@ -16,11 +16,7 @@ class WikisController < ApplicationController
redirect_to wiki_path(@wiki)
end
def verwalten
@wiki = Wiki.find(params[:id])
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('wiki.edit'), :path=>edit_wiki_path(@wiki)}]
end
def edit
@wiki = Wiki.find(params[:id])
respond_to do |format|
@@ -36,7 +32,7 @@ class WikisController < ApplicationController
@wiki.raw_data=params[:wiki][:raw_data]
respond_to do |format|
if @wiki.update_attributes(params[:wiki])
format.html { redirect_to @wiki, notice: 'Thema was successfully updated.' }
format.html { redirect_to verwalten_thema_path(@wiki), notice: 'Thema was successfully updated.' }
format.json { head :no_content }
format.js
else