Studienansicht neu
This commit is contained in:
@@ -13,8 +13,6 @@ end
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@studium= Studium.find(params[:id])
|
@studium= Studium.find(params[:id])
|
||||||
@text = 'Zu Semesteransicht wechseln'
|
|
||||||
@path = studium_semesteransicht_path(@studium)
|
|
||||||
|
|
||||||
@studienphasen=[]
|
@studienphasen=[]
|
||||||
[1, 2 ,3].each do |ph|
|
[1, 2 ,3].each do |ph|
|
||||||
@@ -41,13 +39,14 @@ def show
|
|||||||
@toolbar_modulgruppen =[ {:hicon=>'icon-plus-sign', :text=> I18n.t('modulgruppe.new'), :path=>new_studium_modulgruppe_path(@studium)},
|
@toolbar_modulgruppen =[ {:hicon=>'icon-plus-sign', :text=> I18n.t('modulgruppe.new'), :path=>new_studium_modulgruppe_path(@studium)},
|
||||||
{:hicon=>'icon-list', :text => I18n.t('modulgruppe.list'), :path=>modulgruppen_path}]
|
{:hicon=>'icon-list', :text => I18n.t('modulgruppe.list'), :path=>modulgruppen_path}]
|
||||||
|
|
||||||
@topbar_elements = [ {:hicon=>'icon-list', :text=>I18n.t("studien.allestudien"), :path=>studien_path},
|
if params[:ansicht] == 'semesteransicht'
|
||||||
{:text=>'Zur Semesteransicht wechseln', :path=>studium_semesteransicht_path(@studium)},
|
@text = 'Zu Modulansicht wechseln'
|
||||||
{:newline=>true}]
|
@flip = 'modulgruppenansicht'
|
||||||
for i in Studium.all
|
render 'semesteransicht'
|
||||||
@topbar_elements << {:text=>i.name, :path=>studium_path(i)}
|
else
|
||||||
|
@text = 'Zu Semesteransicht wechseln'
|
||||||
|
@flip = 'semesteransicht'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@@ -85,31 +84,13 @@ def show
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
def semesteransicht
|
|
||||||
@sem = 'true'
|
|
||||||
@studium = Studium.find(params[:id])
|
|
||||||
if @studium.nil?
|
|
||||||
@studium = Studium.first
|
|
||||||
end
|
|
||||||
@text = 'Zu Modulgruppenansicht wechseln'
|
|
||||||
@path = studium_path(@studium)
|
|
||||||
@topbar_elements = [ {:hicon=>'icon-list', :text=>I18n.t("studien.allestudien"), :path=>studien_path},
|
|
||||||
{:text=>'Zur Modulgruppenansicht wechseln', :path=>studium_path(@studium)},
|
|
||||||
{:newline=>true}]
|
|
||||||
for i in Studium.all
|
|
||||||
@topbar_elements << {:text=>i.name, :path=>studium_semesteransicht_path(i)}
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@toolbar_elements = [ {:icon=>:plus, :hicon =>'icon-plus-sign' ,:text=> I18n.t('studien.new') , :path => new_studium_path(@studium) },
|
|
||||||
{:icon=>:pencil, :hicon=>'icon-pencil',:text =>I18n.t('common.edit'),:path => edit_studium_path(@studium)},
|
|
||||||
{:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => studium_path(@studium), :method=> :delete,:confirm=>"Sure?" }]
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@studium = Studium.find(params[:id])
|
@studium = Studium.find(params[:id])
|
||||||
@studium.destroy
|
@studium.destroy
|
||||||
redirect_to studien_url
|
redirect_to studien_url
|
||||||
end
|
end
|
||||||
|
def default_url_options
|
||||||
|
{ansicht: params[:ansicht]}.merge(super)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<!-- <h4>Module</h4>
|
<h4>Module</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<% @lva.modul.each do |modul| %>
|
<% @lva.modul.each do |modul| %>
|
||||||
<li><b><%= link_to modul.name , modul_path(modul)%></b>
|
<li><b><%= link_to modul.name , modul_path(modul)%></b>
|
||||||
@@ -31,6 +31,6 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul> -->
|
</ul>
|
||||||
<%= render 'layouts/pretty_toolbar' %>
|
<%= render 'layouts/pretty_toolbar' %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<%= render 'layouts/topbar'%>
|
<%= render 'layouts/topbar'%>
|
||||||
<%= render 'layouts/topbar', :topbar=>@tb%>
|
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
<%= render @modul %>
|
<%= render @modul %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<div class="studium">
|
<div class="studium">
|
||||||
<h2><%= link_to studium.name + " " + studium.zahl.to_s, studium_semesteransicht_path(studium)%></h2> <p><b><%= studium.typ%> </b></p>
|
<h2><%= link_to studium.name + " " + studium.zahl.to_s, studium_path(studium, :ansicht=>'semesteransicht')%></h2> <p><b><%= studium.typ%> </b></p>
|
||||||
<p><b>Beschreibung:</b><br>
|
<p><b>Beschreibung:</b><br>
|
||||||
<%= !(studium.desc.to_s == "") ? studium.desc.html_safe : I18n.t("keine.beschreibung")%></p>
|
<%= !(studium.desc.to_s == "") ? studium.desc.html_safe : I18n.t("keine.beschreibung")%></p>
|
||||||
<div><%=link_to "Link zur Modulgruppenansicht",studium_path(studium) %> </div>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
18
app/views/studien/_tabs.html.erb
Normal file
18
app/views/studien/_tabs.html.erb
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<% if @studium.nil? %>
|
||||||
|
<li class="active">
|
||||||
|
<% else %>
|
||||||
|
<li>
|
||||||
|
<% end %>
|
||||||
|
<%= link_to "Alle Studien", studien_path %> </li>
|
||||||
|
<% for s in Studium.all %>
|
||||||
|
<% if !@studium.nil? && s == @studium %>
|
||||||
|
<li class="active">
|
||||||
|
<%= link_to s.name, studium_path(s) %>
|
||||||
|
</li>
|
||||||
|
<% else %>
|
||||||
|
<li> <%= link_to s.name, studium_path(s) %></li>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</ul>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<%= render 'layouts/topbar' %>
|
<%= render 'studien/tabs' %>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<h1><%= I18n.t("studien.list") %></h1>
|
<h1><%= I18n.t("studien.list") %></h1>
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
<div class="container-fluid">
|
|
||||||
<%= render :partial=>'layouts/topbar'%>
|
|
||||||
<div class="row-fluid">
|
|
||||||
<h1><%= @studium.typ %> <%= @studium.name %> (<%= @studium.zahl %>)</h1>
|
|
||||||
<%= raw(@studium.desc) %>
|
|
||||||
<% @studium.semester.each do |sem| %>
|
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<%= render 'studien/tabs' %>
|
||||||
|
<div class="span6"> <h1><%= @studium.typ %> <%= @studium.name %> (<%= @studium.zahl %>)</h1></div>
|
||||||
|
<div class="span3 pull-right"><div class="pull-right"> <%= link_to @text, studium_path(@studium, :ansicht=>@flip), :class=>"btn" %></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%= raw(@studium.desc) %>
|
||||||
|
|
||||||
|
<% @studium.semester.each do |sem| %>
|
||||||
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<div class="modulgruppe_phase_1">
|
<div class="modulgruppe_phase_1">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
@@ -25,7 +30,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= render :partial=>'layouts/pretty_toolbar', :locals=>{:elements=>@toolbar_elements} %>
|
<%= render :partial=>'layouts/pretty_toolbar', :locals=>{:elements=>@toolbar_elements} %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<%= render 'layouts/topbar'%>
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
<%= render 'studien/tabs' %>
|
||||||
|
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
<h1><%= @studium.typ %> <%= @studium.name %> (<%= @studium.zahl %>)</h1>
|
<div class="span6"> <h1><%= @studium.typ %> <%= @studium.name %> (<%= @studium.zahl %>)</h1></div>
|
||||||
|
<div class="span3 pull-right"><div class="pull-right"><%= link_to @text, studium_path(@studium, :ansicht=>@flip), :class=>"btn" %></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
</div>
|
||||||
|
<div class="row-fluid">
|
||||||
<%= raw(@studium.desc) %>
|
<%= raw(@studium.desc) %>
|
||||||
<% @studienphasen.each do |sp| %>
|
<% @studienphasen.each do |sp| %>
|
||||||
<% sp[:modulgruppen].each do |row| %>
|
<% sp[:modulgruppen].each do |row| %>
|
||||||
@@ -18,7 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= render :partial=>'layouts/pretty_toolbar', :object=>@toolbar_modulgruppen %>
|
|
||||||
</div>
|
</div>
|
||||||
|
<%= render :partial=>'layouts/pretty_toolbar', :object=>@toolbar_modulgruppen %><br>
|
||||||
<%= render 'layouts/pretty_toolbar' %>
|
<%= render 'layouts/pretty_toolbar' %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,14 +20,17 @@ Fetsite::Application.routes.draw do
|
|||||||
get 'pages', :to =>'pages#show'
|
get 'pages', :to =>'pages#show'
|
||||||
scope '(:locale)' do
|
scope '(:locale)' do
|
||||||
|
|
||||||
resources :studien, :only=>[:show,:new,:edit,:update,:destroy]
|
resources :studien, :only=>[:new,:edit,:update,:destroy]
|
||||||
|
scope '(:ansicht)' do
|
||||||
|
resources :studien, :only=>[:show]
|
||||||
|
end
|
||||||
resources :modulgruppen,:only =>[:create,:index]
|
resources :modulgruppen,:only =>[:create,:index]
|
||||||
|
|
||||||
resources :studien,:except=>[:show,:new,:edit,:update,:destroy], :shallow=>true do
|
resources :studien,:except=>[:show,:new,:edit,:update,:destroy], :shallow=>true do
|
||||||
resources :modulgruppen, :path => "(:locale)/modulgruppen"
|
resources :modulgruppen, :path => "(:locale)/modulgruppen"
|
||||||
|
|
||||||
end
|
end
|
||||||
get 'studien/:id/semesteransicht', :controller=>:studien, :action=>:semesteransicht, :as=>'studium_semesteransicht'
|
# get 'studien/(:ansicht)/:id', :controller=>:studien, :action=>:show, :as=>'studium_ansicht'
|
||||||
resources :semesters
|
resources :semesters
|
||||||
resources :moduls
|
resources :moduls
|
||||||
resources :lvas
|
resources :lvas
|
||||||
|
|||||||
Reference in New Issue
Block a user