Merge branch 'master' of https://github.com/CactusPuppy/snapcon into 176895037-add-link-to-view-event-from-admin-page

This commit is contained in:
Jimmy 2021-02-24 22:07:38 -08:00
commit 92d052970a
178 changed files with 2810 additions and 277 deletions

1
.flayignore Normal file
View file

@ -0,0 +1 @@
spec/**/*.rb

24
.github/workflows/pronto.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Pronto
on: [pull_request]
jobs:
pronto:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- run: |
git fetch --no-tags --prune --depth=150 origin +refs/heads/*:refs/remotes/origin/*
- name: Setup Ruby
uses: ruby/setup-ruby@v1
- name: Setup bundler # Install only the linters group.
run: bundle config --global set without default development test staging production
- name: Install pronto
run: bundle install --without default development test staging production
- name: Run Pronto
run: pronto run -f github_status github_pr -c origin/${{ github.base_ref }}
env:
PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}"

80
.gitignore vendored
View file

@ -1,6 +1,27 @@
# Global, for Macs
*~
# Compiled Python files
*.pyc
# Folder view configuration files
.DS_Store
Desktop.ini
# Thumbnail cache files
._*
Thumbs.db
# Files that might appear on external disks
.Spotlight-V100
.Trashes
# Legacy from before Feb 2021
/db/test.sqlite3-journal /db/test.sqlite3-journal
config/application.rb config/application.rb
config/config.yml config/config.yml
config/local_env.yml
config/secrets.yml config/secrets.yml
/vendor/cache /vendor/cache
/vendor/cache-old /vendor/cache-old
@ -41,3 +62,62 @@ docker-compose.override.yml
osem_development osem_development
osem_test osem_test
config/local_env.yml config/local_env.yml
# From GitHub, for Ruby
# https://github.com/github/gitignore/blob/master/Ruby.gitignore
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/
# Used by dotenv library to load environment variables.
# .env
# Ignore Byebug command history file.
.byebug_history
## Specific to RubyMotion:
.dat*
.repl_history
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/
## Specific to RubyMotion (use of CocoaPods):
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# vendor/Pods/
## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/
## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/
# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
.rubocop-https?--*

View file

@ -15,6 +15,14 @@ AllCops:
#################### Style ########################### #################### Style ###########################
Style/CommentAnnotation:
Keywords:
- TODO-SNAPCON
- TODO
- OPTIMIZE
- HACK
- REVIEW
##################### Metrics ################################## ##################### Metrics ##################################
##################### Rails ################################## ##################### Rails ##################################

View file

@ -1 +1 @@
2.5.5 2.5.8

View file

@ -7,6 +7,8 @@ addons:
language: ruby language: ruby
cache: bundler cache: bundler
rvm: rvm:
- 2.5
- 2.6
branches: branches:
except: except:
- /^depfu/.*$/ - /^depfu/.*$/
@ -37,9 +39,8 @@ env:
matrix: matrix:
- TEST_SUITE=ability - TEST_SUITE=ability
- TEST_SUITE=features - TEST_SUITE=features
- TEST_SUITE=linters
- TEST_SUITE=models - TEST_SUITE=models
- TEST_SUITE=controllers - TEST_SUITE=controllers
- TEST_SUITE=rest - TEST_SUITE=rest
matrix: matrix:
fast_finish: true fast_finish: false

27
Gemfile
View file

@ -2,14 +2,13 @@
source 'https://rubygems.org' source 'https://rubygems.org'
ruby '~> 2.5.0' # ruby '~> 2.5.0'
# rails-assets requires >= 1.8.4 # rails-assets requires >= 1.8.4
if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.8.4') if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.8.4')
abort "Bundler version >= 1.8.4 is required" abort "Bundler version >= 1.8.4 is required"
end end
# as web framework
gem 'rails', '~> 5.2' gem 'rails', '~> 5.2'
# Use Puma as the app server # Use Puma as the app server
@ -116,8 +115,8 @@ end
gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47' gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47'
# data tables # data tables
gem 'jquery-datatables'
gem 'ajax-datatables-rails' gem 'ajax-datatables-rails'
gem 'jquery-datatables'
# for charts # for charts
gem 'chartkick' gem 'chartkick'
@ -142,7 +141,9 @@ gem 'rqrcode'
gem 'axlsx', git: 'https://github.com/randym/axlsx.git' gem 'axlsx', git: 'https://github.com/randym/axlsx.git'
gem 'axlsx_rails' gem 'axlsx_rails'
gem 'sentry-raven' gem 'sentry-delayed_job'
gem 'sentry-rails'
gem 'sentry-ruby'
# to make links faster # to make links faster
gem 'turbolinks' gem 'turbolinks'
@ -224,11 +225,7 @@ gem 'dalli'
group :development do group :development do
# to launch specs when files are modified # to launch specs when files are modified
gem 'guard-rspec' gem 'guard-rspec'
gem 'haml_lint'
gem 'spring-commands-rspec' gem 'spring-commands-rspec'
# for static code analisys
gem 'rubocop', require: false
gem 'rubocop-rspec'
# to open mails # to open mails
gem 'letter_opener' gem 'letter_opener'
# view mail at /letter_opener/ # view mail at /letter_opener/
@ -239,6 +236,8 @@ group :development do
gem 'web-console' gem 'web-console'
# as development database # as development database
gem 'sqlite3' gem 'sqlite3'
# prepend models with db schema
gem 'annotate'
end end
group :test do group :test do
@ -270,7 +269,17 @@ group :test do
gem 'pdf-inspector', require: "pdf/inspector" gem 'pdf-inspector', require: "pdf/inspector"
end end
group :development, :test do group :development, :test, :linters do
# as debugger # as debugger
gem 'byebug' gem 'byebug'
gem 'pry'
# Linters and static analysis.
gem 'pronto', require: false
gem 'pronto-flay', require: false
gem 'pronto-haml', require: false
gem 'pronto-rubocop', require: false
gem 'rubocop-rspec', require: false
gem 'haml-lint', require: false
end end

View file

@ -13,25 +13,25 @@ GEM
remote: https://rails-assets.org/ remote: https://rails-assets.org/
specs: specs:
Ascii85 (1.0.3) Ascii85 (1.0.3)
actioncable (5.2.4.4) actioncable (5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
actionmailer (5.2.4.4) actionmailer (5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
actionview (= 5.2.4.4) actionview (= 5.2.4.5)
activejob (= 5.2.4.4) activejob (= 5.2.4.5)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (5.2.4.4) actionpack (5.2.4.5)
actionview (= 5.2.4.4) actionview (= 5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
rack (~> 2.0, >= 2.0.8) rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.4.4) actionview (5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
@ -41,20 +41,20 @@ GEM
activemodel (>= 4.1, < 6.1) activemodel (>= 4.1, < 6.1)
case_transform (>= 0.2) case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3) jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (5.2.4.4) activejob (5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.2.4.4) activemodel (5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
activerecord (5.2.4.4) activerecord (5.2.4.5)
activemodel (= 5.2.4.4) activemodel (= 5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
arel (>= 9.0) arel (>= 9.0)
activestorage (5.2.4.4) activestorage (5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
activerecord (= 5.2.4.4) activerecord (= 5.2.4.5)
marcel (~> 0.3.1) marcel (~> 0.3.1)
activesupport (5.2.4.4) activesupport (5.2.4.5)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
@ -70,6 +70,9 @@ GEM
afm (0.2.2) afm (0.2.2)
ajax-datatables-rails (0.4.3) ajax-datatables-rails (0.4.3)
railties (>= 4.0) railties (>= 4.0)
annotate (3.1.1)
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 14.0)
archive-zip (0.12.0) archive-zip (0.12.0)
io-like (~> 0.3.0) io-like (~> 0.3.0)
arel (9.0.0) arel (9.0.0)
@ -101,10 +104,11 @@ GEM
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
regexp_parser (~> 1.5) regexp_parser (~> 1.5)
xpath (~> 3.2) xpath (~> 3.2)
carrierwave (1.3.1) carrierwave (1.3.2)
activemodel (>= 4.0.0) activemodel (>= 4.0.0)
activesupport (>= 4.0.0) activesupport (>= 4.0.0)
mime-types (>= 1.16) mime-types (>= 1.16)
ssrf_filter (~> 1.0)
carrierwave-bombshelter (0.2.2) carrierwave-bombshelter (0.2.2)
activesupport (>= 3.2.0) activesupport (>= 3.2.0)
carrierwave carrierwave
@ -124,7 +128,7 @@ GEM
json json
simplecov simplecov
coderay (1.1.1) coderay (1.1.1)
concurrent-ruby (1.1.7) concurrent-ruby (1.1.8)
countable-rails (0.0.1) countable-rails (0.0.1)
railties (>= 3.1) railties (>= 3.1)
countries (3.0.0) countries (3.0.0)
@ -162,7 +166,7 @@ GEM
dotenv-rails (2.7.5) dotenv-rails (2.7.5)
dotenv (= 2.7.5) dotenv (= 2.7.5)
railties (>= 3.2, < 6.1) railties (>= 3.2, < 6.1)
erubi (1.9.0) erubi (1.10.0)
erubis (2.7.0) erubis (2.7.0)
execjs (2.7.0) execjs (2.7.0)
factory_bot (4.11.1) factory_bot (4.11.1)
@ -172,11 +176,19 @@ GEM
railties (>= 3.0.0) railties (>= 3.0.0)
faker (1.9.3) faker (1.9.3)
i18n (>= 0.7) i18n (>= 0.7)
faraday (0.15.4) faraday (1.3.0)
faraday-net_http (~> 1.0)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
ruby2_keywords
faraday-net_http (1.0.1)
fastimage (2.1.4) fastimage (2.1.4)
feature (1.4.0) feature (1.4.0)
ffi (1.10.0) ffi (1.10.0)
flay (2.12.1)
erubis (~> 2.7.0)
path_expander (~> 1.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.0)
font-awesome-rails (4.7.0.5) font-awesome-rails (4.7.0.5)
railties (>= 3.2, < 6.1) railties (>= 3.2, < 6.1)
formatador (0.2.5) formatador (0.2.5)
@ -186,6 +198,9 @@ GEM
formtastic (>= 3.0) formtastic (>= 3.0)
geckodriver-helper (0.23.0) geckodriver-helper (0.23.0)
archive-zip (~> 0.7) archive-zip (~> 0.7)
gitlab (4.17.0)
httparty (~> 0.18)
terminal-table (~> 1.5, >= 1.5.1)
globalid (0.4.2) globalid (0.4.2)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
gravtastic (3.2.6) gravtastic (3.2.6)
@ -206,6 +221,8 @@ GEM
haml (5.0.4) haml (5.0.4)
temple (>= 0.8.0) temple (>= 0.8.0)
tilt tilt
haml-lint (0.999.999)
haml_lint
haml-rails (1.0.0) haml-rails (1.0.0)
actionpack (>= 4.0.1) actionpack (>= 4.0.1)
activesupport (>= 4.0.1) activesupport (>= 4.0.1)
@ -220,7 +237,7 @@ GEM
sysexits (~> 1.1) sysexits (~> 1.1)
hashdiff (0.3.7) hashdiff (0.3.7)
hashery (2.1.2) hashery (2.1.2)
hashie (3.6.0) hashie (4.1.0)
html2haml (2.2.0) html2haml (2.2.0)
erubis (~> 2.7.0) erubis (~> 2.7.0)
haml (>= 4.0, < 6) haml (>= 4.0, < 6)
@ -229,7 +246,10 @@ GEM
htmlentities (4.3.4) htmlentities (4.3.4)
http-cookie (1.0.3) http-cookie (1.0.3)
domain_name (~> 0.5) domain_name (~> 0.5)
i18n (1.8.5) httparty (0.18.1)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.8.9)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n_data (0.8.0) i18n_data (0.8.0)
inversion (1.1.1) inversion (1.1.1)
@ -248,7 +268,7 @@ GEM
json-schema (2.8.1) json-schema (2.8.1)
addressable (>= 2.4) addressable (>= 2.4)
jsonapi-renderer (0.2.2) jsonapi-renderer (0.2.2)
jwt (2.1.0) jwt (2.2.2)
launchy (2.4.3) launchy (2.4.3)
addressable (~> 2.3) addressable (~> 2.3)
leaflet-rails (1.5.1) leaflet-rails (1.5.1)
@ -264,7 +284,7 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2) ruby_dep (~> 1.2)
loggability (0.14.0) loggability (0.14.0)
loofah (2.7.0) loofah (2.9.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
lumberjack (1.0.12) lumberjack (1.0.12)
@ -273,9 +293,9 @@ GEM
marcel (0.3.3) marcel (0.3.3)
mimemagic (~> 0.3.2) mimemagic (~> 0.3.2)
method_source (0.8.2) method_source (0.8.2)
mime-types (3.2.2) mime-types (3.3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812) mime-types-data (3.2020.1104)
mimemagic (0.3.5) mimemagic (0.3.5)
mina (1.2.3) mina (1.2.3)
open4 (~> 1.3.4) open4 (~> 1.3.4)
@ -283,7 +303,7 @@ GEM
mini_magick (4.9.5) mini_magick (4.9.5)
mini_mime (1.0.2) mini_mime (1.0.2)
mini_portile2 (2.5.0) mini_portile2 (2.5.0)
minitest (5.14.2) minitest (5.14.3)
momentjs-rails (2.20.1) momentjs-rails (2.20.1)
railties (>= 3.1) railties (>= 3.1)
monetize (1.9.2) monetize (1.9.2)
@ -295,41 +315,45 @@ GEM
monetize (~> 1.9.0) monetize (~> 1.9.0)
money (~> 6.13.2) money (~> 6.13.2)
railties (>= 3.0) railties (>= 3.0)
multi_json (1.14.1) multi_json (1.15.0)
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.1.1) multipart-post (2.1.1)
nenv (0.3.0) nenv (0.3.0)
netrc (0.11.0) netrc (0.11.0)
nio4r (2.5.4) nio4r (2.5.5)
nokogiri (1.11.0) nokogiri (1.11.1)
mini_portile2 (~> 2.5.0) mini_portile2 (~> 2.5.0)
racc (~> 1.4) racc (~> 1.4)
notiffany (0.1.1) notiffany (0.1.1)
nenv (~> 0.1) nenv (~> 0.1)
shellany (~> 0.0) shellany (~> 0.0)
oauth2 (1.4.1) oauth2 (1.4.4)
faraday (>= 0.8, < 0.16.0) faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0) jwt (>= 1.0, < 3.0)
multi_json (~> 1.3) multi_json (~> 1.3)
multi_xml (~> 0.5) multi_xml (~> 0.5)
rack (>= 1.2, < 3) rack (>= 1.2, < 3)
omniauth (1.9.0) octokit (4.20.0)
hashie (>= 3.4.6, < 3.7.0) faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
omniauth (1.9.1)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3) rack (>= 1.6.2, < 3)
omniauth-discourse (1.0.0) omniauth-discourse (1.0.0)
omniauth (~> 1.0) omniauth (~> 1.0)
omniauth-facebook (6.0.0) omniauth-facebook (8.0.0)
omniauth-oauth2 (~> 1.2) omniauth-oauth2 (~> 1.2)
omniauth-github (1.3.0) omniauth-github (1.4.0)
omniauth (~> 1.5) omniauth (~> 1.5)
omniauth-oauth2 (>= 1.4.0, < 2.0) omniauth-oauth2 (>= 1.4.0, < 2.0)
omniauth-google-oauth2 (0.6.1) omniauth-google-oauth2 (0.8.1)
jwt (>= 2.0) jwt (>= 2.0)
omniauth (>= 1.1.1)
omniauth-oauth2 (>= 1.5)
omniauth-oauth2 (1.6.0)
oauth2 (~> 1.1) oauth2 (~> 1.1)
omniauth (~> 1.9) omniauth (>= 1.1.1)
omniauth-oauth2 (>= 1.6)
omniauth-oauth2 (1.7.1)
oauth2 (~> 1.4)
omniauth (>= 1.9, < 3)
omniauth-openid (1.0.1) omniauth-openid (1.0.1)
omniauth (~> 1.0) omniauth (~> 1.0)
rack-openid (~> 1.3.1) rack-openid (~> 1.3.1)
@ -341,6 +365,7 @@ GEM
parallel (1.18.0) parallel (1.18.0)
parser (2.6.5.0) parser (2.6.5.0)
ast (~> 2.4.0) ast (~> 2.4.0)
path_expander (1.1.0)
pdf-core (0.7.0) pdf-core (0.7.0)
pdf-inspector (1.3.0) pdf-inspector (1.3.0)
pdf-reader (>= 1.0, < 3.0.a) pdf-reader (>= 1.0, < 3.0.a)
@ -367,6 +392,24 @@ GEM
rails (>= 3.1.0) rails (>= 3.1.0)
prawn-table (0.2.2) prawn-table (0.2.2)
prawn (>= 1.3.0, < 3.0.0) prawn (>= 1.3.0, < 3.0.0)
pronto (0.11.0)
gitlab (~> 4.4, >= 4.4.0)
httparty (>= 0.13.7)
octokit (~> 4.7, >= 4.7.0)
rainbow (>= 2.2, < 4.0)
rexml (~> 3.2)
rugged (>= 0.23.0, < 1.1.0)
thor (>= 0.20.3, < 2.0)
pronto-flay (0.11.0)
flay (~> 2.8)
pronto (~> 0.11.0)
pronto-haml (0.11.0)
haml_lint (~> 0.23)
pronto (~> 0.11.0)
rubocop (< 1.0)
pronto-rubocop (0.11.1)
pronto (~> 0.11.0)
rubocop (>= 0.63.1, < 2.0)
pry (0.10.4) pry (0.10.4)
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.8.1) method_source (~> 0.8.1)
@ -380,18 +423,18 @@ GEM
ruby-openid (>= 2.1.8) ruby-openid (>= 2.1.8)
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails (5.2.4.4) rails (5.2.4.5)
actioncable (= 5.2.4.4) actioncable (= 5.2.4.5)
actionmailer (= 5.2.4.4) actionmailer (= 5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
actionview (= 5.2.4.4) actionview (= 5.2.4.5)
activejob (= 5.2.4.4) activejob (= 5.2.4.5)
activemodel (= 5.2.4.4) activemodel (= 5.2.4.5)
activerecord (= 5.2.4.4) activerecord (= 5.2.4.5)
activestorage (= 5.2.4.4) activestorage (= 5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
bundler (>= 1.3.0) bundler (>= 1.3.0)
railties (= 5.2.4.4) railties (= 5.2.4.5)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-assets-bootstrap (3.3.6) rails-assets-bootstrap (3.3.6)
rails-assets-jquery (>= 1.9.1, < 3) rails-assets-jquery (>= 1.9.1, < 3)
@ -425,9 +468,9 @@ GEM
rails-i18n (5.1.3) rails-i18n (5.1.3)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
railties (>= 5.0, < 6) railties (>= 5.0, < 6)
railties (5.2.4.4) railties (5.2.4.5)
actionpack (= 5.2.4.4) actionpack (= 5.2.4.5)
activesupport (= 5.2.4.4) activesupport (= 5.2.4.5)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0) thor (>= 0.19.0, < 2.0)
@ -455,6 +498,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0) http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0) mime-types (>= 1.16, < 4.0)
netrc (~> 0.8) netrc (~> 0.8)
rexml (3.2.4)
rolify (5.2.0) rolify (5.2.0)
rqrcode (0.10.1) rqrcode (0.10.1)
chunky_png (~> 1.0) chunky_png (~> 1.0)
@ -496,10 +540,12 @@ GEM
ruby-openid (2.9.2) ruby-openid (2.9.2)
ruby-progressbar (1.10.1) ruby-progressbar (1.10.1)
ruby-rc4 (0.1.5) ruby-rc4 (0.1.5)
ruby2_keywords (0.0.4)
ruby_dep (1.5.0) ruby_dep (1.5.0)
ruby_parser (3.11.0) ruby_parser (3.11.0)
sexp_processor (~> 4.9) sexp_processor (~> 4.9)
rubyzip (1.3.0) rubyzip (1.3.0)
rugged (1.0.1)
safe_yaml (1.0.4) safe_yaml (1.0.4)
sass (3.7.2) sass (3.7.2)
sass-listen (~> 4.0.0) sass-listen (~> 4.0.0)
@ -515,12 +561,25 @@ GEM
sassc (2.0.1) sassc (2.0.1)
ffi (~> 1.9) ffi (~> 1.9)
rake rake
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
selectize-rails (0.12.6) selectize-rails (0.12.6)
selenium-webdriver (3.142.6) selenium-webdriver (3.142.6)
childprocess (>= 0.5, < 4.0) childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2) rubyzip (>= 1.2.2)
sentry-raven (2.13.0) sentry-delayed_job (4.2.1)
faraday (>= 0.7.6, < 1.0) sentry-ruby-core (~> 4.2.0)
sentry-rails (4.2.2)
rails (>= 5.0)
sentry-ruby-core (~> 4.2.0)
sentry-ruby (4.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
faraday (>= 1.0)
sentry-ruby-core (= 4.2.2)
sentry-ruby-core (4.2.2)
concurrent-ruby
faraday
sexp_processor (4.11.0) sexp_processor (4.11.0)
shellany (0.0.1) shellany (0.0.1)
shoulda-matchers (4.1.2) shoulda-matchers (4.1.2)
@ -548,6 +607,7 @@ GEM
activesupport (>= 4.0) activesupport (>= 4.0)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
sqlite3 (1.4.2) sqlite3 (1.4.2)
ssrf_filter (1.0.7)
stripe (5.14.0) stripe (5.14.0)
stripe-ruby-mock (3.0.1) stripe-ruby-mock (3.0.1)
dante (>= 0.2.0) dante (>= 0.2.0)
@ -555,7 +615,9 @@ GEM
stripe (> 5, < 6) stripe (> 5, < 6)
sysexits (1.2.0) sysexits (1.2.0)
temple (0.8.0) temple (0.8.0)
thor (1.0.1) terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thor (1.1.0)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (2.0.9) tilt (2.0.9)
timecop (0.9.1) timecop (0.9.1)
@ -564,7 +626,7 @@ GEM
turbolinks (5.2.1) turbolinks (5.2.1)
turbolinks-source (~> 5.2) turbolinks-source (~> 5.2)
turbolinks-source (5.2.0) turbolinks-source (5.2.0)
tzinfo (1.2.7) tzinfo (1.2.9)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.1.20) uglifier (4.1.20)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
@ -607,6 +669,7 @@ DEPENDENCIES
acts_as_commentable_with_threading acts_as_commentable_with_threading
acts_as_list acts_as_list
ajax-datatables-rails ajax-datatables-rails
annotate
autoprefixer-rails autoprefixer-rails
awesome_nested_set awesome_nested_set
axlsx! axlsx!
@ -642,8 +705,8 @@ DEPENDENCIES
geckodriver-helper geckodriver-helper
gravtastic gravtastic
guard-rspec guard-rspec
haml-lint
haml-rails haml-rails
haml_lint
iso-639 iso-639
jquery-datatables jquery-datatables
jquery-rails jquery-rails
@ -668,6 +731,11 @@ DEPENDENCIES
piwik_analytics (~> 1.0.1) piwik_analytics (~> 1.0.1)
prawn-qrcode prawn-qrcode
prawn-rails prawn-rails
pronto
pronto-flay
pronto-haml
pronto-rubocop
pry
puma (~> 3.0) puma (~> 3.0)
rails (~> 5.2) rails (~> 5.2)
rails-assets-bootstrap-markdown! rails-assets-bootstrap-markdown!
@ -692,12 +760,13 @@ DEPENDENCIES
rqrcode rqrcode
rspec-activemodel-mocks rspec-activemodel-mocks
rspec-rails rspec-rails
rubocop
rubocop-rspec rubocop-rspec
ruby-oembed ruby-oembed
sass-rails (>= 4.0.2) sass-rails (>= 4.0.2)
selectize-rails selectize-rails
sentry-raven sentry-delayed_job
sentry-rails
sentry-ruby
shoulda-matchers shoulda-matchers
skylight skylight
spring-commands-rspec spring-commands-rspec
@ -715,8 +784,5 @@ DEPENDENCIES
webmock webmock
whenever whenever
RUBY VERSION
ruby 2.5.5p157
BUNDLED WITH BUNDLED WITH
1.17.3 1.17.3

View file

@ -1,21 +1,32 @@
[![Build Status](https://travis-ci.org/openSUSE/osem.svg?branch=master)](https://travis-ci.org/openSUSE/osem) [![Build Status](https://travis-ci.com/CactusPuppy/snapcon.svg?branch=master)](https://travis-ci.com/CactusPuppy/snapcon)
[![Code Climate](https://codeclimate.com/github/openSUSE/osem.png)](https://codeclimate.com/github/openSUSE/osem) [![Maintainability](https://api.codeclimate.com/v1/badges/6c7fc446b3b10866ba71/maintainability)](https://codeclimate.com/github/CactusPuppy/snapcon/maintainability)
[![codecov](https://codecov.io/gh/opensuse/osem/branch/master/graph/badge.svg)](https://codecov.io/gh/opensuse/osem) [![codecov](https://codecov.io/gh/CactusPuppy/snapcon/branch/master/graph/badge.svg?token=y4aEAtw6KJ)](https://codecov.io/gh/CactusPuppy/snapcon)
[![Security Status](https://hakiri.io/github/openSUSE/osem/master.svg)](https://hakiri.io/github/openSUSE/osem/master) [![Security Status](https://hakiri.io/github/CactusPuppy/snapcon/master.svg)](https://hakiri.io/github/CactusPuppy/snapcon/master)
[![Dependencies](https://badges.depfu.com/badges/8fcd630367d20f5b48d393774c00c5fd/overview.svg)](https://depfu.com/repos/openSUSE/osem) [![Depfu](https://badges.depfu.com/badges/16eb1ffb3a9f1a36c4e595a5ae2a1dca/overview.svg)](https://depfu.com/github/CactusPuppy/snapcon?project_id=22682)
[![Bluejay Dashboard](https://img.shields.io/badge/Bluejay-Dashboard_5-blue.svg)](http://dashboard.bluejay.governify.io/dashboard/script/dashboardLoader.js?dashboardURL=https://reporter.bluejay.governify.io/api/v4/dashboards/tpa-CS169L-GH-CactusPuppy_snapcon/main)
<a href="https://heroku.com/deploy?template=https://github.com/openSUSE/osem/tree/v1.0"> <a href="https://heroku.com/deploy?template=https://github.com/openSUSE/osem/tree/v1.0">
<img src="https://www.herokucdn.com/deploy/button.svg" height="20px" alt="Deploy"> <img src="https://www.herokucdn.com/deploy/button.svg" height="20px" alt="Deploy">
</a> </a>
<a href="https://www.pivotaltracker.com/n/projects/2487653">
<img src="https://www.pivotaltracker.com/marketing_assets/shared_home/tracker-4679313e699d9ba696371344953de96c81d207d967a43f121d353391c81c9ba7.svg" height="20px" alt="Pivotal Tracker">
</a>
# Open Source Event Manager - [osem.io](https://osem.io) # Open Source Event Manager - [osem.io](https://osem.io)
![OSEM Logo](doc/osem-logo.png) ![OSEM Logo](doc/osem-logo.png)
An event management tool tailored to Free and Open Source Software conferences. An event management tool tailored to Free and Open Source Software conferences.
## Installation ## Installation
Please refer to our [installation guide](INSTALL.md). Please refer to our [installation guide](INSTALL.md).
## How to contribute to OSEM ## How to contribute to OSEM
Please refer to our [contributing guide](CONTRIBUTING.md). Please refer to our [contributing guide](CONTRIBUTING.md).
## Contact ## Contact
GitHub issues are the primary way for communicating about specific proposed changes to this project. If you have other questions feel free to subscribe to the [opensuse-web@opensuse.org](http://lists.opensuse.org/opensuse-web/) mailinglist, all OSEM contributors are on that list! Additionally you can use #osem channel on freenode IRC. GitHub issues are the primary way for communicating about specific proposed changes to this project. If you have other questions feel free to subscribe to the [opensuse-web@opensuse.org](http://lists.opensuse.org/opensuse-web/) mailinglist, all OSEM contributors are on that list! Additionally you can use #osem channel on freenode IRC.

View file

@ -64,6 +64,9 @@ class ConferenceRegistrationsController < ApplicationController
redirect_to conference_conference_registration_path(@conference.short_title), redirect_to conference_conference_registration_path(@conference.short_title),
notice: 'You are now registered and will be receiving E-Mail notifications.' notice: 'You are now registered and will be receiving E-Mail notifications.'
end end
elsif @conference.registration_ticket_required? && !current_user.supports?(@conference)
redirect_to conference_tickets_path(@conference.short_title),
error: 'You must buy a registration ticket before registering.'
else else
flash.now[:error] = "Could not create your registration for #{@conference.title}: "\ flash.now[:error] = "Could not create your registration for #{@conference.title}: "\
"#{@registration.errors.full_messages.join('. ')}." "#{@registration.errors.full_messages.join('. ')}."

View file

@ -31,7 +31,9 @@ class UsersController < ApplicationController
end end
# Somewhat of a hack: users/current/edit # Somewhat of a hack: users/current/edit
# rubocop:disable Naming/MemoizedInstanceVariableName
def load_user def load_user
@user ||= (params[:id] && params[:id] != 'current' && User.find(params[:id]) || current_user) @user ||= (params[:id] && params[:id] != 'current' && User.find(params[:id]) || current_user)
end end
# rubocop:enable Naming/MemoizedInstanceVariableName
end end

View file

@ -1,4 +1,3 @@
# frozen_string_literal: true # frozen_string_literal: true
class UserDatatable < AjaxDatatablesRails::Base class UserDatatable < AjaxDatatablesRails::Base

View file

@ -112,7 +112,7 @@ module ApplicationHelper
concurrent_events << other_event_schedule.event concurrent_events << other_event_schedule.event
end end
end end
concurrent_events.sort_by { |event_schedule| event_schedule.room&.order } concurrent_events.sort_by { |schedule| schedule.room&.order }
end end
def speaker_links(event) def speaker_links(event)
@ -188,11 +188,12 @@ module ApplicationHelper
'hidden' if Date.today > conference.end_date 'hidden' if Date.today > conference.end_date
end end
# TODO:Snap!Con: Replace this with a search for a conference logo. # TODO-SNAPCON: Replace this with a search for a conference logo.
# TODO: If conference is defined, the alt text should be conference name.
def nav_root_link_for(conference = nil) def nav_root_link_for(conference = nil)
path = conference&.id.present? ? conference_path(conference) : root_path path = conference&.id.present? ? conference_path(conference) : root_path
link_to( link_to(
image_tag('snapcon_logo.png'), image_tag('snapcon_logo.png', alt: nav_link_text(conference)),
path, path,
class: 'navbar-brand', class: 'navbar-brand',
title: nav_link_text(conference) title: nav_link_text(conference)

View file

@ -24,6 +24,7 @@ module ConferenceHelper
def short_ticket_description(ticket) def short_ticket_description(ticket)
return unless ticket.description return unless ticket.description
markdown(ticket.description.split("\n").first&.strip) markdown(ticket.description.split("\n").first&.strip)
end end
end end

View file

@ -1,5 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
# TODO: Split this module into smaller modules
# rubocop:disable Metrics/ModuleLength
module EventsHelper module EventsHelper
## ##
# Includes functions related to events # Includes functions related to events
@ -193,7 +195,7 @@ module EventsHelper
end end
end end
def calendar_timestamp(timestamp, timezone) def calendar_timestamp(timestamp, _timezone)
timestamp = timestamp.in_time_zone('GMT') timestamp = timestamp.in_time_zone('GMT')
timestamp -= timestamp.utc_offset timestamp -= timestamp.utc_offset
timestamp.strftime('%Y%m%dT%H%M%S') timestamp.strftime('%Y%m%dT%H%M%S')
@ -221,7 +223,7 @@ module EventsHelper
def calendar_event_text(event, event_schedule, conference) def calendar_event_text(event, event_schedule, conference)
<<~TEXT <<~TEXT
#{conference.title} - #{event.title} #{conference.title} - #{event.title}
#{event_schedule.start_time.strftime("%Y %B %e - %H:%M")} #{event_schedule.timezone} #{event_schedule.start_time.strftime('%Y %B %e - %H:%M')} #{event_schedule.timezone}
More Info: #{conference_program_proposal_url(conference, event)} More Info: #{conference_program_proposal_url(conference, event)}
Join: #{event.url} Join: #{event.url}
@ -256,3 +258,4 @@ module EventsHelper
end end
end end
end end
# rubocop:enable Metrics/ModuleLength

View file

@ -68,6 +68,8 @@ class Ability
end end
# Abilities for signed in users # Abilities for signed in users
# TODO: Refactor into multiple functions
# rubocop:disable Metrics/AbcSize
def signed_in(user) def signed_in(user)
# Abilities from not_signed_in user are also inherited # Abilities from not_signed_in user are also inherited
not_signed_in not_signed_in
@ -140,6 +142,7 @@ class Ability
user == track.submitter && !(track.accepted? || track.confirmed?) user == track.submitter && !(track.accepted? || track.confirmed?)
end end
end end
# rubocop:enable Metrics/AbcSize
# Abilities for users with roles wandering around in non-admin views. # Abilities for users with roles wandering around in non-admin views.
def common_abilities_for_admins(user) def common_abilities_for_admins(user)

View file

@ -1,5 +1,14 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: answers
#
# id :bigint not null, primary key
# title :string
# created_at :datetime
# updated_at :datetime
#
class Answer < ApplicationRecord class Answer < ApplicationRecord
has_many :qanswers has_many :qanswers
has_many :questions, through: :qanswers has_many :questions, through: :qanswers

View file

@ -1,5 +1,21 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: booths
#
# id :bigint not null, primary key
# description :text
# logo_link :string
# reasoning :text
# state :string
# submitter_relationship :text
# title :string
# website_url :string
# created_at :datetime not null
# updated_at :datetime not null
# conference_id :integer
#
class Booth < ApplicationRecord class Booth < ApplicationRecord
include ActiveRecord::Transitions include ActiveRecord::Transitions
has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id } has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id }

View file

@ -1,5 +1,21 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: booth_requests
#
# id :bigint not null, primary key
# role :string
# created_at :datetime not null
# updated_at :datetime not null
# booth_id :integer
# user_id :integer
#
# Indexes
#
# index_booth_requests_on_booth_id (booth_id)
# index_booth_requests_on_user_id (user_id)
#
class BoothRequest < ApplicationRecord class BoothRequest < ApplicationRecord
belongs_to :booth belongs_to :booth
belongs_to :user belongs_to :user

View file

@ -1,5 +1,19 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: cfps
#
# id :bigint not null, primary key
# cfp_type :string
# description :text
# enable_registrations :boolean default(FALSE)
# end_date :date not null
# start_date :date not null
# created_at :datetime
# updated_at :datetime
# program_id :integer
#
# cannot delete program if there are events submitted # cannot delete program if there are events submitted
class Cfp < ApplicationRecord class Cfp < ApplicationRecord

View file

@ -1,5 +1,28 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: comments
#
# id :bigint not null, primary key
# body :text
# commentable_type :string
# lft :integer
# rgt :integer
# subject :string
# title :string(50) default("")
# created_at :datetime
# updated_at :datetime
# commentable_id :integer
# parent_id :integer
# user_id :integer
#
# Indexes
#
# index_comments_on_commentable_id (commentable_id)
# index_comments_on_commentable_type (commentable_type)
# index_comments_on_user_id (user_id)
#
class Comment < ApplicationRecord class Comment < ApplicationRecord
acts_as_nested_set scope: %i(commentable_id commentable_type) acts_as_nested_set scope: %i(commentable_id commentable_type)
validates :body, presence: true validates :body, presence: true

View file

@ -1,5 +1,18 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: commercials
#
# id :bigint not null, primary key
# commercial_type :string
# commercialable_type :string
# url :string
# created_at :datetime
# updated_at :datetime
# commercial_id :string
# commercialable_id :integer
#
class Commercial < ApplicationRecord class Commercial < ApplicationRecord
require 'oembed' require 'oembed'
@ -17,7 +30,7 @@ class Commercial < ApplicationRecord
begin begin
resource = OEmbed::Providers.get(url, maxwidth: 560, maxheight: 315) resource = OEmbed::Providers.get(url, maxwidth: 560, maxheight: 315)
{ html: resource.html.html_safe } { html: resource.html.html_safe }
rescue StandardError => exception rescue StandardError
{ html: iframe_fallback(url) } { html: iframe_fallback(url) }
# { error: exception.message } # { error: exception.message }
end end

View file

@ -1,5 +1,41 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: conferences
#
# id :bigint not null, primary key
# booth_limit :integer default(0)
# color :string
# custom_css :text
# custom_domain :string
# description :text
# end_date :date not null
# end_hour :integer default(20)
# events_per_week :text
# guid :string not null
# logo_file_name :string
# picture :string
# registration_limit :integer default(0)
# revision :integer default(0), not null
# short_title :string not null
# start_date :date not null
# start_hour :integer default(9)
# ticket_layout :integer default("portrait")
# timezone :string not null
# title :string not null
# use_vdays :boolean default(FALSE)
# use_volunteers :boolean
# use_vpositions :boolean default(FALSE)
# created_at :datetime
# updated_at :datetime
# organization_id :integer
#
# Indexes
#
# index_conferences_on_organization_id (organization_id)
#
# rubocop:disable Metrics/ClassLength
class Conference < ApplicationRecord class Conference < ApplicationRecord
include RevisionCount include RevisionCount
require 'uri' require 'uri'
@ -1199,3 +1235,4 @@ class Conference < ApplicationRecord
] ]
end end
end end
# rubocop:enable Metrics/ClassLength

View file

@ -1,5 +1,24 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: contacts
#
# id :bigint not null, primary key
# blog :string
# email :string
# facebook :string
# googleplus :string
# instagram :string
# mastodon :string
# social_tag :string
# sponsor_email :string
# twitter :string
# youtube :string
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class Contact < ApplicationRecord class Contact < ApplicationRecord
has_paper_trail on: [:update], ignore: [:updated_at], meta: { conference_id: :conference_id } has_paper_trail on: [:update], ignore: [:updated_at], meta: { conference_id: :conference_id }

View file

@ -1,5 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: difficulty_levels
#
# id :bigint not null, primary key
# color :string
# description :text
# title :string
# created_at :datetime
# updated_at :datetime
# program_id :integer
#
class DifficultyLevel < ApplicationRecord class DifficultyLevel < ApplicationRecord
belongs_to :program, touch: true belongs_to :program, touch: true
has_many :events, dependent: :nullify has_many :events, dependent: :nullify

View file

@ -1,5 +1,50 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: email_settings
#
# id :bigint not null, primary key
# accepted_body :text
# accepted_subject :string
# booths_acceptance_body :text
# booths_acceptance_subject :string
# booths_rejection_body :text
# booths_rejection_subject :string
# cfp_dates_updated_body :text
# cfp_dates_updated_subject :string
# conference_dates_updated_body :text
# conference_dates_updated_subject :string
# conference_registration_dates_updated_body :text
# conference_registration_dates_updated_subject :string
# confirmed_without_registration_body :text
# confirmed_without_registration_subject :string
# program_schedule_public_body :text
# program_schedule_public_subject :string
# registration_body :text
# registration_subject :string
# rejected_body :text
# rejected_subject :string
# send_on_accepted :boolean default(FALSE)
# send_on_booths_acceptance :boolean default(FALSE)
# send_on_booths_rejection :boolean default(FALSE)
# send_on_cfp_dates_updated :boolean default(FALSE)
# send_on_conference_dates_updated :boolean default(FALSE)
# send_on_conference_registration_dates_updated :boolean default(FALSE)
# send_on_confirmed_without_registration :boolean default(FALSE)
# send_on_program_schedule_public :boolean default(FALSE)
# send_on_registration :boolean default(FALSE)
# send_on_rejected :boolean default(FALSE)
# send_on_submitted_proposal :boolean default(FALSE)
# send_on_venue_updated :boolean default(FALSE)
# submitted_proposal_body :text
# submitted_proposal_subject :string
# venue_updated_body :text
# venue_updated_subject :string
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class EmailSettings < ApplicationRecord class EmailSettings < ApplicationRecord
belongs_to :conference belongs_to :conference

View file

@ -1,5 +1,34 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: events
#
# id :bigint not null, primary key
# abstract :text
# comments_count :integer default(0), not null
# description :text
# guid :string not null
# is_highlight :boolean default(FALSE)
# language :string
# max_attendees :integer
# progress :string default("new"), not null
# proposal_additional_speakers :text
# public :boolean default(TRUE)
# require_registration :boolean
# start_time :datetime
# state :string default("new"), not null
# subtitle :string
# title :string not null
# week :integer
# created_at :datetime
# updated_at :datetime
# difficulty_level_id :integer
# event_type_id :integer
# program_id :integer
# room_id :integer
# track_id :integer
#
class Event < ApplicationRecord class Event < ApplicationRecord
include ActiveRecord::Transitions include ActiveRecord::Transitions
include RevisionCount include RevisionCount
@ -281,7 +310,6 @@ class Event < ApplicationRecord
event_schedules.find_by(schedule_id: selected_schedule_id).try(:happening_now?) event_schedules.find_by(schedule_id: selected_schedule_id).try(:happening_now?)
end end
## ##
# Returns true or false, if the event is already over or not # Returns true or false, if the event is already over or not
# #

View file

@ -1,5 +1,25 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: event_schedules
#
# id :bigint not null, primary key
# enabled :boolean default(TRUE)
# start_time :datetime
# created_at :datetime not null
# updated_at :datetime not null
# event_id :integer
# room_id :integer
# schedule_id :integer
#
# Indexes
#
# index_event_schedules_on_event_id (event_id)
# index_event_schedules_on_event_id_and_schedule_id (event_id,schedule_id) UNIQUE
# index_event_schedules_on_room_id (room_id)
# index_event_schedules_on_schedule_id (schedule_id)
#
class EventSchedule < ApplicationRecord class EventSchedule < ApplicationRecord
default_scope { where(enabled: true) } default_scope { where(enabled: true) }
belongs_to :schedule belongs_to :schedule

View file

@ -1,5 +1,20 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: event_types
#
# id :bigint not null, primary key
# color :string
# description :string
# length :integer default(30)
# maximum_abstract_length :integer default(500)
# minimum_abstract_length :integer default(0)
# title :string not null
# created_at :datetime
# updated_at :datetime
# program_id :integer
#
class EventType < ApplicationRecord class EventType < ApplicationRecord
belongs_to :program, touch: true belongs_to :program, touch: true
has_many :events, dependent: :restrict_with_error has_many :events, dependent: :restrict_with_error

View file

@ -1,5 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: event_users
#
# id :bigint not null, primary key
# comment :string
# event_role :string default("participant"), not null
# created_at :datetime
# updated_at :datetime
# event_id :integer
# user_id :integer
#
class EventUser < ApplicationRecord class EventUser < ApplicationRecord
ROLES = [%w[Speaker speaker], %w[Submitter submitter], %w[Moderator moderator], ROLES = [%w[Speaker speaker], %w[Submitter submitter], %w[Moderator moderator],
%w[Volunteer volunteer]] %w[Volunteer volunteer]]

View file

@ -1,5 +1,15 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: events_registrations
#
# id :bigint not null, primary key
# attended :boolean default(FALSE), not null
# created_at :datetime
# event_id :integer
# registration_id :integer
#
class EventsRegistration < ApplicationRecord class EventsRegistration < ApplicationRecord
belongs_to :registration belongs_to :registration
belongs_to :event belongs_to :event

View file

@ -1,5 +1,22 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: lodgings
#
# id :bigint not null, primary key
# description :text
# name :string
# photo_content_type :string
# photo_file_name :string
# photo_file_size :integer
# photo_updated_at :datetime
# picture :string
# website_link :string
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class Lodging < ApplicationRecord class Lodging < ApplicationRecord
belongs_to :conference belongs_to :conference

View file

@ -1,5 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: openids
#
# id :bigint not null, primary key
# email :string
# provider :string
# uid :string
# created_at :datetime
# updated_at :datetime
# user_id :integer
#
class Openid < ApplicationRecord class Openid < ApplicationRecord
belongs_to :user belongs_to :user
validates :provider, :uid, :email, presence: true validates :provider, :uid, :email, presence: true

View file

@ -1,5 +1,15 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: organizations
#
# id :bigint not null, primary key
# code_of_conduct :text
# description :text
# name :string not null
# picture :string
#
class Organization < ApplicationRecord class Organization < ApplicationRecord
resourcify :roles, dependent: :delete_all resourcify :roles, dependent: :delete_all

View file

@ -1,5 +1,19 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: payments
#
# id :bigint not null, primary key
# amount :integer
# authorization_code :string
# last4 :string
# status :integer default("unpaid"), not null
# created_at :datetime not null
# updated_at :datetime not null
# conference_id :integer not null
# user_id :integer not null
#
class Payment < ApplicationRecord class Payment < ApplicationRecord
has_many :ticket_purchases has_many :ticket_purchases
belongs_to :user belongs_to :user

View file

@ -1,5 +1,19 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: physical_tickets
#
# id :bigint not null, primary key
# token :string
# created_at :datetime not null
# updated_at :datetime not null
# ticket_purchase_id :integer not null
#
# Indexes
#
# index_physical_tickets_on_token (token) UNIQUE
#
class PhysicalTicket < ApplicationRecord class PhysicalTicket < ApplicationRecord
belongs_to :ticket_purchase belongs_to :ticket_purchase
has_one :ticket, through: :ticket_purchase has_one :ticket, through: :ticket_purchase

View file

@ -1,5 +1,27 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: programs
#
# id :bigint not null, primary key
# blind_voting :boolean default(FALSE)
# languages :string
# rating :integer default(0)
# schedule_fluid :boolean default(FALSE)
# schedule_interval :integer default(15), not null
# schedule_public :boolean default(FALSE)
# voting_end_date :datetime
# voting_start_date :datetime
# created_at :datetime
# updated_at :datetime
# conference_id :integer
# selected_schedule_id :integer
#
# Indexes
#
# index_programs_on_selected_schedule_id (selected_schedule_id)
#
# cannot delete program if there are events submitted # cannot delete program if there are events submitted
class Program < ApplicationRecord class Program < ApplicationRecord

View file

@ -1,5 +1,15 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: qanswers
#
# id :bigint not null, primary key
# created_at :datetime
# updated_at :datetime
# answer_id :integer
# question_id :integer
#
class Qanswer < ApplicationRecord class Qanswer < ApplicationRecord
belongs_to :question belongs_to :question
belongs_to :answer, dependent: :delete belongs_to :answer, dependent: :delete

View file

@ -1,5 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: questions
#
# id :bigint not null, primary key
# global :boolean
# title :string
# created_at :datetime
# updated_at :datetime
# conference_id :integer
# question_type_id :integer
#
class Question < ApplicationRecord class Question < ApplicationRecord
belongs_to :question_type belongs_to :question_type
has_and_belongs_to_many :conferences has_and_belongs_to_many :conferences

View file

@ -1,5 +1,14 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: question_types
#
# id :bigint not null, primary key
# title :string
# created_at :datetime
# updated_at :datetime
#
class QuestionType < ApplicationRecord class QuestionType < ApplicationRecord
has_many :questions has_many :questions
end end

View file

@ -1,5 +1,20 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: registrations
#
# id :bigint not null, primary key
# accepted_code_of_conduct :boolean
# attended :boolean default(FALSE)
# other_special_needs :text
# volunteer :boolean
# week :integer
# created_at :datetime
# updated_at :datetime
# conference_id :integer
# user_id :integer
#
class Registration < ApplicationRecord class Registration < ApplicationRecord
require 'csv' require 'csv'
belongs_to :user belongs_to :user
@ -69,7 +84,8 @@ class Registration < ApplicationRecord
end end
def user_has_registration_ticket def user_has_registration_ticket
return if TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any? return if conference.registration_ticket_required? &&
TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any?
errors.add(:base, 'You must purchase a registration ticket before registering') errors.add(:base, 'You must purchase a registration ticket before registering')
if TicketPurchase.where(user: user, ticket: conference.registration_tickets).unpaid.any? if TicketPurchase.where(user: user, ticket: conference.registration_tickets).unpaid.any?

View file

@ -1,5 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: registration_periods
#
# id :bigint not null, primary key
# end_date :date
# start_date :date
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class RegistrationPeriod < ApplicationRecord class RegistrationPeriod < ApplicationRecord
belongs_to :conference belongs_to :conference

View file

@ -1,5 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: resources
#
# id :bigint not null, primary key
# description :text
# name :string
# quantity :integer
# used :integer default(0)
# conference_id :integer
#
class Resource < ApplicationRecord class Resource < ApplicationRecord
belongs_to :conference belongs_to :conference
validates :name, :used, :quantity, presence: true validates :name, :used, :quantity, presence: true

View file

@ -1,5 +1,22 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: roles
#
# id :bigint not null, primary key
# description :string
# name :string
# resource_type :string
# created_at :datetime
# updated_at :datetime
# resource_id :integer
#
# Indexes
#
# index_roles_on_name (name)
# index_roles_on_name_and_resource_type_and_resource_id (name,resource_type,resource_id)
#
class Role < ApplicationRecord class Role < ApplicationRecord
belongs_to :resource, polymorphic: true belongs_to :resource, polymorphic: true
has_many :users_roles has_many :users_roles

View file

@ -1,5 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: rooms
#
# id :bigint not null, primary key
# guid :string not null
# name :string not null
# order :integer
# size :integer
# url :string
# venue_id :integer not null
#
class Room < ApplicationRecord class Room < ApplicationRecord
include RevisionCount include RevisionCount
belongs_to :venue belongs_to :venue

View file

@ -1,5 +1,20 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: schedules
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# program_id :integer
# track_id :integer
#
# Indexes
#
# index_schedules_on_program_id (program_id)
# index_schedules_on_track_id (track_id)
#
class Schedule < ApplicationRecord class Schedule < ApplicationRecord
belongs_to :program belongs_to :program
belongs_to :track belongs_to :track

View file

@ -1,5 +1,30 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: splashpages
#
# id :bigint not null, primary key
# banner_photo_content_type :string
# banner_photo_file_name :string
# banner_photo_file_size :integer
# banner_photo_updated_at :datetime
# include_booths :boolean
# include_cfp :boolean default(FALSE)
# include_lodgings :boolean
# include_program :boolean
# include_registrations :boolean
# include_social_media :boolean
# include_sponsors :boolean
# include_tickets :boolean
# include_tracks :boolean
# include_venue :boolean
# public :boolean
# shuffle_highlights :boolean default(FALSE), not null
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class Splashpage < ApplicationRecord class Splashpage < ApplicationRecord
belongs_to :conference belongs_to :conference

View file

@ -1,5 +1,20 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: sponsors
#
# id :bigint not null, primary key
# description :text
# logo_file_name :string
# name :string
# picture :string
# website_url :string
# created_at :datetime
# updated_at :datetime
# conference_id :integer
# sponsorship_level_id :integer
#
class Sponsor < ApplicationRecord class Sponsor < ApplicationRecord
belongs_to :sponsorship_level belongs_to :sponsorship_level
belongs_to :conference belongs_to :conference

View file

@ -1,5 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: sponsorship_levels
#
# id :bigint not null, primary key
# position :integer
# title :string
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class SponsorshipLevel < ApplicationRecord class SponsorshipLevel < ApplicationRecord
validates :title, presence: true validates :title, presence: true
belongs_to :conference belongs_to :conference

View file

@ -1,5 +1,15 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: subscriptions
#
# id :bigint not null, primary key
# created_at :datetime
# updated_at :datetime
# conference_id :integer
# user_id :integer
#
class Subscription < ApplicationRecord class Subscription < ApplicationRecord
belongs_to :conference belongs_to :conference
belongs_to :user belongs_to :user

View file

@ -1,5 +1,24 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: surveys
#
# id :bigint not null, primary key
# description :text
# end_date :datetime
# start_date :datetime
# surveyable_type :string
# target :integer default("after_conference")
# title :string
# created_at :datetime not null
# updated_at :datetime not null
# surveyable_id :integer
#
# Indexes
#
# index_surveys_on_surveyable_type_and_surveyable_id (surveyable_type,surveyable_id)
#
class Survey < ActiveRecord::Base class Survey < ActiveRecord::Base
belongs_to :surveyable, polymorphic: true belongs_to :surveyable, polymorphic: true
has_many :survey_questions, dependent: :destroy has_many :survey_questions, dependent: :destroy

View file

@ -1,5 +1,18 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: survey_questions
#
# id :bigint not null, primary key
# kind :integer default("boolean")
# mandatory :boolean default(FALSE)
# max_choices :integer
# min_choices :integer
# possible_answers :text
# title :string
# survey_id :integer
#
class SurveyQuestion < ActiveRecord::Base class SurveyQuestion < ActiveRecord::Base
belongs_to :survey belongs_to :survey
has_many :survey_replies, dependent: :destroy has_many :survey_replies, dependent: :destroy

View file

@ -1,5 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: survey_replies
#
# id :bigint not null, primary key
# text :text
# created_at :datetime not null
# updated_at :datetime not null
# survey_question_id :integer
# user_id :integer
#
class SurveyReply < ActiveRecord::Base class SurveyReply < ActiveRecord::Base
belongs_to :user belongs_to :user
belongs_to :survey_question belongs_to :survey_question

View file

@ -1,5 +1,15 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: survey_submissions
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# survey_id :integer
# user_id :integer
#
class SurveySubmission < ActiveRecord::Base class SurveySubmission < ActiveRecord::Base
belongs_to :user belongs_to :user
belongs_to :survey belongs_to :survey

View file

@ -1,5 +1,20 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: tickets
#
# id :bigint not null, primary key
# description :text
# price_cents :integer default(0), not null
# price_currency :string default("USD"), not null
# registration_ticket :boolean default(FALSE)
# title :string not null
# visible :boolean default(TRUE)
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class Ticket < ApplicationRecord class Ticket < ApplicationRecord
belongs_to :conference belongs_to :conference
has_many :ticket_purchases, dependent: :destroy has_many :ticket_purchases, dependent: :destroy

View file

@ -1,5 +1,20 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: ticket_purchases
#
# id :bigint not null, primary key
# amount_paid :float default(0.0)
# paid :boolean default(FALSE)
# quantity :integer default(1)
# week :integer
# created_at :datetime
# conference_id :integer
# payment_id :integer
# ticket_id :integer
# user_id :integer
#
class TicketPurchase < ApplicationRecord class TicketPurchase < ApplicationRecord
belongs_to :ticket belongs_to :ticket
belongs_to :user belongs_to :user
@ -107,6 +122,7 @@ end
def count_purchased_registration_tickets(conference, purchases) def count_purchased_registration_tickets(conference, purchases)
# TODO: WHAT CAUSED THIS??? # TODO: WHAT CAUSED THIS???
return 0 unless purchases return 0 unless purchases
conference.tickets.for_registration.inject(0) do |sum, registration_ticket| conference.tickets.for_registration.inject(0) do |sum, registration_ticket|
sum + purchases[registration_ticket.id.to_s].to_i sum + purchases[registration_ticket.id.to_s].to_i
end end

View file

@ -1,5 +1,14 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: ticket_scannings
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# physical_ticket_id :integer not null
#
class TicketScanning < ApplicationRecord class TicketScanning < ApplicationRecord
belongs_to :physical_ticket belongs_to :physical_ticket

View file

@ -1,5 +1,33 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: tracks
#
# id :bigint not null, primary key
# cfp_active :boolean not null
# color :string
# description :text
# end_date :date
# guid :string not null
# name :string not null
# relevance :text
# short_name :string not null
# start_date :date
# state :string default("new"), not null
# created_at :datetime
# updated_at :datetime
# program_id :integer
# room_id :integer
# selected_schedule_id :integer
# submitter_id :integer
#
# Indexes
#
# index_tracks_on_room_id (room_id)
# index_tracks_on_selected_schedule_id (selected_schedule_id)
# index_tracks_on_submitter_id (submitter_id)
#
class Track < ApplicationRecord class Track < ApplicationRecord
include ActiveRecord::Transitions include ActiveRecord::Transitions
include RevisionCount include RevisionCount

View file

@ -1,5 +1,51 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: users
#
# id :bigint not null, primary key
# affiliation :string
# avatar_content_type :string
# avatar_file_name :string
# avatar_file_size :integer
# avatar_updated_at :datetime
# biography :text
# confirmation_sent_at :datetime
# confirmation_token :string
# confirmed_at :datetime
# current_sign_in_at :datetime
# current_sign_in_ip :string
# email :string default(""), not null
# email_public :boolean default(FALSE)
# encrypted_password :string default(""), not null
# is_admin :boolean default(FALSE)
# is_disabled :boolean default(FALSE)
# languages :string
# last_sign_in_at :datetime
# last_sign_in_ip :string
# mobile :string
# name :string
# nickname :string
# picture :string
# remember_created_at :datetime
# reset_password_sent_at :datetime
# reset_password_token :string
# sign_in_count :integer default(0)
# tshirt :string
# unconfirmed_email :string
# username :string
# volunteer_experience :text
# created_at :datetime
# updated_at :datetime
#
# Indexes
#
# index_users_on_confirmation_token (confirmation_token) UNIQUE
# index_users_on_email (email) UNIQUE
# index_users_on_reset_password_token (reset_password_token) UNIQUE
# index_users_on_username (username) UNIQUE
#
class IChainRecordNotFound < StandardError class IChainRecordNotFound < StandardError
end end
@ -55,9 +101,8 @@ class User < ApplicationRecord
[:database_authenticatable, :registerable, [:database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable, :confirmable,
:omniauthable, :omniauthable,
# omniauth_providers: [:suse, :google, :facebook, :github, :discourse] omniauth_providers: [:suse, :google, :facebook, :github, :discourse]]
omniauth_providers: [:google, :discourse] # omniauth_providers: [:google, :discourse]
]
end end
devise(*devise_modules) devise(*devise_modules)
@ -160,6 +205,7 @@ class User < ApplicationRecord
# Partials should *not* directly call `gravatar_url` # Partials should *not* directly call `gravatar_url`
def profile_picture(opts = {}) def profile_picture(opts = {})
return gravatar_url(opts) unless picture.present? return gravatar_url(opts) unless picture.present?
size = (opts[:size] || 0).to_i size = (opts[:size] || 0).to_i
if size < 50 if size < 50
picture.tiny.url picture.tiny.url
@ -259,7 +305,7 @@ class User < ApplicationRecord
# TODO: Use a real authorization in the right place.... # TODO: Use a real authorization in the right place....
def manages_volunteers?(conference) def manages_volunteers?(conference)
organizer_roles = get_roles['organizer'] organizer_roles = get_roles['organizer']
organizer_roles&.include?(conference.short_title) # TODO or Volunteer Coorinator. organizer_roles&.include?(conference.short_title) # TODO: or Volunteer Coorinator.
end end
def registered def registered
@ -300,7 +346,6 @@ class User < ApplicationRecord
events.where(program_id: conference.program.id, 'event_users.event_role': 'volunteer') events.where(program_id: conference.program.id, 'event_users.event_role': 'volunteer')
end end
def self.empty? def self.empty?
User.count == 1 && User.first.email == 'deleted@localhost.osem' User.count == 1 && User.first.email == 'deleted@localhost.osem'
end end

View file

@ -1,5 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: users_roles
#
# id :bigint not null, primary key
# role_id :integer
# user_id :integer
#
# Indexes
#
# index_users_roles_on_user_id_and_role_id (user_id,role_id)
#
class UsersRole < ApplicationRecord class UsersRole < ApplicationRecord
belongs_to :role belongs_to :role
belongs_to :user belongs_to :user

View file

@ -1,5 +1,13 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: vchoices
#
# id :bigint not null, primary key
# vday_id :integer
# vposition_id :integer
#
class Vchoice < ApplicationRecord class Vchoice < ApplicationRecord
belongs_to :vday belongs_to :vday
belongs_to :vposition belongs_to :vposition

View file

@ -1,5 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: vdays
#
# id :bigint not null, primary key
# day :date
# description :text
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class Vday < ApplicationRecord class Vday < ApplicationRecord
belongs_to :conference belongs_to :conference

View file

@ -1,5 +1,26 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: venues
#
# id :bigint not null, primary key
# city :string
# country :string
# description :text
# guid :string
# latitude :string
# longitude :string
# name :string
# photo_file_name :string
# picture :string
# postalcode :string
# street :string
# website :string
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class Venue < ApplicationRecord class Venue < ApplicationRecord
belongs_to :conference belongs_to :conference
has_one :commercial, as: :commercialable, dependent: :destroy has_one :commercial, as: :commercialable, dependent: :destroy

View file

@ -1,5 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: votes
#
# id :bigint not null, primary key
# rating :integer
# created_at :datetime
# updated_at :datetime
# event_id :integer
# user_id :integer
#
class Vote < ApplicationRecord class Vote < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :event belongs_to :event

View file

@ -1,5 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: vpositions
#
# id :bigint not null, primary key
# description :text
# title :string not null
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
class Vposition < ApplicationRecord class Vposition < ApplicationRecord
belongs_to :conference belongs_to :conference

View file

@ -1,5 +1,40 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: conferences
#
# id :bigint not null, primary key
# booth_limit :integer default(0)
# color :string
# custom_css :text
# custom_domain :string
# description :text
# end_date :date not null
# end_hour :integer default(20)
# events_per_week :text
# guid :string not null
# logo_file_name :string
# picture :string
# registration_limit :integer default(0)
# revision :integer default(0), not null
# short_title :string not null
# start_date :date not null
# start_hour :integer default(9)
# ticket_layout :integer default("portrait")
# timezone :string not null
# title :string not null
# use_vdays :boolean default(FALSE)
# use_volunteers :boolean
# use_vpositions :boolean default(FALSE)
# created_at :datetime
# updated_at :datetime
# organization_id :integer
#
# Indexes
#
# index_conferences_on_organization_id (organization_id)
#
class ConferenceSerializer < ActiveModel::Serializer class ConferenceSerializer < ActiveModel::Serializer
include ApplicationHelper include ApplicationHelper
attributes :short_title, :title, :description, :start_date, :end_date, :picture_url, attributes :short_title, :title, :description, :start_date, :end_date, :picture_url,

View file

@ -1,5 +1,25 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: event_schedules
#
# id :bigint not null, primary key
# enabled :boolean default(TRUE)
# start_time :datetime
# created_at :datetime not null
# updated_at :datetime not null
# event_id :integer
# room_id :integer
# schedule_id :integer
#
# Indexes
#
# index_event_schedules_on_event_id (event_id)
# index_event_schedules_on_event_id_and_schedule_id (event_id,schedule_id) UNIQUE
# index_event_schedules_on_room_id (room_id)
# index_event_schedules_on_schedule_id (schedule_id)
#
class EventScheduleSerializer < ActiveModel::Serializer class EventScheduleSerializer < ActiveModel::Serializer
include ActionView::Helpers::TextHelper include ActionView::Helpers::TextHelper

View file

@ -1,5 +1,34 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: events
#
# id :bigint not null, primary key
# abstract :text
# comments_count :integer default(0), not null
# description :text
# guid :string not null
# is_highlight :boolean default(FALSE)
# language :string
# max_attendees :integer
# progress :string default("new"), not null
# proposal_additional_speakers :text
# public :boolean default(TRUE)
# require_registration :boolean
# start_time :datetime
# state :string default("new"), not null
# subtitle :string
# title :string not null
# week :integer
# created_at :datetime
# updated_at :datetime
# difficulty_level_id :integer
# event_type_id :integer
# program_id :integer
# room_id :integer
# track_id :integer
#
class EventSerializer < ActiveModel::Serializer class EventSerializer < ActiveModel::Serializer
include ActionView::Helpers::TextHelper include ActionView::Helpers::TextHelper

View file

@ -1,5 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: rooms
#
# id :bigint not null, primary key
# guid :string not null
# name :string not null
# order :integer
# size :integer
# url :string
# venue_id :integer not null
#
class RoomSerializer < ActiveModel::Serializer class RoomSerializer < ActiveModel::Serializer
attributes :guid, :name, :description attributes :guid, :name, :description

View file

@ -1,5 +1,33 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: tracks
#
# id :bigint not null, primary key
# cfp_active :boolean not null
# color :string
# description :text
# end_date :date
# guid :string not null
# name :string not null
# relevance :text
# short_name :string not null
# start_date :date
# state :string default("new"), not null
# created_at :datetime
# updated_at :datetime
# program_id :integer
# room_id :integer
# selected_schedule_id :integer
# submitter_id :integer
#
# Indexes
#
# index_tracks_on_room_id (room_id)
# index_tracks_on_selected_schedule_id (selected_schedule_id)
# index_tracks_on_submitter_id (submitter_id)
#
class TrackSerializer < ActiveModel::Serializer class TrackSerializer < ActiveModel::Serializer
attributes :guid, :name, :color attributes :guid, :name, :color
end end

View file

@ -16,7 +16,7 @@
= semantic_form_for(@commercial, url: admin_conference_commercials_path(conference_id: @conference.short_title)) do |f| = semantic_form_for(@commercial, url: admin_conference_commercials_path(conference_id: @conference.short_title)) do |f|
= f.input :url, label: 'URL', as: :string, input_html: { required: 'required', autofocus: true }, = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', autofocus: true },
hint: 'Just paste the url of your video/photo provider. YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' hint: 'Just paste the url of your video/photo provider. YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.'
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true }, label: 'Save Materials'
%hr %hr
- @commercials.each_slice(3) do |slice| - @commercials.each_slice(3) do |slice|
@ -24,10 +24,10 @@
- slice.each do |commercial| - slice.each do |commercial|
- if commercial.persisted? - if commercial.persisted?
.col-md-4 .col-md-4
.thumbnail .panel
.flexvideo{ id: "resource-content-#{commercial.id}" } %div{ id: "resource-content-#{commercial.id}" }
= render partial: 'shared/media_item', locals: { commercial: commercial } = render partial: 'shared/media_item', locals: { commercial: commercial }
.caption .caption.panel-footer
- if can? :update, commercial - if can? :update, commercial
= semantic_form_for commercial, url: admin_conference_commercial_path(conference_id: @conference.short_title, id: commercial) do |f| = semantic_form_for commercial, url: admin_conference_commercial_path(conference_id: @conference.short_title, id: commercial) do |f|
= f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required' }, hint: 'Just paste the url of your video/photo provider' = f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required' }, hint: 'Just paste the url of your video/photo provider'

View file

@ -3,11 +3,13 @@
/ use smaller cell heights for more compact grids / use smaller cell heights for more compact grids
- cell_height = compact_grid ? 32 : 58 - cell_height = compact_grid ? 32 : 58
- date_event_schedules = @event_schedules.select{ |e| e.start_time.to_date.eql? date } - date_event_schedules = @event_schedules.select{ |e| e.start_time.to_date.eql? date }
/ Dynamically set the column width, but no narrower than 2 (on a BS grid of 12)
- col_size = [2, (12 / @rooms.count).to_i ].max
.row .row
- @rooms.each do |room| - @rooms.each do |room|
- non_schedulable = room.tracks.self_organized.confirmed.any? do |track| - non_schedulable = room.tracks.self_organized.confirmed.any? do |track|
- !track.schedules.include?(@schedule) && (track.start_date..track.end_date).include?(date) - !track.schedules.include?(@schedule) && (track.start_date..track.end_date).include?(date)
.col-md-2.col-xs-6{ class: ('non_schedulable' if non_schedulable) } .col-xs-6{ class: "#{('non_schedulable' if non_schedulable)} col-md-#{col_size}" }
.room-name .room-name
- room_date_event_schedules = date_event_schedules.select{ |e| e.room == room } - room_date_event_schedules = date_event_schedules.select{ |e| e.room == room }
= room.name = room.name

View file

@ -6,7 +6,7 @@
.col-md-12 .col-md-12
.row.row-centered.shuffle-deck .row.row-centered.shuffle-deck
- highlights.each do |event| - highlights.each do |event|
- speaker = event.speakers_ordered.first - event.speakers_ordered.each do |speaker|
.col-md-3.col-sm-3.col-centered.col-top.highlights .col-md-3.col-sm-3.col-centered.col-top.highlights
= link_to(conference_program_proposal_path(conference_id, = link_to(conference_program_proposal_path(conference_id,
event), event),

View file

@ -22,17 +22,17 @@
= semantic_form_for(@event.commercials.build, url: conference_program_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event)) do |f| = semantic_form_for(@event.commercials.build, url: conference_program_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event)) do |f|
= f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' }, = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' },
hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.'
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true }, label: 'Save Materials'
%hr %hr
- @event.commercials.each_slice(3) do |slice| - @event.commercials.each_slice(3) do |slice|
.row .row
- slice.each do |commercial| - slice.each do |commercial|
- if commercial.persisted? - if commercial.persisted?
.col-md-4 .col-md-4
.thumbnail .panel.panel-default
.flexvideo{ id: "resource-content-#{commercial.id}"} %div{ id: "resource-content-#{commercial.id}"}
= render partial: 'shared/media_item', locals: { commercial: commercial } = render partial: 'shared/media_item', locals: { commercial: commercial }
.caption .caption.panel-footer
- if can? :update, commercial - if can? :update, commercial
= semantic_form_for commercial, url: conference_program_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event, id: commercial) do |f| = semantic_form_for commercial, url: conference_program_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event, id: commercial) do |f|
= f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required', type: 'url' } = f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required', type: 'url' }

View file

@ -64,7 +64,7 @@
%p.text-right %p.text-right
- if @event.new_record? - if @event.new_record?
= f.submit 'Create Proposal', class: 'btn btn-success' = f.submit 'Submit Proposal', class: 'btn btn-success'
- else - else
= f.submit 'Update Proposal', class: 'btn btn-success' = f.submit 'Update Proposal', class: 'btn btn-success'

View file

@ -1,7 +1,4 @@
.flexvideo .flexvideo
- if commercial.url
= Commercial.render_from_url(commercial.url)[:html]
- else
- if commercial.commercial_type == 'SlideShare' - if commercial.commercial_type == 'SlideShare'
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://www.slideshare.net/slideshow/embed_code/#{commercial.commercial_id}"} %iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://www.slideshare.net/slideshow/embed_code/#{commercial.commercial_id}"}
- elsif commercial.commercial_type == 'Flickr' - elsif commercial.commercial_type == 'Flickr'
@ -12,8 +9,10 @@
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://speakerdeck.com/player/#{commercial.commercial_id}?"} %iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://speakerdeck.com/player/#{commercial.commercial_id}?"}
- elsif commercial.commercial_type == 'Instagram' - elsif commercial.commercial_type == 'Instagram'
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', scrolling: 'no', allowtransparency: 'true', src: "//instagram.com/p/#{commercial.commercial_id}/embed/"} %iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', scrolling: 'no', allowtransparency: 'true', src: "//instagram.com/p/#{commercial.commercial_id}/embed/"}
- else - elsif commercial.commercial_type == 'YouTube'
%iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://www.youtube.com/embed/#{commercial.commercial_id}?rel=0"} %iframe{width: '560', height: '315', frameborder: '0', allowfullscreen: 'true', src: "https://www.youtube.com/embed/#{commercial.commercial_id}?rel=0"}
- elsif commercial.url
= Commercial.render_from_url(commercial.url)[:html]
- if commercial.url - if commercial.url
%br %br
= link_to('Open in a new tab', commercial.url, target: '_blank') = link_to('Open in a new tab', commercial.url, target: '_blank', class: 'btn btn-info')

View file

@ -68,9 +68,11 @@ module Osem
config.before_configuration do config.before_configuration do
env_file = File.join(Rails.root, 'config', 'local_env.yml') env_file = File.join(Rails.root, 'config', 'local_env.yml')
YAML.load(File.open(env_file)).each do |key, value| if File.exist?(env_file)
YAML.safe_load(File.open(env_file)).each do |key, value|
ENV[key.to_s] = value ENV[key.to_s] = value
end if File.exists?(env_file) end
end
end end
end end
end end

View file

@ -1,7 +1,7 @@
Osem::Application.configure do Osem::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb
config.action_mailer.delivery_method = :letter_opener config.action_mailer.delivery_method = :letter_opener_web
# In the development environment your application's code is reloaded on # In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development # every request. This slows down response time but is perfect for development

View file

@ -6,7 +6,7 @@ Devise.setup do |config|
# Define the available openID providers that can be used to log in # Define the available openID providers that can be used to log in
# Pass each provider to User model in :omniauth_providers (for open_id providers use their name) # Pass each provider to User model in :omniauth_providers (for open_id providers use their name)
# config.omniauth :open_id, name: 'suse', identifier: 'http://www.opensuse.org/openid/user' config.omniauth :open_id, name: 'suse', identifier: 'http://www.opensuse.org/openid/user'
config.omniauth :google_oauth2, config.omniauth :google_oauth2,
(ENV['OSEM_GOOGLE_KEY'] || Rails.application.secrets.google_key), (ENV['OSEM_GOOGLE_KEY'] || Rails.application.secrets.google_key),
@ -14,6 +14,7 @@ Devise.setup do |config|
name: 'google', name: 'google',
scope: 'email' scope: 'email'
# TODO-SNAPCON: This ought to be configurable. Use OSEM_DISCOURSE_KEY?
config.omniauth :discourse, config.omniauth :discourse,
sso_url: 'https://forum.snap.berkeley.edu/session/sso_provider', sso_url: 'https://forum.snap.berkeley.edu/session/sso_provider',
sso_secret: ENV['OSEM_DISCOURSE_SECRET'] sso_secret: ENV['OSEM_DISCOURSE_SECRET']

View file

@ -1,4 +1,4 @@
Raven.configure do |config| Sentry.init do |config|
config.enabled_environments = %|production staging|
config.dsn = ENV['SENTRY_DSN'] config.dsn = ENV['SENTRY_DSN']
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
end end

View file

@ -44,11 +44,11 @@ on_worker_boot do
end end
lowlevel_error_handler do |ex, env| lowlevel_error_handler do |ex, env|
Raven.capture_exception( Sentry.capture_exception(
ex, ex,
:message => ex.message, message: ex.message,
:extra => { :puma => env }, extra: { puma: env },
:transaction => "Puma" transaction: "Puma"
) )
# note the below is just a Rack response # note the below is just a Rack response
[500, {}, ["An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact conference@snap.berkeley.edu\n"]] [500, {}, ["An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact conference@snap.berkeley.edu\n"]]

View file

@ -1,6 +1,6 @@
Osem::Application.routes.draw do Osem::Application.routes.draw do
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development? mount LetterOpenerWeb::Engine, at: '/letter_opener' if Rails.env.development?
if ENV['OSEM_ICHAIN_ENABLED'] == 'true' if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
devise_for :users, controllers: { registrations: :registrations } devise_for :users, controllers: { registrations: :registrations }

View file

@ -2,7 +2,7 @@ class AddVisibleToTickets < ActiveRecord::Migration[5.0]
def up def up
add_column :tickets, :visible, :boolean, default: true add_column :tickets, :visible, :boolean, default: true
Ticket.reset_column_information Ticket.reset_column_information
Ticket.update_all(visible: true) # rubocop:disable Rails/SkipsModelValidations Ticket.update_all(visible: true)
end end
def down def down

20
info.yml Normal file
View file

@ -0,0 +1,20 @@
project:
name: 'snapcon'
owner: 'cs169'
teamId: '5'
identities:
pivotal:
url: 'https://www.pivotaltracker.com/n/projects/2487653'
heroku:
url: 'https://cs169l-sp2021-snapcon.herokuapp.com'
travis:
url: 'https://travis-ci.com/github/CactusPuppy/snapcon'
codeclimate:
url: 'https://codeclimate.com/github/CactusPuppy/snapcon'
members:
member1:
name: 'Coby'
surname: 'Zhong'
githubUsername: 'CactusPuppy'
pivotalUsername: 'cobyzhong'
herokuEmail: 'coby.zhong@berkeley.edu'

View file

@ -0,0 +1,59 @@
# NOTE: only doing this in development as some production environments (Heroku)
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
# NOTE: to have a dev-mode tool do its thing in production.
if Rails.env.development?
require 'annotate'
task :set_annotation_options do
# You can override any of these by setting an environment variable of the
# same name.
Annotate.set_defaults(
'active_admin' => 'false',
'additional_file_patterns' => [],
'routes' => 'false',
'models' => 'true',
'position_in_routes' => 'before',
'position_in_class' => 'before',
'position_in_test' => 'before',
'position_in_fixture' => 'before',
'position_in_factory' => 'before',
'position_in_serializer' => 'before',
'show_foreign_keys' => 'true',
'show_complete_foreign_keys' => 'false',
'show_indexes' => 'true',
'simple_indexes' => 'false',
'model_dir' => 'app/models',
'root_dir' => '',
'include_version' => 'false',
'require' => '',
'exclude_tests' => 'false',
'exclude_fixtures' => 'false',
'exclude_factories' => 'false',
'exclude_serializers' => 'false',
'exclude_scaffolds' => 'true',
'exclude_controllers' => 'true',
'exclude_helpers' => 'true',
'exclude_sti_subclasses' => 'false',
'ignore_model_sub_dir' => 'false',
'ignore_columns' => nil,
'ignore_routes' => nil,
'ignore_unknown_models' => 'false',
'hide_limit_column_types' => 'integer,bigint,boolean',
'hide_default_column_types' => 'json,jsonb,hstore',
'skip_on_db_migrate' => 'false',
'format_bare' => 'true',
'format_rdoc' => 'false',
'format_yard' => 'false',
'format_markdown' => 'false',
'sort' => 'false',
'force' => 'false',
'frozen' => 'false',
'classified_sort' => 'true',
'trace' => 'false',
'wrapper_open' => nil,
'wrapper_close' => nil,
'with_comment' => 'true'
)
end
Annotate.load_tasks
end

View file

@ -13,24 +13,24 @@ namespace :db do
end end
end end
desc "Import a given file into the database" desc 'Import a given file into the database'
task :import, [:path] => :environment do |_t, args| task :import, [:path] => :environment do |_t, args|
dump_path = args.path dump_path = args.path
connection_config = ActiveRecord::Base.connection_config connection_config = ActiveRecord::Base.connection_config
case connection_config[:adapter] case connection_config[:adapter]
when "postgresql" when 'postgresql'
system("PGPASSWORD=#{connection_config[:password]} pg_restore " \ system("PGPASSWORD=#{connection_config[:password]} pg_restore " \
"--verbose --clean --no-acl --no-owner " \ '--verbose --clean --no-acl --no-owner ' \
"--username=#{connection_config[:username]} " \ "--username=#{connection_config[:username]} " \
"-d #{connection_config[:database]} #{dump_path}") "-d #{connection_config[:database]} #{dump_path}")
when "mysql", "mysql2" when 'mysql', 'mysql2'
system("mysql -u #{connection_config[:username]} " \ system("mysql -u #{connection_config[:username]} " \
"-p#{connection_config[:password]} " \ "-p#{connection_config[:password]} " \
"#{connection_config[:database]} < #{dump_path}") "#{connection_config[:database]} < #{dump_path}")
else else
raise NotImplementedError, "An importer hasn't been implemented for: " \ raise NotImplementedError.new("An importer hasn't been implemented for: " \
"#{connection_config[:adapter]}" "#{connection_config[:adapter]}")
end end
end end
end end

View file

@ -1,17 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
namespace :registrations do namespace :registrations do
desc "Create missing registrations for those how have a registration ticket." desc 'Create missing registrations for those how have a registration ticket.'
task :create_missing, [:conference] => :environment do |t, args| task :create_missing, [:conference] => :environment do |_t, args|
fail 'Please supply a conference short name.' unless args.conference raise 'Please supply a conference short name.' unless args.conference
conf = Conference.find_by(short_title: args.conference) conf = Conference.find_by(short_title: args.conference)
# Check if a user is found based on the supplied email address # Check if a user is found based on the supplied email address
fail "Coud not find conference #{args.conference}" unless conf raise "Coud not find conference #{args.conference}" unless conf
purchases = conf.ticket_purchases.where(ticket: conf.registration_tickets, paid: true) purchases = conf.ticket_purchases.where(ticket: conf.registration_tickets, paid: true)
unregistered = purchases.select { |tp| !conf.user_registered?(tp.user) } unregistered = purchases.reject { |tp| conf.user_registered?(tp.user) }
puts "Found #{unregistered.count} unregistered users for #{purchases.count} ticket purchases." puts "Found #{unregistered.count} unregistered users for #{purchases.count} ticket purchases."
puts "There are currently #{conf.participants.count} registered users." puts "There are currently #{conf.participants.count} registered users."
@ -19,17 +19,17 @@ namespace :registrations do
puts "Creating registration for #{tp.user.email}" puts "Creating registration for #{tp.user.email}"
Registration.create(user: tp.user, conference: conf) Registration.create(user: tp.user, conference: conf)
end end
puts "Done." puts 'Done.'
end end
desc "Show User emails who have not paid, but did register" desc 'Show User emails who have not paid, but did register'
task :list_unpaid, [:conference] => :environment do |t, args| task :list_unpaid, [:conference] => :environment do |_t, args|
fail 'Please supply a conference short name.' unless args.conference raise 'Please supply a conference short name.' unless args.conference
conf = Conference.find_by(short_title: args.conference) conf = Conference.find_by(short_title: args.conference)
# Check if a user is found based on the supplied email address # Check if a user is found based on the supplied email address
fail "Coud not find conference #{args.conference}" unless conf raise "Coud not find conference #{args.conference}" unless conf
registered = conf.participants registered = conf.participants
unpaid = registered.select do |user| unpaid = registered.select do |user|
@ -41,6 +41,6 @@ namespace :registrations do
unpaid.each do |user| unpaid.each do |user|
puts "'#{user.name}'<#{user.email}>, " puts "'#{user.name}'<#{user.email}>, "
end end
puts "" puts ''
end end
end end

View file

@ -98,7 +98,8 @@ describe Admin::ConferencesController do
expect(response).to render_template :show expect(response).to render_template :show
end end
it 'assigns conference withdrawn events distribution to event_type_distribution_withdrawn' do # TODO-SNAPCON: This is currently disabled due to slow performance.
skip 'assigns conference withdrawn events distribution to event_type_distribution_withdrawn' do
conference conference
create(:event, program: conference.program) create(:event, program: conference.program)
workshop = create(:event_type, title: 'Workshop', color: '#000000', program: conference.program) workshop = create(:event_type, title: 'Workshop', color: '#000000', program: conference.program)
@ -121,7 +122,8 @@ describe Admin::ConferencesController do
expect(assigns(:event_type_distribution_withdrawn)).to eq(result) expect(assigns(:event_type_distribution_withdrawn)).to eq(result)
end end
it 'assigns conference withdrawn difficulty level distribution to difficulty_levels_distribution_withdrawn' do # TODO-SNAPCON: This is currently disabled due to slow performance.
skip 'assigns conference withdrawn difficulty level distribution to difficulty_levels_distribution_withdrawn' do
conference conference
create(:event, program: conference.program) create(:event, program: conference.program)
get :show, params: { id: conference.short_title } get :show, params: { id: conference.short_title }
@ -144,7 +146,8 @@ describe Admin::ConferencesController do
expect(assigns(:difficulty_levels_distribution_withdrawn)).to eq(result) expect(assigns(:difficulty_levels_distribution_withdrawn)).to eq(result)
end end
it 'assigns conference withdrawn track distribution to tracks_distribution_withdrawn' do # TODO-SNAPCON: This is currently disabled due to slow performance.
skip 'assigns conference withdrawn track distribution to tracks_distribution_withdrawn' do
conference conference
create(:event, program: conference.program) create(:event, program: conference.program)
get :show, params: { id: conference.short_title } get :show, params: { id: conference.short_title }

View file

@ -8,7 +8,7 @@ describe UserDatatable do
end end
let(:data_cols) do let(:data_cols) do
[:id, :confirmed_at, :email, :name, :attended, :roles, :view_url, :edit_url, :DT_RowId] [:id, :confirmed_at, :email, :name, :username, :attended, :roles, :view_url, :edit_url, :DT_RowId]
end end
let(:view) do let(:view) do
view = double( view = double(

View file

@ -1,5 +1,21 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: booths
#
# id :bigint not null, primary key
# description :text
# logo_link :string
# reasoning :text
# state :string
# submitter_relationship :text
# title :string
# website_url :string
# created_at :datetime not null
# updated_at :datetime not null
# conference_id :integer
#
FactoryBot.define do FactoryBot.define do
factory :booth do factory :booth do
title { Faker::Hipster.sentence } title { Faker::Hipster.sentence }

View file

@ -1,6 +1,19 @@
# frozen_string_literal: true # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot # == Schema Information
#
# Table name: cfps
#
# id :bigint not null, primary key
# cfp_type :string
# description :text
# enable_registrations :boolean default(FALSE)
# end_date :date not null
# start_date :date not null
# created_at :datetime
# updated_at :datetime
# program_id :integer
#
FactoryBot.define do FactoryBot.define do
factory :cfp do factory :cfp do

View file

@ -1,6 +1,28 @@
# frozen_string_literal: true # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot # == Schema Information
#
# Table name: comments
#
# id :bigint not null, primary key
# body :text
# commentable_type :string
# lft :integer
# rgt :integer
# subject :string
# title :string(50) default("")
# created_at :datetime
# updated_at :datetime
# commentable_id :integer
# parent_id :integer
# user_id :integer
#
# Indexes
#
# index_comments_on_commentable_id (commentable_id)
# index_comments_on_commentable_type (commentable_type)
# index_comments_on_user_id (user_id)
#
FactoryBot.define do FactoryBot.define do
factory :comment do factory :comment do

View file

@ -1,6 +1,18 @@
# frozen_string_literal: true # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot # == Schema Information
#
# Table name: commercials
#
# id :bigint not null, primary key
# commercial_type :string
# commercialable_type :string
# url :string
# created_at :datetime
# updated_at :datetime
# commercial_id :string
# commercialable_id :integer
#
FactoryBot.define do FactoryBot.define do
factory :commercial do factory :commercial do

View file

@ -1,6 +1,40 @@
# frozen_string_literal: true # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot # == Schema Information
#
# Table name: conferences
#
# id :bigint not null, primary key
# booth_limit :integer default(0)
# color :string
# custom_css :text
# custom_domain :string
# description :text
# end_date :date not null
# end_hour :integer default(20)
# events_per_week :text
# guid :string not null
# logo_file_name :string
# picture :string
# registration_limit :integer default(0)
# revision :integer default(0), not null
# short_title :string not null
# start_date :date not null
# start_hour :integer default(9)
# ticket_layout :integer default("portrait")
# timezone :string not null
# title :string not null
# use_vdays :boolean default(FALSE)
# use_volunteers :boolean
# use_vpositions :boolean default(FALSE)
# created_at :datetime
# updated_at :datetime
# organization_id :integer
#
# Indexes
#
# index_conferences_on_organization_id (organization_id)
#
FactoryBot.define do FactoryBot.define do
factory :conference do factory :conference do

View file

@ -1,5 +1,24 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: contacts
#
# id :bigint not null, primary key
# blog :string
# email :string
# facebook :string
# googleplus :string
# instagram :string
# mastodon :string
# social_tag :string
# sponsor_email :string
# twitter :string
# youtube :string
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
FactoryBot.define do FactoryBot.define do
factory :contact do factory :contact do
social_tag { SecureRandom.urlsafe_base64(4) } social_tag { SecureRandom.urlsafe_base64(4) }

View file

@ -1,5 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information
#
# Table name: difficulty_levels
#
# id :bigint not null, primary key
# color :string
# description :text
# title :string
# created_at :datetime
# updated_at :datetime
# program_id :integer
#
FactoryBot.define do FactoryBot.define do
factory :difficulty_level do factory :difficulty_level do
title { 'Example Difficulty Level' } title { 'Example Difficulty Level' }

View file

@ -1,6 +1,50 @@
# frozen_string_literal: true # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot # == Schema Information
#
# Table name: email_settings
#
# id :bigint not null, primary key
# accepted_body :text
# accepted_subject :string
# booths_acceptance_body :text
# booths_acceptance_subject :string
# booths_rejection_body :text
# booths_rejection_subject :string
# cfp_dates_updated_body :text
# cfp_dates_updated_subject :string
# conference_dates_updated_body :text
# conference_dates_updated_subject :string
# conference_registration_dates_updated_body :text
# conference_registration_dates_updated_subject :string
# confirmed_without_registration_body :text
# confirmed_without_registration_subject :string
# program_schedule_public_body :text
# program_schedule_public_subject :string
# registration_body :text
# registration_subject :string
# rejected_body :text
# rejected_subject :string
# send_on_accepted :boolean default(FALSE)
# send_on_booths_acceptance :boolean default(FALSE)
# send_on_booths_rejection :boolean default(FALSE)
# send_on_cfp_dates_updated :boolean default(FALSE)
# send_on_conference_dates_updated :boolean default(FALSE)
# send_on_conference_registration_dates_updated :boolean default(FALSE)
# send_on_confirmed_without_registration :boolean default(FALSE)
# send_on_program_schedule_public :boolean default(FALSE)
# send_on_registration :boolean default(FALSE)
# send_on_rejected :boolean default(FALSE)
# send_on_submitted_proposal :boolean default(FALSE)
# send_on_venue_updated :boolean default(FALSE)
# submitted_proposal_body :text
# submitted_proposal_subject :string
# venue_updated_body :text
# venue_updated_subject :string
# created_at :datetime
# updated_at :datetime
# conference_id :integer
#
FactoryBot.define do FactoryBot.define do
factory :email_settings do factory :email_settings do

View file

@ -1,6 +1,20 @@
# frozen_string_literal: true # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot # == Schema Information
#
# Table name: event_types
#
# id :bigint not null, primary key
# color :string
# description :string
# length :integer default(30)
# maximum_abstract_length :integer default(500)
# minimum_abstract_length :integer default(0)
# title :string not null
# created_at :datetime
# updated_at :datetime
# program_id :integer
#
FactoryBot.define do FactoryBot.define do
factory :event_type do factory :event_type do

View file

@ -1,6 +1,17 @@
# frozen_string_literal: true # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot # == Schema Information
#
# Table name: event_users
#
# id :bigint not null, primary key
# comment :string
# event_role :string default("participant"), not null
# created_at :datetime
# updated_at :datetime
# event_id :integer
# user_id :integer
#
FactoryBot.define do FactoryBot.define do
factory :event_user do factory :event_user do

View file

@ -1,6 +1,34 @@
# frozen_string_literal: true # frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot # == Schema Information
#
# Table name: events
#
# id :bigint not null, primary key
# abstract :text
# comments_count :integer default(0), not null
# description :text
# guid :string not null
# is_highlight :boolean default(FALSE)
# language :string
# max_attendees :integer
# progress :string default("new"), not null
# proposal_additional_speakers :text
# public :boolean default(TRUE)
# require_registration :boolean
# start_time :datetime
# state :string default("new"), not null
# subtitle :string
# title :string not null
# week :integer
# created_at :datetime
# updated_at :datetime
# difficulty_level_id :integer
# event_type_id :integer
# program_id :integer
# room_id :integer
# track_id :integer
#
FactoryBot.define do FactoryBot.define do
factory :event do factory :event do

Some files were not shown because too many files have changed in this diff Show more