contact page new
This commit is contained in:
@@ -4,4 +4,6 @@ class ConfigController < ApplicationController
|
||||
|
||||
end
|
||||
|
||||
def choose_contact_topics
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,6 +8,8 @@ class HomeController < ApplicationController
|
||||
|
||||
end
|
||||
def kontakt
|
||||
t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml")
|
||||
@themen = Thema.where(:id=>t)
|
||||
end
|
||||
def intern
|
||||
authorize! :seeintern, User
|
||||
@@ -51,4 +53,9 @@ class HomeController < ApplicationController
|
||||
format.js
|
||||
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
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class LvasController < ApplicationController
|
||||
# GET /lvas
|
||||
require 'zip'
|
||||
before_filter :load_toolbar, :only => [:show]
|
||||
before_filter :load_toolbar, :only => [:verwalten]
|
||||
load_and_authorize_resource
|
||||
def index
|
||||
@lvas = Lva.all
|
||||
@@ -43,6 +43,15 @@ class LvasController < ApplicationController
|
||||
def show
|
||||
@lva = Lva.find_by_id(params[:id])
|
||||
@beispiel=Beispiel.new
|
||||
@toolbar_elements =[]
|
||||
@toolbar_elements<<{:hicon=>'icon-pencil', :icon=>:pencil,:text =>I18n.t('common.manage'),:path => verwalten_lva_path(@lva)} if can? :verwalten, @lva
|
||||
|
||||
end
|
||||
def verwalten
|
||||
@lva = Lva.find_by_id(params[:id])
|
||||
@beispiel=Beispiel.new
|
||||
|
||||
render :show
|
||||
end
|
||||
|
||||
# GET /lvas/new
|
||||
|
||||
@@ -69,7 +69,7 @@ class NeuigkeitenController < ApplicationController
|
||||
unless @neuigkeit.published?
|
||||
redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit muss veröffentlicht sein um sie auf Facebook zu posten.'
|
||||
else
|
||||
page=YAML.load_file("#{::Rails.root.to_s}/tmp/page.yml")
|
||||
page=YAML.load_file("#{::Rails.root.to_s}/config/page.yml")
|
||||
page.feed!(:access_token=>page.access_token, :message=>@neuigkeit.text_first_words, :name=>@neuigkeit.title, :link=>rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit)+".html", :picture=>@neuigkeit.picture.url)
|
||||
|
||||
redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit auf Facebook gepostet'
|
||||
|
||||
@@ -17,7 +17,7 @@ class UsersController < ApplicationController
|
||||
redirect_to intern_home_index_path
|
||||
else
|
||||
@fbu=FbGraph::User.new(current_user.uid.to_s).fetch(:access_token=>session["fbuser_access_token"])
|
||||
File.open("tmp/page.yml",'w'){|f| f.write(@fbu.accounts(:access_token=>session["fbuser_access_token"]).select { |p| p.name == params["page"] }.first.to_yaml)}
|
||||
File.open("config/page.yml",'w'){|f| f.write(@fbu.accounts(:access_token=>session["fbuser_access_token"]).select { |p| p.name == params["page"] }.first.to_yaml)}
|
||||
logger.debug @fbu.to_s
|
||||
redirect_to admin_home_index_path
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user