forked from bofh/fetsite
lecturer load lva load first steps
This commit is contained in:
@@ -36,6 +36,17 @@ class LvasController < ApplicationController
|
||||
|
||||
|
||||
end
|
||||
|
||||
def compare_tiss
|
||||
|
||||
end
|
||||
|
||||
def load_tiss
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
# POST /lvas
|
||||
# POST /lvas.json
|
||||
def create
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<div class="media">
|
||||
<a class="pull-left" href="#">
|
||||
<img class="media-object img" src="<%= lec_lva.picture.thumb.url %>"/>
|
||||
<img class="media-object img" src="<%= lec_lva.picture.thumb.url unless lec_lva.picture.nil? %>"/>
|
||||
</a>
|
||||
<div class="media-body">
|
||||
<h4><%= link_to lec_lva.name, lec_lva %></h4>
|
||||
Email: <%= mail_to lec_lva.email %><br>
|
||||
TISS: <%= link_to lec_lva.name, lec_lva.link %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
|
||||
<%= render partial: "lec_lva", object: @lecturer %>
|
||||
|
||||
<p>
|
||||
<b>Name:</b>
|
||||
<%= @lecturer.name %>
|
||||
|
||||
Reference in New Issue
Block a user