forked from bofh/fetsite
Merge remote-tracking branch 'origin/paginate' into extrafeature
This commit is contained in:
@@ -28,6 +28,7 @@ class HomeController < ApplicationController
|
||||
def linksnotimplemented
|
||||
render 'links_notimplemented'
|
||||
end
|
||||
|
||||
def search
|
||||
|
||||
unless params['query'].nil? || params['query'].empty?
|
||||
@@ -54,8 +55,8 @@ class HomeController < ApplicationController
|
||||
end
|
||||
end
|
||||
def choose_contact_topics
|
||||
File.open("config/contact_topic.yml",'w'){|f| f.write(params[:themen].to_yaml)}
|
||||
redirect_to admin_home_index_path
|
||||
File.open("config/contact_topic.yml",'w'){|f| f.write(params[:themen].to_yaml)}
|
||||
redirect_to admin_home_index_path
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -86,6 +86,11 @@ class NeuigkeitenController < ApplicationController
|
||||
|
||||
end
|
||||
end
|
||||
def mail_preview
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
authorize! :publish, @neuigkeit
|
||||
render template: "news_mailer/neuigkeit_mail", layout: false
|
||||
end
|
||||
def edit
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
|
||||
@@ -109,8 +114,12 @@ class NeuigkeitenController < ApplicationController
|
||||
|
||||
|
||||
@nlink_search.flatten!
|
||||
|
||||
render action:"show"
|
||||
respond_to do |format|
|
||||
format.html { render action:"show" }
|
||||
format.js
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
def create_link
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
@@ -118,7 +127,7 @@ class NeuigkeitenController < ApplicationController
|
||||
Nlink.create(:link=>params[:link_type].constantize.find(params[:link_id]),:neuigkeit=>Neuigkeit.find(params[:id]))
|
||||
@nlinks=@neuigkeit.nlinks
|
||||
respond_to do |format|
|
||||
format.html { edirect_to action:"show" }
|
||||
format.html { redirect_to action:"show" }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,13 +4,18 @@ class RubrikenController < ApplicationController
|
||||
def index
|
||||
if can?(:showintern, Rubrik)
|
||||
@rubriken = Rubrik.all
|
||||
@neuigkeiten = Neuigkeit.recent
|
||||
@neuigkeiten = Neuigkeit.paginate(page: params[:page], per_page:3)
|
||||
else
|
||||
@rubriken = Rubrik.where(:public=>true)
|
||||
@neuigkeiten = Neuigkeit.public.recent
|
||||
end
|
||||
|
||||
@calentries= @rubriken.collect(&:calentries).flatten
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js {render action: :show}
|
||||
end
|
||||
|
||||
end
|
||||
def intern
|
||||
|
||||
@@ -26,14 +31,17 @@ class RubrikenController < ApplicationController
|
||||
@moderatoren=User.with_role(:newsmoderator,@rubrik)
|
||||
@calentries= @rubrik.calentries
|
||||
if can?(:showunpublished, Neuigkeit)
|
||||
@neuigkeiten = @rubrik.neuigkeiten
|
||||
@neuigkeiten = @rubrik.neuigkeiten.paginate(page: params[:page], per_page:3)
|
||||
else
|
||||
@neuigkeiten = @rubrik.neuigkeiten.published
|
||||
@neuigkeiten = @rubrik.neuigkeiten.published.paginate(page: params[:page], per_page:3)
|
||||
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
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ class ThemengruppenController < ApplicationController
|
||||
@toolbar_elements = []
|
||||
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()} if can? :new, Themengruppe
|
||||
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.manage_all'), :path=>verwalten_all_themengruppen_path()} if can? :verwalten_all, Themengruppe
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @themengruppen }
|
||||
|
||||
Reference in New Issue
Block a user