diff --git a/.geanyprojekt b/.geanyprojekt index abc039c..cd9ac3d 100644 --- a/.geanyprojekt +++ b/.geanyprojekt @@ -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 diff --git a/.gitignore b/.gitignore index a978807..d88beef 100755 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ # Ignore bundler config /.bundle - +*.*~ # Ignore the default SQLite database. /db/*.sqlite3 /db/schema.rb diff --git a/Gemfile b/Gemfile index 98dc781..7f63ecb 100755 --- a/Gemfile +++ b/Gemfile @@ -78,3 +78,6 @@ end gem "simple_calendar", "~> 0.1.9" gem 'rmagick' + +gem 'bootstrap-addons-rails' +gem "jquery-fileupload-rails" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index ff6d52b..797788d 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 68c0b94..97ab022 100755 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -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 diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index bd9a219..194f5be 100755 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -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 diff --git a/app/assets/stylesheets/lvas.css.scss b/app/assets/stylesheets/lvas.css.scss index d9b9a12..3e95e92 100755 --- a/app/assets/stylesheets/lvas.css.scss +++ b/app/assets/stylesheets/lvas.css.scss @@ -4,7 +4,7 @@ div.lva-semester { border: solid; -border-width: 1px; +border-width: 0px; margin: 1px; padding: 5px; border-color: green; diff --git a/app/controllers/fotos_controller.rb b/app/controllers/fotos_controller.rb index 591bf1f..af920da 100644 --- a/app/controllers/fotos_controller.rb +++ b/app/controllers/fotos_controller.rb @@ -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 diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb index 8ebf183..b51e1f8 100644 --- a/app/controllers/galleries_controller.rb +++ b/app/controllers/galleries_controller.rb @@ -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.' } diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 150a2c3..8c5379b 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -7,4 +7,7 @@ class HomeController < ApplicationController def startdev render 'setup_fetsite_dev' end + def linksnotimplemented + render 'links_notimplemented' + end end diff --git a/app/controllers/lvas_controller.rb b/app/controllers/lvas_controller.rb index d2ee71f..7a2667c 100755 --- a/app/controllers/lvas_controller.rb +++ b/app/controllers/lvas_controller.rb @@ -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 diff --git a/app/controllers/memberships_controller.rb b/app/controllers/memberships_controller.rb index fa9c90c..ae0383f 100644 --- a/app/controllers/memberships_controller.rb +++ b/app/controllers/memberships_controller.rb @@ -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 diff --git a/app/controllers/studien_controller.rb b/app/controllers/studien_controller.rb index f5b9d63..f94a440 100755 --- a/app/controllers/studien_controller.rb +++ b/app/controllers/studien_controller.rb @@ -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 diff --git a/app/models/ability.rb b/app/models/ability.rb index 293df62..dd9aefd 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -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 diff --git a/app/models/attachment.rb b/app/models/attachment.rb index fe3d597..f375f87 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -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 diff --git a/app/models/beispiel.rb b/app/models/beispiel.rb index 2ad10de..d779617 100755 --- a/app/models/beispiel.rb +++ b/app/models/beispiel.rb @@ -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 diff --git a/app/models/calendar.rb b/app/models/calendar.rb index 5f317b1..92e6c15 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -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 diff --git a/app/models/calentry.rb b/app/models/calentry.rb index d4c64bc..9dbc178 100644 --- a/app/models/calentry.rb +++ b/app/models/calentry.rb @@ -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 diff --git a/app/models/fetprofile.rb b/app/models/fetprofile.rb index 34ae476..fba5c01 100644 --- a/app/models/fetprofile.rb +++ b/app/models/fetprofile.rb @@ -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 diff --git a/app/models/fetznedition.rb b/app/models/fetznedition.rb index ff3046d..54fda42 100644 --- a/app/models/fetznedition.rb +++ b/app/models/fetznedition.rb @@ -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 diff --git a/app/models/foto.rb b/app/models/foto.rb index 08a5d59..cbe9761 100644 --- a/app/models/foto.rb +++ b/app/models/foto.rb @@ -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 diff --git a/app/models/frage.rb b/app/models/frage.rb index 0508fc2..beed787 100644 --- a/app/models/frage.rb +++ b/app/models/frage.rb @@ -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 diff --git a/app/models/gallery.rb b/app/models/gallery.rb index 746a1d1..ac5e8c9 100644 --- a/app/models/gallery.rb +++ b/app/models/gallery.rb @@ -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 diff --git a/app/models/gremium.rb b/app/models/gremium.rb index 3c0bfae..2b0d20b 100644 --- a/app/models/gremium.rb +++ b/app/models/gremium.rb @@ -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 diff --git a/app/models/lecturer.rb b/app/models/lecturer.rb index 773e2de..f860542 100644 --- a/app/models/lecturer.rb +++ b/app/models/lecturer.rb @@ -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 diff --git a/app/models/lva.rb b/app/models/lva.rb index 68cb831..a649467 100755 --- a/app/models/lva.rb +++ b/app/models/lva.rb @@ -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 diff --git a/app/models/membership.rb b/app/models/membership.rb index 701d603..ad17ee4 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -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 diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index e2b655e..45bd7f8 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -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 diff --git a/app/models/semester.rb b/app/models/semester.rb index 913a370..2adb3aa 100755 --- a/app/models/semester.rb +++ b/app/models/semester.rb @@ -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 diff --git a/app/models/studium.rb b/app/models/studium.rb index be8f3be..af783be 100755 --- a/app/models/studium.rb +++ b/app/models/studium.rb @@ -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 diff --git a/app/models/thema.rb b/app/models/thema.rb index 64bdea9..5d5797b 100644 --- a/app/models/thema.rb +++ b/app/models/thema.rb @@ -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 diff --git a/app/models/themengruppe.rb b/app/models/themengruppe.rb index 0966914..7cee6f8 100644 --- a/app/models/themengruppe.rb +++ b/app/models/themengruppe.rb @@ -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 diff --git a/app/uploaders/foto_uploader.rb b/app/uploaders/foto_uploader.rb new file mode 100644 index 0000000..a47f073 --- /dev/null +++ b/app/uploaders/foto_uploader.rb @@ -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 diff --git a/app/uploaders/picture_uploader.rb b/app/uploaders/picture_uploader.rb index ec0f27a..58d233a 100644 --- a/app/uploaders/picture_uploader.rb +++ b/app/uploaders/picture_uploader.rb @@ -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 diff --git a/app/views/calendars/index.html.erb b/app/views/calendars/index.html.erb index ad394cb..fd90c6c 100644 --- a/app/views/calendars/index.html.erb +++ b/app/views/calendars/index.html.erb @@ -1,28 +1,28 @@
-
-
-<%= render 'tabs' %> -
-
+
+
+ <%= render 'tabs' %> +
+
-
-
-

<%= I18n.t 'calendars.calendar' %>

-<% @calendars.each do |calendar| %> -
+
+
+

<%= I18n.t 'calendars.calendar' %>

+ <% @calendars.each do |calendar| %> +
- +
-

<%= link_to calendar.name, calendar %>

+

<%= link_to calendar.name, calendar %>

+
+ <% end %>
-<% end %> -
-
-
-
-<%= link_to 'New Calendar', new_calendar_path unless cannot?(:new, Calendar) %> -
-
+
+
+
+ <%= link_to 'New Calendar', new_calendar_path unless cannot?(:new, Calendar) %> +
+
diff --git a/app/views/fetprofiles/_form.html.erb b/app/views/fetprofiles/_form.html.erb index 016e4cf..dcd19db 100644 --- a/app/views/fetprofiles/_form.html.erb +++ b/app/views/fetprofiles/_form.html.erb @@ -1,15 +1,40 @@ +
+ <%= 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 %> +
+
+ <%= f.input :vorname %>
+
<%= f.input :nachname %>
+
<%= f.input :short %> +
+
+
+ <%= f.input :desc %>
+
+
+
<%= f.input :active %>
+
<%= f.input :picture, :as=>:file %>
+
<%= f.input :fetmailalias %>
+
+ <% @fetprofile.memberships.each do |m| %> + <%= semantic_fields_for m do |mf| %> +
+
+ <%= mf.inputs do %> +
<%= mf.input :start, :as=>:date %>
+
<%= mf.input :stop %>
+
<%= mf. input :gremium %>
+
<%= mf.input :typ ,:as=>:radio, :collection=>{"mitglied"=>1, "ersatzmitglied"=>2} %>
<% end %> - +
+ <% end %> +<% end +end %> +
+
<%= f.actions do %> <%= f.action :submit, :as => :input %> <% end %> <% end %> +
diff --git a/app/views/fetprofiles/index.html.erb b/app/views/fetprofiles/index.html.erb index 133fc40..b005167 100644 --- a/app/views/fetprofiles/index.html.erb +++ b/app/views/fetprofiles/index.html.erb @@ -1,35 +1,25 @@ +
+
+

Listing fetprofiles

- - - - - - - - - - - - - - + + <% @fetprofiles.each do |fetprofile| %> - - - - - - - - - - - - +
+
+ <%= image_tag fetprofile.picture.portrait.url %> +
+
+ +

<%= link_to fetprofile.name, fetprofile %>

+

<%= fetprofile.fetmailalias %>

+

<%= fetprofile.desc %>

+

<%= fetprofile.active %>

+
+
<% end %> -
VornameNachnameShortFetmailaliasDescPictureActive
<%= fetprofile.vorname %><%= fetprofile.nachname %><%= fetprofile.short %><%= fetprofile.fetmailalias %><%= fetprofile.desc %><%= fetprofile.picture %><%= fetprofile.active %><%= link_to 'Show', fetprofile %><%= link_to 'Edit', edit_fetprofile_path(fetprofile) %><%= link_to 'Destroy', fetprofile, method: :delete, data: { confirm: 'Are you sure?' } %>
- -
- +
+
<%= link_to 'New Fetprofile', new_fetprofile_path %> +
diff --git a/app/views/fetprofiles/show.html.erb b/app/views/fetprofiles/show.html.erb index c11f77e..b4e17fc 100644 --- a/app/views/fetprofiles/show.html.erb +++ b/app/views/fetprofiles/show.html.erb @@ -1,40 +1,39 @@

<%= notice %>

+
+
+
+ <%= image_tag @fetprofile.picture.portrait.url %> +
+
+

<%= @fetprofile.name %>

- Vorname: - <%= @fetprofile.vorname %> -

- -

- Nachname: - <%= @fetprofile.nachname %> -

- -

- Short: - <%= @fetprofile.short %> -

- -

- Fetmailalias: <%= @fetprofile.fetmailalias %>

-

- Desc: <%= @fetprofile.desc %>

-

- Picture: - <%= @fetprofile.picture %> + <%= "Aktiv".html_safe if @fetprofile.active %>

+

<%= link_to 'Destroy', @fetprofile, method: :delete, data: { confirm: 'Are you sure?' } %>

+
+
-

- Active: - <%= @fetprofile.active %> -

+
+
+
    + <% @fetprofile.memberships.each do |m| %> +
  • <%= 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) %> +
  • + <% end %> +
+<%= link_to 'Neue Mitgliedschaft', new_fetprofile_membership_path(@fetprofile) %> | + <%= link_to 'Edit', edit_fetprofile_path(@fetprofile) %> | <%= link_to 'Back', fetprofiles_path %> +
+
diff --git a/app/views/fotos/_form_bulk.html.erb b/app/views/fotos/_form_bulk.html.erb new file mode 100644 index 0000000..a0f6332 --- /dev/null +++ b/app/views/fotos/_form_bulk.html.erb @@ -0,0 +1,140 @@ +
+

Upload file

+ <%= semantic_form_for [@gallery, @foto], :remote=>true, :html => { :multipart => true, :id => "fileupload" } do |f| %> + +
+
+ + + + Add files... + <%= f.file_field :datei, :multiple=>true%> + <%= f.input :gallery %> + + + + + +
+
+ +
+
+
+
+
+ +
+
+ + +
+ <% end %> + +
+ + + + + + + + diff --git a/app/views/fotos/new.html.erb b/app/views/fotos/new.html.erb index a76f8c8..c8ad2fd 100644 --- a/app/views/fotos/new.html.erb +++ b/app/views/fotos/new.html.erb @@ -1,5 +1,5 @@

New foto

-<%= render 'form' %> +<%= render 'form_bulk' %> -<%= link_to 'Back', fotos_path %> +<%= link_to 'Back', gallery_path(params[:gallery_id]) %> diff --git a/app/views/fotos/show.html.erb b/app/views/fotos/show.html.erb index 2a4c611..9183e5e 100644 --- a/app/views/fotos/show.html.erb +++ b/app/views/fotos/show.html.erb @@ -1,25 +1,31 @@ -

<%= notice %>

-

- Title: - <%= @foto.title %> -

+
-

- Desc: - <%= @foto.desc %> -

+ +
+
+ <%= 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) ) %> +
+
-

- Gallery: - <%= @foto.gallery_id %> -

+
+
+

<%= @foto.title %>

+

<%= @foto.desc %>

+
+
+

+ <%= 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) %> +

+
+
+
+
+

<%= notice %>

+
+
+
-

- Datei: - <%= @foto.datei %> -

- - -<%= link_to 'Edit', edit_foto_path(@foto) %> | -<%= link_to 'Back', fotos_path %> diff --git a/app/views/galleries/show.html.erb b/app/views/galleries/show.html.erb index 2fa130b..052f027 100644 --- a/app/views/galleries/show.html.erb +++ b/app/views/galleries/show.html.erb @@ -1,3 +1,4 @@ +

<%= notice %>

@@ -14,7 +15,35 @@ Datum: <%= @gallery.datum %>

+ + + + + +<%= link_to 'NewFoto' , new_gallery_foto_path(@gallery) %> | <%= link_to 'Edit', edit_gallery_path(@gallery) %> | <%= link_to 'Back', galleries_path %> + + + + diff --git a/app/views/home/dev.html.erb b/app/views/home/dev.html.erb index 1e9d341..1eef047 100755 --- a/app/views/home/dev.html.erb +++ b/app/views/home/dev.html.erb @@ -1,4 +1,5 @@

Entwicklungsprojekt

+<%= link_to "notimplemented", home_linksnotimplemented_path %>

Feature List: 2013-07-17

  • Info zu Studien/Studienpläne
  • diff --git a/app/views/home/links_notimplemented.html.erb b/app/views/home/links_notimplemented.html.erb new file mode 100644 index 0000000..72a8f21 --- /dev/null +++ b/app/views/home/links_notimplemented.html.erb @@ -0,0 +1,8 @@ +Vorhandene Resourcen +
      +
    • <%= link_to "galleries", galleries_path %>
    • +
    • <%= link_to "fotos", fotos_path %>
    • +
    • <%= link_to "gremien", gremien_path %>
    • +
    • <%= link_to "fetprofiles", fetprofiles_path %>
    • +
    • <%= link_to "memberships", memberships_path %>
    • +
    diff --git a/app/views/home/setup_fetsite_dev.html.erb b/app/views/home/setup_fetsite_dev.html.erb index a4f6161..2d7dc0e 100644 --- a/app/views/home/setup_fetsite_dev.html.erb +++ b/app/views/home/setup_fetsite_dev.html.erb @@ -3,7 +3,8 @@

    Git installieren und Repository koperen

    Falls noch nicht installiert, GIT installieren
    sudo apt-get install git git-cola
    -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.
    git clone https://github.com//fetsite

    Ruby on Rails installieren

    Ruby 1.9 installieren wobei wichtig ist, dass die Version 1.9 ist @@ -12,6 +13,7 @@ Falls mehrere Ruby Versionen installiert ist mit
     sudo update-alternatives --config ruby
    überprüfen, dass Ruby 1.9 verwendet wird.
    sudo apt-get install rubygems1.9
    +Im angelegten Verzeichnis den bundle installer ausführen.
    sudo gem install bundler
    ImageMagick,sqlite3 installieren
    sudo apt-get install libmagickwand-dev libsqlite3-dev nodejs
    diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 81c8440..774d3c9 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,9 +5,14 @@ Fetsite <%= stylesheet_link_tag "application", :media => "all" %> - + + + + + <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> +
    diff --git a/app/views/layouts/menu.html.erb b/app/views/layouts/menu.html.erb index 738252e..7b93ae5 100755 --- a/app/views/layouts/menu.html.erb +++ b/app/views/layouts/menu.html.erb @@ -13,6 +13,8 @@
  • <%= link_to I18n.t(:news,:scope=>'home' ),rubriken_path %>
  • <%= link_to I18n.t(:info,:scope=>'home' ),themengruppen_path %>
  • +
  • <%= link_to I18n.t('mitarbeiter',:scope=>'home' ),fetprofiles_path %>
  • +
  • <%= link_to I18n.t('fotos',:scope=>'home' ),galleries_path %>
  • <%= link_to I18n.t(:studien,:scope=>'home' ), studien_path %>
  • <%= link_to "Kalender", calendars_path %>
  • diff --git a/app/views/lecturers/_form.html.erb b/app/views/lecturers/_form.html.erb index baf4f49..5dbf669 100644 --- a/app/views/lecturers/_form.html.erb +++ b/app/views/lecturers/_form.html.erb @@ -1,10 +1,28 @@ <%= semantic_form_for @lecturer do |f| %> <%= f.inputs do %> +
    +
    <%= f.input :name %> <%= f.input :email %> - <%= f.input :oid %> - <%= f.input :picture %> - <%= f.input :lvas %> + <%= f.input :link %> +
    +
    +

    + + <%= image_tag(@lecturer.picture.thumb.url) unless @lecturer.picture.nil? %> + <%= f.file_field :picture %> + <%= f.hidden_field :picture_cache %> +

    +

    + +

    +
    +
    + <%= f.input :lvas, :as=>:check_boxes%> +
    <% end %> <%= f.actions do %> diff --git a/app/views/lecturers/_lec_lva.html.erb b/app/views/lecturers/_lec_lva.html.erb new file mode 100644 index 0000000..21a9536 --- /dev/null +++ b/app/views/lecturers/_lec_lva.html.erb @@ -0,0 +1,11 @@ +
    + + + +
    +

    <%= link_to lec_lva.name, lec_lva %>

    + Email: <%= mail_to lec_lva.email %>
    + TISS: <%= link_to lec_lva.name, lec_lva.link %> +
    +
    + diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index ec38a70..4fe897b 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -40,7 +40,7 @@
    <%= f.input :semester, :as=>:check_boxes%> - + <%= f.input :lecturers, :as=>:check_boxes%>
    <% end %> <%= f.actions do %> diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index a294a2e..7aa4d24 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -18,17 +18,11 @@

    Beispiele

    -

    Beschreibung

    - <%= @lva.desc %> - -<%= link_to "Beispiel neu" , new_beispiel_path(:lva_id=>@lva.id) %> -

    -

    Beispiele

    -
      - <% @lva.beispiele.each do |b|%> +
        + <% @lva.beispiele.each do |b|%> <%= render b%> - <% end %> + <% end %>
    @@ -53,6 +47,13 @@ <% end %>
+
+

<%= I18n.t "lecturers.lecturers" %>

+ <% @lva.lecturers.each do |lec| %> + <%= render :partial=>'lecturers/lec_lva', :object=>lec %> + + <% end %> +
diff --git a/app/views/memberships/_form.html.erb b/app/views/memberships/_form.html.erb index 15bbe9a..d964a24 100644 --- a/app/views/memberships/_form.html.erb +++ b/app/views/memberships/_form.html.erb @@ -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 %> diff --git a/app/views/neuigkeiten/_neuigkeit.html.erb b/app/views/neuigkeiten/_neuigkeit.html.erb index c3d647b..a7d812b 100755 --- a/app/views/neuigkeiten/_neuigkeit.html.erb +++ b/app/views/neuigkeiten/_neuigkeit.html.erb @@ -1,3 +1,4 @@ +

<%= link_to neuigkeit.title,neuigkeit_path(neuigkeit) %>

<%= if !neuigkeit.author.nil? neuigkeit.author.email diff --git a/app/views/neuigkeiten/show.html.erb b/app/views/neuigkeiten/show.html.erb index ae59a55..47bb223 100755 --- a/app/views/neuigkeiten/show.html.erb +++ b/app/views/neuigkeiten/show.html.erb @@ -1,14 +1,30 @@ - -

<%= notice %>

- -<%= render @neuigkeit %> -

- Datum: - <%= @neuigkeit.datum %> -

+
+
+
+ <%= render 'rubriken/tabs' %> +

<%= notice %>

+
+
+
+
+ <%= @neuigkeit.rubrik.name %> +
+

+ <%= @neuigkeit.try(:author).email.to_s %> am + <%= I18n.l @neuigkeit.datum.to_date %>

+
+
+
+
+
+
+


<%= "FOTO" %>

+
+
+

<%= link_to @neuigkeit.title,neuigkeit_path(@neuigkeit) %>

+ <%= raw(@neuigkeit.text) %> +
+
+
<%= toolbar_html (@toolbar_elements) %> diff --git a/app/views/rubriken/_tabs.html.erb b/app/views/rubriken/_tabs.html.erb index 04ed2a5..89a2eb3 100644 --- a/app/views/rubriken/_tabs.html.erb +++ b/app/views/rubriken/_tabs.html.erb @@ -1,6 +1,6 @@
<%= link_to 'Neues Studium', new_studium_path, :class=>'btn'%>
- + +

Vortragende

+
+
+ <% @lecturers.each_slice([(Lecturer.count/3.0).ceil, 1].max) do |col| %> +
+ <% col.each do |lec| %> + <%= (lec.valid?) ? ' '.html_safe : ''.html_safe %> <%= link_to lec.name, lec %> | <%=link_to ''.html_safe+ 'edit', edit_lecturer_path(lec)%>
+ <% end %> +
+ <% end %> +
+
+
+ + <%= params[:lec_verw].nil? ? I18n.t("filter.lecturer") : Lecturer.find(params[:lec_verw]).name %> + + + + + +
+ <%= link_to "Neuer Vortragender", new_lecturer_path, :class=>"btn"%> +
@@ -36,7 +70,7 @@

Modulgruppen

<% @modulgruppen.each do |mg| %> - <%= (mg.valid?) ? ' '.html_safe : ''.html_safe %> <%= link_to mg.name, mg %> | <%=link_to ''.html_safe+ 'edit', edit_modulgruppe_path(mg)%>
+ <%= (mg.valid?) ? ' '.html_safe : ''.html_safe %> <%= link_to mg.name, mg %> | <%=link_to ''.html_safe+ 'edit', edit_modulgruppe_path(mg)%>
<% end %>
@@ -94,7 +128,7 @@ <% @lvas.each do |lva| %> <%= (lva.valid?) ? ' '.html_safe : ''.html_safe %><%= link_to lva.name, lva %> | - <%=link_to ''.html_safe+ 'edit', edit_lva_path(lva)%>
+ <%=link_to ''.html_safe+ 'edit', edit_lva_path(lva)%>
<% end %>
@@ -123,7 +157,7 @@
- <%= 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" %>

Error Log

  • Red: Error, Solve immediately
  • @@ -132,7 +166,7 @@
    - <% @messages.flatten.each do |m| %> + <% @messages.flatten.compact.each do |m| %> <% if !m.strip.empty? %>
  • <%= m.html_safe %>
  • <% end %> @@ -145,7 +179,7 @@ <% @beispiele.each do |b| %> -<%= (b.valid?) ? ' '.html_safe : ''.html_safe %> <%= link_to b.name, b %> | <%=link_to ''.html_safe+ 'edit', edit_beispiel_path(b)%> + <%= (b.valid?) ? ' '.html_safe : ''.html_safe %> <%= link_to b.name, b %> | <%=link_to ''.html_safe+ 'edit', edit_beispiel_path(b)%> <% end %>
    diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 765c261..5c4d4b8 100755 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -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 = { diff --git a/config/locales/de.yml b/config/locales/de.yml index 9371d5b..e73fab7 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -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: "
      -
    • Klick auf den Namen eines Objektes führt zu dessen Ansicht, ein Klick auf edit direkt zum Bearbeitungsformular
    • -
    • Per Dropdown-Menü kann nach einzelnen Objekten gefiltert werden. Die Filter können kombiniert werden, wobei nur erlaubte Kombinationen möglich sind. Solange validation-Fehler (im Log rot und fett) auftreten, keine Filter verwenden
    • -
    " - 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: ', ' diff --git a/config/locales/studien.de.yml b/config/locales/studien.de.yml new file mode 100644 index 0000000..538d33f --- /dev/null +++ b/config/locales/studien.de.yml @@ -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: "
      +
    • Klick auf den Namen eines Objektes führt zu dessen Ansicht, ein Klick auf edit direkt zum Bearbeitungsformular
    • +
    • Per Dropdown-Menü kann nach einzelnen Objekten gefiltert werden. Die Filter können kombiniert werden, wobei nur erlaubte Kombinationen möglich sind. Solange validation-Fehler (im Log rot und fett) auftreten, keine Filter verwenden
    • +
    " + 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" \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 1f84141..cef5142 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 diff --git a/db/migrate/20130819143148_remove_name_from_semesters.rb b/db/migrate/20130819143148_remove_name_from_semesters.rb new file mode 100644 index 0000000..4f364e8 --- /dev/null +++ b/db/migrate/20130819143148_remove_name_from_semesters.rb @@ -0,0 +1,7 @@ +class RemoveNameFromSemesters < ActiveRecord::Migration + def change + remove_column :semesters, :name + + + end +end diff --git a/db/migrate/20130821113333_add_link_to_lecturers.rb b/db/migrate/20130821113333_add_link_to_lecturers.rb new file mode 100644 index 0000000..f376657 --- /dev/null +++ b/db/migrate/20130821113333_add_link_to_lecturers.rb @@ -0,0 +1,5 @@ +class AddLinkToLecturers < ActiveRecord::Migration + def change + add_column :lecturers, :link, :string + end +end