From 988efd9e6abe2420c6232cb9b7543a7ef0d4d78f Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Mon, 5 Aug 2013 14:54:31 +0200 Subject: [PATCH 01/53] Neues Beispiel Button --- app/controllers/beispiele_controller.rb | 6 ++++-- app/views/lvas/show.html.erb | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/beispiele_controller.rb b/app/controllers/beispiele_controller.rb index 7f117ce..48b7856 100755 --- a/app/controllers/beispiele_controller.rb +++ b/app/controllers/beispiele_controller.rb @@ -25,7 +25,8 @@ class BeispieleController < ApplicationController # GET /beispiele/new.json def new @beispiel = Beispiel.new - + @beispiel.lva = Lva.find(params[:lva_id]) + respond_to do |format| format.html # new.html.erb format.json { render json: @beispiel } @@ -40,8 +41,9 @@ class BeispieleController < ApplicationController # POST /beispiele # POST /beispiele.json def create + lvaid=params[:lva_id] + params.delete(:lva_id) @beispiel = Beispiel.new(params[:beispiel]) - respond_to do |format| if @beispiel.save format.html { redirect_to @beispiel, notice: 'Beispiel was successfully created.' } diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index 4f90f1c..f7a4bc7 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -17,6 +17,8 @@

<%= @lva.desc %> + +<%= link_to "Beispiel neu" , new_beispiel_path(:lva_id=>@lva.id) %>

- <%= params[:beispiel].nil? ? "Beispiele" : Beispiel.find(params[:beispiel]).name %> + <%= params[:beispiel].nil? ? I18n.t("filter.beispiel") : Beispiel.find(params[:beispiel]).name %> @@ -62,6 +62,7 @@ <% end %>
- <%= link_to 'Alle Filter Löschen', studien_verwalten_path(:studium=>nil, :modulgruppe=>nil, :modul=>nil, :lva=>nil, :beispiel=>nil), :class=>"btn" %> - + <%= link_to I18n.t("filter.reset"), studien_verwalten_path(:studium=>nil, :modulgruppe=>nil, :modul=>nil, :lva=>nil, :beispiel=>nil), :class=>"btn" %> + + diff --git a/app/views/studien/verwalten.html.erb b/app/views/studien/verwalten.html.erb index 9674023..ca64fe5 100644 --- a/app/views/studien/verwalten.html.erb +++ b/app/views/studien/verwalten.html.erb @@ -1,63 +1,89 @@
<%= render 'studien/tabs'%>
-
-

Verwaltung <%=@title%>

-
-
<%= render 'studien/verwalten_menu'%>
-
-
-
-
- <% @messages.flatten.each do |m| %>
- <%= m.to_s %> - <% end %> -
-
-
-

Studien <%= link_to "new", new_studium_path %>

- <% @studien.each do |s| %> - <%= link_to s.name, s %> <%= (s.valid?) ? "Gültig" : "Problemfall" %>
- <% end %> -
-
-

Modulgruppen <%= link_to 'new', new_studium_modulgruppe_path(Studium.first) unless Studium.first.nil? %>

- <% @modulgruppen.each do |mg| %> - <%= link_to mg.name, mg %><%=' ('+mg.studium.name.to_s+')' unless mg.studium.nil? %> <%= (mg.valid?) ? "Gültig" : "Problemfall" %>
- <% end %> -
-
-
-
-

Module <%= link_to "new", new_modul_path %>

- <% @module.each do |m| %> - <%= link_to m.name, m %> ( - <% m.modulgruppen.each do |mg| %> - <%=mg.name.to_s+ ' ' %> - <% end %> - ) | <%= (m.valid?) ? "Gültig" : "Problemfall" %>
- <% end %> - -
-
-

LVas <%= link_to "new", new_lva_path %>

- <% @lvas.each do |lva| %> - <%= link_to lva.name, lva %> | - <%= (lva.valid?) ? "Gültig" : "Problemfall" %>
- - <% end %> -
-
-

Beispiele <%= link_to "new", new_beispiel_path %>

- <% @beispiele.each do |b| %> - <%= link_to b.name, b %> - <% end %> +
+
+
+

<%= I18n.t("studien.verwaltung") %>

+ <%= I18n.t("filter.explanation").html_safe %> + <%= render 'studien/verwalten_menu' %> +
+ +
+
+

Studien <%= link_to "new", new_studium_path %>

+ <% @studien.each do |s| %> + <%= link_to s.name, s %> <%= (s.valid?) ? "Gültig" : "Problemfall" %>
+ <% end %> + +
+
+
+
+ +
+
+

Modulgruppen <%= link_to 'new', new_studium_modulgruppe_path(Studium.first) unless Studium.first.nil? %>

+ <% @modulgruppen.each do |mg| %> + <%= link_to mg.name, mg %> | <%= (mg.valid?) ? "Gültig" : "Problemfall" %>
+ <% end %> +
+
+
+
+

Module <%= link_to "new", new_modul_path %>

+ <% @module.each do |m| %> + <%= link_to m.name, m %> + | <%= (m.valid?) ? "Gültig" : "Problemfall" %>
+ <% end %> +
+
+
+
+

LVas <%= link_to "new", new_lva_path %>

+ <% @lvas.each do |lva| %> + <%= link_to lva.name, lva %> | + <%= (lva.valid?) ? "Gültig" : "Problemfall" %>
+ + <% end %> +
+
+
+
+

Beispiele <%= link_to "new", new_beispiel_path %>

+ <% @beispiele.each do |b| %> + <%= link_to b.name, b %> + <% end %> +
+
+ + + + +
+
+
+
+

Error Log

+
    +
  • Red: Error, Solve immediately
  • +
  • Black: Warning, should be solved
  • +
  • Green: Everything is fine
  • +
+
+
    + <% @messages.flatten.each do |m| %>
    +
  • <%= m.html_safe %>
  • + <% end %> +
+ <%= I18n.t("verwalten.fehler.keine").html_safe if @messages.empty?%> +
+
+
+
+
- - - - - +
diff --git a/config/locales/de.yml b/config/locales/de.yml index 84fa7a6..94ea21c 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -13,6 +13,7 @@ de: allestudien: "Alle Studien" loeschen: "Dieses Studium löschen" edit: "Studium bearbeiten" + verwaltung: "Studien verwalten" modul: edit: "Modul bearbeiten" list: "Alle Module" @@ -102,6 +103,19 @@ de: taken: "Der Name ist bereits vergeben" typ: inclusion: 'Wählen Sie "Bachelor" oder "Master" aus' - - + modul: + attributes: + modulgruppen: + blank: "Wählen Sie zumindest eine Modulgruppe aus" + filter: + explanation: "Per Dropdown-Menü kann nach einzelnen Objekten gefiltert werden. Die Filter können kombiniert werden, wobei nur erlaubte Kombinationen möglich sind. Solange validation-Fehler (im Log rot und fett) auftreten, keine Filter verwenden" + studium: "Studium" + modulgruppe: "Modulgruppe" + modul: "Modul" + lva: "Lva" + beispiel: "Beispiel" + reset: "Alle Filter zurücksetzen" + verwalten: + fehler: + keine: "Keine Fehlermeldungen oder Warnungen" From ae75459d58a14998e9e115be850537f99855140f Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Thu, 8 Aug 2013 09:08:43 +0200 Subject: [PATCH 08/53] Relationship Calentry,Calendar --- app/models/calendar.rb | 1 + app/models/calentry.rb | 10 ++++++++-- ...8062732_create_calendar_calentries_join_table.rb | 13 +++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20130808062732_create_calendar_calentries_join_table.rb diff --git a/app/models/calendar.rb b/app/models/calendar.rb index 5b55280..eaaa1a9 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -1,3 +1,4 @@ class Calendar < ActiveRecord::Base attr_accessible :name, :public + has_and_belongs_to_many :calentries end diff --git a/app/models/calentry.rb b/app/models/calentry.rb index 6e892ad..7d7ded6 100644 --- a/app/models/calentry.rb +++ b/app/models/calentry.rb @@ -1,4 +1,10 @@ class Calentry < ActiveRecord::Base - attr_accessible :ende, :start, :summary, :typ - + attr_accessible :ende, :start, :summary, :typ,:calendar_ids + has_and_belongs_to_many :calendar + def start_time + start + end + def name + summary + end end diff --git a/db/migrate/20130808062732_create_calendar_calentries_join_table.rb b/db/migrate/20130808062732_create_calendar_calentries_join_table.rb new file mode 100644 index 0000000..bbf0362 --- /dev/null +++ b/db/migrate/20130808062732_create_calendar_calentries_join_table.rb @@ -0,0 +1,13 @@ +class CreateCalendarCalentriesJoinTable < ActiveRecord::Migration + def up + create_table :calendars_calentries, :id=>false do |t| + t.integer :calentry_id + t.integer :calendar_id + end + add_index :calendars_calentries, [:calentry_id, :calendar_id] + add_index :calendars_calentries, :calendar_id + end + + def down + end +end From b329fa489603761a724a5d28c6a9a22c2d35acef Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Thu, 8 Aug 2013 09:09:34 +0200 Subject: [PATCH 09/53] simple_calendar, calender_show_view Kalender in Tabellenansicht --- Gemfile | 2 ++ app/controllers/calentries_controller.rb | 2 +- app/views/calendars/show.html.erb | 9 +++++++++ app/views/calentries/_form.html.erb | 1 + app/views/layouts/menu.html.erb | 4 ++-- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 7fce64e..d81643d 100755 --- a/Gemfile +++ b/Gemfile @@ -75,3 +75,5 @@ group :development, :test do gem 'factory_girl_rails' gem 'rspec-rails' end + +gem "simple_calendar", "~> 0.1.9" diff --git a/app/controllers/calentries_controller.rb b/app/controllers/calentries_controller.rb index 89990cd..3452d72 100644 --- a/app/controllers/calentries_controller.rb +++ b/app/controllers/calentries_controller.rb @@ -18,7 +18,7 @@ class CalentriesController < ApplicationController respond_to do |format| format.html # show.html.erb format.json { render json: @calentry } - format.ics { render 'show.ics.erb',} + format.ics { render 'show.ics.erb'} end end diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb index efadc5a..8778ca8 100644 --- a/app/views/calendars/show.html.erb +++ b/app/views/calendars/show.html.erb @@ -9,7 +9,16 @@ Public: <%= @calendar.public %>

+

+

    +<% @calendar.calentries.each do |entry| %> +<%= entry.summary+ "- " + entry.start.to_s %> +<% end %> +<%= calendar @calendar.calentries do |entry| %> +
    <%= link_to entry.name, entry %>
    +<% end %> +<%= link_to 'New Entry', new_calentry_path %> <%= link_to 'Edit', edit_calendar_path(@calendar) %> | <%= link_to 'Back', calendars_path %> diff --git a/app/views/calentries/_form.html.erb b/app/views/calentries/_form.html.erb index bd74e58..6dd64ad 100644 --- a/app/views/calentries/_form.html.erb +++ b/app/views/calentries/_form.html.erb @@ -3,6 +3,7 @@ <%= f.input :start %> <%= f.input :ende %> <%= f.input :summary %> + <%= f.input :calendar, :as=> :radio %> <%= f.input :typ %> <% end %> diff --git a/app/views/layouts/menu.html.erb b/app/views/layouts/menu.html.erb index bc71698..cd73c74 100755 --- a/app/views/layouts/menu.html.erb +++ b/app/views/layouts/menu.html.erb @@ -4,8 +4,8 @@
  • <%= link_to I18n.t(:news,:scope=>'home' ),rubriken_path %>
  • <%= link_to I18n.t(:info,:scope=>'home' ) %>
  • -
  • <%= link_to I18n.t(:studien,:scope=>'home' ), studien_path %> -
  • +
  • <%= link_to I18n.t(:studien,:scope=>'home' ), studien_path %>
  • +
  • <%= link_to "Kalender", calendars_path %>
  • <%= link_to "wiki intern", page_path(1) %>
From 8ec00d6a5658513069263a46d55d3aa8ac105089 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Thu, 8 Aug 2013 09:09:55 +0200 Subject: [PATCH 10/53] Lokalisierung date,time --- config/locales/de.yml | 201 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 4 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 84fa7a6..75fd73f 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -101,7 +101,200 @@ de: blank: "Geben Sie den Namen des Studiums ein" taken: "Der Name ist bereits vergeben" typ: - inclusion: 'Wählen Sie "Bachelor" oder "Master" aus' - - - + inclusion: 'Wählen Sie "Bachelor" oder "Master" aus' + + date: + abbr_day_names: + - So + - Mo + - Di + - Mi + - Do + - Fr + - Sa + abbr_month_names: + - + - Jan + - Feb + - Mär + - Apr + - Mai + - Jun + - Jul + - Aug + - Sep + - Okt + - Nov + - Dez + day_names: + - Sonntag + - Montag + - Dienstag + - Mittwoch + - Donnerstag + - Freitag + - Samstag + formats: + default: ! '%d.%m.%Y' + long: ! '%e. %B %Y' + short: ! '%e. %b' + month_names: + - + - Januar + - Februar + - März + - April + - Mai + - Juni + - Juli + - August + - September + - Oktober + - November + - Dezember + order: + - :day + - :month + - :year + datetime: + distance_in_words: + about_x_hours: + one: etwa eine Stunde + other: etwa %{count} Stunden + about_x_months: + one: etwa ein Monat + other: etwa %{count} Monate + about_x_years: + one: etwa ein Jahr + other: etwa %{count} Jahre + almost_x_years: + one: fast ein Jahr + other: fast %{count} Jahre + half_a_minute: eine halbe Minute + less_than_x_minutes: + one: weniger als eine Minute + other: weniger als %{count} Minuten + less_than_x_seconds: + one: weniger als eine Sekunde + other: weniger als %{count} Sekunden + over_x_years: + one: mehr als ein Jahr + other: mehr als %{count} Jahre + x_days: + one: ein Tag + other: ! '%{count} Tage' + x_minutes: + one: eine Minute + other: ! '%{count} Minuten' + x_months: + one: ein Monat + other: ! '%{count} Monate' + x_seconds: + one: eine Sekunde + other: ! '%{count} Sekunden' + prompts: + day: Tag + hour: Stunden + minute: Minuten + month: Monat + second: Sekunden + year: Jahr + errors: + format: ! '%{attribute} %{message}' + messages: + accepted: muss akzeptiert werden + blank: muss ausgefüllt werden + confirmation: stimmt nicht mit der Bestätigung überein + empty: muss ausgefüllt werden + equal_to: muss genau %{count} sein + even: muss gerade sein + exclusion: ist nicht verfügbar + greater_than: muss größer als %{count} sein + greater_than_or_equal_to: muss größer oder gleich %{count} sein + inclusion: ist kein gültiger Wert + invalid: ist nicht gültig + less_than: muss kleiner als %{count} sein + less_than_or_equal_to: muss kleiner oder gleich %{count} sein + not_a_number: ist keine Zahl + not_an_integer: muss ganzzahlig sein + odd: muss ungerade sein + record_invalid: ! 'Gültigkeitsprüfung ist fehlgeschlagen: %{errors}' + taken: ist bereits vergeben + too_long: ist zu lang (nicht mehr als %{count} Zeichen) + too_short: ist zu kurz (nicht weniger als %{count} Zeichen) + wrong_length: hat die falsche Länge (muss genau %{count} Zeichen haben) + template: + body: ! 'Bitte überprüfen Sie die folgenden Felder:' + header: + one: ! 'Konnte %{model} nicht speichern: ein Fehler.' + other: ! 'Konnte %{model} nicht speichern: %{count} Fehler.' + helpers: + select: + prompt: Bitte wählen + submit: + create: ! '%{model} erstellen' + submit: ! '%{model} speichern' + update: ! '%{model} aktualisieren' + number: + currency: + format: + delimiter: . + format: ! '%n %u' + precision: 2 + separator: ! ',' + significant: false + strip_insignificant_zeros: false + unit: € + format: + delimiter: . + precision: 2 + separator: ! ',' + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: ! '%n %u' + units: + billion: + one: Milliarde + other: Milliarden + million: Millionen + quadrillion: + one: Billiarde + other: Billiarden + thousand: Tausend + trillion: Billionen + unit: '' + format: + delimiter: '' + precision: 1 + significant: true + strip_insignificant_zeros: true + storage_units: + format: ! '%n %u' + units: + byte: + one: Byte + other: Bytes + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + precision: + format: + delimiter: '' + support: + array: + last_word_connector: ! ' und ' + two_words_connector: ! ' und ' + words_connector: ! ', ' + time: + am: vormittags + formats: + default: ! '%A, %d. %B %Y, %H:%M Uhr' + long: ! '%A, %d. %B %Y, %H:%M Uhr' + short: ! '%d. %B, %H:%M Uhr' + pm: nachmittags From 3b975461e6d4344cc27b956732b9097235e86de8 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Thu, 8 Aug 2013 09:09:55 +0200 Subject: [PATCH 11/53] Lokalisierung date,time --- config/locales/de.yml | 201 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 4 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 84fa7a6..75fd73f 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -101,7 +101,200 @@ de: blank: "Geben Sie den Namen des Studiums ein" taken: "Der Name ist bereits vergeben" typ: - inclusion: 'Wählen Sie "Bachelor" oder "Master" aus' - - - + inclusion: 'Wählen Sie "Bachelor" oder "Master" aus' + + date: + abbr_day_names: + - So + - Mo + - Di + - Mi + - Do + - Fr + - Sa + abbr_month_names: + - + - Jan + - Feb + - Mär + - Apr + - Mai + - Jun + - Jul + - Aug + - Sep + - Okt + - Nov + - Dez + day_names: + - Sonntag + - Montag + - Dienstag + - Mittwoch + - Donnerstag + - Freitag + - Samstag + formats: + default: ! '%d.%m.%Y' + long: ! '%e. %B %Y' + short: ! '%e. %b' + month_names: + - + - Januar + - Februar + - März + - April + - Mai + - Juni + - Juli + - August + - September + - Oktober + - November + - Dezember + order: + - :day + - :month + - :year + datetime: + distance_in_words: + about_x_hours: + one: etwa eine Stunde + other: etwa %{count} Stunden + about_x_months: + one: etwa ein Monat + other: etwa %{count} Monate + about_x_years: + one: etwa ein Jahr + other: etwa %{count} Jahre + almost_x_years: + one: fast ein Jahr + other: fast %{count} Jahre + half_a_minute: eine halbe Minute + less_than_x_minutes: + one: weniger als eine Minute + other: weniger als %{count} Minuten + less_than_x_seconds: + one: weniger als eine Sekunde + other: weniger als %{count} Sekunden + over_x_years: + one: mehr als ein Jahr + other: mehr als %{count} Jahre + x_days: + one: ein Tag + other: ! '%{count} Tage' + x_minutes: + one: eine Minute + other: ! '%{count} Minuten' + x_months: + one: ein Monat + other: ! '%{count} Monate' + x_seconds: + one: eine Sekunde + other: ! '%{count} Sekunden' + prompts: + day: Tag + hour: Stunden + minute: Minuten + month: Monat + second: Sekunden + year: Jahr + errors: + format: ! '%{attribute} %{message}' + messages: + accepted: muss akzeptiert werden + blank: muss ausgefüllt werden + confirmation: stimmt nicht mit der Bestätigung überein + empty: muss ausgefüllt werden + equal_to: muss genau %{count} sein + even: muss gerade sein + exclusion: ist nicht verfügbar + greater_than: muss größer als %{count} sein + greater_than_or_equal_to: muss größer oder gleich %{count} sein + inclusion: ist kein gültiger Wert + invalid: ist nicht gültig + less_than: muss kleiner als %{count} sein + less_than_or_equal_to: muss kleiner oder gleich %{count} sein + not_a_number: ist keine Zahl + not_an_integer: muss ganzzahlig sein + odd: muss ungerade sein + record_invalid: ! 'Gültigkeitsprüfung ist fehlgeschlagen: %{errors}' + taken: ist bereits vergeben + too_long: ist zu lang (nicht mehr als %{count} Zeichen) + too_short: ist zu kurz (nicht weniger als %{count} Zeichen) + wrong_length: hat die falsche Länge (muss genau %{count} Zeichen haben) + template: + body: ! 'Bitte überprüfen Sie die folgenden Felder:' + header: + one: ! 'Konnte %{model} nicht speichern: ein Fehler.' + other: ! 'Konnte %{model} nicht speichern: %{count} Fehler.' + helpers: + select: + prompt: Bitte wählen + submit: + create: ! '%{model} erstellen' + submit: ! '%{model} speichern' + update: ! '%{model} aktualisieren' + number: + currency: + format: + delimiter: . + format: ! '%n %u' + precision: 2 + separator: ! ',' + significant: false + strip_insignificant_zeros: false + unit: € + format: + delimiter: . + precision: 2 + separator: ! ',' + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: ! '%n %u' + units: + billion: + one: Milliarde + other: Milliarden + million: Millionen + quadrillion: + one: Billiarde + other: Billiarden + thousand: Tausend + trillion: Billionen + unit: '' + format: + delimiter: '' + precision: 1 + significant: true + strip_insignificant_zeros: true + storage_units: + format: ! '%n %u' + units: + byte: + one: Byte + other: Bytes + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + precision: + format: + delimiter: '' + support: + array: + last_word_connector: ! ' und ' + two_words_connector: ! ' und ' + words_connector: ! ', ' + time: + am: vormittags + formats: + default: ! '%A, %d. %B %Y, %H:%M Uhr' + long: ! '%A, %d. %B %Y, %H:%M Uhr' + short: ! '%d. %B, %H:%M Uhr' + pm: nachmittags From 33c3fea2bce27267462b51a57a0bedf0aff5e493 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Thu, 8 Aug 2013 15:23:12 +0200 Subject: [PATCH 12/53] Formatierung --- app/views/studien/verwalten.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/studien/verwalten.html.erb b/app/views/studien/verwalten.html.erb index ca64fe5..a834154 100644 --- a/app/views/studien/verwalten.html.erb +++ b/app/views/studien/verwalten.html.erb @@ -1,7 +1,7 @@
<%= render 'studien/tabs'%>
-
+
@@ -64,7 +64,7 @@
-
+

Error Log

    From 585af6f162b5b93a01c056dc2fe1e26ace84b0d6 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Fri, 9 Aug 2013 14:15:02 +0200 Subject: [PATCH 13/53] Lva form verbessert --- .../stylesheets/formtastic-changes.css.scss | 21 +++++++ app/views/lvas/_form.html.erb | 55 ++++++++++++++----- config/locales/de.yml | 10 +++- 3 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 app/assets/stylesheets/formtastic-changes.css.scss diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss new file mode 100644 index 0000000..5007540 --- /dev/null +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -0,0 +1,21 @@ +form.formtastic .stringish input { +width:90%; +} +form.formtastic textarea { +width:90%; +height:20em; +} +form.formtastic .stringish label { +font-weight: bold; +} +form.formtastic .choice-group label { +font-weight: bold; +} +form.formtastic fieldset div.control-group{} + +div.form-group { +border-width: 1px; +border-style: dashed; +padding: 10px; +border-radius: 10px; +} diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index 49bbb78..8692e8e 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -1,15 +1,44 @@ -<%= semantic_form_for @lva do |f| %> - <%= f.inputs do %> - <%= f.input :semester, :collection=>Semester.all.sort_by{|n| [:name]}%> - <%= f.input :modul %> - <%= f.input :name %> - <%= f.input :ects %> - <%= f.input :stunden %> - <%= f.input :desc %> - <%= f.input :lvanr %> - <% end %> - <%= f.actions do %> - <%= f.action :submit, :as => :input %> - <% end %> +<%= semantic_form_for @lva do |f| %> +
    + <%= f.inputs do %> + +
    +
    +
    +
    +
    + + <%= f.input :name, :wrapper_html=>{:class=>'span5'}%> +
    +
    + <%= f.input :lvanr, :wrapper_html=>{:class=>'span4'}%> + + <%= f.input :ects, :wrapper_html=>{:class=>'span4'} %> + <%= f.input :stunden, :wrapper_html=>{:class=>'span4'} %> +
    +
    +
    +
    +
    +
    + <%= f.input :desc %> +
    +
    + +
    +

    BILD

    + <%= f.input :modul,:label=>'Modul'.html_safe, :as=>:check_boxes%> +
    +
    +
    +
    + + <%= f.input :semester, :label=>'Semester'.html_safe, :as=>:check_boxes%> + +
    + <% end %> + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> <% end %> diff --git a/config/locales/de.yml b/config/locales/de.yml index 94ea21c..2e2ca1e 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -91,7 +91,10 @@ de: stunden: blank: "Geben Sie die Stunden der LVA an" lvanr: - invalid: "Geben Sie eine LVA-Nummer in richtigem Format an. Wenn die LVA noch keine Nummer hat, so geben sie 000 an." + invalid: "Geben Sie eine Nummer im Format 000.000 an." + blank: "Geben sie eine Lva-Nr an" + taken: "Die Lva-Nummer ist bereits vergeben" + studium: attributes: zahl: @@ -118,4 +121,7 @@ de: verwalten: fehler: keine: "Keine Fehlermeldungen oder Warnungen" - + support: + array: + two_words_connector: ', ' + From 61fc09bcf07696e2d6d1cf23bc6aa5ebe17f14e8 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Fri, 9 Aug 2013 16:17:51 +0200 Subject: [PATCH 14/53] Formatierungen --- .../stylesheets/formtastic-changes.css.scss | 13 +++--- app/controllers/modulgruppen_controller.rb | 7 +-- app/views/modulgruppen/_form.html.erb | 24 +++++++--- app/views/studien/verwalten.html.erb | 44 ++++++++----------- 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss index 5007540..498eb2a 100644 --- a/app/assets/stylesheets/formtastic-changes.css.scss +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -5,13 +5,7 @@ form.formtastic textarea { width:90%; height:20em; } -form.formtastic .stringish label { -font-weight: bold; -} -form.formtastic .choice-group label { -font-weight: bold; -} -form.formtastic fieldset div.control-group{} + div.form-group { border-width: 1px; @@ -19,3 +13,8 @@ border-style: dashed; padding: 10px; border-radius: 10px; } +div.verwalten-block { +border-width: 1px; +border-style: solid; +padding: 5px; +} \ No newline at end of file diff --git a/app/controllers/modulgruppen_controller.rb b/app/controllers/modulgruppen_controller.rb index c69f8fe..d84de6f 100755 --- a/app/controllers/modulgruppen_controller.rb +++ b/app/controllers/modulgruppen_controller.rb @@ -51,15 +51,10 @@ class ModulgruppenController < ApplicationController def create @modulgruppe = Modulgruppe.new(params[:modulgruppe]) - if !params[:studium_id].nil? - @studium=Studium.find_by_id(params[:studium_id]) - else - @studium=Studium.find_by_id(params[:modulgruppe][:studium_id]) - end respond_to do |format| if @modulgruppe.save - format.html { redirect_to @studium, notice: 'Modulgruppe was successfully created.' } + format.html { redirect_to @modulgruppe.studium, notice: 'Modulgruppe was successfully created.' } else format.html { render action: "new" } diff --git a/app/views/modulgruppen/_form.html.erb b/app/views/modulgruppen/_form.html.erb index 8191af5..22cc925 100755 --- a/app/views/modulgruppen/_form.html.erb +++ b/app/views/modulgruppen/_form.html.erb @@ -1,13 +1,25 @@ <%= semantic_form_for @modulgruppe do |f| %> <%= f.inputs do %> - <%= f.input :studium_id, :as =>:select, :collection => Studium.all %> - <%= f.input :typ ,:as => :radio, :collection=>["Pflicht","Vertiefungspflicht","Wahl"]%> - <%= f.input :phase,:as => :radio,:collection=>1..3 %> - <%= f.input :name %> - <%= f.input :desc,:input_html=>{:rows=> 3 }%> - <% end %> +
    +
    + <%= f.input :name, :wrapper_html=>{:class=>"span12"}%> +
    + <%= f.input :studium_id, :as =>:select, :collection => Studium.all, :wrapper_html=>{:class=>"span4"} %> + <%= f.input :typ, :collection=>["Pflicht","Vertiefungspflicht","Wahl"], :wrapper_html=>{:class=>"span4"}%> + <%= f.input :phase, :as=>:select, :collection=>1..3, :wrapper_html=>{:class=>"span4"} %> +
    +
    + + +
    + <%= f.input :desc %> + +
    + <% end %> +
    <%= f.actions do %> <%= f.action :submit, :as => :input %> + <% end %> <% end %> diff --git a/app/views/studien/verwalten.html.erb b/app/views/studien/verwalten.html.erb index a834154..279026f 100644 --- a/app/views/studien/verwalten.html.erb +++ b/app/views/studien/verwalten.html.erb @@ -1,8 +1,7 @@
    <%= render 'studien/tabs'%>
    -
    -
    +

    <%= I18n.t("studien.verwaltung") %>

    @@ -11,7 +10,7 @@
    -
    +

    Studien <%= link_to "new", new_studium_path %>

    <% @studien.each do |s| %> <%= link_to s.name, s %> <%= (s.valid?) ? "Gültig" : "Problemfall" %>
    @@ -23,7 +22,7 @@
    -
    +

    Modulgruppen <%= link_to 'new', new_studium_modulgruppe_path(Studium.first) unless Studium.first.nil? %>

    <% @modulgruppen.each do |mg| %> <%= link_to mg.name, mg %> | <%= (mg.valid?) ? "Gültig" : "Problemfall" %>
    @@ -31,7 +30,7 @@
    -
    +

    Module <%= link_to "new", new_modul_path %>

    <% @module.each do |m| %> <%= link_to m.name, m %> @@ -40,7 +39,7 @@
    -
    +

    LVas <%= link_to "new", new_lva_path %>

    <% @lvas.each do |lva| %> <%= link_to lva.name, lva %> | @@ -50,7 +49,7 @@
    -
    +

    Beispiele <%= link_to "new", new_beispiel_path %>

    <% @beispiele.each do |b| %> <%= link_to b.name, b %> @@ -62,28 +61,23 @@
    -
    -
    -
    -

    Error Log

    +
    +

    Error Log

    +
      +
    • Red: Error, Solve immediately
    • +
    • Black: Warning, should be solved
    • +
    • Green: Everything is fine
    • +
    +
      -
    • Red: Error, Solve immediately
    • -
    • Black: Warning, should be solved
    • -
    • Green: Everything is fine
    • -
    -
    -
      - <% @messages.flatten.each do |m| %>
      -
    • <%= m.html_safe %>
    • - <% end %> -
    - <%= I18n.t("verwalten.fehler.keine").html_safe if @messages.empty?%> -
    + <% @messages.flatten.each do |m| %>
    +
  • <%= m.html_safe %>
  • + <% end %> +
+ <%= I18n.t("verwalten.fehler.keine").html_safe if @messages.empty?%>
- -
From b6671879fc906dbb8dca561e53c28ca1fec4e7e1 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Fri, 9 Aug 2013 18:49:30 +0200 Subject: [PATCH 15/53] Bug fix Die persistent variables waren schlecht benannt. hab sie eindeutig benannt --- app/controllers/studien_controller.rb | 32 +++++++++++----------- app/views/studien/_verwalten_menu.html.erb | 32 +++++++++++----------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/controllers/studien_controller.rb b/app/controllers/studien_controller.rb index 4d0a0b3..f2c9231 100755 --- a/app/controllers/studien_controller.rb +++ b/app/controllers/studien_controller.rb @@ -92,7 +92,7 @@ class StudienController < ApplicationController end def verwalten - @new_params={:studium=>params[:studium], :modulgruppe=>params[:modulgruppe], :modul=>params[:modul], :lva=>params[:lva], :beispiel=>params[:beispiel]} + @new_params={:std_verw=>params[:std_verw], :mg_verw=>params[:mg_verw], :m_verw=>params[:m_verw], :lva_verw=>params[:lva_verw], :b_verw=>params[:b_verw]} if @new_params.values.compact.empty? @studien=Studium.all @modulgruppen=Modulgruppe.all @@ -100,13 +100,13 @@ class StudienController < ApplicationController @lvas=Lva.all @beispiele=Beispiel.all else - if !@new_params[:studium].nil? - @studien = [Studium.find(@new_params[:studium])] + if !@new_params[:std_verw].nil? + @studien = [Studium.find(@new_params[:std_verw])] else @studien = Studium.all end - if !@new_params[:modulgruppe].nil? - @modulgruppen = [Modulgruppe.find(@new_params[:modulgruppe])] + if !@new_params[:mg_verw].nil? + @modulgruppen = [Modulgruppe.find(@new_params[:mg_verw])] temp = @modulgruppen.map{|x| x.studium}.flatten.uniq # Force Studien @studien=@studien.select{|k| temp.include?(k)} @@ -115,8 +115,8 @@ class StudienController < ApplicationController temp = @studien.map{|x| x.modulgruppen}.flatten.uniq # Studien forcen Modulgruppen @modulgruppen = @modulgruppen.select{|k| temp.include?(k)} end - if !@new_params[:modul].nil? - @module = [Modul.find(@new_params[:modul])] + if !@new_params[:m_verw].nil? + @module = [Modul.find(@new_params[:m_verw])] temp = @module.map{|x| x.modulgruppen}.flatten.uniq # Force Modulgruppen @modulgruppen = @modulgruppen.select{|k| temp.include?(k)} temp = @modulgruppen.map{|x| x.studium}.flatten.uniq # Force Studien @@ -127,8 +127,8 @@ class StudienController < ApplicationController temp = @modulgruppen.map{|x| x.moduls}.flatten.uniq @module=@module.select{|k| temp.include?(k)} end - if !@new_params[:lva].nil? - @lvas = [Lva.find(@new_params[:lva])] + if !@new_params[:lva_verw].nil? + @lvas = [Lva.find(@new_params[:lva_verw])] temp = @lvas.map{|x| x.modul}.flatten.uniq @module=@module.select{|k| temp.include?(k)} temp = @module.map{|x| x.modulgruppen}.flatten.uniq # Force Modulgruppen @@ -140,8 +140,8 @@ class StudienController < ApplicationController temp = @module.map{|x| x.lvas}.flatten.uniq #Force Module @lvas=@lvas.select{|k| temp.include?(k)} end - if !@new_params[:beispiel].nil? - @beispiele = [Beispiel.find(@new_params[:beispiel])] + if !@new_params[:b_verw].nil? + @beispiele = [Beispiel.find(@new_params[:b_verw])] temp = @lvas.map{|x| x.beispiele}.flatten.uniq #Force Force Lvas @lvas=@lvas.select{|k| temp.include?(k)} temp = @module.map{|x| x.lvas}.flatten.uniq #Force Module @@ -226,11 +226,11 @@ class StudienController < ApplicationController def default_url_options {:ansicht=> params[:ansicht], - :studium=> params[:studium], - :modulgruppe=> params[:modulgruppe], - :modul=>params[:modul], - :lva=>params[:lva], - :beispiel=>params[:beispiel]}.merge(super) + :std_verw=> params[:std_verw], + :mg_verw=> params[:mg_verw], + :m_verw=>params[:m_verw], + :lva_verw=>params[:lva_verw], + :b_verw=>params[:b_verw]}.merge(super) end end diff --git a/app/views/studien/_verwalten_menu.html.erb b/app/views/studien/_verwalten_menu.html.erb index 0c37f91..3f7c051 100644 --- a/app/views/studien/_verwalten_menu.html.erb +++ b/app/views/studien/_verwalten_menu.html.erb @@ -1,68 +1,68 @@
- <%= params[:studium].nil? ? I18n.t("filter.studium") : Studium.find(params[:studium]).name %> + <%= params[:std_verw].nil? ? I18n.t("filter.studium") : Studium.find(params[:std_verw]).name %>
- <%= params[:modulgruppe].nil? ? I18n.t("filter.modulgruppe") : Modulgruppe.find(params[:modulgruppe]).name %> + <%= params[:mg_verw].nil? ? I18n.t("filter.modulgruppe") : Modulgruppe.find(params[:mg_verw]).name %>
- <%= params[:modul].nil? ? I18n.t("filter.modul") : Modul.find(params[:modul]).name %> + <%= params[:m_verw].nil? ? I18n.t("filter.modul") : Modul.find(params[:m_verw]).name %>
- <%= params[:lva].nil? ? I18n.t("filter.lva") : Lva.find(params[:lva]).name %> + <%= params[:lva_verw].nil? ? I18n.t("filter.lva") : Lva.find(params[:lva_verw]).name %>
- <%= params[:beispiel].nil? ? I18n.t("filter.beispiel") : Beispiel.find(params[:beispiel]).name %> + <%= params[:b_verw].nil? ? I18n.t("filter.beispiel") : Beispiel.find(params[:b_verw]).name %>
- <%= link_to I18n.t("filter.reset"), studien_verwalten_path(:studium=>nil, :modulgruppe=>nil, :modul=>nil, :lva=>nil, :beispiel=>nil), :class=>"btn" %> + <%= link_to I18n.t("filter.reset"), studien_verwalten_path(:std_verw=>nil, :mg_verw=>nil, :m_verw=>nil, :lva_verw=>nil, :b_verw=>nil), :class=>"btn" %>
From 9bf4768e0981313ca33db9a79385be837435371a Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Fri, 9 Aug 2013 18:49:56 +0200 Subject: [PATCH 16/53] Form designs --- .../stylesheets/formtastic-changes.css.scss | 4 +-- app/views/moduls/_form.html.erb | 31 ++++++++++++++----- app/views/studien/_form.html.erb | 29 ++++++++++++----- 3 files changed, 47 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss index 498eb2a..192ee43 100644 --- a/app/assets/stylesheets/formtastic-changes.css.scss +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -9,9 +9,9 @@ height:20em; div.form-group { border-width: 1px; -border-style: dashed; +border-style: none; padding: 10px; -border-radius: 10px; +// border-radius: 10px; } div.verwalten-block { border-width: 1px; diff --git a/app/views/moduls/_form.html.erb b/app/views/moduls/_form.html.erb index fb6b68b..db03f9d 100755 --- a/app/views/moduls/_form.html.erb +++ b/app/views/moduls/_form.html.erb @@ -1,15 +1,30 @@ +
+ <%= semantic_form_for @modul do |f| %> -<%= semantic_form_for @modul do |f| %> <%= f.inputs do %> - <% # f.input :modulgruppen,:as => :select, :collection => Hash[Modulgruppe.all.map{|m| [m.studium.name + " " + m.name,m.id]}] %> - <%= f.input :modulgruppen %> - <%= f.input :name ,:hint=>true%> - <%= f.input :desc, :as=>:tinymce_text %> - <%= f.input :depend %> +
+
+ <%= f.input :name ,:hint=>true%> +
+
+ <%= f.input :desc, :as=>:tinymce_text %> +
+
+ <%= f.input :depend %> +
+
+
+
+ <%= f.input :modulgruppen,:as => :check_boxes, :collection => Hash[Modulgruppe.all.map{|m| [m.studium.name + " " + m.name,m.id]}.sort] %> +
+
+ <% end %> <%= f.actions do %> - <%= f.action :submit, :as => :input %> + <%= f.action :submit, :as => :input %> <% end %> -<% end %> + + <% end %> +
<%= tinymce %> diff --git a/app/views/studien/_form.html.erb b/app/views/studien/_form.html.erb index 471a8c3..0973ef5 100755 --- a/app/views/studien/_form.html.erb +++ b/app/views/studien/_form.html.erb @@ -1,13 +1,28 @@ +
<%= tinymce_assets %> -<%= semantic_form_for @studium do |f| %> + <%= semantic_form_for @studium do |f| %> +
<%= f.inputs do %> - <%= f.input :zahl %> - <%= f.input :name,:append=>"NAME" %> + +
+
+ <%= f.input :name,:append=>"NAME" %> +
+
+ <%= f.input :zahl %> +
+
+ <%= f.input :typ, :as=>:select, :include_blank=>false, :collection=>["Bachelor","Master"]%> +
+
+
<%= f.input :desc, :as=>:tinymce_text %> - <%= f.input :typ, :as=>:radio, :collection=>["Bachelor","Master"]%> +
<% end %> -<%= tinymce %> + <%= tinymce %> <%= f.actions do %> - <%= f.action :submit, :as => :input %> + <%= f.action :submit, :as => :input %> <% end %> -<% end %> +
+ <% end %> +
From 36381343949196ce3c934600da9be17c8c0de01a Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Fri, 9 Aug 2013 18:49:30 +0200 Subject: [PATCH 17/53] Bug fix Die persistent variables waren schlecht benannt. hab sie eindeutig benannt --- app/controllers/studien_controller.rb | 32 +++++++++++----------- app/views/studien/_verwalten_menu.html.erb | 32 +++++++++++----------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/controllers/studien_controller.rb b/app/controllers/studien_controller.rb index 4d0a0b3..f2c9231 100755 --- a/app/controllers/studien_controller.rb +++ b/app/controllers/studien_controller.rb @@ -92,7 +92,7 @@ class StudienController < ApplicationController end def verwalten - @new_params={:studium=>params[:studium], :modulgruppe=>params[:modulgruppe], :modul=>params[:modul], :lva=>params[:lva], :beispiel=>params[:beispiel]} + @new_params={:std_verw=>params[:std_verw], :mg_verw=>params[:mg_verw], :m_verw=>params[:m_verw], :lva_verw=>params[:lva_verw], :b_verw=>params[:b_verw]} if @new_params.values.compact.empty? @studien=Studium.all @modulgruppen=Modulgruppe.all @@ -100,13 +100,13 @@ class StudienController < ApplicationController @lvas=Lva.all @beispiele=Beispiel.all else - if !@new_params[:studium].nil? - @studien = [Studium.find(@new_params[:studium])] + if !@new_params[:std_verw].nil? + @studien = [Studium.find(@new_params[:std_verw])] else @studien = Studium.all end - if !@new_params[:modulgruppe].nil? - @modulgruppen = [Modulgruppe.find(@new_params[:modulgruppe])] + if !@new_params[:mg_verw].nil? + @modulgruppen = [Modulgruppe.find(@new_params[:mg_verw])] temp = @modulgruppen.map{|x| x.studium}.flatten.uniq # Force Studien @studien=@studien.select{|k| temp.include?(k)} @@ -115,8 +115,8 @@ class StudienController < ApplicationController temp = @studien.map{|x| x.modulgruppen}.flatten.uniq # Studien forcen Modulgruppen @modulgruppen = @modulgruppen.select{|k| temp.include?(k)} end - if !@new_params[:modul].nil? - @module = [Modul.find(@new_params[:modul])] + if !@new_params[:m_verw].nil? + @module = [Modul.find(@new_params[:m_verw])] temp = @module.map{|x| x.modulgruppen}.flatten.uniq # Force Modulgruppen @modulgruppen = @modulgruppen.select{|k| temp.include?(k)} temp = @modulgruppen.map{|x| x.studium}.flatten.uniq # Force Studien @@ -127,8 +127,8 @@ class StudienController < ApplicationController temp = @modulgruppen.map{|x| x.moduls}.flatten.uniq @module=@module.select{|k| temp.include?(k)} end - if !@new_params[:lva].nil? - @lvas = [Lva.find(@new_params[:lva])] + if !@new_params[:lva_verw].nil? + @lvas = [Lva.find(@new_params[:lva_verw])] temp = @lvas.map{|x| x.modul}.flatten.uniq @module=@module.select{|k| temp.include?(k)} temp = @module.map{|x| x.modulgruppen}.flatten.uniq # Force Modulgruppen @@ -140,8 +140,8 @@ class StudienController < ApplicationController temp = @module.map{|x| x.lvas}.flatten.uniq #Force Module @lvas=@lvas.select{|k| temp.include?(k)} end - if !@new_params[:beispiel].nil? - @beispiele = [Beispiel.find(@new_params[:beispiel])] + if !@new_params[:b_verw].nil? + @beispiele = [Beispiel.find(@new_params[:b_verw])] temp = @lvas.map{|x| x.beispiele}.flatten.uniq #Force Force Lvas @lvas=@lvas.select{|k| temp.include?(k)} temp = @module.map{|x| x.lvas}.flatten.uniq #Force Module @@ -226,11 +226,11 @@ class StudienController < ApplicationController def default_url_options {:ansicht=> params[:ansicht], - :studium=> params[:studium], - :modulgruppe=> params[:modulgruppe], - :modul=>params[:modul], - :lva=>params[:lva], - :beispiel=>params[:beispiel]}.merge(super) + :std_verw=> params[:std_verw], + :mg_verw=> params[:mg_verw], + :m_verw=>params[:m_verw], + :lva_verw=>params[:lva_verw], + :b_verw=>params[:b_verw]}.merge(super) end end diff --git a/app/views/studien/_verwalten_menu.html.erb b/app/views/studien/_verwalten_menu.html.erb index 0c37f91..3f7c051 100644 --- a/app/views/studien/_verwalten_menu.html.erb +++ b/app/views/studien/_verwalten_menu.html.erb @@ -1,68 +1,68 @@
- <%= params[:studium].nil? ? I18n.t("filter.studium") : Studium.find(params[:studium]).name %> + <%= params[:std_verw].nil? ? I18n.t("filter.studium") : Studium.find(params[:std_verw]).name %>
- <%= params[:modulgruppe].nil? ? I18n.t("filter.modulgruppe") : Modulgruppe.find(params[:modulgruppe]).name %> + <%= params[:mg_verw].nil? ? I18n.t("filter.modulgruppe") : Modulgruppe.find(params[:mg_verw]).name %>
- <%= params[:modul].nil? ? I18n.t("filter.modul") : Modul.find(params[:modul]).name %> + <%= params[:m_verw].nil? ? I18n.t("filter.modul") : Modul.find(params[:m_verw]).name %>
- <%= params[:lva].nil? ? I18n.t("filter.lva") : Lva.find(params[:lva]).name %> + <%= params[:lva_verw].nil? ? I18n.t("filter.lva") : Lva.find(params[:lva_verw]).name %>
- <%= params[:beispiel].nil? ? I18n.t("filter.beispiel") : Beispiel.find(params[:beispiel]).name %> + <%= params[:b_verw].nil? ? I18n.t("filter.beispiel") : Beispiel.find(params[:b_verw]).name %>
- <%= link_to I18n.t("filter.reset"), studien_verwalten_path(:studium=>nil, :modulgruppe=>nil, :modul=>nil, :lva=>nil, :beispiel=>nil), :class=>"btn" %> + <%= link_to I18n.t("filter.reset"), studien_verwalten_path(:std_verw=>nil, :mg_verw=>nil, :m_verw=>nil, :lva_verw=>nil, :b_verw=>nil), :class=>"btn" %>
From a8c6ecd08cfff0995c1ac704f06c44364aeebcbb Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Fri, 9 Aug 2013 19:09:01 +0200 Subject: [PATCH 18/53] beispiel formular --- app/views/beispiele/_form.html.erb | 39 ++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/app/views/beispiele/_form.html.erb b/app/views/beispiele/_form.html.erb index bf0c027..1e3833c 100755 --- a/app/views/beispiele/_form.html.erb +++ b/app/views/beispiele/_form.html.erb @@ -1,13 +1,32 @@ -<%= semantic_form_for @beispiel, :html => { :multipart => true } do |f| %> - <%= f.inputs do %> - <%= f.input :name %> - <%= f.input :desc %> - <%= f.file_field :beispieldatei %> - <%= f.hidden_field :beispieldatei_cache %> - <%= f.input :lva, :as=>:select, :collection => Lva.all%> - <% end %> +
+
+ <%= semantic_form_for @beispiel, :html => { :multipart => true } do |f| %> + + <%= f.inputs do %> +
+
+ <%= f.file_field :beispieldatei %> + <%= f.hidden_field :beispieldatei_cache %> +
+
+ <%= f.input :lva, :as=>:select, :collection => Lva.all%> + +
+
+ <%= f.input :name %> +
+
+ +
+ <%= f.input :desc %> +
+ <% end %> <%= f.actions do %> - <%= f.action :submit, :as => :input %> + <%= f.action :submit, :as => :input %> + <% end %> -<% end %> + + <% end %> +
+
From 1a10f4fc5e2bebf4bcaab01928ed40e9341990d2 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Fri, 9 Aug 2013 20:04:23 +0200 Subject: [PATCH 19/53] Kleiner edit --- app/views/beispiele/_form.html.erb | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/app/views/beispiele/_form.html.erb b/app/views/beispiele/_form.html.erb index 1e3833c..01cb3b8 100755 --- a/app/views/beispiele/_form.html.erb +++ b/app/views/beispiele/_form.html.erb @@ -4,17 +4,10 @@ <%= f.inputs do %>
-
- <%= f.file_field :beispieldatei %> - <%= f.hidden_field :beispieldatei_cache %> -
-
- <%= f.input :lva, :as=>:select, :collection => Lva.all%> - -
-
- <%= f.input :name %> -
+ <%= f.file_field :beispieldatei, :wrapper_html=>{:class=>'span4'}%> + <%= f.hidden_field :beispieldatei_cache, :wrapper_html=>{:class=>'span0'} %> + <%= f.input :lva, :as=>:select, :collection => Lva.all, :wrapper_html=>{:class=>'span3'}%> + <%= f.input :name, :wrapper_html=>{:class=>'span5'} %>
From 9d8b8ad3d603bc8bdad24b27e20af8ae1cf62ce8 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sat, 10 Aug 2013 00:58:09 +0200 Subject: [PATCH 20/53] kleiner bugfix, layout --- app/controllers/beispiele_controller.rb | 2 +- app/controllers/studien_controller.rb | 2 +- app/views/beispiele/_form.html.erb | 28 ++++++++++++++----------- app/views/beispiele/show.html.erb | 4 +++- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/app/controllers/beispiele_controller.rb b/app/controllers/beispiele_controller.rb index ccd30a3..c9d4c49 100755 --- a/app/controllers/beispiele_controller.rb +++ b/app/controllers/beispiele_controller.rb @@ -42,7 +42,7 @@ class BeispieleController < ApplicationController # POST /beispiele.json def create @beispiel = Beispiel.new(params[:beispiel]) - + respond_to do |format| if @beispiel.save format.html { redirect_to @beispiel, notice: 'Beispiel was successfully created.' } diff --git a/app/controllers/studien_controller.rb b/app/controllers/studien_controller.rb index f2c9231..0504b84 100755 --- a/app/controllers/studien_controller.rb +++ b/app/controllers/studien_controller.rb @@ -214,7 +214,7 @@ class StudienController < ApplicationController end for b in @beispiele if b.valid? - @messages << b.name + ' hat keine Lva' if lva.moduls + @messages << b.name + ' hat keine Lva' if b.lva.nil? else @messages << ''+b.name + ': ' @messages << b.errors.full_messages diff --git a/app/views/beispiele/_form.html.erb b/app/views/beispiele/_form.html.erb index 01cb3b8..a5795e7 100755 --- a/app/views/beispiele/_form.html.erb +++ b/app/views/beispiele/_form.html.erb @@ -1,25 +1,29 @@
- <%= semantic_form_for @beispiel, :html => { :multipart => true } do |f| %> + <%= semantic_form_for @beispiel, :html => { :multipart => true } do |f| %> <%= f.inputs do %> -
- <%= f.file_field :beispieldatei, :wrapper_html=>{:class=>'span4'}%> - <%= f.hidden_field :beispieldatei_cache, :wrapper_html=>{:class=>'span0'} %> - <%= f.input :lva, :as=>:select, :collection => Lva.all, :wrapper_html=>{:class=>'span3'}%> - <%= f.input :name, :wrapper_html=>{:class=>'span5'} %> -
+ <%= f.hidden_field :beispieldatei_cache %> + + <%= f.file_field :beispieldatei, :wrapper_html=>{:class=>"span4"}%> +
+ <%= f.input :name, :wrapper_html=>{:class=>'span6'} %> + <%= f.input :lva, :as=>:select, :collection => Lva.all, :wrapper_html=>{:class=>'span6'}%> + + + <% end %> +
<%= f.input :desc %>
<% end %> - <%= f.actions do %> - <%= f.action :submit, :as => :input %> + <%= f.actions do %> + <%= f.action :submit, :as => :input %> - <% end %> + <% end %> - <% end %> -
+ <% end %> +
diff --git a/app/views/beispiele/show.html.erb b/app/views/beispiele/show.html.erb index 1115fb3..49501a7 100755 --- a/app/views/beispiele/show.html.erb +++ b/app/views/beispiele/show.html.erb @@ -10,7 +10,9 @@ <%= @beispiel.desc %> <%= @beispiel.beispieldatei.url %>

- +

+ <%= @beispiel.lva.name %> +

<%= link_to 'Edit', edit_beispiel_path(@beispiel) %> | <%= link_to 'Back', beispiele_path %> From 86913257afd97a5d1df9f3a52c9a51f585610e7f Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sat, 10 Aug 2013 02:03:45 +0200 Subject: [PATCH 21/53] Layout changes --- .../stylesheets/formtastic-changes.css.scss | 1 + app/views/beispiele/_form.html.erb | 8 +- app/views/studien/_verwalten_menu.html.erb | 68 ------ app/views/studien/verwalten.html.erb | 193 +++++++++++++----- 4 files changed, 140 insertions(+), 130 deletions(-) diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss index 192ee43..bd015db 100644 --- a/app/assets/stylesheets/formtastic-changes.css.scss +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -17,4 +17,5 @@ div.verwalten-block { border-width: 1px; border-style: solid; padding: 5px; +border-radius:10px; } \ No newline at end of file diff --git a/app/views/beispiele/_form.html.erb b/app/views/beispiele/_form.html.erb index a5795e7..26e018e 100755 --- a/app/views/beispiele/_form.html.erb +++ b/app/views/beispiele/_form.html.erb @@ -1,5 +1,4 @@ -
-
+ <%= semantic_form_for @beispiel, :html => { :multipart => true } do |f| %> <%= f.inputs do %> @@ -10,8 +9,7 @@ <%= f.input :name, :wrapper_html=>{:class=>'span6'} %> <%= f.input :lva, :as=>:select, :collection => Lva.all, :wrapper_html=>{:class=>'span6'}%> - - <% end %> +
@@ -25,5 +23,3 @@ <% end %> <% end %> -
-
diff --git a/app/views/studien/_verwalten_menu.html.erb b/app/views/studien/_verwalten_menu.html.erb index 3f7c051..e69de29 100644 --- a/app/views/studien/_verwalten_menu.html.erb +++ b/app/views/studien/_verwalten_menu.html.erb @@ -1,68 +0,0 @@ -
-
- - <%= params[:std_verw].nil? ? I18n.t("filter.studium") : Studium.find(params[:std_verw]).name %> - - - -
-
- - <%= params[:mg_verw].nil? ? I18n.t("filter.modulgruppe") : Modulgruppe.find(params[:mg_verw]).name %> - - - - -
-
- - <%= params[:m_verw].nil? ? I18n.t("filter.modul") : Modul.find(params[:m_verw]).name %> - - - - -
-
- - <%= params[:lva_verw].nil? ? I18n.t("filter.lva") : Lva.find(params[:lva_verw]).name %> - - - -
-
- - <%= params[:b_verw].nil? ? I18n.t("filter.beispiel") : Beispiel.find(params[:b_verw]).name %> - - - - -
- <%= link_to I18n.t("filter.reset"), studien_verwalten_path(:std_verw=>nil, :mg_verw=>nil, :m_verw=>nil, :lva_verw=>nil, :b_verw=>nil), :class=>"btn" %> -
- - diff --git a/app/views/studien/verwalten.html.erb b/app/views/studien/verwalten.html.erb index 279026f..f991b3f 100644 --- a/app/views/studien/verwalten.html.erb +++ b/app/views/studien/verwalten.html.erb @@ -1,68 +1,123 @@
<%= render 'studien/tabs'%>
-
-
-
-

<%= I18n.t("studien.verwaltung") %>

- <%= I18n.t("filter.explanation").html_safe %> - <%= render 'studien/verwalten_menu' %> -
- -
-
-

Studien <%= link_to "new", new_studium_path %>

- <% @studien.each do |s| %> - <%= link_to s.name, s %> <%= (s.valid?) ? "Gültig" : "Problemfall" %>
- <% end %> +
+ +

<%= I18n.t("studien.verwaltung") %>

<%= link_to I18n.t("filter.reset"), studien_verwalten_path(:std_verw=>nil, :mg_verw=>nil, :m_verw=>nil, :lva_verw=>nil, :b_verw=>nil), :class=>"btn" %> + <%= I18n.t("filter.explanation").html_safe %> +

Studien

+
+ + | + <% @studien.each do |s| %> + <%= link_to s.name, s %> <%= (s.valid?) ? "Gültig" : "Problemfall" %> | <% end %> +
+
+ + <%= params[:std_verw].nil? ? I18n.t("filter.studium") : Studium.find(params[:std_verw]).name %> + + + + <%= link_to 'Neues Studium', new_studium_path, :class=>'btn'%> +
+
+ +
+
+ +
+

Modulgruppen

+
+ <% @modulgruppen.each do |mg| %> + <%= link_to mg.name, mg %> | <%= (mg.valid?) ? "Gültig" : "Problemfall" %>
+ <% end %> +
+
+ + <%= params[:mg_verw].nil? ? I18n.t("filter.modulgruppe") : Modulgruppe.find(params[:mg_verw]).name %> + + + + + <%= link_to "Neue Modulgruppe", new_studium_modulgruppe_path(Studium.first), :class=>"btn" unless Studium.first.nil?%> +
+ + +
+
+
+

Module

+
+ + + <% @module.each do |m| %> + <%= link_to m.name, m %> + | <%= (m.valid?) ? "Gültig" : "Problemfall" %>
+ <% end %> +
+
+ + <%= params[:m_verw].nil? ? I18n.t("filter.modul") : Modul.find(params[:m_verw]).name %> + + + + + <%= link_to "Neues Modul", new_modul_path, :class=>"btn"%> +
+
-
- -
-
-

Modulgruppen <%= link_to 'new', new_studium_modulgruppe_path(Studium.first) unless Studium.first.nil? %>

- <% @modulgruppen.each do |mg| %> - <%= link_to mg.name, mg %> | <%= (mg.valid?) ? "Gültig" : "Problemfall" %>
- <% end %> -
-
-
-
-

Module <%= link_to "new", new_modul_path %>

- <% @module.each do |m| %> - <%= link_to m.name, m %> - | <%= (m.valid?) ? "Gültig" : "Problemfall" %>
- <% end %> -
-
-
-
-

LVas <%= link_to "new", new_lva_path %>

- <% @lvas.each do |lva| %> - <%= link_to lva.name, lva %> | - <%= (lva.valid?) ? "Gültig" : "Problemfall" %>
- - <% end %> -
-
-
-
-

Beispiele <%= link_to "new", new_beispiel_path %>

- <% @beispiele.each do |b| %> - <%= link_to b.name, b %> - <% end %> -
-
- - +
+

Lvas

+
+ + <% @lvas.each do |lva| %> + <%= link_to lva.name, lva %> | + <%= (lva.valid?) ? "Gültig" : "Problemfall" %>
+ + <% end %> +
+
+ + <%= params[:lva_verw].nil? ? I18n.t("filter.lva") : Lva.find(params[:lva_verw]).name %> + + + + <%= link_to "Neue LVa", new_lva_path, :class=>'btn'%> +
+
+ + + + +
-
+

Error Log

  • Red: Error, Solve immediately
  • @@ -71,12 +126,38 @@
    - <% @messages.flatten.each do |m| %>
    -
  • <%= m.html_safe %>
  • + <% @messages.flatten.each do |m| %> + <% if !m.strip.empty? %> +
  • <%= m.html_safe %>
  • + <% end %> <% end %>
<%= I18n.t("verwalten.fehler.keine").html_safe if @messages.empty?%>
+

Beispiele

+
+ + + <% @beispiele.each do |b| %> + <%= link_to b.name, b %> + <% end %> +
+
+ + <%= params[:b_verw].nil? ? I18n.t("filter.beispiel") : Beispiel.find(params[:b_verw]).name %> + + + + + <%= link_to "Neues Beispiel", new_beispiel_path, :class=>"btn"%> +
+ +
From a6b4501d2d40b38a42fce74988cc6c68b4efb371 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Fri, 9 Aug 2013 18:49:56 +0200 Subject: [PATCH 22/53] Form designs Conflicts: app/assets/stylesheets/formtastic-changes.css.scss --- .../stylesheets/formtastic-changes.css.scss | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/assets/stylesheets/formtastic-changes.css.scss diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss new file mode 100644 index 0000000..192ee43 --- /dev/null +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -0,0 +1,20 @@ +form.formtastic .stringish input { +width:90%; +} +form.formtastic textarea { +width:90%; +height:20em; +} + + +div.form-group { +border-width: 1px; +border-style: none; +padding: 10px; +// border-radius: 10px; +} +div.verwalten-block { +border-width: 1px; +border-style: solid; +padding: 5px; +} \ No newline at end of file From 5f7bad1004544f748e13c436ccbad2a90829d3b0 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 10 Aug 2013 14:27:15 +0200 Subject: [PATCH 23/53] Date-String Input angelegt --- app/inputs/date_string_input.rb | 6 ++++++ app/views/calentries/_form.html.erb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 app/inputs/date_string_input.rb diff --git a/app/inputs/date_string_input.rb b/app/inputs/date_string_input.rb new file mode 100644 index 0000000..d10e2c9 --- /dev/null +++ b/app/inputs/date_string_input.rb @@ -0,0 +1,6 @@ +class DateStringInput < FormtasticBootstrap::Inputs::StringInput + def input_html_options + super.merge(:class => "datetext", :onclick =>"beep", :value=>I18n.l(@object.send(method.to_sym))) + end + +end diff --git a/app/views/calentries/_form.html.erb b/app/views/calentries/_form.html.erb index 6dd64ad..5306d58 100644 --- a/app/views/calentries/_form.html.erb +++ b/app/views/calentries/_form.html.erb @@ -1,6 +1,6 @@ <%= semantic_form_for @calentry do |f| %> <%= f.inputs do %> - <%= f.input :start %> + <%= f.input :start , :as => :date_string %> <%= f.input :ende %> <%= f.input :summary %> <%= f.input :calendar, :as=> :radio %> From c31c530e626ad2c602ad32cbce18aedb12844cbd Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 10 Aug 2013 14:28:17 +0200 Subject: [PATCH 24/53] Datumsformat - Time.short angepasst --- config/locales/de.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 75fd73f..16f6956 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -294,7 +294,7 @@ de: time: am: vormittags formats: - default: ! '%A, %d. %B %Y, %H:%M Uhr' + default: ! '%d.%m.%Y, %H:%M Uhr' long: ! '%A, %d. %B %Y, %H:%M Uhr' - short: ! '%d. %B, %H:%M Uhr' + short: ! '%d.%m.%Y, %H:%M Uhr' pm: nachmittags From 116446ff63d82a4fd3885cfef34912e5be701581 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 10 Aug 2013 14:29:36 +0200 Subject: [PATCH 25/53] merge layout formular moduls & studien --- app/views/moduls/_form.html.erb | 31 +++++++++++++++++++++++-------- app/views/studien/_form.html.erb | 29 ++++++++++++++++++++++------- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/app/views/moduls/_form.html.erb b/app/views/moduls/_form.html.erb index fb6b68b..db03f9d 100755 --- a/app/views/moduls/_form.html.erb +++ b/app/views/moduls/_form.html.erb @@ -1,15 +1,30 @@ +
+ <%= semantic_form_for @modul do |f| %> -<%= semantic_form_for @modul do |f| %> <%= f.inputs do %> - <% # f.input :modulgruppen,:as => :select, :collection => Hash[Modulgruppe.all.map{|m| [m.studium.name + " " + m.name,m.id]}] %> - <%= f.input :modulgruppen %> - <%= f.input :name ,:hint=>true%> - <%= f.input :desc, :as=>:tinymce_text %> - <%= f.input :depend %> +
+
+ <%= f.input :name ,:hint=>true%> +
+
+ <%= f.input :desc, :as=>:tinymce_text %> +
+
+ <%= f.input :depend %> +
+
+
+
+ <%= f.input :modulgruppen,:as => :check_boxes, :collection => Hash[Modulgruppe.all.map{|m| [m.studium.name + " " + m.name,m.id]}.sort] %> +
+
+ <% end %> <%= f.actions do %> - <%= f.action :submit, :as => :input %> + <%= f.action :submit, :as => :input %> <% end %> -<% end %> + + <% end %> +
<%= tinymce %> diff --git a/app/views/studien/_form.html.erb b/app/views/studien/_form.html.erb index 471a8c3..0973ef5 100755 --- a/app/views/studien/_form.html.erb +++ b/app/views/studien/_form.html.erb @@ -1,13 +1,28 @@ +
<%= tinymce_assets %> -<%= semantic_form_for @studium do |f| %> + <%= semantic_form_for @studium do |f| %> +
<%= f.inputs do %> - <%= f.input :zahl %> - <%= f.input :name,:append=>"NAME" %> + +
+
+ <%= f.input :name,:append=>"NAME" %> +
+
+ <%= f.input :zahl %> +
+
+ <%= f.input :typ, :as=>:select, :include_blank=>false, :collection=>["Bachelor","Master"]%> +
+
+
<%= f.input :desc, :as=>:tinymce_text %> - <%= f.input :typ, :as=>:radio, :collection=>["Bachelor","Master"]%> +
<% end %> -<%= tinymce %> + <%= tinymce %> <%= f.actions do %> - <%= f.action :submit, :as => :input %> + <%= f.action :submit, :as => :input %> <% end %> -<% end %> +
+ <% end %> +
From 57a7e49a3452d07c2068adb3e69997568536aa90 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sat, 10 Aug 2013 22:47:32 +0200 Subject: [PATCH 26/53] CSS changes --- .../stylesheets/formtastic-changes.css.scss | 14 +--- app/assets/stylesheets/lvas.css.scss | 8 ++ app/assets/stylesheets/studien.css.scss | 15 ++++ app/views/lvas/_form.html.erb | 4 +- app/views/lvas/_lva_semester.html.erb | 5 +- app/views/studien/semesteransicht.html.erb | 6 +- app/views/studien/verwalten.html.erb | 81 ++++++++++--------- 7 files changed, 76 insertions(+), 57 deletions(-) diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss index bd015db..35dfec3 100644 --- a/app/assets/stylesheets/formtastic-changes.css.scss +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -6,16 +6,6 @@ width:90%; height:20em; } - -div.form-group { -border-width: 1px; -border-style: none; -padding: 10px; -// border-radius: 10px; +form.formtastic .input label.control-label { +font-weight:bold; } -div.verwalten-block { -border-width: 1px; -border-style: solid; -padding: 5px; -border-radius:10px; -} \ No newline at end of file diff --git a/app/assets/stylesheets/lvas.css.scss b/app/assets/stylesheets/lvas.css.scss index 797b72c..32979e8 100755 --- a/app/assets/stylesheets/lvas.css.scss +++ b/app/assets/stylesheets/lvas.css.scss @@ -1,3 +1,11 @@ // Place all the styles related to the lvas controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + +div.lva-semester { +border: solid; +border-width: 1px; +margin: 1px; +padding: 5px; +border-color: green; +} \ No newline at end of file diff --git a/app/assets/stylesheets/studien.css.scss b/app/assets/stylesheets/studien.css.scss index 7b5973a..5c788c2 100755 --- a/app/assets/stylesheets/studien.css.scss +++ b/app/assets/stylesheets/studien.css.scss @@ -1,3 +1,18 @@ // Place all the styles related to the studia controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ +div.verwalten-block { +border-width: 1px; +border-style: solid; +padding: 5px; +border-radius:10px; +margin: 2px; +} +div.studien-semester { +border-width: 1px; +border-style: solid; +padding: 5px; +border-radius:10px; +border-color: blue; +margin: 2px; +} diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index 8692e8e..d43f386 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -28,13 +28,13 @@

BILD

- <%= f.input :modul,:label=>'Modul'.html_safe, :as=>:check_boxes%> + <%= f.input :modul, :as=>:check_boxes%>
- <%= f.input :semester, :label=>'Semester'.html_safe, :as=>:check_boxes%> + <%= f.input :semester, :as=>:check_boxes%>
<% end %> diff --git a/app/views/lvas/_lva_semester.html.erb b/app/views/lvas/_lva_semester.html.erb index a60029d..8e92fd7 100755 --- a/app/views/lvas/_lva_semester.html.erb +++ b/app/views/lvas/_lva_semester.html.erb @@ -1,10 +1,9 @@ -

+

<%= link_to lva.name, lva_path(lva)%>
Module: /<% lva.modul.each do |m| %> <%= link_to m.name + ' / ', modul_path(m) unless m.modulgruppen.map{|x| x.studium}.index(@studium).nil? && !@studium.nil? %><% end %>
<%="LVa-Nr " + lva.lvanr.to_s %> <%= lva.ects %> ECTS / <%= lva.stunden %> Std <% " / " + lva.beispiele.count.to_s + " Beispiele"%>
<%= link_to "Edit", edit_lva_path(lva) %> | <%= link_to "Beispiel hinzufügen", new_beispiel_path(:lva_id=>lva.id) %> -

-<% #toolbar_html(@toolbar_elements) %> +
diff --git a/app/views/studien/semesteransicht.html.erb b/app/views/studien/semesteransicht.html.erb index ee4d588..abf692a 100644 --- a/app/views/studien/semesteransicht.html.erb +++ b/app/views/studien/semesteransicht.html.erb @@ -11,16 +11,16 @@ <% @studium.semester.each do |sem| %>
-
+

<%= sem.name %>

- <% sem.lvas.each_slice(2) do |row| %> + <% sem.lvas.each_slice(4) do |row| %>
<% row.each do |l| %> -
+
<%= render :partial=>'lvas/lva_semester', :locals =>{:lva => l}%>
<% end %> diff --git a/app/views/studien/verwalten.html.erb b/app/views/studien/verwalten.html.erb index f991b3f..a7b7d4b 100644 --- a/app/views/studien/verwalten.html.erb +++ b/app/views/studien/verwalten.html.erb @@ -5,7 +5,7 @@

<%= I18n.t("studien.verwaltung") %>

<%= link_to I18n.t("filter.reset"), studien_verwalten_path(:std_verw=>nil, :mg_verw=>nil, :m_verw=>nil, :lva_verw=>nil, :b_verw=>nil), :class=>"btn" %> <%= I18n.t("filter.explanation").html_safe %> -

Studien

+

Studien

| @@ -24,15 +24,16 @@ <% end %> - <%= link_to 'Neues Studium', new_studium_path, :class=>'btn'%> +
+ <%= link_to 'Neues Studium', new_studium_path, :class=>'btn'%>
-

Modulgruppen

+

Modulgruppen

<% @modulgruppen.each do |mg| %> <%= link_to mg.name, mg %> | <%= (mg.valid?) ? "Gültig" : "Problemfall" %>
@@ -50,14 +51,16 @@
  • <%= link_to mg.name, studien_verwalten_path(:mg_verw=>mg)%>
  • <% end %> - <%= link_to "Neue Modulgruppe", new_studium_modulgruppe_path(Studium.first), :class=>"btn" unless Studium.first.nil?%> -
    + +
    + <%= link_to "Neue Modulgruppe", new_studium_modulgruppe_path(Studium.first), :class=>"btn" unless Studium.first.nil?%> +
    -

    Module

    +

    Module

    @@ -78,14 +81,14 @@
  • <%= link_to m.name, studien_verwalten_path(:m_verw=>m)%>
  • <% end %> - <%= link_to "Neues Modul", new_modul_path, :class=>"btn"%> +
    - + <%= link_to "Neues Modul", new_modul_path, :class=>"btn"%>
    -

    Lvas

    +

    Lvas

    @@ -95,20 +98,22 @@ <% end %>
    -
    - - <%= params[:lva_verw].nil? ? I18n.t("filter.lva") : Lva.find(params[:lva_verw]).name %> +
    + + <%= params[:lva_verw].nil? ? I18n.t("filter.lva") : Lva.find(params[:lva_verw]).name %> - - - - <%= link_to "Neue LVa", new_lva_path, :class=>'btn'%> -
    + + + + +
    + <%= link_to "Neue LVa", new_lva_path, :class=>'btn'%> +
    @@ -128,8 +133,8 @@
      <% @messages.flatten.each do |m| %> <% if !m.strip.empty? %> -
    • <%= m.html_safe %>
    • - <% end %> +
    • <%= m.html_safe %>
    • + <% end %> <% end %>
    <%= I18n.t("verwalten.fehler.keine").html_safe if @messages.empty?%> @@ -141,21 +146,23 @@ <% @beispiele.each do |b| %> <%= link_to b.name, b %> <% end %> -
    -
    - - <%= params[:b_verw].nil? ? I18n.t("filter.beispiel") : Beispiel.find(params[:b_verw]).name %> +
    +
    + + <%= params[:b_verw].nil? ? I18n.t("filter.beispiel") : Beispiel.find(params[:b_verw]).name %> - - - + + + + +
    <%= link_to "Neues Beispiel", new_beispiel_path, :class=>"btn"%> -
    +
    From 8229570ec7d5bab339ba1059a45f3b0209b96686 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 00:34:49 +0200 Subject: [PATCH 27/53] =?UTF-8?q?css=20=C3=A4nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/stylesheets/formtastic-changes.css.scss | 1 + app/assets/stylesheets/lvas.css.scss | 1 + 2 files changed, 2 insertions(+) diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss index 35dfec3..ea322e8 100644 --- a/app/assets/stylesheets/formtastic-changes.css.scss +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -8,4 +8,5 @@ height:20em; form.formtastic .input label.control-label { font-weight:bold; +font-size:125%; } diff --git a/app/assets/stylesheets/lvas.css.scss b/app/assets/stylesheets/lvas.css.scss index 32979e8..54abac2 100755 --- a/app/assets/stylesheets/lvas.css.scss +++ b/app/assets/stylesheets/lvas.css.scss @@ -8,4 +8,5 @@ border-width: 1px; margin: 1px; padding: 5px; border-color: green; +border-radius: 5px; } \ No newline at end of file From 1bddc125eb21b11651d0ec8e07ff1cdc3681c163 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 00:35:23 +0200 Subject: [PATCH 28/53] =?UTF-8?q?Semesters=20edit=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/semesters_controller.rb | 3 ++- app/views/semesters/_form.html.erb | 7 +++---- app/views/semesters/edit.html.erb | 7 ++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/controllers/semesters_controller.rb b/app/controllers/semesters_controller.rb index 751a4b7..8a527c4 100755 --- a/app/controllers/semesters_controller.rb +++ b/app/controllers/semesters_controller.rb @@ -16,6 +16,7 @@ class SemestersController < ApplicationController def edit @semester = Semester.find(params[:id]) + @studium = @semester.studium end def create @@ -33,7 +34,7 @@ class SemestersController < ApplicationController def update @semester = Semester.find(params[:id]) - + @studium= @semester.studium respond_to do |format| if @semester.update_attributes(params[:semester]) format.html { redirect_to @semester, notice: 'Semester was successfully updated.' } diff --git a/app/views/semesters/_form.html.erb b/app/views/semesters/_form.html.erb index 710e4ea..7ff4d18 100755 --- a/app/views/semesters/_form.html.erb +++ b/app/views/semesters/_form.html.erb @@ -1,12 +1,11 @@ <%= semantic_form_for @semester do |f| %> <%= f.inputs do %> - <%= f.input :name %> - <%= f.input :nummer %> - <%= f.input :ssws %> - <%= f.input :lvas %> + <%= f.input :lvas, :as=>:check_boxes%> <% end %> <%= f.actions do %> <%= f.action :submit, :as => :input %> <% end %> <% end %> +<%= link_to 'Zurück',@studium, :class=>"btn"%> +x diff --git a/app/views/semesters/edit.html.erb b/app/views/semesters/edit.html.erb index 10925ec..bf39462 100755 --- a/app/views/semesters/edit.html.erb +++ b/app/views/semesters/edit.html.erb @@ -1,6 +1,3 @@ -

    Editing semester

    +

    <%=@semester.name%>

    + <%= render 'form' %> -<%= render 'form' %> - -<%= link_to 'Show', @semester %> | -<%= link_to 'Back', semesters_path %> From 4da8b3a0b37b73392f6ff495acad986e8cf7e1f6 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 00:36:09 +0200 Subject: [PATCH 29/53] =?UTF-8?q?Module=20k=C3=B6nnen=20Modulgruppen=20auc?= =?UTF-8?q?h=20per=20form=20hinzugef=C3=BCgt=20werden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/modulgruppe.rb | 2 +- app/views/modulgruppen/_form.html.erb | 38 +++++++++++++++------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/models/modulgruppe.rb b/app/models/modulgruppe.rb index dc3787b..236811c 100755 --- a/app/models/modulgruppe.rb +++ b/app/models/modulgruppe.rb @@ -13,7 +13,7 @@ # class Modulgruppe < ActiveRecord::Base - attr_accessible :name, :phase, :typ,:desc, :studium_id + attr_accessible :name, :phase, :typ,:desc, :studium_id, :modul_ids belongs_to :studium, :foreign_key => "studium_id" has_and_belongs_to_many :moduls diff --git a/app/views/modulgruppen/_form.html.erb b/app/views/modulgruppen/_form.html.erb index 22cc925..52a558e 100755 --- a/app/views/modulgruppen/_form.html.erb +++ b/app/views/modulgruppen/_form.html.erb @@ -1,25 +1,29 @@ <%= semantic_form_for @modulgruppe do |f| %> - <%= f.inputs do %> -
    +<%= f.inputs do %> +
    -
    - <%= f.input :name, :wrapper_html=>{:class=>"span12"}%> -
    - <%= f.input :studium_id, :as =>:select, :collection => Studium.all, :wrapper_html=>{:class=>"span4"} %> - <%= f.input :typ, :collection=>["Pflicht","Vertiefungspflicht","Wahl"], :wrapper_html=>{:class=>"span4"}%> - <%= f.input :phase, :as=>:select, :collection=>1..3, :wrapper_html=>{:class=>"span4"} %> -
    -
    +
    + <%= f.input :name, :wrapper_html=>{:class=>"span12"}%> +
    +
    + <%= f.input :studium_id, :as =>:select, :collection => Studium.all, :wrapper_html=>{:class=>"span4"} %> + <%= f.input :typ, :collection=>["Pflicht","Vertiefungspflicht","Wahl"], :wrapper_html=>{:class=>"span4"}%> + <%= f.input :phase, :as=>:select, :collection=>1..3, :wrapper_html=>{:class=>"span4"} %> +
    -
    - <%= f.input :desc %> - -
    - <% end %> +
    + <%= f.input :desc %> +
    - <%= f.actions do %> - <%= f.action :submit, :as => :input %> +
    +
    + <%= f.input :moduls, :as=>:check_boxes %> +
    <% end %> +<%= f.actions do %> +<%= f.action :submit, :as => :input %> + +<% end %> <% end %> From cd14b0dd52dfa112eca10c028cc107eeaa9ef71f Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 00:37:13 +0200 Subject: [PATCH 30/53] Layout kleinigkeiten --- app/views/lvas/show.html.erb | 2 +- app/views/modulgruppen/show.html.erb | 2 +- app/views/moduls/show.html.erb | 6 ++---- app/views/studien/_form.html.erb | 6 +++--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index ce41a44..b1e0e04 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -1,5 +1,5 @@
    -<%= render 'layouts/topbar'%> +<%= render 'studien/tabs'%>

    <%= notice %>

    diff --git a/app/views/modulgruppen/show.html.erb b/app/views/modulgruppen/show.html.erb index b8a33b3..a127623 100755 --- a/app/views/modulgruppen/show.html.erb +++ b/app/views/modulgruppen/show.html.erb @@ -19,7 +19,7 @@ <% @modulgruppe.moduls.each do |modul| %> -<%= render modul%> +<%= render 'moduls/kurz', :modul=>modul%> <% end %>

    diff --git a/app/views/moduls/show.html.erb b/app/views/moduls/show.html.erb index 7e297e7..8253a6b 100755 --- a/app/views/moduls/show.html.erb +++ b/app/views/moduls/show.html.erb @@ -1,8 +1,6 @@ -<%= render 'layouts/topbar'%> + +<%= render 'studien/tabs'%>

    <%= notice %>

    <%= render @modul %> <%= render 'layouts/pretty_toolbar' %> -<% # link_to 'Add LVA', %> -<% # link_to ''.html_safe+ I18n.t("common.edit") , edit_modul_path(@modul) %> -<% # link_to "Loeschen", [@modul],:method=>:delete ,:data => {:confirm =>"Are you sure" } %> diff --git a/app/views/studien/_form.html.erb b/app/views/studien/_form.html.erb index 0973ef5..3aa4a64 100755 --- a/app/views/studien/_form.html.erb +++ b/app/views/studien/_form.html.erb @@ -1,9 +1,8 @@
    <%= tinymce_assets %> <%= semantic_form_for @studium do |f| %> -
    - <%= f.inputs do %> + <%= f.inputs do %>
    <%= f.input :name,:append=>"NAME" %> @@ -18,11 +17,12 @@
    <%= f.input :desc, :as=>:tinymce_text %>
    + <% end %> <%= tinymce %> <%= f.actions do %> <%= f.action :submit, :as => :input %> <% end %> -
    + <% end %>
    From 6408d04ea88f2a24e40150dd1787a273c11a1e34 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 00:38:01 +0200 Subject: [PATCH 31/53] =?UTF-8?q?Modul-show=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/modulgruppen/_kurz.html.erb | 1 + app/views/moduls/_modul.html.erb | 43 +++++++++++++-------------- 2 files changed, 21 insertions(+), 23 deletions(-) create mode 100644 app/views/modulgruppen/_kurz.html.erb diff --git a/app/views/modulgruppen/_kurz.html.erb b/app/views/modulgruppen/_kurz.html.erb new file mode 100644 index 0000000..610f838 --- /dev/null +++ b/app/views/modulgruppen/_kurz.html.erb @@ -0,0 +1 @@ +<%=link_to modulgruppe.name, modulgruppe %> <%= ' ( ' + modulgruppe.studium.name + ')' unless modulgruppe.studium.nil? %> diff --git a/app/views/moduls/_modul.html.erb b/app/views/moduls/_modul.html.erb index eca542f..78ff8dc 100755 --- a/app/views/moduls/_modul.html.erb +++ b/app/views/moduls/_modul.html.erb @@ -1,26 +1,23 @@ -

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

    + +

    <%=@modul.name %>

    + + +

    Beschreibung

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

    -LVAs: - -
      - -<% modul.lvas.each do |lv| %> -
    • -<%= link_to lv.name.to_s, lva_path(lv.id) %> -
    • -<% end %> - -
    - -<% # @toolbar_elements << {:icon=>:pencil,:text=>I18n.t("common.edit"),:path=> edit_modul_path(modul)} %> +

    Lvas

    +<% @modul.lvas.each_slice(3) do |row| %> +
    +<% row.each do |lv| %> +
    +<%= render 'lvas/lva_semester', :lva=>lv%>
    +<% end %> +
    + +<% end %> +

    Modulgruppen

    +<% @modul.modulgruppen.each do |mg| %> +<%= render 'modulgruppen/kurz', :modulgruppe=>mg %>
    +<% end %> From 661783bcd1e8841a246b65699ed7681c9184f11a Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 00:38:24 +0200 Subject: [PATCH 32/53] =?UTF-8?q?Aus=20semesteransicht=20per=20link=20lvas?= =?UTF-8?q?=20zu=20semester=20hinzuf=C3=BCgen=20/entfernen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/studien/semesteransicht.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/studien/semesteransicht.html.erb b/app/views/studien/semesteransicht.html.erb index abf692a..ca302e7 100644 --- a/app/views/studien/semesteransicht.html.erb +++ b/app/views/studien/semesteransicht.html.erb @@ -14,7 +14,7 @@
    -

    <%= sem.name %>

    +

    <%= sem.name %> <%= link_to 'Lvas hinzufügen/entfernen', edit_semester_path(sem)%>

    <% sem.lvas.each_slice(4) do |row| %>
    From a5a02e065a319d162c5a280605c2c0d3c15643ca Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 11 Aug 2013 01:17:37 +0200 Subject: [PATCH 33/53] =?UTF-8?q?Calendar=20Klasse=20=C3=BCberarbeitet=20V?= =?UTF-8?q?iews,gefixt,=20Pictures=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 5 +- app/assets/stylesheets/application.css.scss | 2 +- app/controllers/calendars_controller.rb | 2 +- app/inputs/date_string_input.rb | 3 +- app/models/calendar.rb | 3 +- app/models/calentry.rb | 9 ++- app/uploaders/picture_uploader.rb | 51 ++++++++++++++ app/views/calendars/_form.html.erb | 1 + app/views/calendars/index.html.erb | 27 +++----- app/views/calendars/show.html.erb | 40 ++++++----- app/views/calendars/show.ics.erb | 3 + app/views/calentries/_calentry.ics.erb | 5 ++ app/views/calentries/_form.html.erb | 27 +++++++- app/views/calentries/show.html.erb | 36 +++++----- ...20130810214456_add_picture_to_calendars.rb | 5 ++ db/schema.rb | 69 ++++++++++++++++++- spec/models/calentry_spec.rb | 17 ++++- 17 files changed, 238 insertions(+), 67 deletions(-) create mode 100644 app/uploaders/picture_uploader.rb create mode 100644 app/views/calendars/show.ics.erb create mode 100644 app/views/calentries/_calentry.ics.erb create mode 100644 db/migrate/20130810214456_add_picture_to_calendars.rb diff --git a/Gemfile b/Gemfile index d81643d..1fdf2bd 100755 --- a/Gemfile +++ b/Gemfile @@ -12,9 +12,9 @@ gem 'rails', '3.2.9' # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.2.3' + gem 'sass-rails', '~> 3.2' gem 'coffee-rails', '~> 3.2.1' - gem 'bootstrap-sass','~> 2.2.0' + gem 'bootstrap-sass','~> 2.3.2.1' # See https://github.com/sstephenson/execjs#readme for more supported runtimes gem 'therubyracer', :platforms => :ruby gem 'uglifier', '>= 1.0.3' @@ -77,3 +77,4 @@ gem 'rspec-rails' end gem "simple_calendar", "~> 0.1.9" +gem 'rmagick' diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 71eebc4..ecbb13d 100755 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -10,7 +10,7 @@ * *= require_self *= require_tree . - * require 'bootstrap' + *= require 'bootstrap' */ $linkColor: #03006E; @import 'bootstrap'; diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb index b3631aa..059a7f0 100644 --- a/app/controllers/calendars_controller.rb +++ b/app/controllers/calendars_controller.rb @@ -3,7 +3,6 @@ class CalendarsController < ApplicationController # GET /calendars.json def index @calendars = Calendar.all - respond_to do |format| format.html # index.html.erb format.json { render json: @calendars } @@ -18,6 +17,7 @@ class CalendarsController < ApplicationController respond_to do |format| format.html # show.html.erb format.json { render json: @calendar } + format.ics { render 'show.ics.erb'} end end diff --git a/app/inputs/date_string_input.rb b/app/inputs/date_string_input.rb index d10e2c9..a70ab33 100644 --- a/app/inputs/date_string_input.rb +++ b/app/inputs/date_string_input.rb @@ -1,6 +1,7 @@ class DateStringInput < FormtasticBootstrap::Inputs::StringInput def input_html_options - super.merge(:class => "datetext", :onclick =>"beep", :value=>I18n.l(@object.send(method.to_sym))) + value = (@object.send(method.to_sym)) + super.merge(:class => "datetext", :onclick =>"beep", :value=>I18n.l((value.is_a?(Time)||value.is_a?(Date)||value.is_a?(DateTime)) ? value : Time.now)) end end diff --git a/app/models/calendar.rb b/app/models/calendar.rb index eaaa1a9..4f5de1d 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -1,4 +1,5 @@ class Calendar < ActiveRecord::Base - attr_accessible :name, :public + attr_accessible :name, :public, :picture has_and_belongs_to_many :calentries + mount_uploader :picture, PictureUploader end diff --git a/app/models/calentry.rb b/app/models/calentry.rb index 7d7ded6..d6cf59e 100644 --- a/app/models/calentry.rb +++ b/app/models/calentry.rb @@ -1,6 +1,13 @@ class Calentry < ActiveRecord::Base attr_accessible :ende, :start, :summary, :typ,:calendar_ids - has_and_belongs_to_many :calendar + has_and_belongs_to_many :calendars + validates :start, :presence => true + validates :typ, :presence => true + validate do |entry| + if entry.ende.nil? + errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein") + end + end def start_time start end diff --git a/app/uploaders/picture_uploader.rb b/app/uploaders/picture_uploader.rb new file mode 100644 index 0000000..ec0f27a --- /dev/null +++ b/app/uploaders/picture_uploader.rb @@ -0,0 +1,51 @@ +# encoding: utf-8 + +class PictureUploader < 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 :resize_to_fill => [64, 64] + 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/calendars/_form.html.erb b/app/views/calendars/_form.html.erb index dc6e021..139e9d8 100644 --- a/app/views/calendars/_form.html.erb +++ b/app/views/calendars/_form.html.erb @@ -2,6 +2,7 @@ <%= f.inputs do %> <%= f.input :name %> <%= f.input :public %> + <%= f.input :picture, :as => :file %> <% end %> <%= f.actions do %> diff --git a/app/views/calendars/index.html.erb b/app/views/calendars/index.html.erb index 402c093..8d6c591 100644 --- a/app/views/calendars/index.html.erb +++ b/app/views/calendars/index.html.erb @@ -1,25 +1,14 @@

    Listing calendars

    - - - - - - - - - <% @calendars.each do |calendar| %> - - - - - - - +
    + + + +
    +

    <%= link_to calendar.name, calendar %>

    +
    +
    <% end %> -
    NamePublic
    <%= calendar.name %><%= calendar.public %><%= link_to 'Show', calendar %><%= link_to 'Edit', edit_calendar_path(calendar) %><%= link_to 'Destroy', calendar, method: :delete, data: { confirm: 'Are you sure?' } %>
    - -
    <%= link_to 'New Calendar', new_calendar_path %> diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb index 8778ca8..0c7e038 100644 --- a/app/views/calendars/show.html.erb +++ b/app/views/calendars/show.html.erb @@ -1,24 +1,30 @@ +
    +

    <%= notice %>

    -

    - Name: - <%= @calendar.name %> -

    - -

    - Public: - <%= @calendar.public %> -

    -

    -

      +

      + <%= ''.html_safe unless !@calendar.public%> + <%= @calendar.name %> +

      +
      +
        <% @calendar.calentries.each do |entry| %> -<%= entry.summary+ "- " + entry.start.to_s %> +
      • +<%= link_to entry.summary+ " - " + I18n.l(entry.start), entry %> +
      • <% end %> - +
      +
      +
      <%= calendar @calendar.calentries do |entry| %>
      <%= link_to entry.name, entry %>
      <% end %> - -<%= link_to 'New Entry', new_calentry_path %> -<%= link_to 'Edit', edit_calendar_path(@calendar) %> | -<%= link_to 'Back', calendars_path %> +
      +
      +
      +<%= link_to 'New Entry', new_calentry_path, {:class=>"btn"} %> +<%= link_to 'Edit', edit_calendar_path(@calendar), {:class=>"btn"} %> +<%= link_to 'Back', calendars_path, {:class=>"btn"} %> +
      +
      +
    diff --git a/app/views/calendars/show.ics.erb b/app/views/calendars/show.ics.erb new file mode 100644 index 0000000..8d3126f --- /dev/null +++ b/app/views/calendars/show.ics.erb @@ -0,0 +1,3 @@ +<% @calendar.calentries.each do |entry| %> +<%= render entry %> +<% end %> diff --git a/app/views/calentries/_calentry.ics.erb b/app/views/calentries/_calentry.ics.erb new file mode 100644 index 0000000..dead832 --- /dev/null +++ b/app/views/calentries/_calentry.ics.erb @@ -0,0 +1,5 @@ + <%= calentry.start %> + <%= calentry.ende %> + <%= calentry.summary %> + <%= calentry.typ %> + diff --git a/app/views/calentries/_form.html.erb b/app/views/calentries/_form.html.erb index 5306d58..eb9bb02 100644 --- a/app/views/calentries/_form.html.erb +++ b/app/views/calentries/_form.html.erb @@ -1,13 +1,34 @@ +
    <%= semantic_form_for @calentry do |f| %> <%= f.inputs do %> +
    +
    <%= f.input :start , :as => :date_string %> - <%= f.input :ende %> +
    +
    + <%= f.input :ende , :as => :date_string %> +
    +
    +
    +
    <%= f.input :summary %> - <%= f.input :calendar, :as=> :radio %> +
    +
    +
    +
    + <%= f.input :calendars, :as=> :radio %> +
    +
    <%= f.input :typ %> +
    +
    <% end %> - +
    +
    <%= f.actions do %> <%= f.action :submit, :as => :input %> <% end %> +
    +
    <% end %> +
    diff --git a/app/views/calentries/show.html.erb b/app/views/calentries/show.html.erb index 908d8dc..faa5c9c 100644 --- a/app/views/calentries/show.html.erb +++ b/app/views/calentries/show.html.erb @@ -1,25 +1,25 @@

    <%= notice %>

    - -

    - Start: - <%= @calentry.start %> -

    - -

    - Ende: - <%= @calentry.ende %> -

    - -

    - Summary: +

    +
    +
    + <%= @calentry.summary %> -

    +
    -

    - Typ: +

    +
    +
    +
    + <%= I18n.l @calentry.start %> + <%= " bis " unless @calentry.ende.nil? %> + <%= I18n.l @calentry.ende %> +
    +
    <%= @calentry.typ %> -

    - +
    +
    +
    <%= link_to 'Edit', edit_calentry_path(@calentry) %> | <%= link_to 'Back', calentries_path %> +
    diff --git a/db/migrate/20130810214456_add_picture_to_calendars.rb b/db/migrate/20130810214456_add_picture_to_calendars.rb new file mode 100644 index 0000000..d1b4b44 --- /dev/null +++ b/db/migrate/20130810214456_add_picture_to_calendars.rb @@ -0,0 +1,5 @@ +class AddPictureToCalendars < ActiveRecord::Migration + def change + add_column :calendars, :picture, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 6a96d37..b8d0781 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,23 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130729085446) do +ActiveRecord::Schema.define(:version => 20130810214456) do + + create_table "attachments", :force => true do |t| + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "beispiel_translations", :force => true do |t| + t.string "locale" + t.text "desc" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "beispiele_id" + end + + add_index "beispiel_translations", ["locale"], :name => "index_beispiel_translations_on_locale" create_table "beispiele", :force => true do |t| t.string "name" @@ -22,6 +38,38 @@ ActiveRecord::Schema.define(:version => 20130729085446) do t.string "beispieldatei" end + create_table "calendars", :force => true do |t| + t.string "name" + t.boolean "public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "picture" + end + + create_table "calendars_calentries", :id => false, :force => true do |t| + t.integer "calentry_id" + t.integer "calendar_id" + end + + add_index "calendars_calentries", ["calendar_id"], :name => "index_calendars_calentries_on_calendar_id" + add_index "calendars_calentries", ["calentry_id", "calendar_id"], :name => "index_calendars_calentries_on_calentry_id_and_calendar_id" + + create_table "calentries", :force => true do |t| + t.datetime "start" + t.datetime "ende" + t.string "summary" + t.integer "typ" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "fragen", :force => true do |t| + t.string "title" + t.text "text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "lva_translations", :force => true do |t| t.integer "lva_id" t.string "locale" @@ -50,11 +98,14 @@ ActiveRecord::Schema.define(:version => 20130729085446) do t.integer "modul_id" end - create_table "lvas_semesters", :force => true do |t| + create_table "lvas_semesters", :id => false, :force => true do |t| t.integer "lva_id" t.integer "semester_id" end + add_index "lvas_semesters", ["lva_id", "semester_id"], :name => "index_lvas_semesters_on_lva_id_and_semester_id" + add_index "lvas_semesters", ["semester_id"], :name => "index_lvas_semesters_on_semester_id" + create_table "modul_translations", :force => true do |t| t.integer "modul_id" t.string "locale" @@ -161,6 +212,20 @@ ActiveRecord::Schema.define(:version => 20130729085446) do add_index "studium_translations", ["locale"], :name => "index_studium_translations_on_locale" + create_table "themen", :force => true do |t| + t.string "title" + t.text "text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "themengruppen", :force => true do |t| + t.string "title" + t.text "text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "users", :force => true do |t| t.string "email", :default => "", :null => false t.string "encrypted_password", :default => "", :null => false diff --git a/spec/models/calentry_spec.rb b/spec/models/calentry_spec.rb index 0e3a169..02e654e 100644 --- a/spec/models/calentry_spec.rb +++ b/spec/models/calentry_spec.rb @@ -1,5 +1,20 @@ require 'spec_helper' describe Calentry do - pending "add some examples to (or delete) #{__FILE__}" + it "should be valid with full data" do + e = FactoryGirl.build(:calentry) + c = FactoryGirl.create(:calendar) + e.calendars< nil) + c=FactoryGirl.create(:calendar) + e.calendars< Date: Sun, 11 Aug 2013 10:50:33 +0200 Subject: [PATCH 34/53] merge conflict behoben --- Gemfile.lock | 11 +- .../stylesheets/formtastic-changes.css.scss | 14 -- config/locales/de.yml | 9 +- config/routes.rb | 121 +----------------- 4 files changed, 16 insertions(+), 139 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2f98cfb..ff6d52b 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,7 +35,7 @@ GEM activerecord (>= 3.0.0) bcrypt-ruby (3.0.1) bcrypt-ruby (3.0.1-x86-mingw32) - bootstrap-sass (2.2.2.0) + bootstrap-sass (2.3.2.1) sass (~> 3.2) builder (3.0.4) cancan (1.6.9) @@ -128,6 +128,7 @@ GEM rdoc (3.12.1) json (~> 1.4) ref (1.0.2) + rmagick (2.13.2) rolify (3.2.0) rspec-core (2.14.4) rspec-expectations (2.14.0) @@ -145,6 +146,8 @@ GEM railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) + simple_calendar (0.1.9) + rails (>= 3.0) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) @@ -176,7 +179,7 @@ PLATFORMS DEPENDENCIES annotate (>= 2.5.0) awesome_nested_set - bootstrap-sass (~> 2.2.0) + bootstrap-sass (~> 2.3.2.1) cancan carrierwave coffee-rails (~> 3.2.1) @@ -192,9 +195,11 @@ DEPENDENCIES paper_trail (>= 2.7.0) paperclip (~> 3.4.0) rails (= 3.2.9) + rmagick rolify rspec-rails - sass-rails (~> 3.2.3) + sass-rails (~> 3.2) + simple_calendar (~> 0.1.9) sqlite3 therubyracer tinymce-rails (>= 3.5.8) diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss index 07c5dfe..233b45e 100644 --- a/app/assets/stylesheets/formtastic-changes.css.scss +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -6,22 +6,8 @@ width:90%; height:20em; } -<<<<<<< HEAD form.formtastic .input label.control-label { font-weight:bold; font-size:125%; } -======= -div.form-group { -border-width: 1px; -border-style: none; -padding: 10px; -// border-radius: 10px; -} -div.verwalten-block { -border-width: 1px; -border-style: solid; -padding: 5px; -} ->>>>>>> a5a02e065a319d162c5a280605c2c0d3c15643ca diff --git a/config/locales/de.yml b/config/locales/de.yml index 0a24057..0b26e0f 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -105,7 +105,6 @@ de: blank: "Geben Sie den Namen des Studiums ein" taken: "Der Name ist bereits vergeben" typ: -<<<<<<< HEAD inclusion: 'Wählen Sie "Bachelor" oder "Master" aus' modul: attributes: @@ -124,11 +123,7 @@ de: keine: "Keine Fehlermeldungen oder Warnungen" support: array: - two_words_connector: ', ' - -======= - inclusion: 'Wählen Sie "Bachelor" oder "Master" aus' - + two_words_connector: ', ' date: abbr_day_names: - So @@ -324,4 +319,4 @@ de: long: ! '%A, %d. %B %Y, %H:%M Uhr' short: ! '%d.%m.%Y, %H:%M Uhr' pm: nachmittags ->>>>>>> a5a02e065a319d162c5a280605c2c0d3c15643ca + diff --git a/config/routes.rb b/config/routes.rb index 46911fd..db295a4 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,10 @@ -<<<<<<< HEAD Fetsite::Application.routes.draw do - + + resources :calendars + + + resources :calentries + devise_for :users resources :home, :only=>[:index] #get 'home',:controller=>home,:action=>:index,:as=>"home_index" @@ -107,116 +111,3 @@ # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id))(.:format)' end -======= -Fetsite::Application.routes.draw do - - resources :calendars - - - resources :calentries - - - devise_for :users - resources :home, :only=>[:index] - #get 'home',:controller=>home,:action=>:index,:as=>"home_index" - scope '(:locale)/admin' do - resources :users - get 'config',:controller=>:config,:action=>:index , :as => 'config' - get 'config/get_git_update',:controller=>:config,:action=>:get_git_update, :as=>'config_getgitupdate' - get 'config/get_git_update',:controller=>:config,:action=>:get_git_update - end - - devise_for :users - - resources :pages, :except => [:index] do - member do - post 'preview' - end - end - get 'pages', :to =>'pages#show' - scope '(:locale)' do - - resources :studien, :only=>[:show,:new,:edit,:update,:destroy] - resources :modulgruppen,:only =>[:create,:index] - - resources :studien,:except=>[:show,:new,:edit,:update,:destroy], :shallow=>true do - resources :modulgruppen, :path => "(:locale)/modulgruppen" - - end - get 'studien/:id/semesteransicht', :controller=>:studien, :action=>:semesteransicht, :as=>'studium_semesteransicht' - resources :semesters - resources :moduls - resources :lvas - resources :neuigkeiten - get 'rubriken/verwalten', :controller=>:rubriken, :action=>:alle_verwalten, :as=>'alle_verwalten_rubrik' - - resources :rubriken do - resources :neuigkeiten, :only=>[:new, :show] - end - put 'rubriken/(:id)/addmoderator',:controller=>:rubriken,:action=>:addmoderator - get 'rubriken/:id/verwalten',:controller=>:rubriken,:action=>:verwalten, :as=>'verwalten_rubrik' - resources :home, :only=>[:index] - get 'home/dev', :controller=>:home, :action=>:dev, :as=>'home_dev' - resources :beispiele - - end - - # The priority is based upon order of creation: - # first created -> highest priority. - - # Sample of regular route: - # match 'products/:id' => 'catalog#view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Sample resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Sample resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Sample resource route with more complex sub-resources - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', :on => :collection - # end - # end - - # Sample resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - - root :to => 'home#index' - - # See how all your routes lay out with "rake routes" - - # This is a legacy wild controller route that's not recommended for RESTful applications. - # Note: This route will make all actions in every controller accessible via GET requests. - # match ':controller(/:action(/:id))(.:format)' -end ->>>>>>> a5a02e065a319d162c5a280605c2c0d3c15643ca From eefd3d9a76e703ed613b196e6ac91a376a19f438 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 11:09:03 +0200 Subject: [PATCH 35/53] schema --- db/schema.rb | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index 6a96d37..4dbfdf9 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,14 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130729085446) do +ActiveRecord::Schema.define(:version => 20130810214456) do + + create_table "attachments", :force => true do |t| + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "thema_id" + end create_table "beispiele", :force => true do |t| t.string "name" @@ -22,6 +29,50 @@ ActiveRecord::Schema.define(:version => 20130729085446) do t.string "beispieldatei" end + create_table "calendars", :force => true do |t| + t.string "name" + t.boolean "public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "picture" + end + + create_table "calendars_calentries", :id => false, :force => true do |t| + t.integer "calentry_id" + t.integer "calendar_id" + end + + add_index "calendars_calentries", ["calendar_id"], :name => "index_calendars_calentries_on_calendar_id" + add_index "calendars_calentries", ["calentry_id", "calendar_id"], :name => "index_calendars_calentries_on_calentry_id_and_calendar_id" + + create_table "calentries", :force => true do |t| + t.datetime "start" + t.datetime "ende" + t.string "summary" + t.integer "typ" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "frage_translations", :force => true do |t| + t.string "locale" + t.string "title" + t.text "text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "fragen_id" + end + + add_index "frage_translations", ["locale"], :name => "index_frage_translations_on_locale" + + create_table "fragen", :force => true do |t| + t.string "title" + t.text "text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "thema_id" + end + create_table "lva_translations", :force => true do |t| t.integer "lva_id" t.string "locale" @@ -161,6 +212,43 @@ ActiveRecord::Schema.define(:version => 20130729085446) do add_index "studium_translations", ["locale"], :name => "index_studium_translations_on_locale" + create_table "thema_translations", :force => true do |t| + t.string "locale" + t.string "title" + t.text "text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "themen_id" + end + + add_index "thema_translations", ["locale"], :name => "index_thema_translations_on_locale" + + create_table "themen", :force => true do |t| + t.string "title" + t.text "text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "themengruppe_id" + end + + create_table "themengruppe_translations", :force => true do |t| + t.string "locale" + t.string "title" + t.text "text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "themengruppen_id" + end + + add_index "themengruppe_translations", ["locale"], :name => "index_themengruppe_translations_on_locale" + + create_table "themengruppen", :force => true do |t| + t.string "title" + t.text "text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "users", :force => true do |t| t.string "email", :default => "", :null => false t.string "encrypted_password", :default => "", :null => false From 4f95770fa7e33354440c875119a3838ab4788fa3 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 11:27:37 +0200 Subject: [PATCH 36/53] =?UTF-8?q?Lva-show=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/lvas_controller.rb | 8 ----- app/views/lvas/show.html.erb | 53 ++++++++++++++++++------------ 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/app/controllers/lvas_controller.rb b/app/controllers/lvas_controller.rb index 7b737dd..d2ee71f 100755 --- a/app/controllers/lvas_controller.rb +++ b/app/controllers/lvas_controller.rb @@ -16,14 +16,6 @@ class LvasController < ApplicationController @toolbar_elements<<{:hicon=>'icon-plus-sign', :icon=>:plus, :text => "Neues Beispiel", :path=> new_beispiel_path(:lva_id =>@lva.id)} @toolbar_elements<<{:hicon=>'icon-pencil', :icon=>:pencil,:text =>I18n.t('common.edit'),:path => edit_lva_path(@lva)} - @topbar_elements =[{:hicon=>'icon-list', :text=>I18n.t("lva.list"), :path=>lvas_path}] - for m in @lva.modul - @topbar_elements << {:newline=>true} - @topbar_elements << {:text=> '' + m.name + '', :path=>modul_path(m)} - for mg in m.modulgruppen - @topbar_elements << {:text => mg.studium.name + ' (' + mg.name + ')', :path=>studium_path(mg.studium)} - end - end end # GET /lvas/new diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index b1e0e04..9f01de4 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -1,36 +1,47 @@
    -<%= render 'studien/tabs'%> -

    <%= notice %>

    -

    + <%= render 'studien/tabs'%> +

    <%= notice %>

    -

    <%= @lva.lvanr %><%= @lva.name %> <%= @lva.ects %> ECTS/ <%= @lva.stunden %> Std

    - -

    - -

    Beschreibung

    - <%= @lva.desc %> -

    -

    Beispiele

    +
    +

    <%= @lva.name %>

    + +

    Beschreibung

    +
    + <%= @lva.desc %> +
    +
    +

    Beispiele

    <% @lva.beispiele.each do |b|%> - +
    <%= render b%> - +
    <% end %>
    -

    Module

    -
      - <% @lva.modul.each do |modul| %> +
    +
    +
      +
    • LVA-Nummer: <%=@lva.lvanr %>
    • +
    • ECTS: <%=@lva.ects %>
    • +
    • Stunden: <%=@lva.ects %>
    • +
    +

    Module

    +
      + <% @lva.modul.each do |modul| %>
    • <%= link_to modul.name , modul_path(modul)%> -
        - <% modul.modulgruppen.each do |g| %> +
          + <% modul.modulgruppen.each do |g| %>
        • <%= link_to g.studium.name , studium_path(g.studium)%> (<%=link_to g.name, modulgruppe_path(g)%>)
        • - <% end %> + <% end %>
        - <% end %> -
      + <% end %> +
    +
    +
    + + <%= render 'layouts/pretty_toolbar' %>
    From 90b8aff78decf1d779a899933f83305051b9392d Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 11:34:20 +0200 Subject: [PATCH 37/53] lva view tweaks --- app/assets/stylesheets/lvas.css.scss | 15 ++++++ app/views/beispiele/_beispiel.html.erb | 2 +- app/views/lvas/show.html.erb | 69 +++++++++++++------------- 3 files changed, 51 insertions(+), 35 deletions(-) diff --git a/app/assets/stylesheets/lvas.css.scss b/app/assets/stylesheets/lvas.css.scss index 54abac2..9084fc3 100755 --- a/app/assets/stylesheets/lvas.css.scss +++ b/app/assets/stylesheets/lvas.css.scss @@ -9,4 +9,19 @@ margin: 1px; padding: 5px; border-color: green; border-radius: 5px; +} +div.lva-sidebar { +border:solid; +border-width: 1px; +margin: 2px; +padding:5px; +border-radius:5px; +} +div.lva-beispiele { +border:solid; +border-width: 1px; +margin: 2px; +padding:5px; +border-radius:5px; +border-color: green; } \ No newline at end of file diff --git a/app/views/beispiele/_beispiel.html.erb b/app/views/beispiele/_beispiel.html.erb index 740e496..07c9cf9 100644 --- a/app/views/beispiele/_beispiel.html.erb +++ b/app/views/beispiele/_beispiel.html.erb @@ -1,4 +1,4 @@ -
    +

    <%=link_to beispiel.name, beispiel.beispieldatei.url%>

    <%= beispiel.desc %>
    diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index 9f01de4..b2d9e89 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -6,42 +6,43 @@

    <%= @lva.name %>

    -

    Beschreibung

    -
    - <%= @lva.desc %> -
    -
    -

    Beispiele

    - <% @lva.beispiele.each do |b|%> -
    - <%= render b%> -
    - <% end %> -
    -
    -
    -
      -
    • LVA-Nummer: <%=@lva.lvanr %>
    • -
    • ECTS: <%=@lva.ects %>
    • -
    • Stunden: <%=@lva.ects %>
    • -
    -

    Module

    -
      - <% @lva.modul.each do |modul| %> -
    • <%= link_to modul.name , modul_path(modul)%> -
        - <% modul.modulgruppen.each do |g| %> +

        Beschreibung

        +
        + <%= @lva.desc %> +
        +
        +

        Beispiele

        -
      • <%= link_to g.studium.name , studium_path(g.studium)%> (<%=link_to g.name, modulgruppe_path(g)%>)
      • + <% @lva.beispiele.each do |b|%> + + <%= render b%> <% end %> -
      -
    • - - <% end %> -
    -
    -
    +
    +
    +
    +
    +
      +
    • LVA-Nummer: <%=@lva.lvanr %>
    • +
    • ECTS: <%=@lva.ects %>
    • +
    • Stunden: <%=@lva.ects %>
    • +
    +

    Module

    +
      + <% @lva.modul.each do |modul| %> +
    • <%= link_to modul.name , modul_path(modul)%> +
        + <% modul.modulgruppen.each do |g| %> +
      • <%= link_to g.studium.name , studium_path(g.studium)%> (<%=link_to g.name, modulgruppe_path(g)%>)
      • + <% end %> +
      +
    • + + <% end %> +
    +
    +
    +
    -<%= render 'layouts/pretty_toolbar' %> + <%= render 'layouts/pretty_toolbar' %>
    From 0736320be6eb5b408b52099b9533e05299051544 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 11:43:06 +0200 Subject: [PATCH 38/53] Semesteransicht verbessert --- app/views/studien/semesteransicht.html.erb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/studien/semesteransicht.html.erb b/app/views/studien/semesteransicht.html.erb index ca302e7..e9f423a 100644 --- a/app/views/studien/semesteransicht.html.erb +++ b/app/views/studien/semesteransicht.html.erb @@ -13,9 +13,12 @@
    - -

    <%= sem.name %> <%= link_to 'Lvas hinzufügen/entfernen', edit_semester_path(sem)%>

    - +
    +
    +

    <%= sem.name %>

    +
    +
    <%= link_to 'Lvas hinzufügen/entfernen', edit_semester_path(sem), :class=>"btn"%>
    +
    <% sem.lvas.each_slice(4) do |row| %>
    <% row.each do |l| %> From ff31ba6bff3d403a55977f1005e82d904670f8fa Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 11 Aug 2013 17:05:56 +0200 Subject: [PATCH 39/53] Kleine Anpassungen Calentry --- app/models/calentry.rb | 3 +++ app/views/calendars/show.html.erb | 2 +- config/routes.rb | 8 +++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/models/calentry.rb b/app/models/calentry.rb index d6cf59e..47f90ee 100644 --- a/app/models/calentry.rb +++ b/app/models/calentry.rb @@ -11,6 +11,9 @@ class Calentry < ActiveRecord::Base def start_time start end + def start1 + start.to_date + end def name summary end diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb index 0c7e038..cb20b2a 100644 --- a/app/views/calendars/show.html.erb +++ b/app/views/calendars/show.html.erb @@ -10,7 +10,7 @@
      <% @calendar.calentries.each do |entry| %>
    • -<%= link_to entry.summary+ " - " + I18n.l(entry.start), entry %> +<%= link_to entry.summary+ " - " + I18n.l(entry.start1), entry %>
    • <% end %>
    diff --git a/config/routes.rb b/config/routes.rb index 696aeb1..5a7fbf6 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,9 +1,6 @@ Fetsite::Application.routes.draw do - resources :calendars - - - resources :calentries + devise_for :users @@ -48,7 +45,8 @@ Fetsite::Application.routes.draw do resources :home, :only=>[:index] get 'home/dev', :controller=>:home, :action=>:dev, :as=>'home_dev' resources :beispiele - + resources :calendars + resources :calentries end # The priority is based upon order of creation: From 7bdd3b19599a190e748573925e5c21df28c34f1b Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 11 Aug 2013 17:06:22 +0200 Subject: [PATCH 40/53] =?UTF-8?q?Bootstrap=20wieder=20zur=C3=BCck=20korrig?= =?UTF-8?q?iert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/stylesheets/application.css.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index ecbb13d..3de1cac 100755 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -10,7 +10,7 @@ * *= require_self *= require_tree . - *= require 'bootstrap' + * require 'bootstrap' */ $linkColor: #03006E; @import 'bootstrap'; From ac09de9e0ab1c45aa641d6b7a7d92a2853c4612a Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 11 Aug 2013 17:06:39 +0200 Subject: [PATCH 41/53] =?UTF-8?q?Link=20->Issues=20f=C3=BCr=20Startseite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 11 ++++++++--- app/views/home/index.html.erb | 10 ++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2f98cfb..ff6d52b 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,7 +35,7 @@ GEM activerecord (>= 3.0.0) bcrypt-ruby (3.0.1) bcrypt-ruby (3.0.1-x86-mingw32) - bootstrap-sass (2.2.2.0) + bootstrap-sass (2.3.2.1) sass (~> 3.2) builder (3.0.4) cancan (1.6.9) @@ -128,6 +128,7 @@ GEM rdoc (3.12.1) json (~> 1.4) ref (1.0.2) + rmagick (2.13.2) rolify (3.2.0) rspec-core (2.14.4) rspec-expectations (2.14.0) @@ -145,6 +146,8 @@ GEM railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) + simple_calendar (0.1.9) + rails (>= 3.0) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) @@ -176,7 +179,7 @@ PLATFORMS DEPENDENCIES annotate (>= 2.5.0) awesome_nested_set - bootstrap-sass (~> 2.2.0) + bootstrap-sass (~> 2.3.2.1) cancan carrierwave coffee-rails (~> 3.2.1) @@ -192,9 +195,11 @@ DEPENDENCIES paper_trail (>= 2.7.0) paperclip (~> 3.4.0) rails (= 3.2.9) + rmagick rolify rspec-rails - sass-rails (~> 3.2.3) + sass-rails (~> 3.2) + simple_calendar (~> 0.1.9) sqlite3 therubyracer tinymce-rails (>= 3.5.8) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 4d56fdb..9dc3abb 100755 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,3 +1,13 @@

    <%= t 'home.willkommen' %>

    <%= t 'home.hallobeiderfet' %>

    +
    +

    Alpha Test

    +

    Die Webseite befindet sich derzeit in einem Entsicklungsstadium, +volle Funktionsfähigkeit ist noch nicht erreicht. Bitte Featurerequests und +Fehlermeldungen auf GitHub melden. +

    +

    +<%= link_to "Issues", "http://www.github.com/fetsite/fetsite/issues" %> +

    +
    <%= link_to "Entwicklungsstatus" , home_dev_path %> From dfd99bec5fad90afd113a0674bcee316b52980a4 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 21:25:18 +0200 Subject: [PATCH 42/53] =?UTF-8?q?Pr=C3=BCfungsinformation=20und=20Lernaufw?= =?UTF-8?q?and=20zu=20Lva=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/lva.rb | 2 +- app/views/lvas/_form.html.erb | 2 ++ app/views/lvas/show.html.erb | 9 ++++++++- db/schema.rb | 8 +++++--- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/models/lva.rb b/app/models/lva.rb index 86d1c5c..300e0e2 100755 --- a/app/models/lva.rb +++ b/app/models/lva.rb @@ -17,7 +17,7 @@ class Lva < ActiveRecord::Base has_paper_trail # Versionsverfolgung - attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids + attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand has_and_belongs_to_many :modul # Gehört zu einem Modul has_and_belongs_to_many :semester #Gehört zu einem Semester( derzeit nicht implementiert) diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index d43f386..be3ef9d 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -23,6 +23,8 @@
    <%= f.input :desc %> + <%= f.input :pruefungsinformation %> + <%= f.input :lernaufwand %>
    diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index b2d9e89..d5e5950 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -5,7 +5,14 @@

    <%= @lva.name %>

    - +

    Prüfungsinformation

    +
    + <%= @lva.pruefungsinformation %> +
    +

    Lernaufwand

    +
    + <%= @lva.lernaufwand %> +

    Beschreibung

    <%= @lva.desc %> diff --git a/db/schema.rb b/db/schema.rb index 4dbfdf9..c8266dc 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130810214456) do +ActiveRecord::Schema.define(:version => 20130811191150) do create_table "attachments", :force => true do |t| t.string "name" @@ -90,10 +90,12 @@ ActiveRecord::Schema.define(:version => 20130810214456) do t.decimal "ects" t.string "lvanr" t.decimal "stunden" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "modul_id" t.integer "semester_id" + t.text "pruefungsinformation" + t.text "lernaufwand" end create_table "lvas_moduls", :id => false, :force => true do |t| From 09dd4f65a07705bd62467f862f21a76d265dd2f7 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Mon, 12 Aug 2013 09:15:58 +0200 Subject: [PATCH 43/53] =?UTF-8?q?Pr=C3=BCfungsinformationen=20und=20Typ=20?= =?UTF-8?q?zu=20lva=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/lva.rb | 3 ++- app/views/lvas/_form.html.erb | 8 ++++++-- app/views/lvas/show.html.erb | 2 +- db/migrate/20130811191150_add_pruefungsinfos_to_lvas.rb | 6 ++++++ db/migrate/20130812070544_add_typ_to_lvas.rb | 5 +++++ db/schema.rb | 3 ++- 6 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20130811191150_add_pruefungsinfos_to_lvas.rb create mode 100644 db/migrate/20130812070544_add_typ_to_lvas.rb diff --git a/app/models/lva.rb b/app/models/lva.rb index 300e0e2..307133c 100755 --- a/app/models/lva.rb +++ b/app/models/lva.rb @@ -17,7 +17,7 @@ class Lva < ActiveRecord::Base has_paper_trail # Versionsverfolgung - attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand + attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand, :typ has_and_belongs_to_many :modul # Gehört zu einem Modul has_and_belongs_to_many :semester #Gehört zu einem Semester( derzeit nicht implementiert) @@ -29,6 +29,7 @@ class Lva < ActiveRecord::Base validates_presence_of :ects # ECTS vorhanden? validates :name, :presence=>true validates :name, :uniqueness=>true# Name Eingetragen? + validates :typ, :presence=>true validates_presence_of :stunden # Stunden Eingetragen? validates_presence_of :modul # Zugehöriges Modul eingetragen? (zumindest eines) def add_semesters diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index be3ef9d..5aa9135 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -8,8 +8,12 @@
    - - <%= f.input :name, :wrapper_html=>{:class=>'span5'}%> +
    + <%= f.input :typ %> +
    + <%= f.input :name, :wrapper_html=>{:class=>'span10'}%> +
    +
    <%= f.input :lvanr, :wrapper_html=>{:class=>'span4'}%> diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index d5e5950..9063cca 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -4,7 +4,7 @@
    -

    <%= @lva.name %>

    +

    <%=@lva.typ.to_s + ' ' + @lva.name %>

    Prüfungsinformation

    <%= @lva.pruefungsinformation %> diff --git a/db/migrate/20130811191150_add_pruefungsinfos_to_lvas.rb b/db/migrate/20130811191150_add_pruefungsinfos_to_lvas.rb new file mode 100644 index 0000000..a4a2443 --- /dev/null +++ b/db/migrate/20130811191150_add_pruefungsinfos_to_lvas.rb @@ -0,0 +1,6 @@ +class AddPruefungsinfosToLvas < ActiveRecord::Migration + def change + add_column :lvas, :pruefungsinformation, :text + add_column :lvas, :lernaufwand, :text + end +end diff --git a/db/migrate/20130812070544_add_typ_to_lvas.rb b/db/migrate/20130812070544_add_typ_to_lvas.rb new file mode 100644 index 0000000..ed8c291 --- /dev/null +++ b/db/migrate/20130812070544_add_typ_to_lvas.rb @@ -0,0 +1,5 @@ +class AddTypToLvas < ActiveRecord::Migration + def change + add_column :lvas, :typ, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index c8266dc..66a1e19 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130811191150) do +ActiveRecord::Schema.define(:version => 20130812070544) do create_table "attachments", :force => true do |t| t.string "name" @@ -96,6 +96,7 @@ ActiveRecord::Schema.define(:version => 20130811191150) do t.integer "semester_id" t.text "pruefungsinformation" t.text "lernaufwand" + t.string "typ" end create_table "lvas_moduls", :id => false, :force => true do |t| From 7a452fa9c13283cc87f2454653264442f76be0de Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Mon, 12 Aug 2013 11:58:27 +0200 Subject: [PATCH 44/53] =?UTF-8?q?Formtastic=20css,=20Lva-typ=20=C3=A4nderu?= =?UTF-8?q?ngen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stylesheets/formtastic-changes.css.scss | 3 +++ app/models/lva.rb | 6 +++--- app/views/lvas/_form.html.erb | 5 ++--- config/locales/de.yml | 15 +++++++++------ 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss index ea322e8..608dce6 100644 --- a/app/assets/stylesheets/formtastic-changes.css.scss +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -1,6 +1,9 @@ form.formtastic .stringish input { width:90%; } +form.formtastic select { +width:90% +} form.formtastic textarea { width:90%; height:20em; diff --git a/app/models/lva.rb b/app/models/lva.rb index 307133c..411d913 100755 --- a/app/models/lva.rb +++ b/app/models/lva.rb @@ -16,6 +16,7 @@ # class Lva < ActiveRecord::Base + ERLAUBTE_TYPEN = ['VO', 'UE', 'VU', 'LU', 'SE', 'andere']; has_paper_trail # Versionsverfolgung attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand, :typ has_and_belongs_to_many :modul # Gehört zu einem Modul @@ -27,9 +28,8 @@ class Lva < ActiveRecord::Base validates :lvanr,:format=>{ :with => /^[0-9][0-9][0-9]\.[0-9][0-9][0-9]$/}, :presence=>true, :uniqueness=>true # , :uniqueness=>true # LVA-Nummer muss das Format 000.000 besitzen (uniqueness?) oder 000 für nicht validates_presence_of :ects # ECTS vorhanden? - validates :name, :presence=>true - validates :name, :uniqueness=>true# Name Eingetragen? - validates :typ, :presence=>true + validates :name, :presence=>true, :uniqueness=>true# Name Eingetragen? + validates :typ, :presence=>true, :inclusion=> ERLAUBTE_TYPEN validates_presence_of :stunden # Stunden Eingetragen? validates_presence_of :modul # Zugehöriges Modul eingetragen? (zumindest eines) def add_semesters diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index 5aa9135..ec38a70 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -8,9 +8,8 @@
    -
    - <%= f.input :typ %> -
    + <%= f.input :typ, :as=>:select, :include_blank=>false, :collection=>Lva::ERLAUBTE_TYPEN, :wrapper_html=>{:class=>'span2'}%> + <%= f.input :name, :wrapper_html=>{:class=>'span10'}%>
    diff --git a/config/locales/de.yml b/config/locales/de.yml index 2e2ca1e..a25344a 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -83,17 +83,20 @@ de: lva: attributes: modul: - blank: "Wählen Sie zumindest ein Modul aus" + blank: "Lva muss zumindest einem Modul zugewiesen sein" name: - blank: "Geben Sie bitte den Namen der LVA an" + blank: "Die Lva muss einen Namen haben" ects: - blank: "Geben Sie die ECTS der LVA an" + blank: "Es müssen ECTS eingetragen sein" stunden: - blank: "Geben Sie die Stunden der LVA an" + blank: "Es muss die Studenanzahl eingettragen sein" lvanr: - invalid: "Geben Sie eine Nummer im Format 000.000 an." + invalid: "Die Nummer muss im Format 000.000 eingegeben sein" blank: "Geben sie eine Lva-Nr an" - taken: "Die Lva-Nummer ist bereits vergeben" + taken: "Die Lva-Nummer ist vergeben" + typ: + blank: "Es muss ein Lva-Typ angegeben sein" + inclusion: "Der Typ ist nicht aus der Auswahl der gültigen Typen" studium: attributes: From 501a4f390345e98b5f81df387060a144d57dde95 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Mon, 12 Aug 2013 12:49:10 +0200 Subject: [PATCH 45/53] =?UTF-8?q?Views=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/studien_controller.rb | 6 +++--- app/views/modulgruppen/show.html.erb | 10 +-------- app/views/moduls/_kurz.html.erb | 4 ---- app/views/moduls/_modul.html.erb | 29 ++++++++++++++++----------- app/views/studien/verwalten.html.erb | 25 ++++++++++++----------- config/locales/de.yml | 9 +++++++-- 6 files changed, 41 insertions(+), 42 deletions(-) diff --git a/app/controllers/studien_controller.rb b/app/controllers/studien_controller.rb index 0504b84..f5b9d63 100755 --- a/app/controllers/studien_controller.rb +++ b/app/controllers/studien_controller.rb @@ -184,10 +184,10 @@ class StudienController < ApplicationController for m in @module if m.valid? - @messages << m.name + ' hat keine Modulgruppe' if m.modulgruppen.count == 0 - @messages << m.name + ' hat keine Lvas' if m.lvas.count == 0 + @messages << m.name.to_s + ' hat keine Modulgruppe' if m.modulgruppen.count == 0 + @messages << m.name.to_s + ' hat keine Lvas' if m.lvas.count == 0 else - @messages << ''+m.name + ': ' + @messages << ''+m.name.to_s + ': ' @messages << m.errors.full_messages @messages << '' end diff --git a/app/views/modulgruppen/show.html.erb b/app/views/modulgruppen/show.html.erb index a127623..3c00840 100755 --- a/app/views/modulgruppen/show.html.erb +++ b/app/views/modulgruppen/show.html.erb @@ -1,11 +1,4 @@ - -

    <%= notice %>

    -

    <%= @modulgruppe.name %>

    @@ -21,7 +14,6 @@ <% @modulgruppe.moduls.each do |modul| %> <%= render 'moduls/kurz', :modul=>modul%> <% end %> -
    <%= I18n.t("common.actions")%> @@ -30,4 +22,4 @@ <%= link_to I18n.t("modulgruppe.studium"), studium_path(@modulgruppe.studium),:class =>"btn" %> <%= link_to I18n.t("common.edit"), edit_modulgruppe_path(@modulgruppe),:class =>"btn" %> <%= link_to I18n.t("common.delete"),[@modulgruppe], :method=>:delete , :data=>{:confirm=>I18n.t("common.sure")} ,:class=>"btn" %> -
    +
    diff --git a/app/views/moduls/_kurz.html.erb b/app/views/moduls/_kurz.html.erb index 7792e5b..2f70525 100755 --- a/app/views/moduls/_kurz.html.erb +++ b/app/views/moduls/_kurz.html.erb @@ -1,10 +1,6 @@

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

    -

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

    - <% link_to ''.html_safe+I18n.t("common.edit"), edit_modul_path(modul) %>
    diff --git a/app/views/moduls/_modul.html.erb b/app/views/moduls/_modul.html.erb index 78ff8dc..0bf3d55 100755 --- a/app/views/moduls/_modul.html.erb +++ b/app/views/moduls/_modul.html.erb @@ -2,22 +2,27 @@

    <%=@modul.name %>

    -

    Beschreibung

    + +
    +
    +

    Beschreibung

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

    -

    Lvas

    -<% @modul.lvas.each_slice(3) do |row| %> -
    -<% row.each do |lv| %> -
    -<%= render 'lvas/lva_semester', :lva=>lv%> -
    -<% end %> -
    -<% end %> -

    Modulgruppen

    +
    +
    +

    Modulgruppen

    <% @modul.modulgruppen.each do |mg| %> <%= render 'modulgruppen/kurz', :modulgruppe=>mg %>
    <% end %> + +

    Lvas

    +<% @modul.lvas.each_slice(3) do |row| %> +<% row.each do |lv| %> +<%= render 'lvas/lva_semester', :lva=>lv%> +<% end %> + +<% end %> + +
    diff --git a/app/views/studien/verwalten.html.erb b/app/views/studien/verwalten.html.erb index a7b7d4b..c1008e8 100644 --- a/app/views/studien/verwalten.html.erb +++ b/app/views/studien/verwalten.html.erb @@ -3,14 +3,14 @@
    -

    <%= I18n.t("studien.verwaltung") %>

    <%= link_to I18n.t("filter.reset"), studien_verwalten_path(:std_verw=>nil, :mg_verw=>nil, :m_verw=>nil, :lva_verw=>nil, :b_verw=>nil), :class=>"btn" %> - <%= I18n.t("filter.explanation").html_safe %> +

    <%= I18n.t("studien.verwaltung.title") %>

    + <%= I18n.t("studien.verwaltung.explanation").html_safe %>

    Studien

    | <% @studien.each do |s| %> - <%= link_to s.name, s %> <%= (s.valid?) ? "Gültig" : "Problemfall" %> | <% end %> + <%= (s.valid?) ? ' '.html_safe : ''.html_safe %> <%= link_to s.name, s %> | <%=link_to ''.html_safe+ 'edit', edit_studium_path(s)%> ||<% end %>
    @@ -36,7 +36,7 @@

    Modulgruppen

    <% @modulgruppen.each do |mg| %> - <%= link_to mg.name, mg %> | <%= (mg.valid?) ? "Gültig" : "Problemfall" %>
    + <%= (mg.valid?) ? ' '.html_safe : ''.html_safe %> <%= link_to mg.name, mg %> | <%=link_to ''.html_safe+ 'edit', edit_modulgruppe_path(mg)%>
    <% end %>
    @@ -65,8 +65,8 @@ <% @module.each do |m| %> - <%= link_to m.name, m %> - | <%= (m.valid?) ? "Gültig" : "Problemfall" %>
    + <%= (m.valid?) ? ' '.html_safe : ''.html_safe %> <%= link_to m.name, m %> + | <%=link_to ''.html_safe+ 'edit', edit_modul_path(m)%>
    <% end %>
    @@ -93,8 +93,8 @@ <% @lvas.each do |lva| %> - <%= link_to lva.name, lva %> | - <%= (lva.valid?) ? "Gültig" : "Problemfall" %>
    + <%= (lva.valid?) ? ' '.html_safe : ''.html_safe %><%= link_to lva.name, lva %> | + <%=link_to ''.html_safe+ 'edit', edit_lva_path(lva)%>
    <% end %>
    @@ -123,11 +123,12 @@
    + <%= link_to I18n.t("filter.reset"), studien_verwalten_path(:std_verw=>nil, :mg_verw=>nil, :m_verw=>nil, :lva_verw=>nil, :b_verw=>nil), :class=>"btn" %>

    Error Log

      -
    • Red: Error, Solve immediately
    • -
    • Black: Warning, should be solved
    • -
    • Green: Everything is fine
    • +
    • Red: Error, Solve immediately
    • +
    • Black: Warning, should be solved
    • +
    • Green: Everything is fine
    diff --git a/db/schema.rb b/db/schema.rb index 8043ec8..3b2d2f9 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -13,11 +13,6 @@ ActiveRecord::Schema.define(:version => 20130812070544) do - create_table "attachments", :force => true do |t| - t.string "name" - t.datetime "created_at", :null => false - end - create_table "beispiel_translations", :force => true do |t| t.string "locale" t.text "desc" @@ -27,22 +22,17 @@ ActiveRecord::Schema.define(:version => 20130812070544) do end add_index "beispiel_translations", ["locale"], :name => "index_beispiel_translations_on_locale" -======= - t.integer "thema_id" - end -<<<<<<< HEAD ->>>>>>> master -======= ->>>>>>> thomasb/master ->>>>>>> 4aca98c0f53d92273c1efb7ae217fa7a89630d57 create_table "beispiele", :force => true do |t| t.string "name" t.text "desc" t.integer "lva_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "beispieldatei" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "file_file_name" + t.string "file_content_type" + t.integer "file_file_size" + t.datetime "file_updated_at" end create_table "calendars", :force => true do |t| @@ -70,39 +60,6 @@ ActiveRecord::Schema.define(:version => 20130812070544) do t.datetime "updated_at", :null => false end -<<<<<<< HEAD -======= - create_table "frage_translations", :force => true do |t| - t.string "locale" - t.string "title" - t.text "text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "fragen_id" - end - - add_index "frage_translations", ["locale"], :name => "index_frage_translations_on_locale" - -<<<<<<< HEAD ->>>>>>> master -======= ->>>>>>> thomasb/master ->>>>>>> 4aca98c0f53d92273c1efb7ae217fa7a89630d57 - create_table "fragen", :force => true do |t| - t.string "title" - t.text "text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false -<<<<<<< HEAD -======= - t.integer "thema_id" -<<<<<<< HEAD ->>>>>>> master -======= ->>>>>>> thomasb/master ->>>>>>> 4aca98c0f53d92273c1efb7ae217fa7a89630d57 - end - create_table "lva_translations", :force => true do |t| t.integer "lva_id" t.string "locale" @@ -199,6 +156,18 @@ ActiveRecord::Schema.define(:version => 20130812070544) do t.datetime "updated_at", :null => false end + create_table "pages", :force => true do |t| + t.string "name" + t.string "url" + t.integer "parent_id" + t.integer "lft" + t.integer "rgt" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "pages", ["parent_id"], :name => "index_pages_on_parent_id" + create_table "roles", :force => true do |t| t.string "name" t.integer "resource_id" @@ -248,45 +217,6 @@ ActiveRecord::Schema.define(:version => 20130812070544) do add_index "studium_translations", ["locale"], :name => "index_studium_translations_on_locale" - create_table "themen", :force => true do |t| - t.integer "themen_id" - end - create_table "thema_translations", :force => true do |t| - t.string "locale" - t.string "title" - t.text "text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - - add_index "thema_translations", ["locale"], :name => "index_thema_translations_on_locale" - - create_table "themen", :force => true do |t| - t.string "title" - t.text "text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "themengruppe_id" - end - - create_table "themengruppe_translations", :force => true do |t| - t.string "locale" - t.string "title" - t.text "text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "themengruppen_id" - end - - add_index "themengruppe_translations", ["locale"], :name => "index_themengruppe_translations_on_locale" - create_table "themengruppen", :force => true do |t| - t.string "title" - t.text "text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "users", :force => true do |t| t.string "email", :default => "", :null => false t.string "encrypted_password", :default => "", :null => false From 4bff7a8c8d25fb05f5c8e4f3dd7e89db5080b7be Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Mon, 12 Aug 2013 20:00:32 +0200 Subject: [PATCH 50/53] Bootstrap Link - Startseite, Wiki Link entfernt --- app/views/home/index.html.erb | 10 +++++++++- app/views/layouts/menu.html.erb | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 9dc3abb..6e2e796 100755 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,5 +1,4 @@

    <%= t 'home.willkommen' %>

    -

    <%= t 'home.hallobeiderfet' %>

    Alpha Test

    Die Webseite befindet sich derzeit in einem Entsicklungsstadium, @@ -9,5 +8,14 @@ Fehlermeldungen auf GitHub melden.

    <%= link_to "Issues", "http://www.github.com/fetsite/fetsite/issues" %>

    +

    +Folgene Features sind schon soweit, dass Bugreports sinnvoll sind: +

      +
    • Studien/Beispielsammlung
    • +
    +alle anderen sind nur zur Voransicht. Bezüglich Design und Steuerung sind Vorschläge erwünscht. +

    +

    <%= link_to "Steuerelemente und Komponenten", "http://getbootstrap.com/2.3.2/index.html" %>

    +

    <%= t 'home.hallobeiderfet' %>

    <%= link_to "Entwicklungsstatus" , home_dev_path %> diff --git a/app/views/layouts/menu.html.erb b/app/views/layouts/menu.html.erb index 28a30d7..2ad7d4c 100755 --- a/app/views/layouts/menu.html.erb +++ b/app/views/layouts/menu.html.erb @@ -15,8 +15,6 @@
  • <%= link_to I18n.t(:info,:scope=>'home' ) %>
  • <%= link_to I18n.t(:studien,:scope=>'home' ), studien_path %>
  • <%= link_to "Kalender", calendars_path %>
  • -
  • <%= link_to "wiki intern", page_path(1) %> -
  • <% if user_signed_in? %>
  • Logged in as : <%= current_user.email %> <%= link_to('Logout', destroy_user_session_path, :method => :delete) %> From 989f0c2c5457831f37f1baa12380dcc4cebe9867 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Tue, 13 Aug 2013 00:07:29 +0200 Subject: [PATCH 51/53] Responsive Menubar springt direkt auf 100% Kopfzeile um MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kann einfach rückgängig gemacht werden, indem in bootstrap- responsive.scss die earlymax-classe bearbeitet/gelöscht wird. --- app/assets/stylesheets/bootstrap-responsive.scss | 5 +++++ app/views/layouts/application.html.erb | 4 ++-- app/views/layouts/menu.html.erb | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 app/assets/stylesheets/bootstrap-responsive.scss diff --git a/app/assets/stylesheets/bootstrap-responsive.scss b/app/assets/stylesheets/bootstrap-responsive.scss new file mode 100644 index 0000000..f2950bd --- /dev/null +++ b/app/assets/stylesheets/bootstrap-responsive.scss @@ -0,0 +1,5 @@ +@import "bootstrap/responsive"; +@media (max-width: 979px){ +.earlymax { +min-width: 100%; +}} diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a59dc71..83b766f 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,9 +17,9 @@
  • -
    +
    -
    +
    <%= yield %>
    diff --git a/app/views/layouts/menu.html.erb b/app/views/layouts/menu.html.erb index 6ed78be..fede1cd 100755 --- a/app/views/layouts/menu.html.erb +++ b/app/views/layouts/menu.html.erb @@ -2,7 +2,7 @@