Merge remote-tracking branch 'thomasb/master'

Conflicts:
	.gitignore
This commit is contained in:
2013-07-26 00:44:11 +02:00
6 changed files with 91 additions and 52 deletions

4
.gitignore vendored
View File

@@ -16,3 +16,7 @@
/tmp /tmp
/config/initializers/devise.rb /config/initializers/devise.rb
/app/doc/* /app/doc/*
console
/server
/public/uploads/

View File

@@ -0,0 +1,51 @@
# encoding: utf-8
class BeispieldateiUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
# include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage :file
# storage :fog
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url
# # For Rails 3.1+ asset pipeline compatibility:
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
#
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
# end
# Process files as they are uploaded:
# process :scale => [200, 300]
#
# def scale(width, height)
# # do something
# end
# Create different versions of your uploaded files:
# version :thumb do
# process :scale => [50, 50]
# end
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
# def extension_white_list
# %w(jpg jpeg gif png)
# end
# Override the filename of the uploaded files:
# Avoid using model.id or version_name here, see uploader/store.rb for details.
# def filename
# "something.jpg" if original_filename
# end
end

View File

@@ -0,0 +1 @@
<%=link_to beispiel.name, beispiel.beispieldatei.url%>

View File

@@ -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
View 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>

View File

@@ -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? %>