Merge remote-tracking branch 'thomasb/master'
This commit is contained in:
@@ -9,7 +9,7 @@ class LvasController < ApplicationController
|
||||
# GET /lvas/1
|
||||
|
||||
def show
|
||||
@lva = Lva.find(params[:id])
|
||||
@lva = Lva.find_by_id(params[:id])
|
||||
@toolbar_elements<<{:icon=>:pencil,:text =>I18n.t('common.edit'),:path => edit_lva_path(@lva)}
|
||||
end
|
||||
|
||||
|
||||
@@ -3,14 +3,15 @@ class ModulsController < ApplicationController
|
||||
# GET /moduls.json
|
||||
def index
|
||||
@moduls = Modul.all
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find(params[:studium_id])
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @moduls }
|
||||
if @moduls
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find_by_id(params[:studium_id])
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @moduls }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# GET /moduls/1
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
class Beispiel < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
attr_accessible :desc, :name, :file, :lva_id
|
||||
has_attached_file :file
|
||||
attr_accessible :desc, :name, :lva_id, :beispieldatei, :beispieldatei_cache
|
||||
belongs_to :lva
|
||||
translates :desc, :fallbacks_for_empty_translations => true
|
||||
mount_uploader :beispieldatei, BeispieldateiUploader
|
||||
end
|
||||
|
||||
@@ -36,19 +36,19 @@ private
|
||||
##
|
||||
# Lade Daten aus TISS und füge diese in die Datenbank ein.
|
||||
def load_tissdata
|
||||
url= "https://tiss.tuwien.ac.at/api/course/"+ self.lvanr.to_s+"-2012W"
|
||||
begin
|
||||
@hash=Hash.from_xml(open(url).read)["tuvienna"]
|
||||
@person=[]
|
||||
if @hash["course"]["lecturers"]["oid"].is_a? String
|
||||
@person = @hash["course"]["lecturers"]["oid"]
|
||||
else
|
||||
@hash["course"]["lecturers"]["oid"].each do |pid|
|
||||
@person << Hash.from_xml(open("https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/" + pid.to_s + ".xml").read)["tuvienna"]["person"]
|
||||
end
|
||||
end
|
||||
rescue OpenURI::HTTPError => e
|
||||
end
|
||||
url= "https://tiss.tuwien.ac.at/api/course/"+ self.lvanr.to_s+"-2012W"
|
||||
begin
|
||||
@hash=Hash.from_xml(open(url).read)["tuvienna"]
|
||||
@person=[]
|
||||
if @hash["course"]["lecturers"]["oid"].is_a? String
|
||||
@person = @hash["course"]["lecturers"]["oid"]
|
||||
else
|
||||
@hash["course"]["lecturers"]["oid"].each do |pid|
|
||||
@person << Hash.from_xml(open("https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/" + pid.to_s + ".xml").read)["tuvienna"]["person"]
|
||||
end
|
||||
end
|
||||
rescue OpenURI::HTTPError => e
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# -*- coding: undecided -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: moduls
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :desc %>
|
||||
<%= f.input :file , :as=>:file %>
|
||||
<%= f.file_field :beispieldatei %>
|
||||
<%= f.hidden_field :beispieldatei_cache %>
|
||||
<%= f.input :lva, :as=>:radio, :collection => Lva.all%>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<p>
|
||||
<b>Desc:</b>
|
||||
<%= @beispiel.desc %>
|
||||
<%= @beispiel.file.url %>
|
||||
<%= @beispiel.beispieldatei.url %>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -18,5 +18,11 @@
|
||||
<p>
|
||||
<%= @lva.desc %>
|
||||
</p>
|
||||
<ul>
|
||||
<% @lva.beispiele.each do |b|%>
|
||||
|
||||
<li><%= render b%></li>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= toolbar_html(@toolbar_elements) %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h1>New neuigkeit</h1>
|
||||
<h1><%=I18n.t("neuigkeit.new.title") %></h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user