From 3d11400d5ef6c81904f68b8fe19c4aefd8311774 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 12 Feb 2013 02:05:12 +0100 Subject: [PATCH] GitHub Account angelegt --- .gitattributes | 22 + .gitignore | 15 + .project | 19 + Gemfile | 55 ++ Gemfile.lock | 150 +++++ README.rdoc | 261 ++++++++ Rakefile | 7 + app/assets/images/edit.png | Bin 0 -> 692 bytes app/assets/images/fet_logo_2.png | Bin 0 -> 5829 bytes app/assets/images/rails.png | Bin 0 -> 6646 bytes app/assets/javascripts/application.js | 17 + app/assets/javascripts/lvas.js.coffee | 3 + app/assets/javascripts/modulgruppen.js.coffee | 3 + app/assets/javascripts/moduls.js.coffee | 3 + app/assets/javascripts/neuigkeiten.js.coffee | 3 + app/assets/javascripts/rubriken.js.coffee | 3 + app/assets/javascripts/semesters.js.coffee | 3 + app/assets/javascripts/studia.js.coffee | 3 + app/assets/javascripts/studmods.js.coffee | 3 + app/assets/stylesheets/application.css.scss | 35 ++ app/assets/stylesheets/layout.css.scss | 0 app/assets/stylesheets/lvas.css.scss | 3 + app/assets/stylesheets/modulgruppen.css.scss | 25 + app/assets/stylesheets/moduls.css.scss | 3 + app/assets/stylesheets/neuigkeiten.css.scss | 3 + app/assets/stylesheets/rubriken.css.scss | 4 + app/assets/stylesheets/scaffolds.css.scss | 60 ++ app/assets/stylesheets/semesters.css.scss | 3 + app/assets/stylesheets/studien.css.scss | 3 + app/controllers/application_controller.rb | 18 + app/controllers/home_controller.rb | 6 + app/controllers/lvas_controller.rb | 84 +++ app/controllers/modulgruppen_controller.rb | 89 +++ app/controllers/moduls_controller.rb | 91 +++ app/controllers/neuigkeiten_controller.rb | 83 +++ app/controllers/rubriken_controller.rb | 93 +++ app/controllers/semesters_controller.rb | 83 +++ app/controllers/studien_controller.rb | 83 +++ app/controllers/users_controller.rb | 6 + app/helpers/application_helper.rb | 10 + app/helpers/lvas_helper.rb | 2 + app/helpers/modulgruppen_helper.rb | 2 + app/helpers/moduls_helper.rb | 2 + app/helpers/neuigkeiten_helper.rb | 2 + app/helpers/rubriken_helper.rb | 2 + app/helpers/semesters_helper.rb | 2 + app/helpers/studien_helper.rb | 2 + app/helpers/studmods_helper.rb | 2 + app/inputs/tinymce_text_input.rb | 5 + app/mailers/.gitkeep | 0 app/mailers/confirmmailer.rb | 3 + app/models/.gitkeep | 0 app/models/ability.rb | 31 + app/models/lva.rb | 7 + app/models/modul.rb | 9 + app/models/modulgruppe.rb | 11 + app/models/neuigkeit.rb | 5 + app/models/role.rb | 6 + app/models/rubrik.rb | 10 + app/models/semester.rb | 4 + app/models/studium.rb | 6 + app/models/user.rb | 13 + app/views/devise/confirmations/new.html.erb | 12 + .../mailer/confirmation_instructions.html.erb | 5 + .../reset_password_instructions.html.erb | 8 + .../mailer/unlock_instructions.html.erb | 7 + app/views/devise/passwords/edit.html.erb | 16 + app/views/devise/passwords/new.html.erb | 12 + app/views/devise/registrations/edit.html.erb | 29 + app/views/devise/registrations/new.html.erb | 18 + app/views/devise/sessions/new.html.erb | 17 + app/views/devise/shared/_links.erb | 25 + app/views/devise/unlocks/new.html.erb | 12 + app/views/home/index.html.erb | 2 + app/views/layouts/application.html.erb | 24 + app/views/layouts/menu.html.erb | 24 + app/views/lvas/_form.html.erb | 18 + app/views/lvas/edit.html.erb | 6 + app/views/lvas/index.html.erb | 31 + app/views/lvas/new.html.erb | 5 + app/views/lvas/show.html.erb | 20 + app/views/modulgruppen/_form.html.erb | 13 + app/views/modulgruppen/_modulgruppe.html.erb | 8 + app/views/modulgruppen/edit.html.erb | 6 + app/views/modulgruppen/index.html.erb | 30 + app/views/modulgruppen/new.html.erb | 5 + app/views/modulgruppen/show.html.erb | 27 + app/views/moduls/_form.html.erb | 14 + app/views/moduls/_kurz.html.erb | 9 + app/views/moduls/_modul.html.erb | 13 + app/views/moduls/edit.html.erb | 8 + app/views/moduls/index.html.erb | 26 + app/views/moduls/new.html.erb | 5 + app/views/moduls/show.html.erb | 11 + app/views/neuigkeiten/_form.html.erb | 11 + app/views/neuigkeiten/edit.html.erb | 6 + app/views/neuigkeiten/index.html.erb | 27 + app/views/neuigkeiten/new.html.erb | 5 + app/views/neuigkeiten/show.html.erb | 20 + app/views/rubriken/_form.html.erb | 11 + app/views/rubriken/edit.html.erb | 6 + app/views/rubriken/index.html.erb | 27 + app/views/rubriken/new.html.erb | 5 + app/views/rubriken/show.html.erb | 25 + app/views/semesters/_form.html.erb | 12 + app/views/semesters/edit.html.erb | 6 + app/views/semesters/index.html.erb | 29 + app/views/semesters/new.html.erb | 5 + app/views/semesters/show.html.erb | 25 + app/views/studien/_form.html.erb | 13 + app/views/studien/edit.html.erb | 6 + app/views/studien/index.html.erb | 31 + app/views/studien/new.html.erb | 5 + app/views/studien/show.html.erb | 38 ++ app/views/users/index.html.erb | 10 + config.ru | 4 + config/application.rb | 62 ++ config/boot.rb | 6 + config/database.yml | 25 + config/environment.rb | 5 + config/environments/development.rb | 37 ++ config/environments/production.rb | 67 ++ config/environments/test.rb | 37 ++ config/initializers/backtrace_silencers.rb | 7 + config/initializers/devise.rb | 250 ++++++++ config/initializers/formtastic.rb | 76 +++ config/initializers/inflections.rb | 26 + config/initializers/mime_types.rb | 5 + config/initializers/rolify.rb | 8 + config/initializers/secret_token.rb | 7 + config/initializers/session_store.rb | 8 + config/initializers/wrap_parameters.rb | 14 + config/locales/de.yml | 34 + config/locales/devise.de.yml | 60 ++ config/locales/devise.en.yml | 60 ++ config/locales/en.yml | 12 + config/routes.rb | 93 +++ config/tinymce.yml | 10 + db/development | 0 db/migrate/20130112104517_create_lvas.rb | 15 + db/migrate/20130112105754_create_moduls.rb | 11 + db/migrate/20130112110800_create_semesters.rb | 12 + db/migrate/20130112144222_create_studien.rb | 13 + db/migrate/20130113160023_create_versions.rb | 19 + .../20130113184409_devise_create_users.rb | 46 ++ .../20130113184604_rolify_create_roles.rb | 19 + .../20130115110100_translate_studien.rb | 17 + .../20130119152959_create_neuigkeiten.rb | 11 + .../20130121073050_create_modulgruppen.rb | 12 + ...000_create_modulgruppe_modul_join_table.rb | 8 + .../20130124000100_translate_modulgruppen.rb | 15 + db/migrate/20130124000200_translate_moduls.rb | 17 + db/migrate/20130124000300_translate_lvas.rb | 15 + ...30124010100_create_lva_modul_join_table.rb | 8 + db/migrate/20130124223508_create_rubriken.rb | 11 + db/schema.rb | 194 ++++++ db/seeds.rb | 7 + db/sqlite3.exe | Bin 0 -> 488960 bytes doc/README_FOR_APP | 2 + doku/Studien.xml | 1 + fetsite.ppr | 590 ++++++++++++++++++ lib/assets/.gitkeep | 0 lib/tasks/.gitkeep | 0 lib/templates/erb/scaffold/_form.html.erb | 11 + log/.gitkeep | 0 public/404.html | 26 + public/422.html | 26 + public/500.html | 25 + public/favicon.ico | 0 public/robots.txt | 5 + script/rails | 6 + test/fixtures/.gitkeep | 0 test/fixtures/lvas.yml | 15 + test/fixtures/modulgruppen.yml | 13 + test/fixtures/moduls.yml | 9 + test/fixtures/neuigkeiten.yml | 11 + test/fixtures/rubriken.yml | 11 + test/fixtures/semesters.yml | 13 + test/fixtures/studia.yml | 13 + test/fixtures/studmods.yml | 9 + test/fixtures/users.yml | 11 + test/functional/.gitkeep | 0 test/functional/lvas_controller_test.rb | 49 ++ .../modulgruppen_controller_test.rb | 49 ++ test/functional/moduls_controller_test.rb | 49 ++ .../functional/neuigkeiten_controller_test.rb | 49 ++ test/functional/rubriken_controller_test.rb | 49 ++ test/functional/semesters_controller_test.rb | 49 ++ test/functional/studia_controller_test.rb | 49 ++ test/functional/studmods_controller_test.rb | 49 ++ test/integration/.gitkeep | 0 test/performance/browsing_test.rb | 12 + test/test_helper.rb | 13 + test/unit/.gitkeep | 0 test/unit/helpers/lvas_helper_test.rb | 4 + test/unit/helpers/modulgruppen_helper_test.rb | 4 + test/unit/helpers/moduls_helper_test.rb | 4 + test/unit/helpers/neuigkeiten_helper_test.rb | 4 + test/unit/helpers/rubriken_helper_test.rb | 4 + test/unit/helpers/semesters_helper_test.rb | 4 + test/unit/helpers/studia_helper_test.rb | 4 + test/unit/helpers/studmods_helper_test.rb | 4 + test/unit/lva_test.rb | 7 + test/unit/modul_test.rb | 7 + test/unit/modulgruppe_test.rb | 7 + test/unit/neuigkeit_test.rb | 7 + test/unit/rubrik_test.rb | 7 + test/unit/semester_test.rb | 7 + test/unit/studium_test.rb | 7 + test/unit/studmod_test.rb | 7 + test/unit/user_test.rb | 7 + todo.TXT | 55 ++ todo_devise.txt | 34 + vendor/assets/javascripts/.gitkeep | 0 vendor/assets/stylesheets/.gitkeep | 0 vendor/plugins/.gitkeep | 0 216 files changed, 5031 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .project create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 README.rdoc create mode 100644 Rakefile create mode 100644 app/assets/images/edit.png create mode 100644 app/assets/images/fet_logo_2.png create mode 100644 app/assets/images/rails.png create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/javascripts/lvas.js.coffee create mode 100644 app/assets/javascripts/modulgruppen.js.coffee create mode 100644 app/assets/javascripts/moduls.js.coffee create mode 100644 app/assets/javascripts/neuigkeiten.js.coffee create mode 100644 app/assets/javascripts/rubriken.js.coffee create mode 100644 app/assets/javascripts/semesters.js.coffee create mode 100644 app/assets/javascripts/studia.js.coffee create mode 100644 app/assets/javascripts/studmods.js.coffee create mode 100644 app/assets/stylesheets/application.css.scss create mode 100644 app/assets/stylesheets/layout.css.scss create mode 100644 app/assets/stylesheets/lvas.css.scss create mode 100644 app/assets/stylesheets/modulgruppen.css.scss create mode 100644 app/assets/stylesheets/moduls.css.scss create mode 100644 app/assets/stylesheets/neuigkeiten.css.scss create mode 100644 app/assets/stylesheets/rubriken.css.scss create mode 100644 app/assets/stylesheets/scaffolds.css.scss create mode 100644 app/assets/stylesheets/semesters.css.scss create mode 100644 app/assets/stylesheets/studien.css.scss create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/home_controller.rb create mode 100644 app/controllers/lvas_controller.rb create mode 100644 app/controllers/modulgruppen_controller.rb create mode 100644 app/controllers/moduls_controller.rb create mode 100644 app/controllers/neuigkeiten_controller.rb create mode 100644 app/controllers/rubriken_controller.rb create mode 100644 app/controllers/semesters_controller.rb create mode 100644 app/controllers/studien_controller.rb create mode 100644 app/controllers/users_controller.rb create mode 100644 app/helpers/application_helper.rb create mode 100644 app/helpers/lvas_helper.rb create mode 100644 app/helpers/modulgruppen_helper.rb create mode 100644 app/helpers/moduls_helper.rb create mode 100644 app/helpers/neuigkeiten_helper.rb create mode 100644 app/helpers/rubriken_helper.rb create mode 100644 app/helpers/semesters_helper.rb create mode 100644 app/helpers/studien_helper.rb create mode 100644 app/helpers/studmods_helper.rb create mode 100644 app/inputs/tinymce_text_input.rb create mode 100644 app/mailers/.gitkeep create mode 100644 app/mailers/confirmmailer.rb create mode 100644 app/models/.gitkeep create mode 100644 app/models/ability.rb create mode 100644 app/models/lva.rb create mode 100644 app/models/modul.rb create mode 100644 app/models/modulgruppe.rb create mode 100644 app/models/neuigkeit.rb create mode 100644 app/models/role.rb create mode 100644 app/models/rubrik.rb create mode 100644 app/models/semester.rb create mode 100644 app/models/studium.rb create mode 100644 app/models/user.rb create mode 100644 app/views/devise/confirmations/new.html.erb create mode 100644 app/views/devise/mailer/confirmation_instructions.html.erb create mode 100644 app/views/devise/mailer/reset_password_instructions.html.erb create mode 100644 app/views/devise/mailer/unlock_instructions.html.erb create mode 100644 app/views/devise/passwords/edit.html.erb create mode 100644 app/views/devise/passwords/new.html.erb create mode 100644 app/views/devise/registrations/edit.html.erb create mode 100644 app/views/devise/registrations/new.html.erb create mode 100644 app/views/devise/sessions/new.html.erb create mode 100644 app/views/devise/shared/_links.erb create mode 100644 app/views/devise/unlocks/new.html.erb create mode 100644 app/views/home/index.html.erb create mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/layouts/menu.html.erb create mode 100644 app/views/lvas/_form.html.erb create mode 100644 app/views/lvas/edit.html.erb create mode 100644 app/views/lvas/index.html.erb create mode 100644 app/views/lvas/new.html.erb create mode 100644 app/views/lvas/show.html.erb create mode 100644 app/views/modulgruppen/_form.html.erb create mode 100644 app/views/modulgruppen/_modulgruppe.html.erb create mode 100644 app/views/modulgruppen/edit.html.erb create mode 100644 app/views/modulgruppen/index.html.erb create mode 100644 app/views/modulgruppen/new.html.erb create mode 100644 app/views/modulgruppen/show.html.erb create mode 100644 app/views/moduls/_form.html.erb create mode 100644 app/views/moduls/_kurz.html.erb create mode 100644 app/views/moduls/_modul.html.erb create mode 100644 app/views/moduls/edit.html.erb create mode 100644 app/views/moduls/index.html.erb create mode 100644 app/views/moduls/new.html.erb create mode 100644 app/views/moduls/show.html.erb create mode 100644 app/views/neuigkeiten/_form.html.erb create mode 100644 app/views/neuigkeiten/edit.html.erb create mode 100644 app/views/neuigkeiten/index.html.erb create mode 100644 app/views/neuigkeiten/new.html.erb create mode 100644 app/views/neuigkeiten/show.html.erb create mode 100644 app/views/rubriken/_form.html.erb create mode 100644 app/views/rubriken/edit.html.erb create mode 100644 app/views/rubriken/index.html.erb create mode 100644 app/views/rubriken/new.html.erb create mode 100644 app/views/rubriken/show.html.erb create mode 100644 app/views/semesters/_form.html.erb create mode 100644 app/views/semesters/edit.html.erb create mode 100644 app/views/semesters/index.html.erb create mode 100644 app/views/semesters/new.html.erb create mode 100644 app/views/semesters/show.html.erb create mode 100644 app/views/studien/_form.html.erb create mode 100644 app/views/studien/edit.html.erb create mode 100644 app/views/studien/index.html.erb create mode 100644 app/views/studien/new.html.erb create mode 100644 app/views/studien/show.html.erb create mode 100644 app/views/users/index.html.erb create mode 100644 config.ru create mode 100644 config/application.rb create mode 100644 config/boot.rb create mode 100644 config/database.yml create mode 100644 config/environment.rb create mode 100644 config/environments/development.rb create mode 100644 config/environments/production.rb create mode 100644 config/environments/test.rb create mode 100644 config/initializers/backtrace_silencers.rb create mode 100644 config/initializers/devise.rb create mode 100644 config/initializers/formtastic.rb create mode 100644 config/initializers/inflections.rb create mode 100644 config/initializers/mime_types.rb create mode 100644 config/initializers/rolify.rb create mode 100644 config/initializers/secret_token.rb create mode 100644 config/initializers/session_store.rb create mode 100644 config/initializers/wrap_parameters.rb create mode 100644 config/locales/de.yml create mode 100644 config/locales/devise.de.yml create mode 100644 config/locales/devise.en.yml create mode 100644 config/locales/en.yml create mode 100644 config/routes.rb create mode 100644 config/tinymce.yml create mode 100644 db/development create mode 100644 db/migrate/20130112104517_create_lvas.rb create mode 100644 db/migrate/20130112105754_create_moduls.rb create mode 100644 db/migrate/20130112110800_create_semesters.rb create mode 100644 db/migrate/20130112144222_create_studien.rb create mode 100644 db/migrate/20130113160023_create_versions.rb create mode 100644 db/migrate/20130113184409_devise_create_users.rb create mode 100644 db/migrate/20130113184604_rolify_create_roles.rb create mode 100644 db/migrate/20130115110100_translate_studien.rb create mode 100644 db/migrate/20130119152959_create_neuigkeiten.rb create mode 100644 db/migrate/20130121073050_create_modulgruppen.rb create mode 100644 db/migrate/20130123000000_create_modulgruppe_modul_join_table.rb create mode 100644 db/migrate/20130124000100_translate_modulgruppen.rb create mode 100644 db/migrate/20130124000200_translate_moduls.rb create mode 100644 db/migrate/20130124000300_translate_lvas.rb create mode 100644 db/migrate/20130124010100_create_lva_modul_join_table.rb create mode 100644 db/migrate/20130124223508_create_rubriken.rb create mode 100644 db/schema.rb create mode 100644 db/seeds.rb create mode 100644 db/sqlite3.exe create mode 100644 doc/README_FOR_APP create mode 100644 doku/Studien.xml create mode 100644 fetsite.ppr create mode 100644 lib/assets/.gitkeep create mode 100644 lib/tasks/.gitkeep create mode 100644 lib/templates/erb/scaffold/_form.html.erb create mode 100644 log/.gitkeep create mode 100644 public/404.html create mode 100644 public/422.html create mode 100644 public/500.html create mode 100644 public/favicon.ico create mode 100644 public/robots.txt create mode 100644 script/rails create mode 100644 test/fixtures/.gitkeep create mode 100644 test/fixtures/lvas.yml create mode 100644 test/fixtures/modulgruppen.yml create mode 100644 test/fixtures/moduls.yml create mode 100644 test/fixtures/neuigkeiten.yml create mode 100644 test/fixtures/rubriken.yml create mode 100644 test/fixtures/semesters.yml create mode 100644 test/fixtures/studia.yml create mode 100644 test/fixtures/studmods.yml create mode 100644 test/fixtures/users.yml create mode 100644 test/functional/.gitkeep create mode 100644 test/functional/lvas_controller_test.rb create mode 100644 test/functional/modulgruppen_controller_test.rb create mode 100644 test/functional/moduls_controller_test.rb create mode 100644 test/functional/neuigkeiten_controller_test.rb create mode 100644 test/functional/rubriken_controller_test.rb create mode 100644 test/functional/semesters_controller_test.rb create mode 100644 test/functional/studia_controller_test.rb create mode 100644 test/functional/studmods_controller_test.rb create mode 100644 test/integration/.gitkeep create mode 100644 test/performance/browsing_test.rb create mode 100644 test/test_helper.rb create mode 100644 test/unit/.gitkeep create mode 100644 test/unit/helpers/lvas_helper_test.rb create mode 100644 test/unit/helpers/modulgruppen_helper_test.rb create mode 100644 test/unit/helpers/moduls_helper_test.rb create mode 100644 test/unit/helpers/neuigkeiten_helper_test.rb create mode 100644 test/unit/helpers/rubriken_helper_test.rb create mode 100644 test/unit/helpers/semesters_helper_test.rb create mode 100644 test/unit/helpers/studia_helper_test.rb create mode 100644 test/unit/helpers/studmods_helper_test.rb create mode 100644 test/unit/lva_test.rb create mode 100644 test/unit/modul_test.rb create mode 100644 test/unit/modulgruppe_test.rb create mode 100644 test/unit/neuigkeit_test.rb create mode 100644 test/unit/rubrik_test.rb create mode 100644 test/unit/semester_test.rb create mode 100644 test/unit/studium_test.rb create mode 100644 test/unit/studmod_test.rb create mode 100644 test/unit/user_test.rb create mode 100644 todo.TXT create mode 100644 todo_devise.txt create mode 100644 vendor/assets/javascripts/.gitkeep create mode 100644 vendor/assets/stylesheets/.gitkeep create mode 100644 vendor/plugins/.gitkeep diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb3489a --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile ~/.gitignore_global + +# Ignore bundler config +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 + +# Ignore all logfiles and tempfiles. +/log/*.log +/tmp diff --git a/.project b/.project new file mode 100644 index 0000000..8722348 --- /dev/null +++ b/.project @@ -0,0 +1,19 @@ + + + fetsite + + + + + + com.aptana.ide.core.unifiedBuilder + + + + + + com.aptana.projects.webnature + org.radrails.rails.core.railsnature + com.aptana.ruby.core.rubynature + + diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..223acd3 --- /dev/null +++ b/Gemfile @@ -0,0 +1,55 @@ +source 'https://rubygems.org' + +gem 'rails', '3.2.9' + +# Bundle edge Rails instead: +# gem 'rails', :git => 'git://github.com/rails/rails.git' + +gem 'sqlite3' +gem 'execjs' + + +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' +gem 'bootstrap-sass','~> 2.2.0' + # See https://github.com/sstephenson/execjs#readme for more supported runtimes + gem 'therubyracer', :platforms => :ruby + + gem 'uglifier', '>= 1.0.3' +end + + +gem 'jquery-rails' + +# To use ActiveModel has_secure_password +# gem 'bcrypt-ruby', '~> 3.0.0' + +# To use Jbuilder templates for JSON +# gem 'jbuilder' + +# Use unicorn as the app server +# gem 'unicorn' + +# Deploy with Capistrano +# gem 'capistrano' + +# To use debugger +# gem 'debugger' + +# Formbuilder for easier form generation +gem 'formtastic' +gem 'formtastic-bootstrap' +gem "tinymce-rails" + +gem "globalize3" + +gem "paper_trail" + +gem "devise" + +gem "rolify" + +gem "cancan" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..c2c696e --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,150 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (3.2.9) + actionpack (= 3.2.9) + mail (~> 2.4.4) + actionpack (3.2.9) + activemodel (= 3.2.9) + activesupport (= 3.2.9) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.4) + rack (~> 1.4.0) + rack-cache (~> 1.2) + rack-test (~> 0.6.1) + sprockets (~> 2.2.1) + activemodel (3.2.9) + activesupport (= 3.2.9) + builder (~> 3.0.0) + activerecord (3.2.9) + activemodel (= 3.2.9) + activesupport (= 3.2.9) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activeresource (3.2.9) + activemodel (= 3.2.9) + activesupport (= 3.2.9) + activesupport (3.2.9) + i18n (~> 0.6) + multi_json (~> 1.0) + arel (3.0.2) + bcrypt-ruby (3.0.1) + bcrypt-ruby (3.0.1-x86-mingw32) + bootstrap-sass (2.2.2.0) + sass (~> 3.2) + builder (3.0.4) + cancan (1.6.8) + coffee-rails (3.2.2) + coffee-script (>= 2.2.0) + railties (~> 3.2.0) + coffee-script (2.2.0) + coffee-script-source + execjs + coffee-script-source (1.4.0) + devise (2.2.1) + bcrypt-ruby (~> 3.0) + orm_adapter (~> 0.1) + railties (~> 3.1) + warden (~> 1.2.1) + erubis (2.7.0) + execjs (1.4.0) + multi_json (~> 1.0) + formtastic (2.2.1) + actionpack (>= 3.0) + formtastic-bootstrap (2.0.0) + formtastic (~> 2.2) + formtastic-bootstrap + globalize3 (0.3.0) + activemodel (>= 3.0.0) + activerecord (>= 3.0.0) + paper_trail (~> 2) + hike (1.2.1) + i18n (0.6.1) + journey (1.0.4) + jquery-rails (2.1.4) + railties (>= 3.0, < 5.0) + thor (>= 0.14, < 2.0) + mail (2.4.4) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.19) + multi_json (1.5.0) + orm_adapter (0.4.0) + paper_trail (2.7.0) + activerecord (~> 3.0) + railties (~> 3.0) + polyglot (0.3.3) + rack (1.4.3) + rack-cache (1.2) + rack (>= 0.4) + rack-ssl (1.3.2) + rack + rack-test (0.6.2) + rack (>= 1.0) + rails (3.2.9) + actionmailer (= 3.2.9) + actionpack (= 3.2.9) + activerecord (= 3.2.9) + activeresource (= 3.2.9) + activesupport (= 3.2.9) + bundler (~> 1.0) + railties (= 3.2.9) + railties (3.2.9) + actionpack (= 3.2.9) + activesupport (= 3.2.9) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (>= 0.14.6, < 2.0) + rake (10.0.3) + rdoc (3.9.4) + rolify (3.2.0) + sass (3.2.3) + sass-rails (3.2.5) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + sprockets (2.2.2) + hike (~> 1.2) + multi_json (~> 1.0) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.6) + sqlite3 (1.3.6-x86-mingw32) + thor (0.16.0) + tilt (1.3.3) + tinymce-rails (3.5.8) + railties (>= 3.1.1) + treetop (1.4.12) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.35) + uglifier (1.3.0) + execjs (>= 0.3.0) + multi_json (~> 1.0, >= 1.0.2) + warden (1.2.1) + rack (>= 1.0) + +PLATFORMS + x86-mingw32 + +DEPENDENCIES + bootstrap-sass (~> 2.2.0) + cancan + coffee-rails (~> 3.2.1) + devise + execjs + formtastic + formtastic-bootstrap + globalize3 + jquery-rails + paper_trail + rails (= 3.2.9) + rolify + sass-rails (~> 3.2.3) + sqlite3 + therubyracer + tinymce-rails + uglifier (>= 1.0.3) diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..7c36f23 --- /dev/null +++ b/README.rdoc @@ -0,0 +1,261 @@ +== Welcome to Rails + +Rails is a web-application framework that includes everything needed to create +database-backed web applications according to the Model-View-Control pattern. + +This pattern splits the view (also called the presentation) into "dumb" +templates that are primarily responsible for inserting pre-built data in between +HTML tags. The model contains the "smart" domain objects (such as Account, +Product, Person, Post) that holds all the business logic and knows how to +persist themselves to a database. The controller handles the incoming requests +(such as Save New Account, Update Product, Show Post) by manipulating the model +and directing data to the view. + +In Rails, the model is handled by what's called an object-relational mapping +layer entitled Active Record. This layer allows you to present the data from +database rows as objects and embellish these data objects with business logic +methods. You can read more about Active Record in +link:files/vendor/rails/activerecord/README.html. + +The controller and view are handled by the Action Pack, which handles both +layers by its two parts: Action View and Action Controller. These two layers +are bundled in a single package due to their heavy interdependence. This is +unlike the relationship between the Active Record and Action Pack that is much +more separate. Each of these packages can be used independently outside of +Rails. You can read more about Action Pack in +link:files/vendor/rails/actionpack/README.html. + + +== Getting Started + +1. At the command prompt, create a new Rails application: + rails new myapp (where myapp is the application name) + +2. Change directory to myapp and start the web server: + cd myapp; rails server (run with --help for options) + +3. Go to http://localhost:3000/ and you'll see: + "Welcome aboard: You're riding Ruby on Rails!" + +4. Follow the guidelines to start developing your application. You can find +the following resources handy: + +* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html +* Ruby on Rails Tutorial Book: http://www.railstutorial.org/ + + +== Debugging Rails + +Sometimes your application goes wrong. Fortunately there are a lot of tools that +will help you debug it and get it back on the rails. + +First area to check is the application log files. Have "tail -f" commands +running on the server.log and development.log. Rails will automatically display +debugging and runtime information to these files. Debugging info will also be +shown in the browser on requests from 127.0.0.1. + +You can also log your own messages directly into the log file from your code +using the Ruby logger class from inside your controllers. Example: + + class WeblogController < ActionController::Base + def destroy + @weblog = Weblog.find(params[:id]) + @weblog.destroy + logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!") + end + end + +The result will be a message in your log file along the lines of: + + Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1! + +More information on how to use the logger is at http://www.ruby-doc.org/core/ + +Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are +several books available online as well: + +* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe) +* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide) + +These two books will bring you up to speed on the Ruby language and also on +programming in general. + + +== Debugger + +Debugger support is available through the debugger command when you start your +Mongrel or WEBrick server with --debugger. This means that you can break out of +execution at any point in the code, investigate and change the model, and then, +resume execution! You need to install ruby-debug to run the server in debugging +mode. With gems, use sudo gem install ruby-debug. Example: + + class WeblogController < ActionController::Base + def index + @posts = Post.all + debugger + end + end + +So the controller will accept the action, run the first line, then present you +with a IRB prompt in the server window. Here you can do things like: + + >> @posts.inspect + => "[#nil, "body"=>nil, "id"=>"1"}>, + #"Rails", "body"=>"Only ten..", "id"=>"2"}>]" + >> @posts.first.title = "hello from a debugger" + => "hello from a debugger" + +...and even better, you can examine how your runtime objects actually work: + + >> f = @posts.first + => #nil, "body"=>nil, "id"=>"1"}> + >> f. + Display all 152 possibilities? (y or n) + +Finally, when you're ready to resume execution, you can enter "cont". + + +== Console + +The console is a Ruby shell, which allows you to interact with your +application's domain model. Here you'll have all parts of the application +configured, just like it is when the application is running. You can inspect +domain models, change values, and save to the database. Starting the script +without arguments will launch it in the development environment. + +To start the console, run rails console from the application +directory. + +Options: + +* Passing the -s, --sandbox argument will rollback any modifications + made to the database. +* Passing an environment name as an argument will load the corresponding + environment. Example: rails console production. + +To reload your controllers and models after launching the console run +reload! + +More information about irb can be found at: +link:http://www.rubycentral.org/pickaxe/irb.html + + +== dbconsole + +You can go to the command line of your database directly through rails +dbconsole. You would be connected to the database with the credentials +defined in database.yml. Starting the script without arguments will connect you +to the development database. Passing an argument will connect you to a different +database, like rails dbconsole production. Currently works for MySQL, +PostgreSQL and SQLite 3. + +== Description of Contents + +The default directory structure of a generated Ruby on Rails application: + + |-- app + | |-- assets + | |-- images + | |-- javascripts + | `-- stylesheets + | |-- controllers + | |-- helpers + | |-- mailers + | |-- models + | `-- views + | `-- layouts + |-- config + | |-- environments + | |-- initializers + | `-- locales + |-- db + |-- doc + |-- lib + | `-- tasks + |-- log + |-- public + |-- script + |-- test + | |-- fixtures + | |-- functional + | |-- integration + | |-- performance + | `-- unit + |-- tmp + | |-- cache + | |-- pids + | |-- sessions + | `-- sockets + `-- vendor + |-- assets + `-- stylesheets + `-- plugins + +app + Holds all the code that's specific to this particular application. + +app/assets + Contains subdirectories for images, stylesheets, and JavaScript files. + +app/controllers + Holds controllers that should be named like weblogs_controller.rb for + automated URL mapping. All controllers should descend from + ApplicationController which itself descends from ActionController::Base. + +app/models + Holds models that should be named like post.rb. Models descend from + ActiveRecord::Base by default. + +app/views + Holds the template files for the view that should be named like + weblogs/index.html.erb for the WeblogsController#index action. All views use + eRuby syntax by default. + +app/views/layouts + Holds the template files for layouts to be used with views. This models the + common header/footer method of wrapping views. In your views, define a layout + using the layout :default and create a file named default.html.erb. + Inside default.html.erb, call <% yield %> to render the view using this + layout. + +app/helpers + Holds view helpers that should be named like weblogs_helper.rb. These are + generated for you automatically when using generators for controllers. + Helpers can be used to wrap functionality for your views into methods. + +config + Configuration files for the Rails environment, the routing map, the database, + and other dependencies. + +db + Contains the database schema in schema.rb. db/migrate contains all the + sequence of Migrations for your schema. + +doc + This directory is where your application documentation will be stored when + generated using rake doc:app + +lib + Application specific libraries. Basically, any kind of custom code that + doesn't belong under controllers, models, or helpers. This directory is in + the load path. + +public + The directory available for the web server. Also contains the dispatchers and the + default HTML files. This should be set as the DOCUMENT_ROOT of your web + server. + +script + Helper scripts for automation and generation. + +test + Unit and functional tests along with fixtures. When using the rails generate + command, template test files will be generated for you and placed in this + directory. + +vendor + External libraries that the application depends on. Also includes the plugins + subdirectory. If the app has frozen rails, those gems also go here, under + vendor/rails/. This directory is in the load path. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..a51e5da --- /dev/null +++ b/Rakefile @@ -0,0 +1,7 @@ +#!/usr/bin/env rake +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Fetsite::Application.load_tasks diff --git a/app/assets/images/edit.png b/app/assets/images/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..0947dbfb43aa78844d8fdfeec70ecf111d678e12 GIT binary patch literal 692 zcmV;l0!#ggP)WcXayv-0MQzN3eIT>qKZ=`=XqQo8l-jauFAS|3p-G$+*wt5c=sInT%N7# zjmh*9T$K}5<=+g-8!Ez+(O#D49@9PWlOwHh+72bdLuGYZfxv|=7~<3WeJu4}&~@b-LuXcz{u<}tv0G);u!j$@2JmR)0?P`oIePgE zgQw$soQc!cb(>f$HV+V18L+wWM_cUoGukgsGJLj?4>Ji4blxBujg~*2nwrA%Jc`94 zu~^IpJj{&tJq`W$?hNEMZdh$EhqqYr{BFx+GM3Nhtxzafu~;0ZrARaY0000MJ5@0INm*CpeIkgV+NnY~Gb>@9SYY%;R08B$#%l$jCP z*(>>fo!{@=bM86!e&0Fo_q@;Zyl!;v5g&W$~6C6GM?L;-vg^b|jy4M{euY0bxUcQzdHjuBcub_j=W6wvH zZZ?9h9(Flfa^OeTP#UVr`cHCa9{73b8)RS1+&3r<(lof4MybL3ikN~_1C0)U*7=`G zZuOlF!=yX9{!STLMDky**SGX7|B9c=8Xb8z!z-3RTvD%YW55YhF=2Q_djrwWQY(~( zao%p5oXb-mU5mHfA#vc)o{@r(cbPJJPzWMddS7Qb?*MsPJ=%xw%Lq{`3*eRT>o6ReE}SyW2c!|L7>? z!-o$+kx8l;hu{9k@@7pxZ8N_+HT3rN6<1YVmY0_oW}p_%`OJmtzr)(Tw6w%*V`EeF z>J_K8o!z7FwKi%MhG#kxgWEe@0(ThLIN5IAyz|zuZ20^4*vd-5{+}L36^3L=BewAaeZ+q2j0SeWy;tNN`z-W^K5XjZwZpMV@V^9+1g{ zcUmAKA|k%7A4H!A<5jCBR0?&C`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JXTP&h5G)A74!0e%ZJbl}( zssI|_!%~_hZFypv*S^JE5N&Kvmx7KiG<|fGMO=WrH+@Yhuj+KwiS#l4>@%2nl zS)mDikfmokO4q2A)hRVZBq2-5q&XC>%HOLkOYxZ66(s86?=0s4z5xbiOV)}L-&6b)h6(~CIaR#JNw~46+WBiU7IhB zq!NuR4!TsYnyBg>@G=Ib*cMq^k<}AMpCeYEf&dzfiGI-wOQ7hb+nA zkN7_){y&c3xC0 AQ~&?~ literal 0 HcmV?d00001 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000..f261299 --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,17 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// +//= require jquery +//= require jquery_ujs +//= require_tree . +//= require tinymce-jquery +//= require bootstrap \ No newline at end of file diff --git a/app/assets/javascripts/lvas.js.coffee b/app/assets/javascripts/lvas.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/lvas.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/modulgruppen.js.coffee b/app/assets/javascripts/modulgruppen.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/modulgruppen.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/moduls.js.coffee b/app/assets/javascripts/moduls.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/moduls.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/neuigkeiten.js.coffee b/app/assets/javascripts/neuigkeiten.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/neuigkeiten.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/rubriken.js.coffee b/app/assets/javascripts/rubriken.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/rubriken.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/semesters.js.coffee b/app/assets/javascripts/semesters.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/semesters.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/studia.js.coffee b/app/assets/javascripts/studia.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/studia.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/studmods.js.coffee b/app/assets/javascripts/studmods.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/studmods.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss new file mode 100644 index 0000000..7dc9389 --- /dev/null +++ b/app/assets/stylesheets/application.css.scss @@ -0,0 +1,35 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_tree . + * require 'bootstrap' + */ + +@import 'bootstrap'; +@import 'bootstrap-responsive'; +h1 +{font-size: 23px} +h2 +{font-size: 19px} +body,html +{padding:0;margin:0;} + +div.header +{display: block; +background: url('/assets/fet_logo_2.png') rgb(200,200,200) no-repeat; +background-position:15px center; +height:60px; +padding-left:160px; +padding-top:0px; +overflow:hidden +} + + diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/stylesheets/lvas.css.scss b/app/assets/stylesheets/lvas.css.scss new file mode 100644 index 0000000..797b72c --- /dev/null +++ b/app/assets/stylesheets/lvas.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the lvas controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/modulgruppen.css.scss b/app/assets/stylesheets/modulgruppen.css.scss new file mode 100644 index 0000000..6f8581d --- /dev/null +++ b/app/assets/stylesheets/modulgruppen.css.scss @@ -0,0 +1,25 @@ +// Place all the styles related to the modulgruppen controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ +div.modulgruppe_phase_1, div.modulgruppe_phase_2, div.modulgruppe_phase_3 +{padding:10px; +margin:2px; +border-radius:10px; +min-width:13em; +} + +div.modulgruppe_phase_1 , div.modulgruppe_phase_2 +{} + +div.modulgruppe_phase_1 +{border: #91B4FF solid 2px; + +} +div.modulgruppe_phase_2 +{border: #FF7575 solid 2px; + +} +div.modulgruppe_phase_3 +{border: #41B300 solid 2px; + +} \ No newline at end of file diff --git a/app/assets/stylesheets/moduls.css.scss b/app/assets/stylesheets/moduls.css.scss new file mode 100644 index 0000000..e7f0ba1 --- /dev/null +++ b/app/assets/stylesheets/moduls.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the moduls controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/neuigkeiten.css.scss b/app/assets/stylesheets/neuigkeiten.css.scss new file mode 100644 index 0000000..4a995b3 --- /dev/null +++ b/app/assets/stylesheets/neuigkeiten.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the neuigkeiten controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/rubriken.css.scss b/app/assets/stylesheets/rubriken.css.scss new file mode 100644 index 0000000..c2314eb --- /dev/null +++ b/app/assets/stylesheets/rubriken.css.scss @@ -0,0 +1,4 @@ +// Place all the styles related to the rubriken controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ + diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss new file mode 100644 index 0000000..fb13622 --- /dev/null +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -0,0 +1,60 @@ +body { + background-color: #fff; + color: #333; + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +pre { + background-color: #eee; + padding: 10px; + font-size: 11px; +} + + + +div { + &.field, &.actions { + margin-bottom: 10px; + } +} + +#notice { + color: green; +} + +.field_with_errors { + padding: 2px; + background-color: red; + display: table; +} + +#error_explanation { + width: 450px; + border: 2px solid red; + padding: 7px; + padding-bottom: 0; + margin-bottom: 20px; + background-color: #f0f0f0; + h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + margin-bottom: 0px; + background-color: #c00; + color: #fff; + } + ul li { + + list-style: square; + } +} diff --git a/app/assets/stylesheets/semesters.css.scss b/app/assets/stylesheets/semesters.css.scss new file mode 100644 index 0000000..e7f20cf --- /dev/null +++ b/app/assets/stylesheets/semesters.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the semesters controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/studien.css.scss b/app/assets/stylesheets/studien.css.scss new file mode 100644 index 0000000..7b5973a --- /dev/null +++ b/app/assets/stylesheets/studien.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the studia controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..bdc1724 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,18 @@ +class ApplicationController < ActionController::Base + protect_from_forgery + before_filter :set_i18n_locale_from_params + protected + def set_i18n_locale_from_params + if params[:locale] + if I18n.available_locales.include?(params[:locale].to_sym) + I18n.locale=params[:locale].to_sym + else + flash.now[:notice]= "#{params[:locale]} translation not available" + logger.error flash.now[:notice] + end + end + end + def default_url_options + {locale: I18n.locale} + end +end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..9fce75e --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,6 @@ +class HomeController < ApplicationController + def index + + end + +end \ No newline at end of file diff --git a/app/controllers/lvas_controller.rb b/app/controllers/lvas_controller.rb new file mode 100644 index 0000000..ec2e929 --- /dev/null +++ b/app/controllers/lvas_controller.rb @@ -0,0 +1,84 @@ +class LvasController < ApplicationController + # GET /lvas + # GET /lvas.json + def index + @lvas = Lva.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @lvas } + end + end + + # GET /lvas/1 + # GET /lvas/1.json + def show + @lva = Lva.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @lva } + end + end + + # GET /lvas/new + # GET /lvas/new.json + def new + @lva = Lva.new + modul=Modul.find(params[:modul_id]) + @lva.modul< true, :params => params.merge(overwrite).except(:controller,:action) + end + def switch_locale_url(target_locale) + current_url({:locale=>target_locale}) .sub "/"+I18n.locale.to_s+"/", "/"+target_locale.to_s+"/" + + end + +end diff --git a/app/helpers/lvas_helper.rb b/app/helpers/lvas_helper.rb new file mode 100644 index 0000000..f38e5b0 --- /dev/null +++ b/app/helpers/lvas_helper.rb @@ -0,0 +1,2 @@ +module LvasHelper +end diff --git a/app/helpers/modulgruppen_helper.rb b/app/helpers/modulgruppen_helper.rb new file mode 100644 index 0000000..eec6b8c --- /dev/null +++ b/app/helpers/modulgruppen_helper.rb @@ -0,0 +1,2 @@ +module ModulgruppenHelper +end diff --git a/app/helpers/moduls_helper.rb b/app/helpers/moduls_helper.rb new file mode 100644 index 0000000..d40cb7e --- /dev/null +++ b/app/helpers/moduls_helper.rb @@ -0,0 +1,2 @@ +module ModulsHelper +end diff --git a/app/helpers/neuigkeiten_helper.rb b/app/helpers/neuigkeiten_helper.rb new file mode 100644 index 0000000..e6cb104 --- /dev/null +++ b/app/helpers/neuigkeiten_helper.rb @@ -0,0 +1,2 @@ +module NeuigkeitenHelper +end diff --git a/app/helpers/rubriken_helper.rb b/app/helpers/rubriken_helper.rb new file mode 100644 index 0000000..ac76262 --- /dev/null +++ b/app/helpers/rubriken_helper.rb @@ -0,0 +1,2 @@ +module RubrikenHelper +end diff --git a/app/helpers/semesters_helper.rb b/app/helpers/semesters_helper.rb new file mode 100644 index 0000000..ccb76f0 --- /dev/null +++ b/app/helpers/semesters_helper.rb @@ -0,0 +1,2 @@ +module SemestersHelper +end diff --git a/app/helpers/studien_helper.rb b/app/helpers/studien_helper.rb new file mode 100644 index 0000000..5bf1ccc --- /dev/null +++ b/app/helpers/studien_helper.rb @@ -0,0 +1,2 @@ +module StudienHelper +end diff --git a/app/helpers/studmods_helper.rb b/app/helpers/studmods_helper.rb new file mode 100644 index 0000000..48667d4 --- /dev/null +++ b/app/helpers/studmods_helper.rb @@ -0,0 +1,2 @@ +module StudmodsHelper +end diff --git a/app/inputs/tinymce_text_input.rb b/app/inputs/tinymce_text_input.rb new file mode 100644 index 0000000..cc33657 --- /dev/null +++ b/app/inputs/tinymce_text_input.rb @@ -0,0 +1,5 @@ +class TinymceTextInput < FormtasticBootstrap::Inputs::TextInput + def input_html_options + super.merge(:class => "tinymce") + end +end diff --git a/app/mailers/.gitkeep b/app/mailers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/mailers/confirmmailer.rb b/app/mailers/confirmmailer.rb new file mode 100644 index 0000000..77ccfa0 --- /dev/null +++ b/app/mailers/confirmmailer.rb @@ -0,0 +1,3 @@ +class Confirmmailer < ActionMailer::Base + default from: "from@example.com" +end diff --git a/app/models/.gitkeep b/app/models/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/ability.rb b/app/models/ability.rb new file mode 100644 index 0000000..359740c --- /dev/null +++ b/app/models/ability.rb @@ -0,0 +1,31 @@ +class Ability + include CanCan::Ability + + def initialize(user) + # Define abilities for the passed in user here. For example: + # + user ||= User.new # guest user (not logged in) + # if user.admin? + # can :manage, :all + # else + # can :read, :all + # end + can :read, Modulgruppe + if user.has_role? "newsadmin" + can :manage, Modulgruppe + end + # The first argument to `can` is the action you are giving the user permission to do. + # If you pass :manage it will apply to every action. Other common actions here are + # :read, :create, :update and :destroy. + # + # The second argument is the resource the user can perform the action on. If you pass + # :all it will apply to every resource. Otherwise pass a Ruby class of the resource. + # + # The third argument is an optional hash of conditions to further filter the objects. + # For example, here the user can only update published articles. + # + # can :update, Article, :published => true + # + # See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilities + end +end diff --git a/app/models/lva.rb b/app/models/lva.rb new file mode 100644 index 0000000..3b9ff5d --- /dev/null +++ b/app/models/lva.rb @@ -0,0 +1,7 @@ +class Lva < ActiveRecord::Base + has_paper_trail # Versionsver + attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids + has_and_belongs_to_many :modul + has_and_belongs_to_many :semester + translates :desc, :fallbacks_for_empty_translations => true +end diff --git a/app/models/modul.rb b/app/models/modul.rb new file mode 100644 index 0000000..93d7165 --- /dev/null +++ b/app/models/modul.rb @@ -0,0 +1,9 @@ +class Modul < ActiveRecord::Base + attr_accessible :desc,:name, :depend, :studium_id, :modulgruppe_ids + + has_and_belongs_to_many :lvas + has_and_belongs_to_many :modulgruppen + + translates :desc,:depend, :versioning =>true, :fallbacks_for_empty_translations => true + +end diff --git a/app/models/modulgruppe.rb b/app/models/modulgruppe.rb new file mode 100644 index 0000000..7f21489 --- /dev/null +++ b/app/models/modulgruppe.rb @@ -0,0 +1,11 @@ +class Modulgruppe < ActiveRecord::Base + attr_accessible :name, :phase, :typ,:desc, :studium_id + belongs_to :studium, :foreign_key => "studium_id" + has_and_belongs_to_many :moduls + resourcify + validates :studium, :presence=>true + validates :name, :presence=>true,:uniqueness =>{:scope => :studium, :message => "Nur einmal je Studium erlaubt"} + validates :phase, :numericality => { :only_integer => true },:inclusion => {:in => [1, 2, 3, 4], :message => "%{value} is not valid, choose phase 1 to 4"}, :presence=>true + validates :typ, :inclusion => {:in => ["Pflicht","Vertiefungspflicht","Wahl"] } + translates :name,:desc, :versioning =>true,:fallbacks_for_empty_translations => true +end diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb new file mode 100644 index 0000000..13db030 --- /dev/null +++ b/app/models/neuigkeit.rb @@ -0,0 +1,5 @@ +class Neuigkeit < ActiveRecord::Base + attr_accessible :datum, :text, :title + belongs_to :author, :class_name =>'User' + belongs_to :rubrik +end diff --git a/app/models/role.rb b/app/models/role.rb new file mode 100644 index 0000000..145baa7 --- /dev/null +++ b/app/models/role.rb @@ -0,0 +1,6 @@ +class Role < ActiveRecord::Base + has_and_belongs_to_many :users, :join_table => :users_roles + belongs_to :resource, :polymorphic => true + + scopify +end diff --git a/app/models/rubrik.rb b/app/models/rubrik.rb new file mode 100644 index 0000000..600438b --- /dev/null +++ b/app/models/rubrik.rb @@ -0,0 +1,10 @@ +class Rubrik < ActiveRecord::Base + attr_accessible :desc, :name, :prio + has_many :neuigkeiten +def moderator +end + +def moderator=(id) +User.find(id).add_role(:newsmoderator, self) +end +end diff --git a/app/models/semester.rb b/app/models/semester.rb new file mode 100644 index 0000000..13cb02d --- /dev/null +++ b/app/models/semester.rb @@ -0,0 +1,4 @@ +class Semester < ActiveRecord::Base + has_and_belongs_to_many :lvas + attr_accessible :name, :nummer, :ss, :ws +end diff --git a/app/models/studium.rb b/app/models/studium.rb new file mode 100644 index 0000000..7411b30 --- /dev/null +++ b/app/models/studium.rb @@ -0,0 +1,6 @@ +class Studium < ActiveRecord::Base + attr_accessible :desc, :name, :typ, :zahl + has_many :modulgruppen, inverse_of: :studium, :class_name => "Modulgruppe" + validates :zahl, :uniqueness => true + translates :desc,:shortdesc, :versioning =>true,:fallbacks_for_empty_translations => true +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..673b7d6 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,13 @@ +class User < ActiveRecord::Base + rolify + # Include default devise modules. Others available are: + # :token_authenticatable, :confirmable, + # :lockable, :timeoutable and :omniauthable + devise :database_authenticatable, :registerable,:confirmable, + :recoverable, :rememberable, :trackable, :validatable + + # Setup accessible (or protected) attributes for your model + attr_accessible :email, :password, :password_confirmation, :remember_me + # attr_accessible :title, :body + +end diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb new file mode 100644 index 0000000..9c27eb7 --- /dev/null +++ b/app/views/devise/confirmations/new.html.erb @@ -0,0 +1,12 @@ +

Resend confirmation instructions

+ +<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :email %>
+ <%= f.email_field :email, :autofocus => true %>
+ +
<%= f.submit "Resend confirmation instructions" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 0000000..5b04a72 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +

Welcome <%= @email %>!

+ +

You can confirm your account email through the link below:

+ +

<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 0000000..2713034 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +

Hello <%= @resource.email %>!

+ +

Someone has requested a link to change your password. You can do this through the link below.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>

+ +

If you didn't request this, please ignore this email.

+

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 0000000..a4152e1 --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @resource.email %>!

+ +

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

+ +

Click the link below to unlock your account:

+ +

<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %>

diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb new file mode 100644 index 0000000..34a4960 --- /dev/null +++ b/app/views/devise/passwords/edit.html.erb @@ -0,0 +1,16 @@ +

Change your password

+ +<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :reset_password_token %> + +
<%= f.label :password, "New password" %>
+ <%= f.password_field :password, :autofocus => true %>
+ +
<%= f.label :password_confirmation, "Confirm new password" %>
+ <%= f.password_field :password_confirmation %>
+ +
<%= f.submit "Change my password" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb new file mode 100644 index 0000000..5a400df --- /dev/null +++ b/app/views/devise/passwords/new.html.erb @@ -0,0 +1,12 @@ +

Forgot your password?

+ +<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :email %>
+ <%= f.email_field :email, :autofocus => true %>
+ +
<%= f.submit "Send me reset password instructions" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb new file mode 100644 index 0000000..7d701c6 --- /dev/null +++ b/app/views/devise/registrations/edit.html.erb @@ -0,0 +1,29 @@ +

Edit <%= resource_name.to_s.humanize %>

+ +<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :email %>
+ <%= f.email_field :email, :autofocus => true %>
+ + <% if resource.class.reconfirmable && resource.unconfirmed_email.present? %> +
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
+ <% end %> + +
<%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password, :autocomplete => "off" %>
+ +
<%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
+ +
<%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password %>
+ +
<%= f.submit "Update" %>
+<% end %> + +

Cancel my account

+ +

Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.

+ +<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb new file mode 100644 index 0000000..3f189d4 --- /dev/null +++ b/app/views/devise/registrations/new.html.erb @@ -0,0 +1,18 @@ +

Sign up

+ +<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :email %>
+ <%= f.email_field :email, :autofocus => true %>
+ +
<%= f.label :password %>
+ <%= f.password_field :password %>
+ +
<%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
+ +
<%= f.submit "Sign up" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb new file mode 100644 index 0000000..f9bc2c1 --- /dev/null +++ b/app/views/devise/sessions/new.html.erb @@ -0,0 +1,17 @@ +

Sign in

+ +<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> +
<%= f.label :email %>
+ <%= f.email_field :email, :autofocus => true %>
+ +
<%= f.label :password %>
+ <%= f.password_field :password %>
+ + <% if devise_mapping.rememberable? -%> +
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
+ <% end -%> + +
<%= f.submit "Sign in" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb new file mode 100644 index 0000000..eab783a --- /dev/null +++ b/app/views/devise/shared/_links.erb @@ -0,0 +1,25 @@ +<%- if controller_name != 'sessions' %> + <%= link_to "Sign in", new_session_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.registerable? && controller_name != 'registrations' %> + <%= link_to "Sign up", new_registration_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.recoverable? && controller_name != 'passwords' %> + <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> + <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> + <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
+ <% end -%> +<% end -%> \ No newline at end of file diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb new file mode 100644 index 0000000..020787f --- /dev/null +++ b/app/views/devise/unlocks/new.html.erb @@ -0,0 +1,12 @@ +

Resend unlock instructions

+ +<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :email %>
+ <%= f.email_field :email, :autofocus => true %>
+ +
<%= f.submit "Resend unlock instructions" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000..a7804fc --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,2 @@ +

<%= t :hello %>

+

<%= t 'home.hallobeiderfet' %>

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..7979db7 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,24 @@ + + + + Fetsite + <%= stylesheet_link_tag "application", :media => "all" %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tags %> + + + +
+

Fachschaft Elektrotechnik

+
+
+
+
+ +
+ + <%= yield %> +
+
+ + diff --git a/app/views/layouts/menu.html.erb b/app/views/layouts/menu.html.erb new file mode 100644 index 0000000..ac89b3e --- /dev/null +++ b/app/views/layouts/menu.html.erb @@ -0,0 +1,24 @@ +<%= t 'home.mtitle'%> + +<% if user_signed_in? %> +
  • Logged in as : <%= current_user.email %> + <%= link_to('Logout', destroy_user_session_path, :method => :delete) %> +
  • +<% else %> +
  • + <%= link_to('Login', new_user_session_path) %> +
  • +<% end %> +<%if I18n.locale == :en %> +<%= link_to "Deutsch" ,switch_locale_url(:de)%> +<% elsif I18n.locale == :de %> + <%= link_to "English" ,switch_locale_url(:en)%> + <%end %> diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb new file mode 100644 index 0000000..06d8de7 --- /dev/null +++ b/app/views/lvas/_form.html.erb @@ -0,0 +1,18 @@ +<%= semantic_form_for @lva do |f| %> + <%= f.inputs do %> + <%= f.input :modul %> + <%= f.input :name %> + <%= f.input :ects %> + <%= f.input :stunden %> + + <%= f.input :desc %> + + <%= f.input :lvanr %> + + + <% end %> + + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> +<% end %> diff --git a/app/views/lvas/edit.html.erb b/app/views/lvas/edit.html.erb new file mode 100644 index 0000000..b728976 --- /dev/null +++ b/app/views/lvas/edit.html.erb @@ -0,0 +1,6 @@ +

    Editing lva

    + +<%= render 'form' %> + +<%= link_to 'Show', @lva %> | +<%= link_to 'Back', lvas_path %> diff --git a/app/views/lvas/index.html.erb b/app/views/lvas/index.html.erb new file mode 100644 index 0000000..c09b08a --- /dev/null +++ b/app/views/lvas/index.html.erb @@ -0,0 +1,31 @@ +

    Listing lvas

    + + + + + + + + + + + + + +<% @lvas.each do |lva| %> + + + + + + + + + + +<% end %> +
    NameDescEctsLvanrStunden
    <%= lva.name %><%= lva.desc %><%= lva.ects %><%= lva.lvanr %><%= lva.stunden %><%= link_to 'Show', lva %><%= link_to 'Edit', edit_lva_path(lva) %><%= link_to 'Destroy', lva, method: :delete, data: { confirm: 'Are you sure?' } %>
    + +
    + +<%= link_to 'New Lva', new_lva_path %> diff --git a/app/views/lvas/new.html.erb b/app/views/lvas/new.html.erb new file mode 100644 index 0000000..cc24a4c --- /dev/null +++ b/app/views/lvas/new.html.erb @@ -0,0 +1,5 @@ +

    New lva

    + +<%= render 'form' %> + +<%= link_to 'Back', lvas_path %> diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb new file mode 100644 index 0000000..58e3be9 --- /dev/null +++ b/app/views/lvas/show.html.erb @@ -0,0 +1,20 @@ +

    <%= notice %>

    + +

    <%= @lva.lvanr %> + + <%= @lva.name %> (<%= @lva.ects %> ECTS/ <%= @lva.stunden %> Std)<%= link_to image_tag('edit.png'), edit_lva_path(@lva) %> | +

    +

    + <%= @lva.desc %> +

    + +<% @lva.modul.each do |modul| %> +<%= link_to modul.name , modul_path(modul)%>
    + <% modul.modulgruppen.each do |g| %> + <% link =g.studium.name + " - " +g.name %> + <%= link_to link , modulgruppe_path(g)%>
    + <%end%> +<%end%> + + +<%= link_to 'Back', lvas_path %> diff --git a/app/views/modulgruppen/_form.html.erb b/app/views/modulgruppen/_form.html.erb new file mode 100644 index 0000000..8191af5 --- /dev/null +++ b/app/views/modulgruppen/_form.html.erb @@ -0,0 +1,13 @@ +<%= semantic_form_for @modulgruppe do |f| %> + <%= f.inputs do %> + <%= f.input :studium_id, :as =>:select, :collection => Studium.all %> + <%= f.input :typ ,:as => :radio, :collection=>["Pflicht","Vertiefungspflicht","Wahl"]%> + <%= f.input :phase,:as => :radio,:collection=>1..3 %> + <%= f.input :name %> + <%= f.input :desc,:input_html=>{:rows=> 3 }%> + <% end %> + + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> +<% end %> diff --git a/app/views/modulgruppen/_modulgruppe.html.erb b/app/views/modulgruppen/_modulgruppe.html.erb new file mode 100644 index 0000000..3c710ae --- /dev/null +++ b/app/views/modulgruppen/_modulgruppe.html.erb @@ -0,0 +1,8 @@ +
    +

    <%= link_to modulgruppe.name, modulgruppe_path(modulgruppe) %><%= link_to image_tag('edit.png').html_safe+"Edit", edit_modulgruppe_path(modulgruppe),:class=>"btn" %>

    +<%= modulgruppe.desc%> + +<%= render :partial=>'moduls/kurz', :collection=>modulgruppe.moduls, :as=>:modul%> +
    +
    + diff --git a/app/views/modulgruppen/edit.html.erb b/app/views/modulgruppen/edit.html.erb new file mode 100644 index 0000000..ad76be3 --- /dev/null +++ b/app/views/modulgruppen/edit.html.erb @@ -0,0 +1,6 @@ +

    Editing modulgruppe

    + +<%= render 'form' %> + +<%= link_to 'Show', @modulgruppe %> | +<%= link_to 'Back', modulgruppen_path %> diff --git a/app/views/modulgruppen/index.html.erb b/app/views/modulgruppen/index.html.erb new file mode 100644 index 0000000..89e10b9 --- /dev/null +++ b/app/views/modulgruppen/index.html.erb @@ -0,0 +1,30 @@ +

    Listing modulgruppen

    + + + + + + + + + + + + +<% @modulgruppen.each do |modulgruppe| %> + + + + + + + + + +<% end %> +
    TypePhaseStudiumName
    <%= modulgruppe.typ %><%= modulgruppe.phase %><%= modulgruppe.studium.name %><%= modulgruppe.name %><%= link_to 'Show', modulgruppe %><%= link_to 'Edit', edit_modulgruppe_path(modulgruppe) %><%= link_to 'Destroy', modulgruppe, method: :delete, data: { confirm: 'Are you sure?' } %>
    + +
    +<% if !@studium.nil? %> +<%= link_to 'New Modulgruppe', new_modulgruppe_path %> +<% end%> diff --git a/app/views/modulgruppen/new.html.erb b/app/views/modulgruppen/new.html.erb new file mode 100644 index 0000000..d9eeb81 --- /dev/null +++ b/app/views/modulgruppen/new.html.erb @@ -0,0 +1,5 @@ +

    New modulgruppe

    + +<%= render 'form' %> + +<%= link_to 'Back', modulgruppen_path %> diff --git a/app/views/modulgruppen/show.html.erb b/app/views/modulgruppen/show.html.erb new file mode 100644 index 0000000..39eb89a --- /dev/null +++ b/app/views/modulgruppen/show.html.erb @@ -0,0 +1,27 @@ +

    <%= notice %>

    +
    +

    + <%= @modulgruppe.name %> +

    +

    + <%= link_to "Studium: "+@modulgruppe.studium.name, studium_path(@modulgruppe.studium) %> + +

    + <%= I18n.t "modulgruppe.typ"%>: + <%= @modulgruppe.typ %> +

    + + +<% @modulgruppe.moduls.each do |modul| %> +<%= render modul%> +<% end %> +
    + + +Default +
    +<%= link_to 'Add Modul', new_modul_path(:modulgruppen_id =>@modulgruppe.id) %> +<%= link_to 'Studium', studium_path(@modulgruppe.studium),:class =>"btn" %> +<%= link_to 'Edit', edit_modulgruppe_path(@modulgruppe),:class =>"btn" %> +<%= link_to 'Back', modulgruppen_path,:class =>"btn" %> +
    \ No newline at end of file diff --git a/app/views/moduls/_form.html.erb b/app/views/moduls/_form.html.erb new file mode 100644 index 0000000..7d73f6c --- /dev/null +++ b/app/views/moduls/_form.html.erb @@ -0,0 +1,14 @@ + +<%= semantic_form_for @modul do |f| %> + <%= f.inputs do %> + <%= f.input :modulgruppen,:as => :select, :collection => Hash[Modulgruppe.all.map{|m| [m.studium.name + " " + m.name,m.id]}] %> + <%= f.input :name ,:hint=>true%> + <%= f.input :desc, :as=>:tinymce_text %> + <%= f.input :depend %> + <% end %> + + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> +<% end %> +<%= tinymce %> \ No newline at end of file diff --git a/app/views/moduls/_kurz.html.erb b/app/views/moduls/_kurz.html.erb new file mode 100644 index 0000000..96e9726 --- /dev/null +++ b/app/views/moduls/_kurz.html.erb @@ -0,0 +1,9 @@ +

    + <%= link_to "Modul "+ modul.name , modul_path(modul) %> <%= link_to image_tag("edit.png"), edit_modul_path(modul) %> +

    +

    + <%= raw(modul.desc) %> +

    + +
    + diff --git a/app/views/moduls/_modul.html.erb b/app/views/moduls/_modul.html.erb new file mode 100644 index 0000000..c3fc650 --- /dev/null +++ b/app/views/moduls/_modul.html.erb @@ -0,0 +1,13 @@ +

    + <%= link_to "Modul "+ modul.name , modul_path(modul) %> <%= link_to image_tag("edit.png"), edit_modul_path(modul) %> +

    +

    + <%= raw(modul.desc) %> +

    +LVAs: +
      +<% modul.lvas.each do |lva| %> +
    • <%= link_to lva.lvanr+" "+ lva.name, lva %>
    • +<% end %> +
    +
    diff --git a/app/views/moduls/edit.html.erb b/app/views/moduls/edit.html.erb new file mode 100644 index 0000000..7ea122b --- /dev/null +++ b/app/views/moduls/edit.html.erb @@ -0,0 +1,8 @@ +

    <%= I18n.t "moduls.edit.title"%>

    + +<%= render 'form' %> + +<%= link_to 'Show', modul_path( @modul) %> | +<% if !@studium.nil? %> +<%= link_to 'Back', moduls_path(@modul) %> +<% end%> \ No newline at end of file diff --git a/app/views/moduls/index.html.erb b/app/views/moduls/index.html.erb new file mode 100644 index 0000000..cd23d5f --- /dev/null +++ b/app/views/moduls/index.html.erb @@ -0,0 +1,26 @@ +

    Listing moduls

    + + + + + + + + + + +<% @moduls.each do |modul| %> + + + + + + + +<% end %> +
    NameDesc
    <%= modul.name %><%= modul.desc %><%= link_to 'Show', modul_path(modul) %><%= link_to 'Edit', edit_modul_path(modul) %><%= link_to 'Destroy', [modul], method: :delete, data: { confirm: 'Are you sure?' } %>
    + +
    +<% if !@studium.nil? %> +<%= link_to 'New Modul', new_modul_path() %> +<% end%> diff --git a/app/views/moduls/new.html.erb b/app/views/moduls/new.html.erb new file mode 100644 index 0000000..b463dee --- /dev/null +++ b/app/views/moduls/new.html.erb @@ -0,0 +1,5 @@ +

    New modul

    + +<%= render 'form' %> + +<%= link_to 'Back', moduls_path %> diff --git a/app/views/moduls/show.html.erb b/app/views/moduls/show.html.erb new file mode 100644 index 0000000..e9160de --- /dev/null +++ b/app/views/moduls/show.html.erb @@ -0,0 +1,11 @@ +

    <%= notice %>

    + +<%= render @modul %> + +<% @modul.modulgruppen.each do |g| %> +<% link = g.studium.name + " - " +g.name %> +<%= link_to g.studium.name , studium_path(g.studium)%>
    +<%= link_to link , modulgruppe_path(g)%>
    +<%end%> + +<%= link_to 'Add LVA', new_lva_path(:modul_id =>@modul.id) %> diff --git a/app/views/neuigkeiten/_form.html.erb b/app/views/neuigkeiten/_form.html.erb new file mode 100644 index 0000000..f851941 --- /dev/null +++ b/app/views/neuigkeiten/_form.html.erb @@ -0,0 +1,11 @@ +<%= semantic_form_for @neuigkeit do |f| %> + <%= f.inputs do %> + <%= f.input :title, :placeholder=>"Titel" %> + <%= f.input :text %> + <%= f.input :datum %> + <% end %> + + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> +<% end %> diff --git a/app/views/neuigkeiten/edit.html.erb b/app/views/neuigkeiten/edit.html.erb new file mode 100644 index 0000000..a6c5a21 --- /dev/null +++ b/app/views/neuigkeiten/edit.html.erb @@ -0,0 +1,6 @@ +

    Editing neuigkeit

    + +<%= render 'form' %> + +<%= link_to 'Show', @neuigkeit %> | +<%= link_to 'Back', neuigkeiten_path %> diff --git a/app/views/neuigkeiten/index.html.erb b/app/views/neuigkeiten/index.html.erb new file mode 100644 index 0000000..b66a76d --- /dev/null +++ b/app/views/neuigkeiten/index.html.erb @@ -0,0 +1,27 @@ +

    Listing neuigkeiten

    + + + + + + + + + + + +<% @neuigkeiten.each do |neuigkeit| %> + + + + + + + + +<% end %> +
    TitleTextDatum
    <%= neuigkeit.title %><%= neuigkeit.text %><%= neuigkeit.datum %><%= link_to 'Show', neuigkeit %><%= link_to 'Edit', edit_neuigkeit_path(neuigkeit) %><%= link_to 'Destroy', neuigkeit, method: :delete, data: { confirm: 'Are you sure?' } %>
    + +
    + +<%= link_to 'New Neuigkeit', new_neuigkeit_path %> diff --git a/app/views/neuigkeiten/new.html.erb b/app/views/neuigkeiten/new.html.erb new file mode 100644 index 0000000..50aa224 --- /dev/null +++ b/app/views/neuigkeiten/new.html.erb @@ -0,0 +1,5 @@ +

    New neuigkeit

    + +<%= render 'form' %> + +<%= link_to 'Back', neuigkeiten_path %> diff --git a/app/views/neuigkeiten/show.html.erb b/app/views/neuigkeiten/show.html.erb new file mode 100644 index 0000000..f2d02f9 --- /dev/null +++ b/app/views/neuigkeiten/show.html.erb @@ -0,0 +1,20 @@ +

    <%= notice %>

    + +

    + Title: + <%= @neuigkeit.title %> +

    + +

    + Text: + <%= @neuigkeit.text %> +

    + +

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

    + + +<%= link_to 'Edit', edit_neuigkeit_path(@neuigkeit) %> | +<%= link_to 'Back', neuigkeiten_path %> diff --git a/app/views/rubriken/_form.html.erb b/app/views/rubriken/_form.html.erb new file mode 100644 index 0000000..a7071d5 --- /dev/null +++ b/app/views/rubriken/_form.html.erb @@ -0,0 +1,11 @@ +<%= semantic_form_for @rubrik do |f| %> + <%= f.inputs do %> + <%= f.input :name %> + <%= f.input :desc %> + <%= f.input :prio %> + <% end %> + + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> +<% end %> diff --git a/app/views/rubriken/edit.html.erb b/app/views/rubriken/edit.html.erb new file mode 100644 index 0000000..a4ebe5e --- /dev/null +++ b/app/views/rubriken/edit.html.erb @@ -0,0 +1,6 @@ +

    Editing rubrik

    + +<%= render 'form' %> + +<%= link_to 'Show', @rubrik %> | +<%= link_to 'Back', rubriken_path %> diff --git a/app/views/rubriken/index.html.erb b/app/views/rubriken/index.html.erb new file mode 100644 index 0000000..c53bbb4 --- /dev/null +++ b/app/views/rubriken/index.html.erb @@ -0,0 +1,27 @@ +

    Listing rubriken

    + + + + + + + + + + + +<% @rubriken.each do |rubrik| %> + + + + + + + + +<% end %> +
    NameDescPrio
    <%= rubrik.name %><%= rubrik.desc %><%= rubrik.prio %><%= link_to 'Show', rubrik %><%= link_to 'Edit', edit_rubrik_path(rubrik) %><%= link_to 'Destroy', rubrik, method: :delete, data: { confirm: 'Are you sure?' } %>
    + +
    + +<%= link_to 'New Rubrik', new_rubrik_path %> diff --git a/app/views/rubriken/new.html.erb b/app/views/rubriken/new.html.erb new file mode 100644 index 0000000..12dbebd --- /dev/null +++ b/app/views/rubriken/new.html.erb @@ -0,0 +1,5 @@ +

    New rubrik

    + +<%= render 'form' %> + +<%= link_to 'Back', rubriken_path %> diff --git a/app/views/rubriken/show.html.erb b/app/views/rubriken/show.html.erb new file mode 100644 index 0000000..8181a71 --- /dev/null +++ b/app/views/rubriken/show.html.erb @@ -0,0 +1,25 @@ +

    <%= notice %>

    + +

    + Name: + <%= @rubrik.name %> +

    + +

    + Desc: + <%= @rubrik.desc %> +

    + +

    + Prio: + <%= @rubrik.prio %> +

    +<%= semantic_form_for @rubrik, :url=> url_for(:action => 'addmoderator') do |f| %> +<%= f.inputs do %> +<%= f.input :moderator, :as => :select, :collection => Hash[User.all.map{|b| [b.email,b.id]}] %> + <% end %> + <%= f.action :submit %> + <% end %> + +<%= link_to 'Edit', edit_rubrik_path(@rubrik) %> | +<%= link_to 'Back', rubriken_path %> diff --git a/app/views/semesters/_form.html.erb b/app/views/semesters/_form.html.erb new file mode 100644 index 0000000..85a79e6 --- /dev/null +++ b/app/views/semesters/_form.html.erb @@ -0,0 +1,12 @@ +<%= semantic_form_for @semester do |f| %> + <%= f.inputs do %> + <%= f.input :name %> + <%= f.input :nummer %> + <%= f.input :ws %> + <%= f.input :ss %> + <% end %> + + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> +<% end %> diff --git a/app/views/semesters/edit.html.erb b/app/views/semesters/edit.html.erb new file mode 100644 index 0000000..10925ec --- /dev/null +++ b/app/views/semesters/edit.html.erb @@ -0,0 +1,6 @@ +

    Editing semester

    + +<%= render 'form' %> + +<%= link_to 'Show', @semester %> | +<%= link_to 'Back', semesters_path %> diff --git a/app/views/semesters/index.html.erb b/app/views/semesters/index.html.erb new file mode 100644 index 0000000..1a62a2f --- /dev/null +++ b/app/views/semesters/index.html.erb @@ -0,0 +1,29 @@ +

    Listing semesters

    + + + + + + + + + + + + +<% @semesters.each do |semester| %> + + + + + + + + + +<% end %> +
    NameNummerWsSs
    <%= semester.name %><%= semester.nummer %><%= semester.ws %><%= semester.ss %><%= link_to 'Show', semester %><%= link_to 'Edit', edit_semester_path(semester) %><%= link_to 'Destroy', semester, method: :delete, data: { confirm: 'Are you sure?' } %>
    + +
    + +<%= link_to 'New Semester', new_semester_path %> diff --git a/app/views/semesters/new.html.erb b/app/views/semesters/new.html.erb new file mode 100644 index 0000000..604ba79 --- /dev/null +++ b/app/views/semesters/new.html.erb @@ -0,0 +1,5 @@ +

    New semester

    + +<%= render 'form' %> + +<%= link_to 'Back', semesters_path %> diff --git a/app/views/semesters/show.html.erb b/app/views/semesters/show.html.erb new file mode 100644 index 0000000..b6607ef --- /dev/null +++ b/app/views/semesters/show.html.erb @@ -0,0 +1,25 @@ +

    <%= notice %>

    + +

    + Name: + <%= @semester.name %> +

    + +

    + Nummer: + <%= @semester.nummer %> +

    + +

    + Ws: + <%= @semester.ws %> +

    + +

    + Ss: + <%= @semester.ss %> +

    + + +<%= link_to 'Edit', edit_semester_path(@semester) %> | +<%= link_to 'Back', semesters_path %> diff --git a/app/views/studien/_form.html.erb b/app/views/studien/_form.html.erb new file mode 100644 index 0000000..471a8c3 --- /dev/null +++ b/app/views/studien/_form.html.erb @@ -0,0 +1,13 @@ + <%= tinymce_assets %> +<%= semantic_form_for @studium do |f| %> + <%= f.inputs do %> + <%= f.input :zahl %> + <%= f.input :name,:append=>"NAME" %> + <%= f.input :desc, :as=>:tinymce_text %> + <%= f.input :typ, :as=>:radio, :collection=>["Bachelor","Master"]%> + <% end %> +<%= tinymce %> + <%= f.actions do %> + <%= f.action :submit, :as => :input %> + <% end %> +<% end %> diff --git a/app/views/studien/edit.html.erb b/app/views/studien/edit.html.erb new file mode 100644 index 0000000..766d5b2 --- /dev/null +++ b/app/views/studien/edit.html.erb @@ -0,0 +1,6 @@ +

    Editing studium

    + +<%= render 'form' %> + +<%= link_to 'Show', @studium %> | +<%= link_to 'Back', studien_path %> \ No newline at end of file diff --git a/app/views/studien/index.html.erb b/app/views/studien/index.html.erb new file mode 100644 index 0000000..9eab1a1 --- /dev/null +++ b/app/views/studien/index.html.erb @@ -0,0 +1,31 @@ +

    <%= I18n.t("studien.list") %>

    + + + + + + + + + + + + +<% @studien.each do |studium| %> + + + + + + + + + + + +<% end %> +
    ZahlNameDescTyp
    <%= studium.zahl %><%= studium.name %><%= studium.typ %><%= link_to 'Show', studium_path(studium) %><%= link_to 'Edit', edit_studium_path(studium) %><%= link_to 'Destroy', studium, method: :delete, data: { confirm: 'Are you sure?' } %>
    + +
    + +<%= link_to I18n.t("studien.new"), new_studium_path %> diff --git a/app/views/studien/new.html.erb b/app/views/studien/new.html.erb new file mode 100644 index 0000000..a7cd516 --- /dev/null +++ b/app/views/studien/new.html.erb @@ -0,0 +1,5 @@ +

    New studium

    + +<%= render 'form' %> + +<%= link_to 'Back', studien_index_path , :data=>{:locale=>I16n.locale}%> diff --git a/app/views/studien/show.html.erb b/app/views/studien/show.html.erb new file mode 100644 index 0000000..0a5572b --- /dev/null +++ b/app/views/studien/show.html.erb @@ -0,0 +1,38 @@ + +

    <%= notice %>

    +

    <%= @studium.typ %> <%= @studium.name %> (<%= @studium.zahl %>)

    + <%= raw(@studium.desc) %> +<% [1, 2 ,3].each do |ph| %> + + <% ph_mod = @studium.modulgruppen.where(:phase=>ph) + if ph_mod.count==1 + width=12 + slice=1 + elsif ph_mod.count <= 4 + width=6 + slice=2 + else + width=4 + slice=3 + end + + + %> + +<% ph_mod.each_slice(slice) do |row| %> +
    +<% row.each do |modulgruppe| %> +
    +<%= render modulgruppe %> +
    +<% end %> +
    +<% end %> +<% end %> +
    +
    +
    +<%= link_to 'New Modulgruppe', new_studium_modulgruppe_path(@studium) %> | +<%= link_to 'Edit', edit_studium_path(@studium) %> | +<%= link_to ' Alle Studien'.html_safe, studien_path,:class=>"btn",:raw=>true %> +
    \ No newline at end of file diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb new file mode 100644 index 0000000..d06fe69 --- /dev/null +++ b/app/views/users/index.html.erb @@ -0,0 +1,10 @@ + + <% @users.each do |user|%> + + +<% end %> +
    + <%= user.email %>
      + <% user.roles.each do |role| %> +
    • <%= role.name%>
    • +<% end %>
    diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..2beeae7 --- /dev/null +++ b/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Fetsite::Application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..60ec0ec --- /dev/null +++ b/config/application.rb @@ -0,0 +1,62 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +if defined?(Bundler) + # If you precompile assets before deploying to production, use this line + Bundler.require(*Rails.groups(:assets => %w(development test))) + # If you want your assets lazily compiled in production, use this line + # Bundler.require(:default, :assets, Rails.env) +end + +module Fetsite + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Custom directories with classes and modules you want to be autoloadable. + # config.autoload_paths += %W(#{config.root}/extras) + + # Only load the plugins named here, in the order given (default is alphabetical). + # :all can be used as a placeholder for all plugins not explicitly named. + # config.plugins = [ :exception_notification, :ssl_requirement, :all ] + + # Activate observers that should always be running. + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Configure the default encoding used in templates for Ruby 1.9. + config.encoding = "utf-8" + + # Configure sensitive parameters which will be filtered from the log file. + config.filter_parameters += [:password] + + # Enable escaping HTML in JSON. + config.active_support.escape_html_entities_in_json = true + + # Use SQL instead of Active Record's schema dumper when creating the database. + # This is necessary if your schema can't be completely dumped by the schema dumper, + # like if you have constraints or database-specific column types + # config.active_record.schema_format = :sql + + # Enforce whitelist mode for mass assignment. + # This will create an empty whitelist of attributes available for mass-assignment for all models + # in your app. As such, your models will need to explicitly whitelist or blacklist accessible + # parameters by using an attr_accessible or attr_protected declaration. + config.active_record.whitelist_attributes = true + + # Enable the asset pipeline + config.assets.enabled = true + + # Version of your assets, change this if you want to expire all your assets + config.assets.version = '1.0' + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..4489e58 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,6 @@ +require 'rubygems' + +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..51a4dd4 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +development: + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 + +production: + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..346858f --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the rails application +require File.expand_path('../application', __FILE__) + +# Initialize the rails application +Fetsite::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..7e0febd --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,37 @@ +Fetsite::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send + config.action_mailer.raise_delivery_errors = false +config.action_mailer.default_url_options = { :host => 'localhost:3000' } + # Print deprecation notices to the Rails logger + config.active_support.deprecation = :log + + # Only use best-standards-support built into browsers + config.action_dispatch.best_standards_support = :builtin + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + config.active_record.auto_explain_threshold_in_seconds = 0.5 + + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000..6a0f219 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,67 @@ +Fetsite::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # Code is not reloaded between requests + config.cache_classes = true + + # Full error reports are disabled and caching is turned on + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Disable Rails's static asset server (Apache or nginx will already do this) + config.serve_static_assets = false + + # Compress JavaScripts and CSS + config.assets.compress = true + + # Don't fallback to assets pipeline if a precompiled asset is missed + config.assets.compile = false + + # Generate digests for assets URLs + config.assets.digest = true + + # Defaults to nil and saved in location specified by config.assets.prefix + # config.assets.manifest = YOUR_PATH + + # Specifies the header that your server uses for sending files + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # See everything in the log (default is :info) + # config.log_level = :debug + + # Prepend all log lines with the following tags + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" + + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( search.js ) + + # Disable delivery errors, bad email addresses will be ignored + # config.action_mailer.raise_delivery_errors = false + + # Enable threaded mode + # config.threadsafe! + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation can not be found) + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners + config.active_support.deprecation = :notify + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + # config.active_record.auto_explain_threshold_in_seconds = 0.5 +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..2decd94 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,37 @@ +Fetsite::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Configure static asset server for tests with Cache-Control for performance + config.serve_static_assets = true + config.static_cache_control = "public, max-age=3600" + + # Log error messages when you accidentally call methods on nil + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr +end diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb new file mode 100644 index 0000000..d8e7d07 --- /dev/null +++ b/config/initializers/devise.rb @@ -0,0 +1,250 @@ +# Use this hook to configure devise mailer, warden hooks and so forth. +# Many of these configuration options can be set straight in your model. +Devise.setup do |config| + # ==> Mailer Configuration + # Configure the e-mail address which will be shown in Devise::Mailer, + # note that it will be overwritten if you use your own mailer class with default "from" parameter. + config.mailer_sender = "test@example.com" + + # Configure the class responsible to send e-mails. + # config.mailer = "Devise::Mailer" + config.mailer.default_url_options = { :host => 'localhost:3000' } + config.mailer.delivery_method = :smtp + config.mailer.smtp_settings = { + :address => "smtp.gmail.com", + :port => 587, + :user_name => 'testruby12345@gmail.com', + :password => 't12345678', + :authentication => 'plain', + :enable_starttls_auto => true } + + #config.mailer = "confirmmailer" + # ==> ORM configuration + # Load and configure the ORM. Supports :active_record (default) and + # :mongoid (bson_ext recommended) by default. Other ORMs may be + # available as additional gems. + require 'devise/orm/active_record' + + # ==> Configuration for any authentication mechanism + # Configure which keys are used when authenticating a user. The default is + # just :email. You can configure it to use [:username, :subdomain], so for + # authenticating a user, both parameters are required. Remember that those + # parameters are used only when authenticating and not when retrieving from + # session. If you need permissions, you should implement that in a before filter. + # You can also supply a hash where the value is a boolean determining whether + # or not authentication should be aborted when the value is not present. + # config.authentication_keys = [ :email ] + + # Configure parameters from the request object used for authentication. Each entry + # given should be a request method and it will automatically be passed to the + # find_for_authentication method and considered in your model lookup. For instance, + # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. + # The same considerations mentioned for authentication_keys also apply to request_keys. + # config.request_keys = [] + + # Configure which authentication keys should be case-insensitive. + # These keys will be downcased upon creating or modifying a user and when used + # to authenticate or find a user. Default is :email. + config.case_insensitive_keys = [ :email ] + + # Configure which authentication keys should have whitespace stripped. + # These keys will have whitespace before and after removed upon creating or + # modifying a user and when used to authenticate or find a user. Default is :email. + config.strip_whitespace_keys = [ :email ] + + # Tell if authentication through request.params is enabled. True by default. + # It can be set to an array that will enable params authentication only for the + # given strategies, for example, `config.params_authenticatable = [:database]` will + # enable it only for database (email + password) authentication. + # config.params_authenticatable = true + + # Tell if authentication through HTTP Basic Auth is enabled. False by default. + # It can be set to an array that will enable http authentication only for the + # given strategies, for example, `config.http_authenticatable = [:token]` will + # enable it only for token authentication. + # config.http_authenticatable = false + + # If http headers should be returned for AJAX requests. True by default. + # config.http_authenticatable_on_xhr = true + + # The realm used in Http Basic Authentication. "Application" by default. + # config.http_authentication_realm = "Application" + + # It will change confirmation, password recovery and other workflows + # to behave the same regardless if the e-mail provided was right or wrong. + # Does not affect registerable. + # config.paranoid = true + + # By default Devise will store the user in session. You can skip storage for + # :http_auth and :token_auth by adding those symbols to the array below. + # Notice that if you are skipping storage for all authentication paths, you + # may want to disable generating routes to Devise's sessions controller by + # passing :skip => :sessions to `devise_for` in your config/routes.rb + config.skip_session_storage = [:http_auth] + + # ==> Configuration for :database_authenticatable + # For bcrypt, this is the cost for hashing the password and defaults to 10. If + # using other encryptors, it sets how many times you want the password re-encrypted. + # + # Limiting the stretches to just one in testing will increase the performance of + # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use + # a value less than 10 in other environments. + config.stretches = Rails.env.test? ? 1 : 10 + + # Setup a pepper to generate the encrypted password. + # config.pepper = "651a4e90f98836cdfcd54364486467655381acd7d989b042cc878199e0f9edb0314e5d57658bff1ce794955bb10cc220e54e0b2564976a6434798d50632e058f" + + # ==> Configuration for :confirmable + # A period that the user is allowed to access the website even without + # confirming his account. For instance, if set to 2.days, the user will be + # able to access the website for two days without confirming his account, + # access will be blocked just in the third day. Default is 0.days, meaning + # the user cannot access the website without confirming his account. + # config.allow_unconfirmed_access_for = 2.days + + # A period that the user is allowed to confirm their account before their + # token becomes invalid. For example, if set to 3.days, the user can confirm + # their account within 3 days after the mail was sent, but on the fourth day + # their account can't be confirmed with the token any more. + # Default is nil, meaning there is no restriction on how long a user can take + # before confirming their account. + # config.confirm_within = 3.days + + # If true, requires any email changes to be confirmed (exactly the same way as + # initial account confirmation) to be applied. Requires additional unconfirmed_email + # db field (see migrations). Until confirmed new email is stored in + # unconfirmed email column, and copied to email column on successful confirmation. + config.reconfirmable = true + + # Defines which key will be used when confirming an account + # config.confirmation_keys = [ :email ] + + # ==> Configuration for :rememberable + # The time the user will be remembered without asking for credentials again. + # config.remember_for = 2.weeks + + # If true, extends the user's remember period when remembered via cookie. + # config.extend_remember_period = false + + # Options to be passed to the created cookie. For instance, you can set + # :secure => true in order to force SSL only cookies. + # config.rememberable_options = {} + + # ==> Configuration for :validatable + # Range for password length. Default is 8..128. + config.password_length = 8..128 + + # Email regex used to validate email formats. It simply asserts that + # an one (and only one) @ exists in the given string. This is mainly + # to give user feedback and not to assert the e-mail validity. + # config.email_regexp = /\A[^@]+@[^@]+\z/ + + # ==> Configuration for :timeoutable + # The time you want to timeout the user session without activity. After this + # time the user will be asked for credentials again. Default is 30 minutes. + # config.timeout_in = 30.minutes + + # If true, expires auth token on session timeout. + # config.expire_auth_token_on_timeout = false + + # ==> Configuration for :lockable + # Defines which strategy will be used to lock an account. + # :failed_attempts = Locks an account after a number of failed attempts to sign in. + # :none = No lock strategy. You should handle locking by yourself. + # config.lock_strategy = :failed_attempts + + # Defines which key will be used when locking and unlocking an account + # config.unlock_keys = [ :email ] + + # Defines which strategy will be used to unlock an account. + # :email = Sends an unlock link to the user email + # :time = Re-enables login after a certain amount of time (see :unlock_in below) + # :both = Enables both strategies + # :none = No unlock strategy. You should handle unlocking by yourself. + # config.unlock_strategy = :both + + # Number of authentication tries before locking an account if lock_strategy + # is failed attempts. + # config.maximum_attempts = 20 + + # Time interval to unlock the account if :time is enabled as unlock_strategy. + # config.unlock_in = 1.hour + + # ==> Configuration for :recoverable + # + # Defines which key will be used when recovering the password for an account + # config.reset_password_keys = [ :email ] + + # Time interval you can reset your password with a reset password key. + # Don't put a too small interval or your users won't have the time to + # change their passwords. + config.reset_password_within = 6.hours + + # ==> Configuration for :encryptable + # Allow you to use another encryption algorithm besides bcrypt (default). You can use + # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, + # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) + # and :restful_authentication_sha1 (then you should set stretches to 10, and copy + # REST_AUTH_SITE_KEY to pepper) + # config.encryptor = :sha512 + + # ==> Configuration for :token_authenticatable + # Defines name of the authentication token params key + # config.token_authentication_key = :auth_token + + # ==> Scopes configuration + # Turn scoped views on. Before rendering "sessions/new", it will first check for + # "users/sessions/new". It's turned off by default because it's slower if you + # are using only default views. + # config.scoped_views = false + + # Configure the default scope given to Warden. By default it's the first + # devise role declared in your routes (usually :user). + # config.default_scope = :user + + # Set this configuration to false if you want /users/sign_out to sign out + # only the current scope. By default, Devise signs out all scopes. + # config.sign_out_all_scopes = true + + # ==> Navigation configuration + # Lists the formats that should be treated as navigational. Formats like + # :html, should redirect to the sign in page when the user does not have + # access, but formats like :xml or :json, should return 401. + # + # If you have any extra navigational formats, like :iphone or :mobile, you + # should add them to the navigational formats lists. + # + # The "*/*" below is required to match Internet Explorer requests. + # config.navigational_formats = ["*/*", :html] + + # The default HTTP method used to sign out a resource. Default is :delete. + config.sign_out_via = :delete + + # ==> OmniAuth + # Add a new OmniAuth provider. Check the wiki for more information on setting + # up on your models and hooks. + # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' + + # ==> Warden configuration + # If you want to use other strategies, that are not supported by Devise, or + # change the failure app, you can configure them inside the config.warden block. + # + # config.warden do |manager| + # manager.intercept_401 = false + # manager.default_strategies(:scope => :user).unshift :some_external_strategy + # end + + # ==> Mountable engine configurations + # When using Devise inside an engine, let's call it `MyEngine`, and this engine + # is mountable, there are some extra configurations to be taken into account. + # The following options are available, assuming the engine is mounted as: + # + # mount MyEngine, at: "/my_engine" + # + # The router that invoked `devise_for`, in the example above, would be: + # config.router_name = :my_engine + # + # When using omniauth, Devise cannot automatically set Omniauth path, + # so you need to do it manually. For the users scope, it would be: + # config.omniauth_path_prefix = "/my_engine/users/auth" +end diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb new file mode 100644 index 0000000..befce4d --- /dev/null +++ b/config/initializers/formtastic.rb @@ -0,0 +1,76 @@ +# encoding: utf-8 + +# Set the default text field size when input is a string. Default is nil. +# Formtastic::FormBuilder.default_text_field_size = 50 + +# Set the default text area height when input is a text. Default is 20. +# Formtastic::FormBuilder.default_text_area_height = 5 + +# Set the default text area width when input is a text. Default is nil. +# Formtastic::FormBuilder.default_text_area_width = 50 + +# Should all fields be considered "required" by default? +# Defaults to true. +# Formtastic::FormBuilder.all_fields_required_by_default = true + +# Should select fields have a blank option/prompt by default? +# Defaults to true. +# Formtastic::FormBuilder.include_blank_for_select_by_default = true + +# Set the string that will be appended to the labels/fieldsets which are required +# It accepts string or procs and the default is a localized version of +# '*'. In other words, if you configure formtastic.required +# in your locale, it will replace the abbr title properly. But if you don't want to use +# abbr tag, you can simply give a string as below +# Formtastic::FormBuilder.required_string = "(required)" + +# Set the string that will be appended to the labels/fieldsets which are optional +# Defaults to an empty string ("") and also accepts procs (see required_string above) +# Formtastic::FormBuilder.optional_string = "(optional)" + +# Set the way inline errors will be displayed. +# Defaults to :sentence, valid options are :sentence, :list, :first and :none +# Formtastic::FormBuilder.inline_errors = :sentence +# Formtastic uses the following classes as default for hints, inline_errors and error list + +# If you override the class here, please ensure to override it in your stylesheets as well +# Formtastic::FormBuilder.default_hint_class = "inline-hints" +# Formtastic::FormBuilder.default_inline_error_class = "inline-errors" +# Formtastic::FormBuilder.default_error_list_class = "errors" + +# Set the method to call on label text to transform or format it for human-friendly +# reading when formtastic is used without object. Defaults to :humanize. +# Formtastic::FormBuilder.label_str_method = :humanize + +# Set the array of methods to try calling on parent objects in :select and :radio inputs +# for the text inside each @