forked from bofh/fetsite
fixed studien Ansicht und Modulgruppen
This commit is contained in:
@@ -6,11 +6,24 @@ class StudienController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
@studium= Studium.find(params[:id])
|
||||
end
|
||||
@studium= Studium.find(params[:id])
|
||||
@studienphasen=[]
|
||||
[1, 2 ,3].each do |ph|
|
||||
modulgruppen_phase=@studium.modulgruppen.where(:phase=>ph)
|
||||
|
||||
# GET /studia/new
|
||||
# GET /studia/new.json
|
||||
if modulgruppen_phase.count==1
|
||||
opts={:width=>12, :slice=>1}
|
||||
elsif modulgruppen_phase.count <= 4
|
||||
opts={:width=>6, :slice=>2}
|
||||
else
|
||||
opts={:width=>4, :slice=>3}
|
||||
end
|
||||
modulgruppen =[]
|
||||
modulgruppen_phase.each_slice(opts[:slice]) do |s| modulgruppen<<s end
|
||||
@studienphasen << {:modulgruppen=>modulgruppen, :phase => ph}.merge(opts)
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@studium = Studium.new
|
||||
end
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
</div>
|
||||
|
||||
|
||||
<span class="label">Aktionen</span>
|
||||
<span class="label"><%= I18n.t("common.actions")%></span>
|
||||
<div class="btn-group">
|
||||
<%= link_to 'Add Modul', new_modul_path(:modulgruppen_id =>@modulgruppe.id),:class =>"btn" %>
|
||||
<%= link_to 'Studium', studium_path(@modulgruppe.studium),:class =>"btn" %>
|
||||
<%= link_to 'Edit', edit_modulgruppe_path(@modulgruppe),:class =>"btn" %>
|
||||
<%= link_to 'Back', modulgruppen_path,:class =>"btn" %>
|
||||
<%= link_to I18n.t("modulgruppe.addmodul"), new_modul_path(:modulgruppen_id =>@modulgruppe.id),:class =>"btn" %>
|
||||
<%= link_to I18n.t("modulgruppe.studium"), studium_path(@modulgruppe.studium),:class =>"btn" %>
|
||||
<%= link_to I18n.t("common.edit"), edit_modulgruppe_path(@modulgruppe),:class =>"btn" %>
|
||||
|
||||
</div>
|
||||
@@ -1,28 +1,13 @@
|
||||
|
||||
<div class="container-fluid">
|
||||
<p id="notice"><%= notice %></p>
|
||||
<h1><%= @studium.typ %> <%= @studium.name %> (<%= @studium.zahl %>)</h1>
|
||||
<%= raw(@studium.desc) %>
|
||||
<% [1, 2 ,3].each do |ph| %>
|
||||
|
||||
<% ph_mod = @studium.modulgruppen.where(:phase=>ph)
|
||||
if ph_mod.count==1
|
||||
width=12
|
||||
slice=1
|
||||
elsif ph_mod.count <= 4
|
||||
width=6
|
||||
slice=2
|
||||
else
|
||||
width=4
|
||||
slice=3
|
||||
end
|
||||
|
||||
|
||||
%>
|
||||
|
||||
<% ph_mod.each_slice(slice) do |row| %>
|
||||
<% @studienphasen.each do |sp| %>
|
||||
<% sp[:modulgruppen].each do |row| %>
|
||||
<div class="row-fluid">
|
||||
<% row.each do |modulgruppe| %>
|
||||
<div class="span<%= width%> min-width:13em;">
|
||||
<div class="span<%= sp[:width]%> min-width:13em;">
|
||||
<%= render modulgruppe %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -31,8 +16,9 @@
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<%= link_to 'New Modulgruppe', new_studium_modulgruppe_path(@studium) %> |
|
||||
<%= link_to 'Edit', edit_studium_path(@studium) %> |
|
||||
<span class="span12">
|
||||
<%= link_to 'New Modulgruppe', new_studium_modulgruppe_path(@studium),:class=>"btn" %> |
|
||||
<%= link_to I18n.t("common.edit"), edit_studium_path(@studium) ,:class=>"btn"%> |
|
||||
<%= link_to '<i class="icon-list"></i> Alle Studien'.html_safe, studien_path,:class=>"btn",:raw=>true %>
|
||||
</span>
|
||||
</div></div>
|
||||
1
config/initializers/locale.rb
Normal file
1
config/initializers/locale.rb
Normal file
@@ -0,0 +1 @@
|
||||
I18n.default_locale = :de
|
||||
@@ -2,15 +2,22 @@
|
||||
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
||||
de:
|
||||
hello: "Hallo Welt"
|
||||
|
||||
common:
|
||||
edit: "Bearbeiten"
|
||||
actions: "Aktionen"
|
||||
|
||||
studien:
|
||||
list: "Studien der Fakultät Elektrotechnik"
|
||||
new: "Neues Studium"
|
||||
modul:
|
||||
edit:
|
||||
title: "Bearbeite Modul"
|
||||
|
||||
modulgruppe:
|
||||
typ: "Typ"
|
||||
addmodul: "Neues Modul hinzufügen"
|
||||
studium: "Studium"
|
||||
|
||||
home:
|
||||
mtitle: "Menu"
|
||||
hallobeiderfet: "Du bist auf er Seite der Fachschaft Elektrotechnik der TU Wien"
|
||||
@@ -18,7 +25,6 @@ de:
|
||||
studien: "Studien"
|
||||
news: "News"
|
||||
info: "Information"
|
||||
|
||||
rubrik:
|
||||
moderatoradded: "Neuen Moderator hinzugefügt!"
|
||||
moderatoraddnorights: "Keine Berechtigung neue Moderatoren hinzuzufügen!"
|
||||
|
||||
Reference in New Issue
Block a user