diff --git a/.gitignore b/.gitignore index 2c9abc6..9679a17 100755 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ /tmp /config/initializers/devise.rb /app/doc/* +console +/server +/public/uploads/ + diff --git a/app/uploaders/beispieldatei_uploader.rb b/app/uploaders/beispieldatei_uploader.rb new file mode 100644 index 0000000..86da81e --- /dev/null +++ b/app/uploaders/beispieldatei_uploader.rb @@ -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 diff --git a/app/views/beispiele/_beispiel.html.erb b/app/views/beispiele/_beispiel.html.erb new file mode 100644 index 0000000..d15d58c --- /dev/null +++ b/app/views/beispiele/_beispiel.html.erb @@ -0,0 +1 @@ +<%=link_to beispiel.name, beispiel.beispieldatei.url%> 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? %>