From c6e75842537280e6d31832e51e9a40635d995ca5 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Thu, 25 Jul 2013 20:10:25 +0200 Subject: [PATCH] =?UTF-8?q?Layout=20=C3=A4nderungen=20f=C3=BCr=20Modul=20u?= =?UTF-8?q?nd=20Modulgruppenindex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tabellenformatierung durch render-div kombination ersetzt, modul/lang- version für Modulanzeige mit Modulgruppen eingefügt --- app/views/modulgruppen/index.html.erb | 22 +----------------- app/views/moduls/_lang.html.erb | 32 ++++++++++++++++++++++++++ app/views/moduls/index.html.erb | 33 ++------------------------- 3 files changed, 35 insertions(+), 52 deletions(-) create mode 100755 app/views/moduls/_lang.html.erb diff --git a/app/views/modulgruppen/index.html.erb b/app/views/modulgruppen/index.html.erb index 871c406..fb37c87 100755 --- a/app/views/modulgruppen/index.html.erb +++ b/app/views/modulgruppen/index.html.erb @@ -1,29 +1,9 @@

<%= I18n.t("modulgruppe.show.title")%>

- - - - - - - - - - <% @modulgruppen.sort_by{|n| n[:name]}.each do |modulgruppe| %> - - - - - - - - - + <%= render modulgruppe%> <% end %> -
TypePhaseStudiumName
<%= modulgruppe.typ %><%= modulgruppe.phase %><%= modulgruppe.studium.name unless modulgruppe.studium.nil? %><%= modulgruppe.name %><%= link_to 'Show', modulgruppe %><%= link_to 'Edit', edit_modulgruppe_path(modulgruppe) %><%= link_to 'Destroy', modulgruppe, method: :delete, data: { confirm: 'Are you sure?' } %>
-
<% if !@studium.nil? %> <%= link_to 'New Modulgruppe', new_studium_modulgruppe_path(@studium) %> diff --git a/app/views/moduls/_lang.html.erb b/app/views/moduls/_lang.html.erb new file mode 100755 index 0000000..1dbb929 --- /dev/null +++ b/app/views/moduls/_lang.html.erb @@ -0,0 +1,32 @@ +

+ <%= +if modul.name.nil? +name="" +else +name=modul.name +end +link_to "Modul "+name , modul_path(modul) %> +

+

+ <%= raw(modul.desc) %> +

+LVAs: + + + +Modulgruppen: + +<% # @toolbar_elements << {:icon=>:pencil,:text=>I18n.t("common.edit"),:path=> edit_modul_path(modul)} %> +
diff --git a/app/views/moduls/index.html.erb b/app/views/moduls/index.html.erb index 933d4a7..98ade7d 100755 --- a/app/views/moduls/index.html.erb +++ b/app/views/moduls/index.html.erb @@ -1,36 +1,7 @@ +

<%= I18n.t("modul.show.title") %>

- - - - - - - - - - -<% @moduls.sort_by{|n| n[:name]}.each do |modul| %> - - - - - - - - - -<% end %> -
Modulgruppe (Studium)NameDesc
- <%modul.modulgruppen.sort_by{|n| n[:name]}.each do |m|%> - - - <%=m.name unless m.nil? %> (<%=m.studium.name unless m.studium.nil? %>) - -
- <% end %> - -
<%= modul.name %><%= modul.desc %><%= link_to 'Show', modul_path(modul) %><%= link_to 'Edit', edit_modul_path(modul) %><%= link_to 'Destroy', [modul], method: :delete, data: { confirm: 'Are you sure?' } %>
+<%= render :partial=>'moduls/lang', :collection=>@moduls, :as=>:modul%>
<% #if !@studium.nil? %>