Skip to content

Commit

Permalink
Merge branch '672_refactor_role_system' of github.com:hpi-swt2/worksh…
Browse files Browse the repository at this point in the history
…op-portal into 672_refactor_role_system
  • Loading branch information
aloeser committed Jun 2, 2018
2 parents 54eb1b3 + 9387d0b commit fc8a52c
Show file tree
Hide file tree
Showing 34 changed files with 407 additions and 204 deletions.
13 changes: 7 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ GEM
airbrake-ruby (~> 2.3, >= 2.3.1)
airbrake-ruby (2.3.2)
american_date (1.1.1)
annotate (2.7.2)
annotate (2.7.3)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 13.0)
arel (8.0.0)
Expand Down Expand Up @@ -129,7 +129,8 @@ GEM
activesupport (>= 4.1, < 5.2)
hashery (2.1.2)
hashie (3.5.6)
i18n (0.8.6)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
icalendar (2.4.1)
jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3)
Expand Down Expand Up @@ -160,7 +161,7 @@ GEM
mini_magick (4.8.0)
mini_mime (0.1.4)
mini_portile2 (2.2.0)
minitest (5.10.3)
minitest (5.11.3)
nio4r (2.1.0)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
Expand Down Expand Up @@ -241,7 +242,7 @@ GEM
thor (>= 0.18.1, < 2.0)
rainbow (2.2.2)
rake
rake (12.0.0)
rake (12.3.1)
redcarpet (3.4.0)
ref (2.0.0)
responders (2.4.0)
Expand Down Expand Up @@ -314,7 +315,7 @@ GEM
execjs (>= 2.2.2, >= 2.2)
less-rails (>= 2.5.0)
railties (>= 3.1)
tzinfo (1.2.3)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.3.0)
warden (1.2.7)
Expand Down Expand Up @@ -399,4 +400,4 @@ RUBY VERSION
ruby 2.2.2p95

BUNDLED WITH
1.14.6
1.16.2
1 change: 1 addition & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ Vagrant.configure("2") do |config|
apt-get update
apt-get install -y phantomjs
apt-get install -y imagemagick
echo "cd hpi-swt2" >> /home/vagrant/.bashrc
SHELL
end
4 changes: 2 additions & 2 deletions app/models/agreement_letter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Table name: agreement_letters
#
# id :integer not null, primary key
# user_id :integer not null
# event_id :integer not null
# path :string not null
# created_at :datetime not null
# updated_at :datetime not null
# event_id :integer not null
# user_id :integer not null
#
# Indexes
#
Expand Down
27 changes: 16 additions & 11 deletions app/models/application_letter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,37 @@
# Table name: application_letters
#
# id :integer not null, primary key
# motivation :string
# user_id :integer not null
# event_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
# status :integer default(2), not null
# emergency_number :string
# vegetarian :boolean
# vegan :boolean
# allergies :string
# custom_application_fields :text
# annotation :text
# custom_application_fields :text
# emergency_number :string
# motivation :string
# organisation :string
# status :integer default("pending"), not null
# status_notification_sent :boolean default(FALSE), not null
# vegan :boolean
# vegetarian :boolean
# created_at :datetime not null
# updated_at :datetime not null
# event_id :integer not null
# user_id :integer not null
#
# Indexes
#
# index_application_letters_on_event_id (event_id)
# index_application_letters_on_user_id (user_id)
#
# Foreign Keys
#
# fk_rails_... (event_id => events.id)
# fk_rails_... (user_id => users.id)
#

class ApplicationLetter < ActiveRecord::Base
belongs_to :user
belongs_to :event

has_many :application_notes
has_many :application_notes, dependent: :destroy
serialize :custom_application_fields, Array

validates_presence_of :user, :event, :motivation, :emergency_number, :organisation
Expand Down
2 changes: 1 addition & 1 deletion app/models/application_note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
# id :integer not null, primary key
# note :text
# application_letter_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# application_letter_id :integer
#
# Indexes
#
Expand Down
4 changes: 2 additions & 2 deletions app/models/date_range.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Table name: date_ranges
#
# id :integer not null, primary key
# start_date :date
# end_date :date
# event_id :integer
# start_date :date
# created_at :datetime
# updated_at :datetime
# event_id :integer
#
# Indexes
#
Expand Down
4 changes: 2 additions & 2 deletions app/models/email_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# Table name: email_templates
#
# id :integer not null, primary key
# status :integer
# subject :string
# content :text
# hide_recipients :boolean
# status :integer
# subject :string
#

class EmailTemplate < ActiveRecord::Base
Expand Down
20 changes: 10 additions & 10 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
# Table name: events
#
# id :integer not null, primary key
# name :string
# description :text
# max_participants :integer
# created_at :datetime not null
# updated_at :datetime not null
# published :boolean default(FALSE)
# organizer :string
# knowledge_level :string
# acceptances_have_been_sent :boolean default(FALSE)
# application_deadline :date
# custom_application_fields :text
# custom_image :string
# description :text
# hidden :boolean default(FALSE)
# image :string
# knowledge_level :string
# max_participants :integer
# name :string
# organizer :string
# published :boolean default(FALSE)
# rejections_have_been_sent :boolean default(FALSE)
# acceptances_have_been_sent :boolean default(FALSE)
# custom_image :string
# created_at :datetime not null
# updated_at :datetime not null
#

class Event < ActiveRecord::Base
Expand Down
4 changes: 2 additions & 2 deletions app/models/participant_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Table name: participant_groups
#
# id :integer not null, primary key
# user_id :integer
# event_id :integer
# group :integer not null
# event_id :integer
# user_id :integer
#
# Indexes
#
Expand Down
18 changes: 9 additions & 9 deletions app/models/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
# Table name: profiles
#
# id :integer not null, primary key
# user_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
# first_name :string
# last_name :string
# gender :string
# birth_date :date
# street_name :string
# zip_code :string
# city :string
# state :string
# country :string
# discovery_of_site :text
# first_name :string
# gender :string
# last_name :string
# state :string
# street_name :string
# zip_code :string
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer not null
#
# Indexes
#
Expand Down
26 changes: 13 additions & 13 deletions app/models/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
# Table name: requests
#
# id :integer not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# form_of_address :integer
# annotations :text
# contact_person :string
# email :string
# first_name :string
# form_of_address :integer
# grade :string
# knowledge_level :string
# last_name :string
# notes :text
# number_of_participants :integer
# phone_number :string
# school_street :string
# email :string
# topic_of_workshop :text
# time_period :text
# number_of_participants :integer
# knowledge_level :string
# annotations :text
# status :integer default(0)
# school_zip_code_city :string
# contact_person :string
# notes :text
# grade :string
# status :integer default("open")
# time_period :text
# topic_of_workshop :text
# created_at :datetime not null
# updated_at :datetime not null
#

class Request < ActiveRecord::Base
Expand Down
20 changes: 10 additions & 10 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
# Table name: users
#
# id :integer not null, primary key
# current_sign_in_at :datetime
# current_sign_in_ip :string
# email :string default(""), not null
# encrypted_password :string default(""), not null
# reset_password_token :string
# reset_password_sent_at :datetime
# remember_created_at :datetime
# sign_in_count :integer default(0), not null
# current_sign_in_at :datetime
# last_sign_in_at :datetime
# current_sign_in_ip :string
# last_sign_in_ip :string
# created_at :datetime not null
# updated_at :datetime not null
# role :string
# provider :string
# remember_created_at :datetime
# reset_password_sent_at :datetime
# reset_password_token :string
# role :string
# sign_in_count :integer default(0), not null
# uid :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
Expand All @@ -43,7 +43,7 @@ class User < ActiveRecord::Base

def role?(base_role)
return false unless role
raise "invalid role: " + base_role unless ROLES.include?(base_role)
raise 'invalid role: ' + base_role unless ROLES.include?(base_role)

base_role.to_sym == role.to_sym
end
Expand Down
2 changes: 1 addition & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ de:
remember_me: "Eingeloggt bleiben"
midnight: "Mitternacht"
start_page:
welcome_to: "Herzlich Willkommen im"
welcome_to: "Herzlich Willkommen beim"
workshop_portal_hpi_html: "Workshop<div class='row spacer-15'></div>Portal des HPI."
register_now: "Registrieren"
place_request: "Anfrage stellen"
Expand Down
Loading

0 comments on commit fc8a52c

Please sign in to comment.