diff --git a/app/controllers/lvas_controller.rb b/app/controllers/lvas_controller.rb index 8919adb..7f0bd65 100755 --- a/app/controllers/lvas_controller.rb +++ b/app/controllers/lvas_controller.rb @@ -36,6 +36,17 @@ class LvasController < ApplicationController end + + def compare_tiss + + end + + def load_tiss + + end + + + # POST /lvas # POST /lvas.json def create diff --git a/app/controllers/moduls_controller.rb b/app/controllers/moduls_controller.rb index 624d536..ace786b 100755 --- a/app/controllers/moduls_controller.rb +++ b/app/controllers/moduls_controller.rb @@ -8,6 +8,7 @@ class ModulsController < ApplicationController if !params[:studium_id].nil? @studium=Studium.find_by_id(params[:studium_id]) end + @toolbar_elements = [{:hicon=>'icon-plus-sign', :text=>I18n.t("modul.add"), :path=>new_modul_path}] @topbar_elements =[{:hicon=>'icon-list', :text=>I18n.t("studien.allestudien"),:path=>studien_path}] @topbar_elements<<{:hicon=>'icon-list', :text=>I18n.t("modul.list"),:path=>moduls_path} diff --git a/app/models/lecturer.rb b/app/models/lecturer.rb index f860542..8195633 100644 --- a/app/models/lecturer.rb +++ b/app/models/lecturer.rb @@ -16,4 +16,16 @@ class Lecturer < ActiveRecord::Base has_and_belongs_to_many :lvas mount_uploader :picture, PictureUploader resourcify + + def load_tissdata + url= "https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/"+self.oid.to_s+".xml" + hash=Hash.from_xml(open(url).read)["tuvienna"] + self.name=hash["person"]["firstname"]+" "+hash["person"]["lastname"] + if hash["person"]["employee"]["employment"].is_a? Array + self.email= hash["person"]["employee"]["employment"].first["emails"]["email"].first + else + self.email= hash["person"]["employee"]["employment"]["emails"]["email"].first + end + self.link= "https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/"+self.oid.to_s + end end diff --git a/app/models/lva.rb b/app/models/lva.rb index 241b4b6..4bf9bf8 100755 --- a/app/models/lva.rb +++ b/app/models/lva.rb @@ -87,7 +87,7 @@ class Lva < ActiveRecord::Base # rescue OpenURI::HTTPError => e # end self.name=hash["course"]["title"][I18n.locale.to_s] - self.pruefungsinformation= hash["course"]["examinationModalities"][I18n.locale.to_s] + self.pruefungsinformation = hash["course"]["examinationModalities"][I18n.locale.to_s] self.desc= hash["course"]["objective"][I18n.locale.to_s]+hash["course"]["teachingContent"][I18n.locale.to_s] self.typ=hash["course"]["courseType"] self.stunden=hash["course"]["weeklyHours"] diff --git a/app/views/lecturers/_lec_lva.html.erb b/app/views/lecturers/_lec_lva.html.erb index 21a9536..83cc332 100644 --- a/app/views/lecturers/_lec_lva.html.erb +++ b/app/views/lecturers/_lec_lva.html.erb @@ -1,11 +1,11 @@
<%= notice %>
+ +<%= render partial: "lec_lva", object: @lecturer %> +Name: <%= @lecturer.name %>