forked from bofh/fetsite
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
|
||||
/server
|
||||
/public/uploads/
|
||||
/bak/*
|
||||
*#
|
||||
|
||||
@@ -258,6 +258,7 @@ DEPENDENCIES
|
||||
paper_trail (>= 2.7.0)!
|
||||
paperclip (~> 3.4.0)
|
||||
rails (= 3.2.13)
|
||||
remotipart!
|
||||
rmagick
|
||||
rolify
|
||||
rspec-rails
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class LvasController < ApplicationController
|
||||
# GET /lvas
|
||||
before_filter {@toolbar_elements =[]}
|
||||
before_filter :load_toolbar, :only => [:show]
|
||||
load_and_authorize_resource
|
||||
def index
|
||||
@lvas = Lva.all
|
||||
@@ -14,13 +14,7 @@ class LvasController < ApplicationController
|
||||
|
||||
def show
|
||||
@lva = Lva.find_by_id(params[:id])
|
||||
@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)}
|
||||
|
||||
|
||||
@beispiel=Beispiel.new
|
||||
end
|
||||
|
||||
# GET /lvas/new
|
||||
@@ -36,12 +30,10 @@ class LvasController < ApplicationController
|
||||
def edit
|
||||
@lva = Lva.find(params[:id])
|
||||
@semester = @lva.modul.map(&:modulgruppen).flatten.map(&:studium).map(&:semester).flatten.uniq
|
||||
|
||||
|
||||
end
|
||||
|
||||
def compare_tiss
|
||||
@lva = Lva.find_by_id(params[:lva_id])
|
||||
@lva = Lva.find_by_id(params[:id])
|
||||
@lvatiss = Lva.new
|
||||
@lvatiss.lvanr=@lva.lvanr
|
||||
@lvatiss.load_tissdata("-2013W")
|
||||
@@ -49,7 +41,7 @@ class LvasController < ApplicationController
|
||||
end
|
||||
|
||||
def load_tiss
|
||||
@lva = Lva.find_by_id(params[:lva_id])
|
||||
@lva = Lva.find_by_id(params[:id])
|
||||
@lva.load_tissdata("-2013W")
|
||||
if @lva.save
|
||||
redirect_to @lva , notice: 'Lva von TISS geladen.'
|
||||
@@ -58,50 +50,50 @@ class LvasController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
# POST /lvas
|
||||
# POST /lvas.json
|
||||
def create
|
||||
@lva = Lva.new(params[:lva])
|
||||
respond_to do |format|
|
||||
if @lva.save
|
||||
@lva.add_semesters
|
||||
format.html { redirect_to @lva, notice: 'Lva was successfully created.' }
|
||||
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /lvas/1
|
||||
# PUT /lvas/1.json
|
||||
def update
|
||||
@lva = Lva.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @lva.update_attributes(params[:lva])
|
||||
@lva.add_semesters
|
||||
format.html { redirect_to @lva, notice: 'Lva was successfully updated.' }
|
||||
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /lvas/1
|
||||
# DELETE /lvas/1.json
|
||||
def destroy
|
||||
@lva = Lva.find(params[:id])
|
||||
@lva.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to lvas_url }
|
||||
|
||||
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
|
||||
|
||||
@@ -24,7 +24,7 @@ class ModulgruppenController < ApplicationController
|
||||
@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-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
|
||||
|
||||
# GET /modulgruppen/new
|
||||
@@ -71,7 +71,6 @@ class ModulgruppenController < ApplicationController
|
||||
|
||||
def update
|
||||
@modulgruppe = Modulgruppe.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @modulgruppe.update_attributes(params[:modulgruppe])
|
||||
format.html { redirect_to @modulgruppe, notice: 'Modulgruppe was successfully updated.' }
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
class NeuigkeitenController < ApplicationController
|
||||
before_filter :load_toolbar_elements, :only=>[:show,:find_link]
|
||||
before_filter :load_toolbar_elements_edit, :only=>[:edit]
|
||||
|
||||
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
def show
|
||||
@@ -57,7 +61,7 @@ class NeuigkeitenController < ApplicationController
|
||||
|
||||
def edit
|
||||
@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<< Calentry.new
|
||||
|
||||
@@ -134,7 +138,12 @@ private
|
||||
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
|
||||
|
||||
@@ -15,7 +15,7 @@ class Gallery < ActiveRecord::Base
|
||||
attr_accessible :datum, :desc, :name
|
||||
has_many :fotos
|
||||
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
|
||||
name
|
||||
|
||||
@@ -44,7 +44,7 @@ class Lva < ActiveRecord::Base
|
||||
has_many :beispiele , :class_name => "Beispiel"
|
||||
has_and_belongs_to_many :lecturers
|
||||
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_presence_of :ects # ECTS vorhanden?
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<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
|
||||
format=:timeonly
|
||||
else
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span1"></div><div class="span1">
|
||||
<%= image_tag("/icon_kalender_small.png") %>
|
||||
<%= fa_icon("calendar 2x") %>
|
||||
|
||||
</div>
|
||||
<div class="span4">
|
||||
<%= f.input :start, :as => :datepicker %></div><div class="span4">
|
||||
|
||||
@@ -4,18 +4,27 @@
|
||||
<%= f.inputs do %>
|
||||
<div class="row-fluid">
|
||||
<div class="span9">
|
||||
<%= f.input :name ,:hint=>true%>
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<%= f.input :desc, :as=>:tinymce_text %>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<%= f.input :depend %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<%= f.input :name ,:hint=>true%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<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 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>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<% if neuigkeit.has_calentries? %>
|
||||
<div class="pull-right" href="#">
|
||||
<%= image_tag("/iconnavy/time.png") %>
|
||||
<%= fa_icon("calendar 2x") %>
|
||||
<% unless neuigkeit.calentries.upcoming.empty? %>
|
||||
<%= neuigkeit.calentries.upcoming.first.text %>
|
||||
<% else unless neuigkeit.calentries.recent.empty? %>
|
||||
|
||||
@@ -66,9 +66,12 @@
|
||||
end
|
||||
resources :beispiele#, :only=>[:show,:index,:create]
|
||||
resources :lvas do
|
||||
get 'compare_tiss'
|
||||
get 'load_tiss'
|
||||
resources :beispiele#, :only=>[:show,:index,:create]
|
||||
member do
|
||||
get 'compare_tiss'
|
||||
get 'load_tiss'
|
||||
end
|
||||
resources :beispiele#, :only=>[:show,:index,:create]
|
||||
|
||||
end
|
||||
|
||||
resources :fragen
|
||||
|
||||
@@ -2,6 +2,6 @@ class AddInfoToStudien < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :studium_translations, :qualifikation, :text
|
||||
add_column :studium_translations, :struktur, :text
|
||||
add_column :studium_translations, :jobmoeglichkeiten, :text20
|
||||
add_column :studium_translations, :jobmoeglichkeiten, :text
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user