From fe32c2102b01de6f4b1ca3ad63b8612337aea24c Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Thu, 9 Jul 2015 16:03:02 +0200 Subject: [PATCH] AutoCommit Don Jul 9 16:03:02 CEST 2015 --- app/controllers/home_controller.rb | 3 + .../themes/blue2/layouts/application.html.erb | 65 +++++++++++++++++++ app/views/themes/blue2/layouts/menu.html.erb | 62 ++++++++++++++++++ config/routes.rb | 2 +- 4 files changed, 131 insertions(+), 1 deletion(-) create mode 100755 app/views/themes/blue2/layouts/application.html.erb create mode 100644 app/views/themes/blue2/layouts/menu.html.erb diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 17fa2ca..0d30d5d 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -94,7 +94,10 @@ class HomeController < ApplicationController format.js end end + def language + end def choose_contact_topics + authorize! :doadmin, User t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml") unless params[:themen].nil? t=([t].flatten+params[:themen]).uniq diff --git a/app/views/themes/blue2/layouts/application.html.erb b/app/views/themes/blue2/layouts/application.html.erb new file mode 100755 index 0000000..533cfef --- /dev/null +++ b/app/views/themes/blue2/layouts/application.html.erb @@ -0,0 +1,65 @@ + + + + + "> + + + + + <%= stylesheet_link_tag "themes/"+theme_name+"/application", :media => "all" unless theme_name.empty? %> + <%= stylesheet_link_tag "application", :media=>"all" if theme_name.empty? %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tags %> + <% if content_for?(:header) %> + <%= yield :header %> + <% else %> + Fetsite + <% end %> + + + +
+
+
+ <% cache("menu_u"+user_signed_in?.to_s+current_user.try(:id).to_s+"l"+I18n.locale.to_s+ can?(:seeintern, User).to_s+ can?(:index,Gallery).to_s+params[:theme].to_s, expires_in: 24.hours) do %> +
+
+ <%= link_to home_index_path do %> + + <%= image_tag('/logo2014_64.png',{:style=>"float:left;height:50px",:height=>"50"}) %> + <% end %> +
+
+ <%= image_tag('/logo2014_64.png',{:style=>"float:left;height:50px",:height=>"50"}) %> +
+
+ Fachschaft Elektrotechnik +
+
+ + +
+ <% end %> +
+
+
+
+ <%= yield %> +
+
+
+ + + diff --git a/app/views/themes/blue2/layouts/menu.html.erb b/app/views/themes/blue2/layouts/menu.html.erb new file mode 100644 index 0000000..5f3640b --- /dev/null +++ b/app/views/themes/blue2/layouts/menu.html.erb @@ -0,0 +1,62 @@ + + diff --git a/config/routes.rb b/config/routes.rb index 892b23f..0157db5 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,7 @@ devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } resources :home, :only=>[:index] do end - + get ':locale', constraints: {locale: /en|de/}, action: :language,controller: :home, as: "language" scope '(:locale)/admin' do resources :users, :only=>[] do collection do