forked from bofh/fetsite
GitHub Account angelegt
This commit is contained in:
13
app/views/studien/_form.html.erb
Normal file
13
app/views/studien/_form.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= tinymce_assets %>
|
||||
<%= semantic_form_for @studium do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :zahl %>
|
||||
<%= f.input :name,:append=>"NAME" %>
|
||||
<%= f.input :desc, :as=>:tinymce_text %>
|
||||
<%= f.input :typ, :as=>:radio, :collection=>["Bachelor","Master"]%>
|
||||
<% end %>
|
||||
<%= tinymce %>
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/studien/edit.html.erb
Normal file
6
app/views/studien/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing studium</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @studium %> |
|
||||
<%= link_to 'Back', studien_path %>
|
||||
31
app/views/studien/index.html.erb
Normal file
31
app/views/studien/index.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<h1><%= I18n.t("studien.list") %></h1>
|
||||
|
||||
<table class="table-striped">
|
||||
<tr>
|
||||
<th>Zahl</th>
|
||||
<th>Name</th>
|
||||
<th>Desc</th>
|
||||
<th>Typ</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @studien.each do |studium| %>
|
||||
|
||||
<tr>
|
||||
<td><%= studium.zahl %></td>
|
||||
<td><%= studium.name %></td>
|
||||
|
||||
<td><%= studium.typ %></td>
|
||||
<td><%= link_to 'Show', studium_path(studium) %></td>
|
||||
<td><%= link_to 'Edit', edit_studium_path(studium) %></td>
|
||||
<td><%= link_to 'Destroy', studium, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to I18n.t("studien.new"), new_studium_path %>
|
||||
5
app/views/studien/new.html.erb
Normal file
5
app/views/studien/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New studium</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', studien_index_path , :data=>{:locale=>I16n.locale}%>
|
||||
38
app/views/studien/show.html.erb
Normal file
38
app/views/studien/show.html.erb
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
<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| %>
|
||||
<div class="row-fluid">
|
||||
<% row.each do |modulgruppe| %>
|
||||
<div class="span<%= width%> min-width:13em;">
|
||||
<%= render modulgruppe %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% 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) %> |
|
||||
<%= link_to '<i class="icon-list"></i> Alle Studien'.html_safe, studien_path,:class=>"btn",:raw=>true %>
|
||||
</div></div>
|
||||
Reference in New Issue
Block a user