diff --git a/Gemfile b/Gemfile index 8a0a201..9bde7ec 100755 --- a/Gemfile +++ b/Gemfile @@ -33,7 +33,7 @@ gem 'jquery-rails' # Use unicorn as the app server # gem 'unicorn' -# Deploy with Capistrano +# Deploy with Capistran # gem 'capistrano' # To use debugger @@ -87,7 +87,7 @@ gem 'rmagick' gem 'bootstrap-addons-rails' gem "jquery-fileupload-rails" gem "jquery-ui-rails","~> 4.1.1" - +gem "font-awesome-rails" # gem "jquery-sortable-rails" gem "seed_dump", "~> 0.5.3" #gem "themes_for_rails" ,:git =>'git://github.com/tkriplean/themes_for_rails.git' diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index 9b84e0a..4e63f18 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -16,16 +16,27 @@ class ThemenController < ApplicationController # GET /themen/1.json def show @thema = Thema.find(params[:id]) + redirect_to :controller=>'themengruppen', :id=>@thema.themengruppe.id, :action=>:show, :anchor=> params[:id].to_s @fragen=@thema.fragen + @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}] + @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}] @toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('thema.remove'), :path=>thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')} - respond_to do |format| - format.html # show.html.erb - format.json { render json: @thema } - end + # respond_to do |format| + # format.html # show.html.erb + # format.json { render json: @thema } + # end end + def verwalten + @thema = Thema.find(params[:id]) + @fragen=@thema.fragen + @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}] + @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}] + @toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('thema.remove'), :path=>thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')} + + end # GET /themen/new # GET /themen/new.json def new diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index 69667d5..5735a58 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -4,10 +4,12 @@
<%= notice %>
+<%= link_to "Zurück", @thema.themengruppe %> +- <%= raw(@thema.text) %> -
- - <%= render :partial=>'layouts/pretty_toolbar' %> -<%= render :partial=>'themen/fragen' %> - -<%= @themengruppe.text %> @@ -13,10 +13,19 @@ <% unless thema.gremium.nil? %>
- <%= link_to "Zu dem Gremium ..." , thema.gremium %> + <%= link_to fa_icon("users 2x")+" Zu dem Gremium ..." , thema.gremium %>
<% end %> <%= render :partial => 'themen/small', :object => thema %> +tools: + <% + @small_elements2 = [] + @small_elements2 << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('common.verwalten'), :path=>verwalten_thema_path(thema)} if can? :edit, thema + + %> + <%= render :partial=>'layouts/pretty_toolbar', :object=>@small_elements2 unless @small_elements2.empty? %> + + <% thema.nlinks.each do |l| %> <%= render l.neuigkeit %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index b3af66c..69cc67e 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -112,8 +112,11 @@ end resources :themen do - get :fragen - resources :attachments + member do + get :fragen + get :verwalten + end + resources :attachments end resources :themengruppen do