From eefd3d9a76e703ed613b196e6ac91a376a19f438 Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Sun, 11 Aug 2013 11:09:03 +0200 Subject: [PATCH 1/4] 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 2/4] =?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 3/4] 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 4/4] 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| %>