Merge branch 'master' of github.com:fetsite/fetsite
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -29,4 +29,5 @@ Gemfile.lock
|
|||||||
console
|
console
|
||||||
/server
|
/server
|
||||||
/public/uploads/
|
/public/uploads/
|
||||||
|
/bak/*
|
||||||
*#
|
*#
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ DEPENDENCIES
|
|||||||
paper_trail (>= 2.7.0)!
|
paper_trail (>= 2.7.0)!
|
||||||
paperclip (~> 3.4.0)
|
paperclip (~> 3.4.0)
|
||||||
rails (= 3.2.13)
|
rails (= 3.2.13)
|
||||||
|
remotipart!
|
||||||
rmagick
|
rmagick
|
||||||
rolify
|
rolify
|
||||||
rspec-rails
|
rspec-rails
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class LvasController < ApplicationController
|
class LvasController < ApplicationController
|
||||||
# GET /lvas
|
# GET /lvas
|
||||||
before_filter {@toolbar_elements =[]}
|
before_filter :load_toolbar, :only => [:show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
def index
|
def index
|
||||||
@lvas = Lva.all
|
@lvas = Lva.all
|
||||||
@@ -14,13 +14,7 @@ class LvasController < ApplicationController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@lva = Lva.find_by_id(params[:id])
|
@lva = Lva.find_by_id(params[:id])
|
||||||
@beispiel=Beispiel.new
|
@beispiel=Beispiel.new
|
||||||
# @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)}
|
|
||||||
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('common.delete'), :path=> lva_path(@lva), :method=>:delete, :confirm=>'Sure?' }
|
|
||||||
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=>"Tissvergleichladen", :path=> lva_compare_tiss_path(@lva)}
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /lvas/new
|
# GET /lvas/new
|
||||||
@@ -36,12 +30,10 @@ class LvasController < ApplicationController
|
|||||||
def edit
|
def edit
|
||||||
@lva = Lva.find(params[:id])
|
@lva = Lva.find(params[:id])
|
||||||
@semester = @lva.modul.map(&:modulgruppen).flatten.map(&:studium).map(&:semester).flatten.uniq
|
@semester = @lva.modul.map(&:modulgruppen).flatten.map(&:studium).map(&:semester).flatten.uniq
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def compare_tiss
|
def compare_tiss
|
||||||
@lva = Lva.find_by_id(params[:lva_id])
|
@lva = Lva.find_by_id(params[:id])
|
||||||
@lvatiss = Lva.new
|
@lvatiss = Lva.new
|
||||||
@lvatiss.lvanr=@lva.lvanr
|
@lvatiss.lvanr=@lva.lvanr
|
||||||
@lvatiss.load_tissdata("-2013W")
|
@lvatiss.load_tissdata("-2013W")
|
||||||
@@ -49,7 +41,7 @@ class LvasController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def load_tiss
|
def load_tiss
|
||||||
@lva = Lva.find_by_id(params[:lva_id])
|
@lva = Lva.find_by_id(params[:id])
|
||||||
@lva.load_tissdata("-2013W")
|
@lva.load_tissdata("-2013W")
|
||||||
if @lva.save
|
if @lva.save
|
||||||
redirect_to @lva , notice: 'Lva von TISS geladen.'
|
redirect_to @lva , notice: 'Lva von TISS geladen.'
|
||||||
@@ -58,50 +50,50 @@ class LvasController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# POST /lvas
|
|
||||||
# POST /lvas.json
|
|
||||||
def create
|
def create
|
||||||
@lva = Lva.new(params[:lva])
|
@lva = Lva.new(params[:lva])
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @lva.save
|
if @lva.save
|
||||||
@lva.add_semesters
|
@lva.add_semesters
|
||||||
format.html { redirect_to @lva, notice: 'Lva was successfully created.' }
|
format.html { redirect_to @lva, notice: 'Lva was successfully created.' }
|
||||||
|
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# PUT /lvas/1
|
|
||||||
# PUT /lvas/1.json
|
|
||||||
def update
|
def update
|
||||||
@lva = Lva.find(params[:id])
|
@lva = Lva.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @lva.update_attributes(params[:lva])
|
if @lva.update_attributes(params[:lva])
|
||||||
@lva.add_semesters
|
@lva.add_semesters
|
||||||
format.html { redirect_to @lva, notice: 'Lva was successfully updated.' }
|
format.html { redirect_to @lva, notice: 'Lva was successfully updated.' }
|
||||||
|
|
||||||
else
|
else
|
||||||
format.html { render action: "edit" }
|
format.html { render action: "edit" }
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /lvas/1
|
|
||||||
# DELETE /lvas/1.json
|
|
||||||
def destroy
|
def destroy
|
||||||
@lva = Lva.find(params[:id])
|
@lva = Lva.find(params[:id])
|
||||||
@lva.destroy
|
@lva.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to lvas_url }
|
format.html { redirect_to lvas_url }
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def load_toolbar
|
||||||
|
@lva = Lva.find_by_id(params[:id])
|
||||||
|
@toolbar_elements =[]
|
||||||
|
@toolbar_elements<<{:hicon=>'icon-pencil', :icon=>:pencil,:text =>I18n.t('common.edit'),:path => edit_lva_path(@lva)} if can? :edit, @lva
|
||||||
|
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=>"Tissvergleichladen", :path=> lva_compare_tiss_path(@lva)} if can? :compare_tiss, @lva
|
||||||
|
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('common.delete'), :path=> lva_path(@lva), :method=>:delete, :confirm=>'Sure?' } if can? :delete, @lva
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class ModulgruppenController < ApplicationController
|
|||||||
@toolbar_elements = [ {:text=>'Zurück', :path=>studium_path(@studium, :ansicht=>:modulgruppenansicht)}]
|
@toolbar_elements = [ {:text=>'Zurück', :path=>studium_path(@studium, :ansicht=>:modulgruppenansicht)}]
|
||||||
@toolbar_elements << {:hicon=>'icon-plus-sign', :text=>I18n.t('modulgruppe.addmodul'), :path=>new_modul_path(@modulgruppe)}
|
@toolbar_elements << {:hicon=>'icon-plus-sign', :text=>I18n.t('modulgruppe.addmodul'), :path=>new_modul_path(@modulgruppe)}
|
||||||
@toolbar_elements << {:hicon=>'icon-pencil', :text=>I18n.t('modulgruppe.edit'), :path=>edit_modulgruppe_path(@modulgruppe)}
|
@toolbar_elements << {:hicon=>'icon-pencil', :text=>I18n.t('modulgruppe.edit'), :path=>edit_modulgruppe_path(@modulgruppe)}
|
||||||
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => studium_path(@studium, :ansicht=>:modulgruppenansicht), :method=> :delete,:confirm=>"Sure?" }
|
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => studium_path(@studium, :ansicht=>:modulgruppenansicht), :method=> :delete,:confirm=>'Sure?' }
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /modulgruppen/new
|
# GET /modulgruppen/new
|
||||||
@@ -71,7 +71,6 @@ class ModulgruppenController < ApplicationController
|
|||||||
|
|
||||||
def update
|
def update
|
||||||
@modulgruppe = Modulgruppe.find(params[:id])
|
@modulgruppe = Modulgruppe.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @modulgruppe.update_attributes(params[:modulgruppe])
|
if @modulgruppe.update_attributes(params[:modulgruppe])
|
||||||
format.html { redirect_to @modulgruppe, notice: 'Modulgruppe was successfully updated.' }
|
format.html { redirect_to @modulgruppe, notice: 'Modulgruppe was successfully updated.' }
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
class NeuigkeitenController < ApplicationController
|
class NeuigkeitenController < ApplicationController
|
||||||
before_filter :load_toolbar_elements, :only=>[:show,:find_link]
|
before_filter :load_toolbar_elements, :only=>[:show,:find_link]
|
||||||
|
before_filter :load_toolbar_elements_edit, :only=>[:edit]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@@ -57,7 +61,7 @@ class NeuigkeitenController < ApplicationController
|
|||||||
|
|
||||||
def edit
|
def edit
|
||||||
@neuigkeit = Neuigkeit.find(params[:id])
|
@neuigkeit = Neuigkeit.find(params[:id])
|
||||||
@toolbar_elements << {:text=>I18n.t('common.show'),:path=>rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit)} if can? :show, @neuigkeit
|
|
||||||
@calentries= @neuigkeit.calentries
|
@calentries= @neuigkeit.calentries
|
||||||
@calentries<< Calentry.new
|
@calentries<< Calentry.new
|
||||||
|
|
||||||
@@ -134,7 +138,12 @@ private
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def load_toolbar_elements_edit
|
||||||
|
@neuigkeit = Neuigkeit.find(params[:id])
|
||||||
|
@toolbar_elements=[]
|
||||||
|
@toolbar_elements << {:text=>I18n.t('common.show'),:path=>rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit)} if can? :show, @neuigkeit
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class Gallery < ActiveRecord::Base
|
|||||||
attr_accessible :datum, :desc, :name
|
attr_accessible :datum, :desc, :name
|
||||||
has_many :fotos
|
has_many :fotos
|
||||||
has_many :nlinks, as: :link
|
has_many :nlinks, as: :link
|
||||||
scope :search, ->(query) {where("name like ? or desc like ?", "%#{query}%", "%#{query}%")}
|
scope :search, ->(query) {where("name like ? or galleries.desc like ?", "%#{query}%", "%#{query}%")}
|
||||||
|
|
||||||
def title
|
def title
|
||||||
name
|
name
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class Lva < ActiveRecord::Base
|
|||||||
has_many :beispiele , :class_name => "Beispiel"
|
has_many :beispiele , :class_name => "Beispiel"
|
||||||
has_and_belongs_to_many :lecturers
|
has_and_belongs_to_many :lecturers
|
||||||
translates :desc,:pruefungsinformation, :fallbacks_for_empty_translations => true, :versioning=>true
|
translates :desc,:pruefungsinformation, :fallbacks_for_empty_translations => true, :versioning=>true
|
||||||
scope :search, ->(query) {where("name like ? or desc like ?", "%#{query}%", "%#{query}%")}
|
scope :search, ->(query) {where("name like ? or lvas.desc like ?", "%#{query}%", "%#{query}%")}
|
||||||
|
|
||||||
validates :lvanr,:format=>{ :with => /^[0-9][0-9][0-9]\.[0-9A][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 :lvanr,:format=>{ :with => /^[0-9][0-9][0-9]\.[0-9A][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_presence_of :ects # ECTS vorhanden?
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<div class="contentbox">
|
<div class="contentbox">
|
||||||
<%= image_tag("/iconnavy/time.png") %>
|
<% image_tag("/iconnavy/time.png") %>
|
||||||
|
<%= fa_icon("calendar 2x") %>
|
||||||
|
|
||||||
<% if calentry.start.to_date == calentry.ende.to_date
|
<% if calentry.start.to_date == calentry.ende.to_date
|
||||||
format=:timeonly
|
format=:timeonly
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span1"></div><div class="span1">
|
<div class="span1"></div><div class="span1">
|
||||||
<%= image_tag("/icon_kalender_small.png") %>
|
<%= fa_icon("calendar 2x") %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<%= f.input :start, :as => :datepicker %></div><div class="span4">
|
<%= f.input :start, :as => :datepicker %></div><div class="span4">
|
||||||
|
|||||||
@@ -4,18 +4,27 @@
|
|||||||
<%= f.inputs do %>
|
<%= f.inputs do %>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span9">
|
<div class="span9">
|
||||||
<%= f.input :name ,:hint=>true%>
|
<div class="container-fluid">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span8">
|
<div class="span12">
|
||||||
<%= f.input :desc, :as=>:tinymce_text %>
|
<%= f.input :name ,:hint=>true%>
|
||||||
</div>
|
</div>
|
||||||
<div class="span4">
|
</div>
|
||||||
<%= f.input :depend %>
|
|
||||||
</div>
|
<div class="row-fluid">
|
||||||
</div>
|
<div class="span12">
|
||||||
|
<%= f.input :desc, :as=>:tinymce_text %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<%= f.input :depend %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
<%= f.input :modulgruppen,:as => :check_boxes, :collection => Hash[Modulgruppe.all.map{|m| [m.studium.name + " " + m.name,m.id]}.sort] %>
|
<%= f.input :modulgruppen,:as => :check_boxes, :collection => Hash[Modulgruppe.all.map{|m| [m.studium.name + " " + m.name,m.id]}.sort] %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<% if neuigkeit.has_calentries? %>
|
<% if neuigkeit.has_calentries? %>
|
||||||
<div class="pull-right" href="#">
|
<div class="pull-right" href="#">
|
||||||
<%= image_tag("/iconnavy/time.png") %>
|
<%= fa_icon("calendar 2x") %>
|
||||||
<% unless neuigkeit.calentries.upcoming.empty? %>
|
<% unless neuigkeit.calentries.upcoming.empty? %>
|
||||||
<%= neuigkeit.calentries.upcoming.first.text %>
|
<%= neuigkeit.calentries.upcoming.first.text %>
|
||||||
<% else unless neuigkeit.calentries.recent.empty? %>
|
<% else unless neuigkeit.calentries.recent.empty? %>
|
||||||
|
|||||||
@@ -66,9 +66,12 @@
|
|||||||
end
|
end
|
||||||
resources :beispiele#, :only=>[:show,:index,:create]
|
resources :beispiele#, :only=>[:show,:index,:create]
|
||||||
resources :lvas do
|
resources :lvas do
|
||||||
get 'compare_tiss'
|
member do
|
||||||
get 'load_tiss'
|
get 'compare_tiss'
|
||||||
resources :beispiele#, :only=>[:show,:index,:create]
|
get 'load_tiss'
|
||||||
|
end
|
||||||
|
resources :beispiele#, :only=>[:show,:index,:create]
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :fragen
|
resources :fragen
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ class AddInfoToStudien < ActiveRecord::Migration
|
|||||||
def change
|
def change
|
||||||
add_column :studium_translations, :qualifikation, :text
|
add_column :studium_translations, :qualifikation, :text
|
||||||
add_column :studium_translations, :struktur, :text
|
add_column :studium_translations, :struktur, :text
|
||||||
add_column :studium_translations, :jobmoeglichkeiten, :text20
|
add_column :studium_translations, :jobmoeglichkeiten, :text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user