Merge remote-tracking branch 'thomasb/master'
Conflicts: .gitignore
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -16,3 +16,7 @@
|
||||
/tmp
|
||||
/config/initializers/devise.rb
|
||||
/app/doc/*
|
||||
console
|
||||
/server
|
||||
/public/uploads/
|
||||
|
||||
|
||||
51
app/uploaders/beispieldatei_uploader.rb
Normal file
51
app/uploaders/beispieldatei_uploader.rb
Normal 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
|
||||
1
app/views/beispiele/_beispiel.html.erb
Normal file
1
app/views/beispiele/_beispiel.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%=link_to beispiel.name, beispiel.beispieldatei.url%>
|
||||
@@ -1,29 +1,9 @@
|
||||
<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| %>
|
||||
<tr>
|
||||
<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>
|
||||
<%= render modulgruppe%>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<% if !@studium.nil? %>
|
||||
<%= 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>
|
||||
|
||||
<table class="table" >
|
||||
<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>
|
||||
<%= render :partial=>'moduls/lang', :collection=>@moduls, :as=>:modul%>
|
||||
|
||||
<br />
|
||||
<% #if !@studium.nil? %>
|
||||
|
||||
Reference in New Issue
Block a user