contact page new

This commit is contained in:
2014-07-23 22:57:14 +05:30
parent 4de0cfcd26
commit caebc36644
11 changed files with 87 additions and 47 deletions

View File

@@ -4,4 +4,6 @@ class ConfigController < ApplicationController
end
def choose_contact_topics
end
end

View File

@@ -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

View File

@@ -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

View File

@@ -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'

View File

@@ -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

View File

@@ -9,4 +9,12 @@
<%= semantic_form_for :set_page, url: fb_set_default_publish_page_user_path(current_user), html:{method: :get} do |f| %>
<%= f.input :page , :input_html => { :name => 'page' }%>
<% end %>
<%= semantic_form_for :set_thema, url: choose_contact_topics_home_index_path, html:{method: :get} do |f| %>
<%= f.input :themen, :input_html=> {:name=>'themen'}, :as=>:select ,:multiple=>true,:collection =>Thema.all%>
<%= f.actions do %>
<%= f.action :submit, :as => :button, :label=> I18n.t("common.save" ) %>
<% end %>
<% end %>
</p>

View File

@@ -1,12 +1,10 @@
<div class="content-column content-wrap">
<h1> <%= I18n.t "kontakt.H1" %></h1>
<p>
<%= I18n.t "kontakt.text" %>
</p>
<h2><%= I18n.t "kontakt.service" %></h2>
<%= raw(I18n.t( "kontakt.service_text")) %>
<h2><%= I18n.t "kontakt.adresse" %></h2>
<p><%= raw(I18n.t("kontakt.adresse_text")) %></p>
<p><%= raw(I18n.t ("kontakt.telefon_text")) %></p>
<% @themen.each do |th| %>
<%= render partial: "themen/small", object: th %>
<% end %>
</div>

View File

@@ -4,10 +4,17 @@
<div class="row-fluid">
<div class="span6">
<p>
<%= ffi1_icon "academic" %><%= link_to I18n.t('home.login'), user_omniauth_authorize_path(:ldap) %>
</p>
<ul class="linklist">
<li>
<%= link_to ffi1_icon("academic") + I18n.t('home.login'), user_omniauth_authorize_path(:ldap) ,class: :linkbox %>
</li>
<li>
<%= link_to "Entwicklungsstatus" , dev_home_index_path ,class: :linkbox %>
</li>
<li>
<%= link_to "FAQS", faqs_themengruppen_path,class: :btn ,class: :linkbox %>
</li>
</ul>
<div class="alert">
<h2>Beta Test</h2>
<p>Die Webseite befindet sich derzeit in einem Entwicklungsstadium,
@@ -28,9 +35,7 @@
</p>
</div>
<%= link_to "Entwicklungsstatus" , dev_home_index_path %>
<p>
<%= link_to "FAQS", faqs_themengruppen_path,class: :btn %>
</p>
<%= render 'beispiele' %>

View File

@@ -1,5 +1,5 @@
<h1><%= @themengruppe.title %></h1>
<h1><% unless @themengruppe.icon.nil? or @themengruppe.icon.empty? %> <i class="<%= @themengruppe.icon %>" style="font-size:1.5em;margin:0"></i>
<% end %><%= @themengruppe.title %></h1>
<p>
<%= @themengruppe.text %>
</p>
@@ -14,13 +14,22 @@
</div>
<div id="collapse<%=thema.id%>" class="accordion-body<%= ' collapse' unless params['thema'].to_i==thema.id %>">
<div class="accordion-inner">
<% unless thema.gremium.nil? %>
<p><%= link_to "Zu dem Gremium ..." , thema.gremium %>
</p>
<% end %>
<%= render :partial => 'themen/small', :object => thema %>
<ul class="unstyled">
<% unless thema.gremium.nil? %>
<li>
<%= link_to fa_icon("users 2x")+thema.gremium.name , thema.gremium,:class=>"linkbox" %>
</li>
<% end %>
<% thema.nlinks.each do |l| %>
<li>
<%= render l.neuigkeit if can? :show, l.neuigkeit%>
</li>
<% end %>
</ul>
</div>
</div>
</div>

View File

@@ -73,6 +73,7 @@ Fetsite::Application.routes.draw do
get 'beispiel_sammlung'
get 'compare_tiss'
get 'load_tiss'
get 'verwalten'
end
resources :beispiele#, :only=>[:show,:index,:create]
@@ -136,6 +137,7 @@ Fetsite::Application.routes.draw do
get 'startdev'
get 'linksnotimplemented'
get 'kontakt'
get 'choose_contact_topics'
end
end