forked from bofh/fetsite
Layout änderungen für Modul und Modulgruppenindex
Tabellenformatierung durch render-div kombination ersetzt, modul/lang- version für Modulanzeige mit Modulgruppen eingefügt
This commit is contained in:
@@ -1,29 +1,9 @@
|
|||||||
<h1><%= I18n.t("modulgruppe.show.title")%></h1>
|
<h1><%= I18n.t("modulgruppe.show.title")%></h1>
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<th>Type</th>
|
|
||||||
<th>Phase</th>
|
|
||||||
<th>Studium</th>
|
|
||||||
<th>Name</th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<% @modulgruppen.sort_by{|n| n[:name]}.each do |modulgruppe| %>
|
<% @modulgruppen.sort_by{|n| n[:name]}.each do |modulgruppe| %>
|
||||||
<tr>
|
<%= render modulgruppe%>
|
||||||
<td><%= modulgruppe.typ %></td>
|
|
||||||
<td><%= modulgruppe.phase %></td>
|
|
||||||
<td><%= modulgruppe.studium.name unless modulgruppe.studium.nil? %></td>
|
|
||||||
<td><%= modulgruppe.name %></td>
|
|
||||||
<td><%= link_to 'Show', modulgruppe %></td>
|
|
||||||
<td><%= link_to 'Edit', edit_modulgruppe_path(modulgruppe) %></td>
|
|
||||||
<td><%= link_to 'Destroy', modulgruppe, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<% if !@studium.nil? %>
|
<% if !@studium.nil? %>
|
||||||
<%= link_to 'New Modulgruppe', new_studium_modulgruppe_path(@studium) %>
|
<%= link_to 'New Modulgruppe', new_studium_modulgruppe_path(@studium) %>
|
||||||
|
|||||||
32
app/views/moduls/_lang.html.erb
Executable file
32
app/views/moduls/_lang.html.erb
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
<div style="border: solid 1px; padding:2px"><p>
|
||||||
|
<b><%=
|
||||||
|
if modul.name.nil?
|
||||||
|
name=""
|
||||||
|
else
|
||||||
|
name=modul.name
|
||||||
|
end
|
||||||
|
link_to "Modul "+name , modul_path(modul) %> </b>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<%= raw(modul.desc) %>
|
||||||
|
</p>
|
||||||
|
LVAs:
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<% modul.lvas.each do |lv| %>
|
||||||
|
<li>
|
||||||
|
<%= link_to lv.name.to_s, lva_path(lv.id) %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
Modulgruppen:
|
||||||
|
<ul>
|
||||||
|
<% modul.modulgruppen.each do |mg| %>
|
||||||
|
<li> <%=mg.name%> (<%= mg.studium.name unless mg.studium.nil?%>)</li>
|
||||||
|
<%end%>
|
||||||
|
</ul>
|
||||||
|
<% # @toolbar_elements << {:icon=>:pencil,:text=>I18n.t("common.edit"),:path=> edit_modul_path(modul)} %>
|
||||||
|
</div>
|
||||||
@@ -1,36 +1,7 @@
|
|||||||
|
|
||||||
<h1><%= I18n.t("modul.show.title") %></h1>
|
<h1><%= I18n.t("modul.show.title") %></h1>
|
||||||
|
|
||||||
<table class="table" >
|
<%= render :partial=>'moduls/lang', :collection=>@moduls, :as=>:modul%>
|
||||||
<tr>
|
|
||||||
<th>Modulgruppe (Studium)</th>
|
|
||||||
<th>Name</th>
|
|
||||||
<th>Desc</th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<% @moduls.sort_by{|n| n[:name]}.each do |modul| %>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<%modul.modulgruppen.sort_by{|n| n[:name]}.each do |m|%>
|
|
||||||
|
|
||||||
|
|
||||||
<%=m.name unless m.nil? %> (<%=m.studium.name unless m.studium.nil? %>)
|
|
||||||
<!-- Modulgruppenname falls existiert (Studium falls existiert) -->
|
|
||||||
<br>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td><%= modul.name %></td>
|
|
||||||
<td><%= modul.desc %></td>
|
|
||||||
<td><%= link_to 'Show', modul_path(modul) %></td>
|
|
||||||
<td><%= link_to 'Edit', edit_modul_path(modul) %></td>
|
|
||||||
<td><%= link_to 'Destroy', [modul], method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<% #if !@studium.nil? %>
|
<% #if !@studium.nil? %>
|
||||||
|
|||||||
Reference in New Issue
Block a user