thema verwalten added
This commit is contained in:
4
Gemfile
4
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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<h1><%=@lva.typ.to_s + ' ' + @lva.name %></h1>
|
||||
|
||||
<h2>Prüfungsinformation</h2>
|
||||
<div class="">
|
||||
<%= @lva.pruefungsinformation.html_safe %>
|
||||
</div>
|
||||
|
||||
<h2>Lernaufwand</h2>
|
||||
<div class="">
|
||||
<%= @lva.lernaufwand %>
|
||||
@@ -16,14 +18,19 @@
|
||||
<div class="">
|
||||
<%= @lva.desc.to_s.html_safe %>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
|
||||
<h2>Beispiele</h2>
|
||||
<% @lva.beispiele.each do |b| %>
|
||||
<%= render b%>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<% unless @lva.nlinks.empty? %>
|
||||
<h2>Neuigkeiten</h2>
|
||||
<% @lva.nlinks.each do |l| %>
|
||||
<%= render l.neuigkeit %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="span4">
|
||||
<div class="contentbox">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
|
||||
Siehe auch:
|
||||
<ul>
|
||||
<ul class="unstyled">
|
||||
<div id="nlink_list">
|
||||
<%= render partial: "nlink_list", collection: @neuigkeit.nlinks %>
|
||||
</div>
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
@small_elements = []
|
||||
@small_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small} if can? :edit, small
|
||||
@small_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('thema.remove'), :path=>small, :method=>:delete,:confirm=>I18n.t('thema.sure')} if can? :delete, small %>
|
||||
<%= render :partial=>'layouts/pretty_toolbar', :object=>@small_elements unless @small_elements.empty? %>
|
||||
<% render :partial=>'layouts/pretty_toolbar', :object=>@small_elements unless @small_elements.empty? %>
|
||||
|
||||
@@ -1,24 +1,9 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
<%= link_to "Zurück", @thema.themengruppe %>
|
||||
<br>
|
||||
<%= render :partial=>"themen/small", :object=>@thema %>
|
||||
|
||||
<h1><%= @thema.title %></h1>
|
||||
<p>
|
||||
<%= raw(@thema.text) %>
|
||||
</p>
|
||||
|
||||
<!--
|
||||
<%= link_to 'Edit', edit_thema_path(@thema) %> |
|
||||
<%= link_to 'Back', themengruppe_path(@thema.themengruppe) %>
|
||||
-->
|
||||
<%= render :partial=>'layouts/pretty_toolbar' %>
|
||||
|
||||
<%= render :partial=>'themen/fragen' %>
|
||||
<!--
|
||||
<%= link_to 'Neue Frage', new_frage_path %> <br/>
|
||||
-->
|
||||
<br/>
|
||||
|
||||
<h2><%= I18n.t('attachment.title')%>:</h2>
|
||||
<div id="attachmentform">
|
||||
</div>
|
||||
<%= link_to new_thema_attachment_path(@thema) ,:remote=>true do %> new Attachment <% end %>
|
||||
<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="content-wrap content-column" >
|
||||
<h2>sdffs</h2>
|
||||
<h2>sdffs2</h2>
|
||||
<h1><%= @themengruppe.title %></h1>
|
||||
<p>
|
||||
<%= @themengruppe.text %>
|
||||
@@ -13,10 +13,19 @@
|
||||
</a>
|
||||
<% unless thema.gremium.nil? %>
|
||||
<p>
|
||||
<%= link_to "Zu dem Gremium ..." , thema.gremium %>
|
||||
<%= link_to fa_icon("users 2x")+" Zu dem Gremium ..." , thema.gremium %>
|
||||
</p>
|
||||
<% 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 %>
|
||||
|
||||
@@ -112,7 +112,10 @@
|
||||
end
|
||||
|
||||
resources :themen do
|
||||
member do
|
||||
get :fragen
|
||||
get :verwalten
|
||||
end
|
||||
resources :attachments
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user