This commit is contained in:
HausdorffHimself
2013-08-23 12:04:57 +02:00
65 changed files with 948 additions and 293 deletions

View File

@@ -23,38 +23,46 @@ long_line_behaviour=1
long_line_column=72
[files]
current_page=1
current_page=31
FILE_NAME_0=29;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Fcalendars%2Fshow.html.erb;0;4
FILE_NAME_1=58;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Fcalendars%2F_tabs.html.erb;0;4
FILE_NAME_1=573;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Fcalendars%2F_tabs.html.erb;0;4
FILE_NAME_2=1179;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Fability.rb;0;4
FILE_NAME_3=115;None;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Fcalendars%2Fshow.ics.erb;0;4
FILE_NAME_4=454;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fcontrollers%2Fusers_controller.rb;0;4
FILE_NAME_5=571;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fconfig%2Finitializers%2Fdevise.rb;0;4
FILE_NAME_6=627;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Fneuigkeit.rb;0;4
FILE_NAME_7=421;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Fmodulgruppe.rb;0;4
FILE_NAME_8=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Flva.rb;0;4
FILE_NAME_9=363;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Fthema.rb;0;4
FILE_NAME_10=255;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130124000300_translate_lvas.rb;0;4
FILE_NAME_11=222;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130818161841_translate_neuigkeiten.rb;0;4
FILE_NAME_12=1383;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fconfig%2Finitializers%2Finflections.rb;0;4
FILE_NAME_13=1010;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130818175905_fix_translation_tables.rb;0;4
FILE_NAME_14=615;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130805171433_translate_themen.rb;0;4
FILE_NAME_15=844;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ftmp%2Ffetsite%2Fdb%2Fmigrate%2F20130818175905_fix_translation_tables.rb;0;4
FILE_NAME_16=114;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ftmp%2Ffetsite%2Fdb%2Fmigrate%2F20130805171433_translate_themen.rb;0;4
FILE_NAME_17=191;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ftmp%2Ffetsite%2Fdb%2Fmigrate%2F20130805143719_create_themen.rb;0;4
FILE_NAME_18=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130112110800_create_semesters.rb;0;4
FILE_NAME_19=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130113160023_create_versions.rb;0;4
FILE_NAME_20=0;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Frubriken%2Fshow.html.erb;0;4
FILE_NAME_21=161;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Frubriken%2F_tabs.html.erb;0;4
FILE_NAME_22=439;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Flayouts%2Fapplication.html.erb;0;4
FILE_NAME_23=0;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Fusers%2Findex.html.erb;0;4
FILE_NAME_24=3143;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fcontrollers%2Fmoduls_controller.rb;0;4
FILE_NAME_25=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fcontrollers%2Fconfig_controller.rb;0;4
FILE_NAME_26=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fcontrollers%2Fmodulgruppen_controller.rb;0;4
FILE_NAME_27=783;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Flayouts%2Fmenu.html.erb;0;4
FILE_NAME_6=883;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Fmodulgruppe.rb;0;4
FILE_NAME_7=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Flva.rb;0;4
FILE_NAME_8=363;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Fthema.rb;0;4
FILE_NAME_9=255;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130124000300_translate_lvas.rb;0;4
FILE_NAME_10=222;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130818161841_translate_neuigkeiten.rb;0;4
FILE_NAME_11=1383;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fconfig%2Finitializers%2Finflections.rb;0;4
FILE_NAME_12=1010;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130818175905_fix_translation_tables.rb;0;4
FILE_NAME_13=615;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130805171433_translate_themen.rb;0;4
FILE_NAME_14=844;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ftmp%2Ffetsite%2Fdb%2Fmigrate%2F20130818175905_fix_translation_tables.rb;0;4
FILE_NAME_15=114;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ftmp%2Ffetsite%2Fdb%2Fmigrate%2F20130805171433_translate_themen.rb;0;4
FILE_NAME_16=169;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ftmp%2Ffetsite%2Fdb%2Fmigrate%2F20130805143719_create_themen.rb;0;4
FILE_NAME_17=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130112110800_create_semesters.rb;0;4
FILE_NAME_18=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130113160023_create_versions.rb;0;4
FILE_NAME_19=0;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Frubriken%2Fshow.html.erb;0;4
FILE_NAME_20=161;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Frubriken%2F_tabs.html.erb;0;4
FILE_NAME_21=439;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Flayouts%2Fapplication.html.erb;0;4
FILE_NAME_22=0;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Fusers%2Findex.html.erb;0;4
FILE_NAME_23=3143;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fcontrollers%2Fmoduls_controller.rb;0;4
FILE_NAME_24=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fcontrollers%2Fconfig_controller.rb;0;4
FILE_NAME_25=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fcontrollers%2Fmodulgruppen_controller.rb;0;4
FILE_NAME_26=783;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Flayouts%2Fmenu.html.erb;0;4
FILE_NAME_27=375;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Fneuigkeiten%2Fshow.html.erb;0;4
FILE_NAME_28=1;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Fneuigkeiten%2F_neuigkeit.html.erb;0;4
FILE_NAME_29=1;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Fstudien%2Fshow.html.erb;0;4
FILE_NAME_30=658;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Fcalentry.rb;0;4
FILE_NAME_31=218;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fdb%2Fmigrate%2F20130823084252_add_object_to_calentries.rb;0;4
FILE_NAME_32=1069;HTML;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fviews%2Ffetprofiles%2F_form.html.erb;0;4
FILE_NAME_33=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Fbeispiel.rb;0;4
FILE_NAME_34=0;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Fcalendar.rb;0;4
FILE_NAME_35=477;Ruby;0;16;1;1;0;%2Fhome%2Fandreas%2Fwww%2Ffetsite%2Fapp%2Fmodels%2Frubrik.rb;0;4
[gproject]
source_patterns=*.rb;*.erb
source_patterns=*.rb;*.erb;
header_patterns=*.h;*.H;*.hpp;*.hxx;*.h++;*.hh;*.m;
ignored_dirs_patterns=.*;CVS;
generate_tags=false

2
.gitignore vendored
View File

@@ -6,7 +6,7 @@
# Ignore bundler config
/.bundle
*.*~
# Ignore the default SQLite database.
/db/*.sqlite3
/db/schema.rb

View File

@@ -78,3 +78,6 @@ end
gem "simple_calendar", "~> 0.1.9"
gem 'rmagick'
gem 'bootstrap-addons-rails'
gem "jquery-fileupload-rails"

View File

@@ -35,6 +35,8 @@ GEM
activerecord (>= 3.0.0)
bcrypt-ruby (3.0.1)
bcrypt-ruby (3.0.1-x86-mingw32)
bootstrap-addons-rails (0.1.2)
rails
bootstrap-sass (2.3.2.1)
sass (~> 3.2)
builder (3.0.4)
@@ -80,6 +82,9 @@ GEM
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-fileupload-rails (0.4.1)
actionpack (>= 3.1)
railties (>= 3.1)
jquery-rails (2.2.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
@@ -179,6 +184,7 @@ PLATFORMS
DEPENDENCIES
annotate (>= 2.5.0)
awesome_nested_set
bootstrap-addons-rails
bootstrap-sass (~> 2.3.2.1)
cancan
carrierwave
@@ -191,6 +197,7 @@ DEPENDENCIES
git
globalize3 (~> 0.3.0)
haml
jquery-fileupload-rails
jquery-rails
paper_trail (>= 2.7.0)
paperclip (~> 3.4.0)

View File

@@ -16,4 +16,8 @@
//= require_tree .
//= require tinymce-jquery
//= require bootstrap
//= require bootstrap/colorpicker
//= require bootstrap/datepicker
//= require bootstrap/load-image.min
//= require bootstrap/image-gallery.min
//= require jquery-fileupload

View File

@@ -10,11 +10,16 @@
*
*= require_self
*= require_tree .
*= require jquery.fileupload-ui
* require 'bootstrap'
*/
$linkColor: #03006E;
@import 'bootstrap';
@import 'bootstrap-responsive';
@import 'bootstrap/image-gallery';
h1
{font-size: 23px}
h2

View File

@@ -4,7 +4,7 @@
div.lva-semester {
border: solid;
border-width: 1px;
border-width: 0px;
margin: 1px;
padding: 5px;
border-color: green;

View File

@@ -25,7 +25,8 @@ class FotosController < ApplicationController
# GET /fotos/new.json
def new
@foto = Foto.new
@gallery = Gallery.find_by_id(params[:gallery_id])
@foto.gallery_id = @gallery.id
respond_to do |format|
format.html # new.html.erb
format.json { render json: @foto }
@@ -42,10 +43,17 @@ class FotosController < ApplicationController
def create
@foto = Foto.new(params[:foto])
@foto.gallery_id = (params[:gallery_id])
@gallery = @foto.gallery
respond_to do |format|
@foto.title = @foto.datei.filename
if @foto.save
format.html { redirect_to @foto, notice: 'Foto was successfully created.' }
format.json { render json: @foto, status: :created, location: @foto }
format.html {
render :json => [@foto.to_jq_upload].to_json,
:content_type => 'text/html',
:layout => false
}
format.json { render json: {files: [@foto.to_jq_upload]}, status: :created, location: [@gallery, @foto] }
else
format.html { render action: "new" }
format.json { render json: @foto.errors, status: :unprocessable_entity }
@@ -60,8 +68,12 @@ class FotosController < ApplicationController
respond_to do |format|
if @foto.update_attributes(params[:foto])
format.html { redirect_to @foto, notice: 'Foto was successfully updated.' }
format.json { head :no_content }
format.html {
render :json => [@foto.to_jq_upload].to_json,
:content_type => 'text/html',
:layout => false
}
format.json { render json: {files: [@foto.to_jq_upload]}, status: :created, location: [@gallery, @foto] }
else
format.html { render action: "edit" }
format.json { render json: @foto.errors, status: :unprocessable_entity }
@@ -76,7 +88,7 @@ class FotosController < ApplicationController
@foto.destroy
respond_to do |format|
format.html { redirect_to fotos_url }
format.html { redirect_to galleries_url }
format.json { head :no_content }
end
end

View File

@@ -25,7 +25,7 @@ class GalleriesController < ApplicationController
# GET /galleries/new.json
def new
@gallery = Gallery.new
@foto = Foto.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @gallery }
@@ -41,7 +41,7 @@ class GalleriesController < ApplicationController
# POST /galleries.json
def create
@gallery = Gallery.new(params[:gallery])
@foto = Foto.new
respond_to do |format|
if @gallery.save
format.html { redirect_to @gallery, notice: 'Gallery was successfully created.' }
@@ -57,7 +57,7 @@ class GalleriesController < ApplicationController
# PUT /galleries/1.json
def update
@gallery = Gallery.find(params[:id])
@foto = Foto.new
respond_to do |format|
if @gallery.update_attributes(params[:gallery])
format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }

View File

@@ -7,4 +7,7 @@ class HomeController < ApplicationController
def startdev
render 'setup_fetsite_dev'
end
def linksnotimplemented
render 'links_notimplemented'
end
end

View File

@@ -16,6 +16,7 @@ class LvasController < ApplicationController
@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?"}
end
# GET /lvas/new

View File

@@ -1,31 +1,9 @@
class MembershipsController < ApplicationController
# GET /memberships
# GET /memberships.json
def index
@memberships = Membership.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @memberships }
end
end
# GET /memberships/1
# GET /memberships/1.json
def show
@membership = Membership.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @membership }
end
end
# GET /memberships/new
# GET /memberships/new.json
def new
@membership = Membership.new
@membership.fetprofile=Fetprofile.find(params[:fetprofile_id])
respond_to do |format|
format.html # new.html.erb
format.json { render json: @membership }
@@ -44,8 +22,8 @@ class MembershipsController < ApplicationController
respond_to do |format|
if @membership.save
format.html { redirect_to @membership, notice: 'Membership was successfully created.' }
format.json { render json: @membership, status: :created, location: @membership }
format.html { redirect_to @membership.fetprofile, notice: 'Membership was successfully created.' }
format.json { render json: @membership.fetprofile, status: :created, location: @membership.fetprofile }
else
format.html { render action: "new" }
format.json { render json: @membership.errors, status: :unprocessable_entity }
@@ -60,7 +38,7 @@ class MembershipsController < ApplicationController
respond_to do |format|
if @membership.update_attributes(params[:membership])
format.html { redirect_to @membership, notice: 'Membership was successfully updated.' }
format.html { redirect_to @membership.fetprofile, notice: 'Membership was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
@@ -73,10 +51,11 @@ class MembershipsController < ApplicationController
# DELETE /memberships/1.json
def destroy
@membership = Membership.find(params[:id])
fp = @membership.fetprofile
@membership.destroy
respond_to do |format|
format.html { redirect_to memberships_url }
format.html { redirect_to fp }
format.json { head :no_content }
end
end

View File

@@ -92,14 +92,16 @@ class StudienController < ApplicationController
end
def verwalten
@new_params={:std_verw=>params[:std_verw], :mg_verw=>params[:mg_verw], :m_verw=>params[:m_verw], :lva_verw=>params[:lva_verw], :b_verw=>params[:b_verw]}
@new_params={:std_verw=>params[:std_verw], :mg_verw=>params[:mg_verw], :m_verw=>params[:m_verw], :lva_verw=>params[:lva_verw], :b_verw=>params[:b_verw], :lec_verw=>params[:lec_verw]}
if @new_params.values.compact.empty?
@studien=Studium.all
@modulgruppen=Modulgruppe.all
@module=Modul.all
@lvas=Lva.all
@beispiele=Beispiel.all
@lecturers=Lecturer.all
else
if !@new_params[:std_verw].nil?
@studien = [Studium.find(@new_params[:std_verw])]
else
@@ -144,7 +146,7 @@ class StudienController < ApplicationController
@beispiele = [Beispiel.find(@new_params[:b_verw])]
temp = @lvas.map{|x| x.beispiele}.flatten.uniq #Force Force Lvas
@lvas=@lvas.select{|k| temp.include?(k)}
temp = @module.map{|x| x.lvas}.flatten.uniq #Force Module
temp = @lva.map{|x| x.moduls}.flatten.uniq #Force Module
@module=@module.select{|k| temp.include?(k)}
temp = @module.map{|x| x.modulgruppen}.flatten.uniq # Force Modulgruppen
@modulgruppen = @modulgruppen.select{|k| temp.include?(k)}
@@ -157,6 +159,21 @@ class StudienController < ApplicationController
temp = @lvas.map{|x| x.beispiele}.flatten.uniq # Force beispiel
@beispiele=@beispiele.select{|k| temp.include?(k)}
end
if !@new_params[:lec_verw].nil?
@lecturers=[Lecturer.find(@new_params[:lec_verw])]
temp = @lecturers.map{|x| x.lvas}.flatten.uniq #Force Force Lvas
@lvas=@lvas.select{|k| temp.include?(k)}
temp = @lvas.map{|x| x.modul}.flatten.uniq #Force Force Lvas
@module=@module.select{|k| temp.include?(k)}
temp = @module.map{|x| x.modulgruppen}.flatten.uniq # Force Modulgruppen
@modulgruppen = @modulgruppen.select{|k| temp.include?(k)}
temp = @modulgruppen.map{|x| x.studium}.flatten.uniq # Force Studien
@studien=@studien.select{|k| temp.include?(k)}
temp = @lvas.map{|x| x.beispiele}.flatten.uniq # Force beispiel
@beispiele=@beispiele.select{|k| temp.include?(k)}
else
@lecturers = @lvas.map{|k| k.lecturers}.flatten.uniq
end
end
@messages = []
@@ -230,7 +247,9 @@ class StudienController < ApplicationController
:mg_verw=> params[:mg_verw],
:m_verw=>params[:m_verw],
:lva_verw=>params[:lva_verw],
:b_verw=>params[:b_verw]}.merge(super)
:b_verw=>params[:b_verw],
:lec_verw=>params[:lec_verw]}.merge(super)
end
end

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
class Ability
include CanCan::Ability
def initialize(user)
@@ -27,7 +28,7 @@ class Ability
# For Debug allow everything
# Remove this line in production environment and for testing user management
# can :manage, :all
can :manage, :all
can :addfetuser, User
can :addfetadmin, User
can [:show, :index], Studium

View File

@@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: attachments
#
# id :integer not null, primary key
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# thema_id :integer
#
class Attachment < ActiveRecord::Base
has_paper_trail
attr_accessible :name

View File

@@ -2,16 +2,13 @@
#
# Table name: beispiele
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# lva_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# file_file_name :string(255)
# file_content_type :string(255)
# file_file_size :integer
# file_updated_at :datetime
# id :integer not null, primary key
# name :string(255)
# desc :text
# lva_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# beispieldatei :string(255)
#
class Beispiel < ActiveRecord::Base

View File

@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: calendars
#
# id :integer not null, primary key
# name :string(255)
# public :boolean
# created_at :datetime not null
# updated_at :datetime not null
# picture :string(255)
#
class Calendar < ActiveRecord::Base
attr_accessible :name, :public, :picture
has_and_belongs_to_many :calentries

View File

@@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: calentries
#
# id :integer not null, primary key
# start :datetime
# ende :datetime
# summary :string(255)
# typ :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Calentry < ActiveRecord::Base
attr_accessible :ende, :start, :summary, :typ,:calendar_ids
has_and_belongs_to_many :calendars
@@ -8,6 +21,8 @@ class Calentry < ActiveRecord::Base
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
end
end
belongs_to :object, polymorphic: true
resourcify
def start_time
start
@@ -18,5 +33,5 @@ class Calentry < ActiveRecord::Base
def name
summary
end
scope :upcoming, -> { where("start >= ?" , Time.now).where("start <= ?", 8.days.from_now) }
end

View File

@@ -1,3 +1,26 @@
# == Schema Information
#
# Table name: fetprofiles
#
# id :integer not null, primary key
# vorname :string(255)
# nachname :string(255)
# short :string(255)
# fetmailalias :string(255)
# desc :text
# picture :string(255)
# active :boolean
# created_at :datetime not null
# updated_at :datetime not null
#
class Fetprofile < ActiveRecord::Base
attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname
has_many :memberships
has_many :gremien, :through=> :membership
mount_uploader :picture, PictureUploader
def name
[vorname, nachname, "(",short,")"].join(" ")
end
scope :active, -> { where(:active=>:true).order(:vorname) }
end

View File

@@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: fetzneditions
#
# id :integer not null, primary key
# title :string(255)
# desc :text
# datum :date
# datei :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Fetznedition < ActiveRecord::Base
attr_accessible :datei, :datum, :desc, :title
end

View File

@@ -1,3 +1,31 @@
# == Schema Information
#
# Table name: fotos
#
# id :integer not null, primary key
# title :string(255)
# desc :text
# gallery_id :integer
# datei :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Foto < ActiveRecord::Base
attr_accessible :datei, :desc, :gallery_id, :title
belongs_to :gallery
mount_uploader :datei, FotoUploader
resourcify
def to_jq_upload
{
"id" => read_attribute(:id),
"title" => read_attribute(:title),
"description" => read_attribute(:desc),
"name" => read_attribute(:title),
"size" => datei.size,
"url" => datei.url,
"thumbnail_url" => datei.thumb.url,
"delete_type" => "DELETE"
}
end
end

View File

@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: fragen
#
# id :integer not null, primary key
# title :string(255)
# text :text
# created_at :datetime not null
# updated_at :datetime not null
# thema_id :integer
#
class Frage < ActiveRecord::Base
attr_accessible :text, :title, :thema_id
belongs_to :thema

View File

@@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: galleries
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# datum :date
# created_at :datetime not null
# updated_at :datetime not null
#
class Gallery < ActiveRecord::Base
attr_accessible :datum, :desc, :name
has_many :fotos
end

View File

@@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: gremien
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# typ :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Gremium < ActiveRecord::Base
attr_accessible :desc, :name, :typ
has_many :memberships
end

View File

@@ -1,4 +1,19 @@
# == Schema Information
#
# Table name: lecturers
#
# id :integer not null, primary key
# name :string(255)
# email :string(255)
# oid :integer
# picture :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Lecturer < ActiveRecord::Base
attr_accessible :email, :name, :oid, :picture, :lva_ids
attr_accessible :email, :name, :oid, :picture, :remove_picture, :picture_cache, :lva_ids, :link
has_and_belongs_to_many :lvas
mount_uploader :picture, PictureUploader
resourcify
end

View File

@@ -1,4 +1,23 @@
# -*- coding: utf-8 -*-
# == Schema Information
#
# Table name: lvas
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# ects :decimal(, )
# lvanr :string(255)
# stunden :decimal(, )
# created_at :datetime not null
# updated_at :datetime not null
# modul_id :integer
# semester_id :integer
# pruefungsinformation :text
# lernaufwand :text
# typ :string(255)
#
# == Schema Information
#
# Table name: lvas

View File

@@ -1,3 +1,19 @@
# == Schema Information
#
# Table name: memberships
#
# id :integer not null, primary key
# fetprofile_id :string(255)
# gremium_id :string(255)
# start :date
# stop :date
# typ :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Membership < ActiveRecord::Base
attr_accessible :fetprofile_id, :gremium_id, :start, :stop, :typ
belongs_to :fetprofile
belongs_to :gremium
end

View File

@@ -9,6 +9,7 @@
# rubrik_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# author_id :integer
#
class Neuigkeit < ActiveRecord::Base
@@ -19,4 +20,8 @@ class Neuigkeit < ActiveRecord::Base
validates :rubrik, :presence=>true
validates :author, :presence=>true
translates :title,:text, :versioning=>true, :fallbacks_for_empty_translations => true
scope :published, -> {where("datum >= ?", Time.now.to_date)}
scope :recent, -> { where("updated_at >= ? ",Time.now - 7.days)}
end

View File

@@ -13,9 +13,23 @@
#
class Semester < ActiveRecord::Base
attr_accessible :name, :nummer, :ssws, :lva_ids
attr_accessible :nummer, :ssws, :lva_ids
has_and_belongs_to_many :lvas
belongs_to :studium, :foreign_key => "studium_id"
validates :name, :presence => true
validates :nummer, :presence => true
def name
if self.nummer == 0
return I18n.t("ohnezuordnung") + " (" + self.studium.name + ")"
else
return self.nummer.to_s + ". " + self.studium.name
end
end
def name_kurz
if self.nummer == 0
return I18n.t("ohnezuordnung") + " (" + self.studium.abkuerzung + ")"
else
return self.nummer.to_s + ". " + self.studium.abkuerzung
end
end
end

View File

@@ -1,4 +1,19 @@
# -*- coding: utf-8 -*-
# == Schema Information
#
# Table name: studien
#
# id :integer not null, primary key
# zahl :string(255)
# name :string(255)
# shortdesc :text
# desc :text
# typ :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# abkuerzung :string(255)
#
# == Schema Information
#
# Table name: studien

View File

@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: themen
#
# id :integer not null, primary key
# title :string(255)
# text :text
# created_at :datetime not null
# updated_at :datetime not null
# themengruppe_id :integer
#
class Thema < ActiveRecord::Base
attr_accessible :text, :title, :themengruppe_id
has_many :fragen

View File

@@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: themengruppen
#
# id :integer not null, primary key
# title :string(255)
# text :text
# created_at :datetime not null
# updated_at :datetime not null
#
class Themengruppe < ActiveRecord::Base
WORD_COUNT = 50
attr_accessible :text, :title

View File

@@ -0,0 +1,56 @@
# encoding: utf-8
class FotoUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
include CarrierWave::RMagick
# include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage :file
# storage :fog
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url
# # For Rails 3.1+ asset pipeline compatibility:
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
#
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
# end
# Process files as they are uploaded:
# process :scale => [200, 300]
#
# def scale(width, height)
# # do something
# end
# Create different versions of your uploaded files:
version :thumb do
process :resize_to_fill => [64, 64]
end
version :big_thumb do
process :resize_to_fill => [128, 128]
end
version :resized do
process :resize_to_fit => [1024, 1024]
end
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list
%w(jpg jpeg gif png)
end
# Override the filename of the uploaded files:
# Avoid using model.id or version_name here, see uploader/store.rb for details.
# def filename
# "something.jpg" if original_filename
# end
end

View File

@@ -36,6 +36,9 @@ class PictureUploader < CarrierWave::Uploader::Base
process :resize_to_fill => [64, 64]
end
version :portrait do
process :resize_to_fill => [128,192]
end
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list

View File

@@ -1,28 +1,28 @@
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<%= render 'tabs' %>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<%= render 'tabs' %>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h1><%= I18n.t 'calendars.calendar' %></h1>
<% @calendars.each do |calendar| %>
<div class="media">
<div class="row-fluid">
<div class="span12">
<h1><%= I18n.t 'calendars.calendar' %></h1>
<% @calendars.each do |calendar| %>
<div class="media">
<a class="pull-left" href="#">
<img class="media-object img-circle" src="<%= calendar.picture.thumb.url %>"/>
<img class="media-object img-circle" src="<%= calendar.picture.thumb.url %>"/>
</a>
<div class="media-body">
<h4><%= link_to calendar.name, calendar %></h4>
<h4><%= link_to calendar.name, calendar %></h4>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<%= link_to 'New Calendar', new_calendar_path unless cannot?(:new, Calendar) %>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<%= link_to 'New Calendar', new_calendar_path unless cannot?(:new, Calendar) %>
</div>
</div>
</div>

View File

@@ -1,15 +1,40 @@
<div class="container-fluid">
<%= semantic_form_for @fetprofile do |f| %>
<%= f.inputs do %>
<%= f.input :vorname %>
<%= f.input :nachname %>
<%= f.input :short %>
<%= f.input :fetmailalias %>
<%= f.input :desc %>
<%= f.input :picture %>
<%= f.input :active %>
<div class="row-fluid">
<div class="span4">
<%= f.input :vorname %></div>
<div class="span4"><%= f.input :nachname %></div>
<div class="span4"><%= f.input :short %>
</div> </div>
<div class="row-fluid">
<div class="span12">
<%= f.input :desc %></div>
</div>
<div class="row-fluid">
<div class="span4"> <%= f.input :active %></div>
<div class="span4"><%= f.input :picture, :as=>:file %></div>
<div class="span4"> <%= f.input :fetmailalias %></div>
</div>
<% @fetprofile.memberships.each do |m| %>
<%= semantic_fields_for m do |mf| %>
<div class="row-fluid">
<div class="span1"></div>
<%= mf.inputs do %>
<div class="span3"><%= mf.input :start, :as=>:date %></div>
<div class="span3"><%= mf.input :stop %></div>
<div class="span3"><%= mf. input :gremium %></div>
<div class="span2"><%= mf.input :typ ,:as=>:radio, :collection=>{"mitglied"=>1, "ersatzmitglied"=>2} %></div>
<% end %>
</div>
<% end %>
<% end
end %>
<div class="row-fluid">
<div class="span12">
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
<% end %>
<% end %>
</div></div></div>

View File

@@ -1,35 +1,25 @@
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<h1>Listing fetprofiles</h1>
<table>
<tr>
<th>Vorname</th>
<th>Nachname</th>
<th>Short</th>
<th>Fetmailalias</th>
<th>Desc</th>
<th>Picture</th>
<th>Active</th>
<th></th>
<th></th>
<th></th>
</tr>
</div>
</div>
<% @fetprofiles.each do |fetprofile| %>
<tr>
<td><%= fetprofile.vorname %></td>
<td><%= fetprofile.nachname %></td>
<td><%= fetprofile.short %></td>
<td><%= fetprofile.fetmailalias %></td>
<td><%= fetprofile.desc %></td>
<td><%= fetprofile.picture %></td>
<td><%= fetprofile.active %></td>
<td><%= link_to 'Show', fetprofile %></td>
<td><%= link_to 'Edit', edit_fetprofile_path(fetprofile) %></td>
<td><%= link_to 'Destroy', fetprofile, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<div class="row-fluid">
<div class="span3">
<%= image_tag fetprofile.picture.portrait.url %>
</div>
<div class="span9">
<h2><%= link_to fetprofile.name, fetprofile %></h2>
<p><%= fetprofile.fetmailalias %></p>
<p><%= fetprofile.desc %></p>
<p><%= fetprofile.active %> </p>
</div>
</div>
<% end %>
</table>
<br />
<div class="row-fluid">
<div class="span12">
<%= link_to 'New Fetprofile', new_fetprofile_path %>
</div></div></div>

View File

@@ -1,40 +1,39 @@
<p id="notice"><%= notice %></p>
<div class="container-fluid">
<div class="row-fluid">
<div class="span3">
<%= image_tag @fetprofile.picture.portrait.url %>
</div>
<div class="span9">
<h2><%= @fetprofile.name %></h2>
<p>
<b>Vorname:</b>
<%= @fetprofile.vorname %>
</p>
<p>
<b>Nachname:</b>
<%= @fetprofile.nachname %>
</p>
<p>
<b>Short:</b>
<%= @fetprofile.short %>
</p>
<p>
<b>Fetmailalias:</b>
<%= @fetprofile.fetmailalias %>
</p>
<p>
<b>Desc:</b>
<%= @fetprofile.desc %>
</p>
<p>
<b>Picture:</b>
<%= @fetprofile.picture %>
<%= "<b>Aktiv</b>".html_safe if @fetprofile.active %>
</p>
<p><%= link_to 'Destroy', @fetprofile, method: :delete, data: { confirm: 'Are you sure?' } %></p>
</div>
</div>
<p>
<b>Active:</b>
<%= @fetprofile.active %>
</p>
<div class="row-fluid">
<div class="span12">
<ul>
<% @fetprofile.memberships.each do |m| %>
<li><%= m.start.to_s %> bis <%= m.stop.to_s %> in <%= m.gremium.try(:name).to_s %>
<%= link_to 'edit', edit_fetprofile_membership_path(@fetprofile,m) %>
</li>
<% end %>
</ul>
<%= link_to 'Neue Mitgliedschaft', new_fetprofile_membership_path(@fetprofile) %> |
<%= link_to 'Edit', edit_fetprofile_path(@fetprofile) %> |
<%= link_to 'Back', fetprofiles_path %>
</div>
</div></div>

View File

@@ -0,0 +1,140 @@
<div class="container">
<h2>Upload file</h2>
<%= semantic_form_for [@gallery, @foto], :remote=>true, :html => { :multipart => true, :id => "fileupload" } do |f| %>
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row fileupload-buttonbar">
<div class="span7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>
<span>Add files...</span>
<%= f.file_field :datei, :multiple=>true%>
<%= f.input :gallery %>
</span>
<button type="submit" class="btn btn-primary start">
<i class="icon-upload icon-white"></i>
<span>Start upload</span>
</button>
<button type="reset" class="btn btn-warning cancel">
<i class="icon-ban-circle icon-white"></i>
<span>Cancel upload</span>
</button>
<button type="button" class="btn btn-danger delete">
<i class="icon-trash icon-white"></i>
<span>Delete</span>
</button>
<input type="checkbox" class="toggle">
</div>
<div class="span5">
<!-- The global progress bar -->
<div class="progress progress-success progress-striped active fade">
<div class="bar" style="width:100%;"></div>
</div>
</div>
</div>
<!-- The loading indicator is shown during image processing -->
<div class="fileupload-loading"></div>
<br>
<!-- The table listing the files available for upload/download -->
<table class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody>
</table>
<% end %>
</div>
<script>
var fileUploadErrors = {
maxFileSize: 'File is too big',
minFileSize: 'File is too small',
acceptFileTypes: 'Filetype not allowed',
maxNumberOfFiles: 'Max number of files exceeded',
uploadedBytes: 'Uploaded bytes exceed file size',
emptyResult: 'Empty file upload result'
};
</script>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<!--<td class="preview"><span class="fade"></span></td>-->
<td class="name"><span>{%=file.name%}</span></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
{% if (file.error) { %}
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
{% } else if (o.files.valid && !i) { %}
<td>
<div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
</td>
<td class="start">{% if (!o.options.autoUpload) { %}
<button class="btn btn-primary">
<i class="icon-upload icon-white"></i>
<span>{%=locale.fileupload.start%}</span>
</button>
{% } %}</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="cancel">{% if (!i) { %}
<button class="btn btn-warning">
<i class="icon-ban-circle icon-white"></i>
<span>{%=locale.fileupload.cancel%}</span>
</button>
{% } %}</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download fade">
{% if (file.error) { %}
<td></td>
<td class="name"><span>{%=file.name%}</span></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
{% } else { %}
<!--<td class="preview">{% if (file.thumbnail_url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
{% } %}</td>-->
<td class="name">
<a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
</td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
<td colspan="2"></td>
{% } %}
<td class="delete">
<button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
<i class="icon-trash icon-white"></i>
<span>{%=locale.fileupload.destroy%}</span>
</button>
<input type="checkbox" name="delete" value="1">
</td>
</tr>
{% } %}
</script>
<script type="text/javascript" charset="utf-8">
$(function () {
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload();
//
// Load existing files:
$.getJSON($('#fileupload').prop('action'), function (files) {
var fu = $('#fileupload').data('blueimpFileupload'),
template;
fu._adjustMaxNumberOfFiles(-files.length);
console.log(files);
// no Download on Upload form
//template = fu._renderDownload(files)
//.appendTo($('#fileupload .files'));
// Force reflow:
fu._reflow = fu._transition && template.length &&
template[0].offsetWidth;
template.addClass('in');
$('#loading').remove();
});
$('#foto_datei').attr('name', 'foto[datei]');
$('#foto_datei').fileupload();
});
</script>

View File

@@ -1,5 +1,5 @@
<h1>New foto</h1>
<%= render 'form' %>
<%= render 'form_bulk' %>
<%= link_to 'Back', fotos_path %>
<%= link_to 'Back', gallery_path(params[:gallery_id]) %>

View File

@@ -1,25 +1,31 @@
<p id="notice"><%= notice %></p>
<p>
<b>Title:</b>
<%= @foto.title %>
</p>
<div class="container-fluid">
<p>
<b>Desc:</b>
<%= @foto.desc %>
</p>
<div class="row-fluid">
<div class="span12">
<%= link_to image_tag(@foto.datei.resized.url), gallery_foto_path(@foto.gallery, ((@foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil?) ? (@foto.gallery.fotos[0].try(:id).to_i) : @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) ) %>
</div>
</div>
<p>
<b>Gallery:</b>
<%= @foto.gallery_id %>
</p>
<div class="row-fluid">
<div class="span9">
<h2><%= @foto.title %></h2>
<p><%= @foto.desc %></p>
</div>
<div class="span3">
<p>
<%= link_to 'last' , gallery_foto_path(@foto.gallery, @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)-1].try(:id).to_i) unless @foto.gallery.fotos.index(@foto)==0 %>
<%= link_to 'next' , gallery_foto_path(@foto.gallery, @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) unless @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil? %>
<%= link_to 'Edit', edit_foto_path(@foto) %> |
<%= link_to 'Back', gallery_path(@foto.gallery) %>
</p>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<p id="notice"><%= notice %></p>
</div>
</div>
</div>
<p>
<b>Datei:</b>
<%= @foto.datei %>
</p>
<%= link_to 'Edit', edit_foto_path(@foto) %> |
<%= link_to 'Back', fotos_path %>

View File

@@ -1,3 +1,4 @@
<p id="notice"><%= notice %></p>
<p>
@@ -14,7 +15,35 @@
<b>Datum:</b>
<%= @gallery.datum %>
</p>
<!-- modal-gallery is the modal dialog used for the image gallery -->
<div id="modal-gallery" class="modal modal-fullscreen modal-gallery hide fade" tabindex="-1">
<div class="modal-header">
<a class="close" data-dismiss="modal">&times;</a>
<h3 class="modal-title"></h3>
</div>
<div class="modal-body"><div class="modal-image"></div></div>
<div class="modal-footer">
<a class="btn btn-primary modal-next">Next <i class="icon-arrow-right icon-white"></i></a>
<a class="btn btn-info modal-prev"><i class="icon-arrow-left icon-white"></i> Previous</a>
<a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000"><i class="icon-play icon-white"></i> Slideshow</a>
<a class="btn modal-download" target="_blank"><i class="icon-download"></i> Download</a>
</div>
</div>
<div id="gallery" data-toggle="modal-gallery" data-target="#modal-gallery">
<% @gallery.fotos.each do |f| %>
<a href="<%= f.datei.resized.url%>" title="<%=f.title%>" data-gallery="gallery">
<%=image_tag(f.datei.big_thumb.url,{:class=>"img-polaroid"}) %></a>
<% end %>
</div>
<%= link_to 'NewFoto' , new_gallery_foto_path(@gallery) %> |
<%= link_to 'Edit', edit_gallery_path(@gallery) %> |
<%= link_to 'Back', galleries_path %>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/load-image.js"></script>
<script src="js/bootstrap-image-gallery.js"></script>

View File

@@ -1,4 +1,5 @@
<h1>Entwicklungsprojekt</h1>
<%= link_to "notimplemented", home_linksnotimplemented_path %>
<h2>Feature List: 2013-07-17</h2>
<ul>
<li>Info zu Studien/Studienpläne</li>

View File

@@ -0,0 +1,8 @@
Vorhandene Resourcen
<ul>
<li><%= link_to "galleries", galleries_path %></li>
<li><%= link_to "fotos", fotos_path %></li>
<li><%= link_to "gremien", gremien_path %></li>
<li><%= link_to "fetprofiles", fetprofiles_path %></li>
<li><%= link_to "memberships", memberships_path %></li>
</ul>

View File

@@ -3,7 +3,8 @@
<h2>Git installieren und Repository koperen</h2>
Falls noch nicht installiert, GIT installieren
<pre>sudo apt-get install git git-cola</pre>
Repository auf Github forken und dann auf dem Rechner clonen.
Repository auf Github forken und dann auf dem Rechner clonen.
Den folgenden Befehl im Verzeichnis in das gekont werden soll ausführen.
<pre>git clone https://github.com/<github username>/fetsite</pre>
<h2>Ruby on Rails installieren </h2>
Ruby 1.9 installieren wobei wichtig ist, dass die Version 1.9 ist
@@ -12,6 +13,7 @@ Falls mehrere Ruby Versionen installiert ist mit
<pre> sudo update-alternatives --config ruby</pre>
überprüfen, dass Ruby 1.9 verwendet wird.
<pre>sudo apt-get install rubygems1.9</pre>
Im angelegten Verzeichnis den bundle installer ausführen.
<pre>sudo gem install bundler</pre>
ImageMagick,sqlite3 installieren
<pre>sudo apt-get install libmagickwand-dev libsqlite3-dev nodejs</pre>

View File

@@ -5,9 +5,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fetsite</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/bootstrap-responsive.css">
<!--[if lt IE 7]><link rel="stylesheet" href="css/bootstrap-ie6.css"><![endif]-->
<link rel="stylesheet" href="css/bootstrap-image-gallery.css">
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<div class="container-fluid">

View File

@@ -13,6 +13,8 @@
</li>
<li><%= link_to I18n.t(:news,:scope=>'home' ),rubriken_path %></li>
<li><%= link_to I18n.t(:info,:scope=>'home' ),themengruppen_path %></li>
<li><%= link_to I18n.t('mitarbeiter',:scope=>'home' ),fetprofiles_path %></li>
<li><%= link_to I18n.t('fotos',:scope=>'home' ),galleries_path %></li>
<li><%= link_to I18n.t(:studien,:scope=>'home' ), studien_path %></li>
<li><%= link_to "Kalender", calendars_path %></li>
<li class="divider"></li>

View File

@@ -1,10 +1,28 @@
<%= semantic_form_for @lecturer do |f| %>
<%= f.inputs do %>
<div class="row-fluid">
<div class="span6">
<%= f.input :name %>
<%= f.input :email %>
<%= f.input :oid %>
<%= f.input :picture %>
<%= f.input :lvas %>
<%= f.input :link %>
</div>
<div class="span3">
<p>
<label>Bild</label>
<%= image_tag(@lecturer.picture.thumb.url) unless @lecturer.picture.nil? %>
<%= f.file_field :picture %>
<%= f.hidden_field :picture_cache %>
</p>
<p>
<label>
<%= f.check_box :remove_picture %>
Bild Entfernen
</label>
</p>
</div>
<div class="span3">
<%= f.input :lvas, :as=>:check_boxes%>
</div>
<% end %>
<%= f.actions do %>

View File

@@ -0,0 +1,11 @@
<div class="media">
<a class="pull-left" href="#">
<img class="media-object img" src="<%= lec_lva.picture.thumb.url %>"/>
</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>

View File

@@ -40,7 +40,7 @@
<div class="span3">
<%= f.input :semester, :as=>:check_boxes%>
<%= f.input :lecturers, :as=>:check_boxes%>
</div>
<% end %>
<%= f.actions do %>

View File

@@ -18,17 +18,11 @@
</div>
<div class="row-fluid">
<h2>Beispiele</h2>
<p><h4>Beschreibung</h4>
<%= @lva.desc %>
<%= link_to "Beispiel neu" , new_beispiel_path(:lva_id=>@lva.id) %>
</p>
<h4>Beispiele</h4>
<ul>
<% @lva.beispiele.each do |b|%>
<ul>
<% @lva.beispiele.each do |b|%>
<%= render b%>
<% end %>
<% end %>
</div>
</div>
<div class="span4">
@@ -53,6 +47,13 @@
<% end %>
</ul>
</div>
<div class="lva-sidebar">
<h2> <%= I18n.t "lecturers.lecturers" %> </h2>
<% @lva.lecturers.each do |lec| %>
<%= render :partial=>'lecturers/lec_lva', :object=>lec %>
<% end %>
</div>
</div>
</div>

View File

@@ -1,10 +1,9 @@
<%= semantic_form_for @membership do |f| %>
<%= f.inputs do %>
<%= f.input :fetprofile_id %>
<%= f.input :gremium_id %>
<%= f.input :gremium, :as=>:radio %>
<%= f.input :start %>
<%= f.input :stop %>
<%= f.input :typ %>
<%= f.input :typ ,:as=>:radio, :collection=>{"mitglied"=>1, "ersatzmitglied"=>2} %>
<% end %>
<%= f.actions do %>

View File

@@ -1,3 +1,4 @@
<h2><%= link_to neuigkeit.title,neuigkeit_path(neuigkeit) %></h2>
<%= if !neuigkeit.author.nil?
neuigkeit.author.email

View File

@@ -1,14 +1,30 @@
<ul class="breadcrumb">
<li><%= link_to "Neuigkeiten", rubriken_path %></li>
<li><span class="divider">/</span></li>
<li><%= link_to @neuigkeit.rubrik.name , rubrik_path(@neuigkeit.rubrik) %> </li>
</ul>
<p id="notice"><%= notice %></p>
<%= render @neuigkeit %>
<p>
<b>Datum:</b>
<%= @neuigkeit.datum %>
</p>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<%= render 'rubriken/tabs' %>
<p id="notice"><%= notice %></p>
</div>
</div>
<div class="row-fluid">
<div class="span9">
<%= @neuigkeit.rubrik.name %>
</div>
<div class="span3"><p>
<%= @neuigkeit.try(:author).email.to_s %> am
<%= I18n.l @neuigkeit.datum.to_date %></p>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div class="media">
<div class="pull-right" href="#">
<p><br><%= "FOTO" %></p>
</div>
<div class="media-body">
<h1><%= link_to @neuigkeit.title,neuigkeit_path(@neuigkeit) %></h1>
<%= raw(@neuigkeit.text) %>
</div>
</div>
</div>
<%= toolbar_html (@toolbar_elements) %>

View File

@@ -1,6 +1,6 @@
<ul class="nav nav-tabs">
<li <%= (request.fullpath == rubriken_path)? 'class="active"'.html_safe : ''%> >
<%= link_to I18n.t ('rubriken.alle') , calendars_url %> </li>
<li <%= 'class="active"'.html_safe if (request.fullpath == rubriken_path)%> >
<%= link_to I18n.t('rubriken.alle') , rubriken_path %> </li>
<% for r in Rubrik.all %>
<li <%= (!@rubrik.nil? && r == @rubrik) ? 'class="active"'.html_safe : '' %> title="<%= r.name %>">
<%= link_to r.name, r %>

View File

@@ -1,16 +1,11 @@
<%= render 'tabs' %>
<h1><%= I18n.t("rubrik.title")%></h1>
<% @rubriken.each do |rubrik| %>
<%=
html="<b>".html_safe + rubrik.name + "</b> <br>".html_safe + rubrik.desc + "<br>".html_safe
link_to( html , rubrik )%>
<% rubrik.neuigkeiten.recent.each do |n| %>
<li><%= link_to n.title+"("+rubrik.name+")" , n %> </li>
<% end %>
<%= link_to 'Weitere Artikel zu '+rubrik.name.to_s , rubrik %>
<% end %>

View File

@@ -4,12 +4,15 @@
<h1><%= I18n.t("studien.list") %></h1>
<% @studien.sort_by{|z| z[:zahl]}.each do |studium| %>
<div class="span5">
<% @studien.each_slice(2) do |row| %>
<div class="row-fluid">
<% row.each do |studium|%>
<div class="span6">
<%= render studium%>
</div>
<% end %>
</div>
<%end%>
<br>

View File

@@ -14,8 +14,9 @@
<div class="studien-semester">
<div class="container-fluid">
<div class="row-fluid">
<div class="span8">
<h2><%= sem.name %></h2>
<h2><%= sem.name %></h2>
</div>
<div class="span4"><div class="pull-right"><%= link_to 'Lvas hinzufügen/entfernen', edit_semester_path(sem), :class=>"btn-small"%></div>
</div></div>

View File

@@ -5,12 +5,18 @@
<h1><%= I18n.t("studien.verwaltung.title") %></h1>
<%= I18n.t("studien.verwaltung.explanation").html_safe %>
<h2>Studien </h2>
<h2><%= I18n.t "studien.studien"%> </h2>
<div class="verwalten-block">
|
<% @studien.each do |s| %>
<%= (s.valid?) ? '<i class="icon-ok"> </i>'.html_safe : '<i class="icon-remove"></i>'.html_safe %> <%= link_to s.name, s %> | <%=link_to '<i class="icon-pencil"></i>'.html_safe+ 'edit', edit_studium_path(s)%> ||<% end %>
<div class="row-fluid">
<% @studien.each_slice([(Studium.count/2.0).ceil, 1].max) do |col| %>
<div class="span6">
<% col.each do |s| %>
<%= (s.valid?) ? '<i class="icon-ok"> </i>'.html_safe : '<i class="icon-remove"></i>'.html_safe %> <%= link_to s.name, s %> | <%=link_to '<i class="icon-pencil"></i>'.html_safe+ 'edit', edit_studium_path(s)%> <br>
<% end %>
</div>
<% end %>
</div>
<div class="btn-toolbar">
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
@@ -21,14 +27,42 @@
<li> <%= link_to 'Alle Studien', studien_verwalten_path(:std_verw=>nil) %></li>
<% for s in @studien %>
<li> <%= link_to s.name, studien_verwalten_path(:std_verw=>s)%> </li>
<% end %>
</ul>
</div>
<%= link_to 'Neues Studium', new_studium_path, :class=>'btn'%>
</div>
</div>
<h2>Vortragende </h2>
<div class="verwalten-block">
<div class="row-fluid">
<% @lecturers.each_slice([(Lecturer.count/3.0).ceil, 1].max) do |col| %>
<div class="span4">
<% col.each do |lec| %>
<%= (lec.valid?) ? '<i class="icon-ok"> </i>'.html_safe : '<i class="icon-remove"></i>'.html_safe %> <%= link_to lec.name, lec %> | <%=link_to '<i class="icon-pencil"></i>'.html_safe+ 'edit', edit_lecturer_path(lec)%> <br>
<% end %>
</div>
<% end %>
</div>
<div class="btn-toolbar">
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<%= params[:lec_verw].nil? ? I18n.t("filter.lecturer") : Lecturer.find(params[:lec_verw]).name %>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li> <%= link_to 'Alle Vortragenden', studien_verwalten_path(:lec_verw=>nil) %></li>
<% for lec in @lecturers %>
<li> <%= link_to lec.name, studien_verwalten_path(:lec_verw=>lec)%> </li>
<% end %>
</ul>
</div>
<%= link_to "Neuer Vortragender", new_lecturer_path, :class=>"btn"%>
</div>
</div>
<div class="row-fluid">
@@ -36,7 +70,7 @@
<h2>Modulgruppen </h2>
<div class="verwalten-block">
<% @modulgruppen.each do |mg| %>
<%= (mg.valid?) ? '<i class="icon-ok"> </i>'.html_safe : '<i class="icon-remove"></i>'.html_safe %> <%= link_to mg.name, mg %> | <%=link_to '<i class="icon-pencil"></i>'.html_safe+ 'edit', edit_modulgruppe_path(mg)%><br>
<%= (mg.valid?) ? '<i class="icon-ok"> </i>'.html_safe : '<i class="icon-remove"></i>'.html_safe %> <%= link_to mg.name, mg %> | <%=link_to '<i class="icon-pencil"></i>'.html_safe+ 'edit', edit_modulgruppe_path(mg)%><br>
<% end %>
<div class="btn-toolbar">
<div class="btn-group">
@@ -94,7 +128,7 @@
<% @lvas.each do |lva| %>
<%= (lva.valid?) ? '<i class="icon-ok"> </i>'.html_safe : '<i class="icon-remove"></i>'.html_safe %><%= link_to lva.name, lva %> |
<%=link_to '<i class="icon-pencil"></i>'.html_safe+ 'edit', edit_lva_path(lva)%><br>
<%=link_to '<i class="icon-pencil"></i>'.html_safe+ 'edit', edit_lva_path(lva)%><br>
<% end %>
<div class="btn-toolbar">
@@ -123,7 +157,7 @@
</div>
</div>
<div class="span3">
<%= link_to I18n.t("filter.reset"), studien_verwalten_path(:std_verw=>nil, :mg_verw=>nil, :m_verw=>nil, :lva_verw=>nil, :b_verw=>nil), :class=>"btn" %>
<%= link_to I18n.t("filter.reset"), studien_verwalten_path(:std_verw=>nil, :mg_verw=>nil, :m_verw=>nil, :lva_verw=>nil, :b_verw=>nil), :class=>"btn" %>
<h2>Error Log</h2>
<ul>
<li><font color="red"><b>Red</b></font>: Error, Solve immediately</li>
@@ -132,7 +166,7 @@
</ul>
<div class="verwalten-block">
<ul>
<% @messages.flatten.each do |m| %>
<% @messages.flatten.compact.each do |m| %>
<% if !m.strip.empty? %>
<li><%= m.html_safe %></li>
<% end %>
@@ -145,7 +179,7 @@
<% @beispiele.each do |b| %>
<%= (b.valid?) ? '<i class="icon-ok"> </i>'.html_safe : '<i class="icon-remove"></i>'.html_safe %> <%= link_to b.name, b %> | <%=link_to '<i class="icon-pencil"></i>'.html_safe+ 'edit', edit_beispiel_path(b)%>
<%= (b.valid?) ? '<i class="icon-ok"> </i>'.html_safe : '<i class="icon-remove"></i>'.html_safe %> <%= link_to b.name, b %> | <%=link_to '<i class="icon-pencil"></i>'.html_safe+ 'edit', edit_beispiel_path(b)%>
<% end %>
<div class="btn-toolbar">
<div class="btn-group">

View File

@@ -7,7 +7,7 @@ Devise.setup do |config|
config.mailer_sender = "test@example.com"
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
config.mailer = "Devise::Mailer"
config.mailer.default_url_options = { :host => 'glonass.htu.tuwien.ac.at' }
config.mailer.delivery_method = :sendmail
# config.mailer.smtp_settings = {

View File

@@ -1,44 +1,12 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
de:
ohnezuordnung: "Ohne Zuordnung"
hello: "Hallo Welt"
common:
edit: "Bearbeiten"
actions: "Aktionen"
delete: "Löschen"
studien:
list: "Studien der Fakultät Elektrotechnik"
anzeigen: "Studium anzeigen"
new: "Neues Studium"
allestudien: "Alle Studien"
loeschen: "Dieses Studium löschen"
edit: "Studium bearbeiten"
verwaltung:
title: "Studien verwalten"
explanation: "<ul>
<li>Klick auf den Namen eines Objektes führt zu dessen Ansicht, ein Klick auf edit direkt zum Bearbeitungsformular</li>
<li>Per Dropdown-Menü kann nach einzelnen Objekten gefiltert werden. Die Filter können kombiniert werden, wobei nur erlaubte Kombinationen möglich sind. <b>Solange validation-Fehler (im Log rot und fett) auftreten, keine Filter verwenden</b></li>
</ul>"
modul:
edit: "Modul bearbeiten"
list: "Alle Module"
add: "Neues Modul"
keine:
beschreibung: "Keine Beschreibung vorhanden"
lva:
add: "Lva hinzufügen"
list: "Alle Lvas"
semester:
ohne: "Ohne Semesterzuordnung"
modulgruppe:
typ: "Typ"
addmodul: "Neues Modul hinzufügen"
studium: "Studium"
new: "Neue Modulgruppe"
list: "Alle Modulgruppen auflisten"
show:
title: "Auflistung aller Modulgruppen"
link: "Modulgruppen auflisten"
home:
mtitle: "Menu"
@@ -48,7 +16,8 @@ de:
studien: "Studien"
news: "Neuigkeiten"
info: "Information"
mitarbeiter: "Mitarbeiter"
fotos: "Fotos"
formtastic:
titles:
modul:
@@ -110,16 +79,6 @@ de:
attributes:
modulgruppen:
blank: "Wählen Sie zumindest eine Modulgruppe aus"
filter:
studium: "Studium"
modulgruppe: "Modulgruppe"
modul: "Modul"
lva: "Lva"
beispiel: "Beispiel"
reset: "Alle Filter zurücksetzen"
verwalten:
fehler:
keine: "Keine Fehlermeldungen oder Warnungen"
support:
array:
two_words_connector: ', '

View File

@@ -0,0 +1,47 @@
de:
studien:
studien: "Studien"
list: "Studien der Fakultät Elektrotechnik"
anzeigen: "Studium anzeigen"
new: "Neues Studium"
allestudien: "Alle Studien"
loeschen: "Dieses Studium löschen"
edit: "Studium bearbeiten"
verwaltung:
title: "Studien verwalten"
explanation: "<ul>
<li>Klick auf den Namen eines Objektes führt zu dessen Ansicht, ein Klick auf edit direkt zum Bearbeitungsformular</li>
<li>Per Dropdown-Menü kann nach einzelnen Objekten gefiltert werden. Die Filter können kombiniert werden, wobei nur erlaubte Kombinationen möglich sind. <b>Solange validation-Fehler (im Log rot und fett) auftreten, keine Filter verwenden</b></li>
</ul>"
modul:
edit: "Modul bearbeiten"
list: "Alle Module"
add: "Neues Modul"
keine:
beschreibung: "Keine Beschreibung vorhanden"
lva:
add: "Lva hinzufügen"
list: "Alle Lvas"
semester:
ohne: "Ohne Semesterzuordnung"
modulgruppe:
typ: "Typ"
addmodul: "Neues Modul hinzufügen"
studium: "Studium"
new: "Neue Modulgruppe"
list: "Alle Modulgruppen auflisten"
show:
title: "Auflistung aller Modulgruppen"
link: "Modulgruppen auflisten"
filter:
studium: "Studium"
modulgruppe: "Modulgruppe"
modul: "Modul"
lva: "Lva"
beispiel: "Beispiel"
reset: "Alle Filter zurücksetzen"
verwalten:
fehler:
keine: "Keine Fehlermeldungen oder Warnungen"
lecturers:
lecturers: "Vortragende"

View File

@@ -36,11 +36,14 @@
get 'verwalten/studien', :controller=>:studien, :action=>:verwalten, :as=>'studien_verwalten'
resources :fetzneditions
resources :galleries do
resources :fotos
resources :galleries
resources :memberships
end
resources :memberships, :except=>[:new, :show, :edit]
resources :gremien
resources :fetprofiles
resources :fetprofiles do
resources :memberships, :only=>[:new, :show, :edit]
end
resources :lecturers
resources :semesters
resources :moduls
@@ -59,6 +62,9 @@
resources :home, :only=>[:index]
get 'home/dev', :controller=>:home, :action=>:dev, :as=>'home_dev'
get 'home/startdev', :controller=>:home, :action=>:startdev, :as=>'home_startdev'
get 'home/linksnotimplemented', :controller=>:home, :action=>:linksnotimplemented, :as=>'home_linksnotimplemented'
resources :beispiele
resources :attachment
resources :themen

View File

@@ -0,0 +1,7 @@
class RemoveNameFromSemesters < ActiveRecord::Migration
def change
remove_column :semesters, :name
end
end

View File

@@ -0,0 +1,5 @@
class AddLinkToLecturers < ActiveRecord::Migration
def change
add_column :lecturers, :link, :string
end
end