mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Merge branch 'development'
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
language: ruby
|
language: ruby
|
||||||
rvm:
|
rvm:
|
||||||
- 2.3.0
|
- 2.4.0
|
||||||
env:
|
env:
|
||||||
- DB=sqlite
|
- DB=sqlite
|
||||||
script:
|
script:
|
||||||
@@ -14,3 +14,4 @@ deploy:
|
|||||||
on:
|
on:
|
||||||
repo: jcwimer/wrestlingApp
|
repo: jcwimer/wrestlingApp
|
||||||
branch: master
|
branch: master
|
||||||
|
run: "rake db:migrate RAILS_ENV=production"
|
||||||
|
|||||||
54
Gemfile
54
Gemfile
@@ -1,15 +1,15 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
ruby '2.3.0'
|
ruby '2.4.0'
|
||||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||||
gem 'rails', '4.2.5'
|
gem 'rails', '5.1.1'
|
||||||
# Use sqlite3 as the database for Active Record
|
# Use sqlite3 as the database for Active Record
|
||||||
gem 'sqlite3', :group => :development
|
gem 'sqlite3', :group => :development
|
||||||
|
|
||||||
# Use Uglifier as compressor for JavaScript assets
|
# Use Uglifier as compressor for JavaScript assets
|
||||||
gem 'uglifier', '>= 1.3.0'
|
gem 'uglifier'
|
||||||
# Use CoffeeScript for .js.coffee assets and views
|
# Use CoffeeScript for .js.coffee assets and views
|
||||||
gem 'coffee-rails', '~> 4.0.0'
|
gem 'coffee-rails'
|
||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
# gem 'therubyracer', platforms: :ruby
|
# gem 'therubyracer', platforms: :ruby
|
||||||
|
|
||||||
@@ -18,9 +18,9 @@ gem 'jquery-rails'
|
|||||||
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
||||||
gem 'turbolinks'
|
gem 'turbolinks'
|
||||||
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
||||||
gem 'jbuilder', '~> 2.0'
|
gem 'jbuilder'
|
||||||
# bundle exec rake doc:rails generates the API under doc/api.
|
# bundle exec rake doc:rails generates the API under doc/api.
|
||||||
gem 'sdoc', '~> 0.4.0', :group => :doc
|
gem 'sdoc', :group => :doc
|
||||||
|
|
||||||
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
||||||
gem 'spring', :group => :development
|
gem 'spring', :group => :development
|
||||||
@@ -39,26 +39,24 @@ gem 'spring', :group => :development
|
|||||||
|
|
||||||
|
|
||||||
#Installed by me
|
#Installed by me
|
||||||
#For Heroku
|
group :production do
|
||||||
group :production do
|
gem 'rails_12factor'
|
||||||
gem 'rails_12factor'
|
gem 'mysql2'
|
||||||
gem 'mysql2'
|
gem 'therubyracer'
|
||||||
gem 'passenger'
|
gem 'newrelic_rpm'
|
||||||
gem 'therubyracer'
|
gem 'dalli'
|
||||||
gem 'newrelic_rpm'
|
end
|
||||||
gem 'dalli'
|
|
||||||
end
|
gem 'devise'
|
||||||
#Other
|
gem 'cancancan'
|
||||||
gem 'devise'
|
gem 'round_robin_tournament'
|
||||||
gem 'cancancan'
|
gem 'rb-readline'
|
||||||
gem 'round_robin_tournament'
|
gem 'delayed_job_active_record'
|
||||||
gem 'rb-readline'
|
gem 'puma'
|
||||||
gem 'delayed_job_active_record'
|
|
||||||
gem 'puma'
|
group :development do
|
||||||
gem 'brakeman'
|
gem 'rubocop'
|
||||||
gem 'rails-lineman'
|
gem 'bullet'
|
||||||
group :development do
|
gem 'brakeman'
|
||||||
|
end
|
||||||
#gem 'bullet'
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|||||||
317
Gemfile.lock
317
Gemfile.lock
@@ -1,227 +1,220 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (4.2.5)
|
actioncable (5.1.1)
|
||||||
actionpack (= 4.2.5)
|
actionpack (= 5.1.1)
|
||||||
actionview (= 4.2.5)
|
nio4r (~> 2.0)
|
||||||
activejob (= 4.2.5)
|
websocket-driver (~> 0.6.1)
|
||||||
|
actionmailer (5.1.1)
|
||||||
|
actionpack (= 5.1.1)
|
||||||
|
actionview (= 5.1.1)
|
||||||
|
activejob (= 5.1.1)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (4.2.5)
|
actionpack (5.1.1)
|
||||||
actionview (= 4.2.5)
|
actionview (= 5.1.1)
|
||||||
activesupport (= 4.2.5)
|
activesupport (= 5.1.1)
|
||||||
rack (~> 1.6)
|
rack (~> 2.0)
|
||||||
rack-test (~> 0.6.2)
|
rack-test (~> 0.6.3)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
actionview (4.2.5)
|
actionview (5.1.1)
|
||||||
activesupport (= 4.2.5)
|
activesupport (= 5.1.1)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubis (~> 2.7.0)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
||||||
activejob (4.2.5)
|
activejob (5.1.1)
|
||||||
activesupport (= 4.2.5)
|
activesupport (= 5.1.1)
|
||||||
globalid (>= 0.3.0)
|
globalid (>= 0.3.6)
|
||||||
activemodel (4.2.5)
|
activemodel (5.1.1)
|
||||||
activesupport (= 4.2.5)
|
activesupport (= 5.1.1)
|
||||||
builder (~> 3.1)
|
activerecord (5.1.1)
|
||||||
activerecord (4.2.5)
|
activemodel (= 5.1.1)
|
||||||
activemodel (= 4.2.5)
|
activesupport (= 5.1.1)
|
||||||
activesupport (= 4.2.5)
|
arel (~> 8.0)
|
||||||
arel (~> 6.0)
|
activesupport (5.1.1)
|
||||||
activesupport (4.2.5)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (~> 0.7)
|
i18n (~> 0.7)
|
||||||
json (~> 1.7, >= 1.7.7)
|
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
thread_safe (~> 0.3, >= 0.3.4)
|
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
arel (6.0.3)
|
arel (8.0.0)
|
||||||
bcrypt (3.1.10)
|
ast (2.3.0)
|
||||||
brakeman (3.1.5)
|
bcrypt (3.1.11)
|
||||||
erubis (~> 2.6)
|
brakeman (3.7.2)
|
||||||
fastercsv (~> 1.5)
|
builder (3.2.3)
|
||||||
haml (>= 3.0, < 5.0)
|
bullet (5.6.1)
|
||||||
highline (>= 1.6.20, < 2.0)
|
activesupport (>= 3.0.0)
|
||||||
multi_json (~> 1.2)
|
uniform_notifier (~> 1.10.0)
|
||||||
ruby2ruby (>= 2.1.1, < 2.3.0)
|
cancancan (2.0.0)
|
||||||
ruby_parser (~> 3.7.0)
|
coffee-rails (4.2.2)
|
||||||
safe_yaml (>= 1.0)
|
|
||||||
sass (~> 3.0)
|
|
||||||
slim (>= 1.3.6, < 4.0)
|
|
||||||
terminal-table (~> 1.4)
|
|
||||||
builder (3.2.2)
|
|
||||||
cancancan (1.10.1)
|
|
||||||
coffee-rails (4.0.1)
|
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0)
|
||||||
coffee-script (2.4.1)
|
coffee-script (2.4.1)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.9.1.1)
|
coffee-script-source (1.12.2)
|
||||||
concurrent-ruby (1.0.0)
|
concurrent-ruby (1.0.5)
|
||||||
dalli (2.7.5)
|
dalli (2.7.6)
|
||||||
delayed_job (4.1.1)
|
delayed_job (4.1.3)
|
||||||
activesupport (>= 3.0, < 5.0)
|
activesupport (>= 3.0, < 5.2)
|
||||||
delayed_job_active_record (4.1.0)
|
delayed_job_active_record (4.1.2)
|
||||||
activerecord (>= 3.0, < 5)
|
activerecord (>= 3.0, < 5.2)
|
||||||
delayed_job (>= 3.0, < 5)
|
delayed_job (>= 3.0, < 5)
|
||||||
devise (3.4.1)
|
devise (4.3.0)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
railties (>= 3.2.6, < 5)
|
railties (>= 4.1.0, < 5.2)
|
||||||
responders
|
responders
|
||||||
thread_safe (~> 0.1)
|
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
erubis (2.7.0)
|
erubi (1.6.1)
|
||||||
execjs (2.5.2)
|
execjs (2.7.0)
|
||||||
fastercsv (1.5.5)
|
globalid (0.4.0)
|
||||||
globalid (0.3.6)
|
activesupport (>= 4.2.0)
|
||||||
activesupport (>= 4.1.0)
|
i18n (0.8.6)
|
||||||
haml (4.0.7)
|
jbuilder (2.7.0)
|
||||||
tilt
|
activesupport (>= 4.2.0)
|
||||||
highline (1.7.8)
|
multi_json (>= 1.2)
|
||||||
i18n (0.7.0)
|
jquery-rails (4.3.1)
|
||||||
jbuilder (2.2.13)
|
rails-dom-testing (>= 1, < 3)
|
||||||
activesupport (>= 3.0.0, < 5)
|
|
||||||
multi_json (~> 1.2)
|
|
||||||
jquery-rails (4.0.3)
|
|
||||||
rails-dom-testing (~> 1.0)
|
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (1.8.3)
|
json (1.8.6)
|
||||||
libv8 (3.16.14.7)
|
libv8 (3.16.14.19)
|
||||||
loofah (2.0.3)
|
loofah (2.0.3)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.6.3)
|
mail (2.6.6)
|
||||||
mime-types (>= 1.16, < 3)
|
mime-types (>= 1.16, < 4)
|
||||||
mime-types (2.99)
|
method_source (0.8.2)
|
||||||
mini_portile2 (2.0.0)
|
mime-types (3.1)
|
||||||
minitest (5.8.3)
|
mime-types-data (~> 3.2015)
|
||||||
multi_json (1.11.0)
|
mime-types-data (3.2016.0521)
|
||||||
mysql2 (0.3.18)
|
mini_portile2 (2.2.0)
|
||||||
newrelic_rpm (3.13.2.302)
|
minitest (5.10.3)
|
||||||
nokogiri (1.6.7)
|
multi_json (1.12.2)
|
||||||
mini_portile2 (~> 2.0.0.rc2)
|
mysql2 (0.4.9)
|
||||||
|
newrelic_rpm (4.4.0.336)
|
||||||
|
nio4r (2.1.0)
|
||||||
|
nokogiri (1.8.0)
|
||||||
|
mini_portile2 (~> 2.2.0)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
passenger (5.0.7)
|
parallel (1.12.0)
|
||||||
rack
|
parser (2.4.0.0)
|
||||||
rake (>= 0.8.1)
|
ast (~> 2.2)
|
||||||
puma (2.11.2)
|
powerpack (0.1.1)
|
||||||
rack (>= 1.1, < 2.0)
|
puma (3.10.0)
|
||||||
rack (1.6.4)
|
rack (2.0.3)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (4.2.5)
|
rails (5.1.1)
|
||||||
actionmailer (= 4.2.5)
|
actioncable (= 5.1.1)
|
||||||
actionpack (= 4.2.5)
|
actionmailer (= 5.1.1)
|
||||||
actionview (= 4.2.5)
|
actionpack (= 5.1.1)
|
||||||
activejob (= 4.2.5)
|
actionview (= 5.1.1)
|
||||||
activemodel (= 4.2.5)
|
activejob (= 5.1.1)
|
||||||
activerecord (= 4.2.5)
|
activemodel (= 5.1.1)
|
||||||
activesupport (= 4.2.5)
|
activerecord (= 5.1.1)
|
||||||
|
activesupport (= 5.1.1)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.2.5)
|
railties (= 5.1.1)
|
||||||
sprockets-rails
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-deprecated_sanitizer (1.0.3)
|
rails-dom-testing (2.0.3)
|
||||||
activesupport (>= 4.2.0.alpha)
|
activesupport (>= 4.2.0)
|
||||||
rails-dom-testing (1.0.7)
|
nokogiri (>= 1.6)
|
||||||
activesupport (>= 4.2.0.beta, < 5.0)
|
rails-html-sanitizer (1.0.3)
|
||||||
nokogiri (~> 1.6.0)
|
|
||||||
rails-deprecated_sanitizer (>= 1.0.1)
|
|
||||||
rails-html-sanitizer (1.0.2)
|
|
||||||
loofah (~> 2.0)
|
loofah (~> 2.0)
|
||||||
rails-lineman (0.3.0)
|
|
||||||
rake
|
|
||||||
rails_12factor (0.0.3)
|
rails_12factor (0.0.3)
|
||||||
rails_serve_static_assets
|
rails_serve_static_assets
|
||||||
rails_stdout_logging
|
rails_stdout_logging
|
||||||
rails_serve_static_assets (0.0.4)
|
rails_serve_static_assets (0.0.5)
|
||||||
rails_stdout_logging (0.0.3)
|
rails_stdout_logging (0.0.5)
|
||||||
railties (4.2.5)
|
railties (5.1.1)
|
||||||
actionpack (= 4.2.5)
|
actionpack (= 5.1.1)
|
||||||
activesupport (= 4.2.5)
|
activesupport (= 5.1.1)
|
||||||
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rake (10.4.2)
|
rainbow (2.2.2)
|
||||||
rb-readline (0.5.2)
|
rake
|
||||||
rdoc (4.2.0)
|
rake (12.1.0)
|
||||||
json (~> 1.4)
|
rb-readline (0.5.5)
|
||||||
ref (1.0.5)
|
rdoc (4.3.0)
|
||||||
responders (2.1.0)
|
ref (2.0.0)
|
||||||
railties (>= 4.2.0, < 5)
|
responders (2.4.0)
|
||||||
|
actionpack (>= 4.2.0, < 5.3)
|
||||||
|
railties (>= 4.2.0, < 5.3)
|
||||||
round_robin_tournament (0.0.1)
|
round_robin_tournament (0.0.1)
|
||||||
ruby2ruby (2.2.0)
|
rubocop (0.49.1)
|
||||||
ruby_parser (~> 3.1)
|
parallel (~> 1.10)
|
||||||
sexp_processor (~> 4.0)
|
parser (>= 2.3.3.1, < 3.0)
|
||||||
ruby_parser (3.7.3)
|
powerpack (~> 0.1)
|
||||||
sexp_processor (~> 4.1)
|
rainbow (>= 1.99.1, < 3.0)
|
||||||
safe_yaml (1.0.4)
|
ruby-progressbar (~> 1.7)
|
||||||
sass (3.4.21)
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||||
sdoc (0.4.1)
|
ruby-progressbar (1.8.1)
|
||||||
|
sdoc (0.4.2)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
rdoc (~> 4.0)
|
rdoc (~> 4.0)
|
||||||
sexp_processor (4.6.1)
|
spring (2.0.2)
|
||||||
slim (3.0.6)
|
activesupport (>= 4.2)
|
||||||
temple (~> 0.7.3)
|
sprockets (3.7.1)
|
||||||
tilt (>= 1.3.3, < 2.1)
|
|
||||||
spring (1.3.5)
|
|
||||||
sprockets (3.5.0)
|
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (2.3.3)
|
sprockets-rails (3.2.1)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 4.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 4.0)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 3.0.0)
|
||||||
sqlite3 (1.3.10)
|
sqlite3 (1.3.13)
|
||||||
temple (0.7.6)
|
therubyracer (0.12.3)
|
||||||
terminal-table (1.5.2)
|
libv8 (~> 3.16.14.15)
|
||||||
therubyracer (0.12.2)
|
|
||||||
libv8 (~> 3.16.14.0)
|
|
||||||
ref
|
ref
|
||||||
thor (0.19.1)
|
thor (0.20.0)
|
||||||
thread_safe (0.3.5)
|
thread_safe (0.3.6)
|
||||||
tilt (2.0.2)
|
turbolinks (5.0.1)
|
||||||
turbolinks (2.5.3)
|
turbolinks-source (~> 5)
|
||||||
coffee-rails
|
turbolinks-source (5.0.3)
|
||||||
tzinfo (1.2.2)
|
tzinfo (1.2.3)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (2.7.1)
|
uglifier (3.2.0)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0, < 3)
|
||||||
json (>= 1.8.0)
|
unicode-display_width (1.3.0)
|
||||||
warden (1.2.3)
|
uniform_notifier (1.10.0)
|
||||||
|
warden (1.2.7)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
|
websocket-driver (0.6.5)
|
||||||
|
websocket-extensions (>= 0.1.0)
|
||||||
|
websocket-extensions (0.1.2)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
brakeman
|
brakeman
|
||||||
|
bullet
|
||||||
cancancan
|
cancancan
|
||||||
coffee-rails (~> 4.0.0)
|
coffee-rails
|
||||||
dalli
|
dalli
|
||||||
delayed_job_active_record
|
delayed_job_active_record
|
||||||
devise
|
devise
|
||||||
jbuilder (~> 2.0)
|
jbuilder
|
||||||
jquery-rails
|
jquery-rails
|
||||||
mysql2
|
mysql2
|
||||||
newrelic_rpm
|
newrelic_rpm
|
||||||
passenger
|
|
||||||
puma
|
puma
|
||||||
rails (= 4.2.5)
|
rails (= 5.1.1)
|
||||||
rails-lineman
|
|
||||||
rails_12factor
|
rails_12factor
|
||||||
rb-readline
|
rb-readline
|
||||||
round_robin_tournament
|
round_robin_tournament
|
||||||
sdoc (~> 0.4.0)
|
rubocop
|
||||||
|
sdoc
|
||||||
spring
|
spring
|
||||||
sqlite3
|
sqlite3
|
||||||
therubyracer
|
therubyracer
|
||||||
turbolinks
|
turbolinks
|
||||||
uglifier (>= 1.3.0)
|
uglifier
|
||||||
|
|
||||||
RUBY VERSION
|
RUBY VERSION
|
||||||
ruby 2.3.0p0
|
ruby 2.4.0p0
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.13.5
|
1.15.4
|
||||||
|
|||||||
2
Procfile
2
Procfile
@@ -1,2 +1,2 @@
|
|||||||
worker: bundle exec rake jobs:work
|
worker: bundle exec rake jobs:work
|
||||||
web: bundle exec passenger start -p $PORT --max-pool-size 3
|
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ MIT License
|
|||||||
|
|
||||||
<b>Development details:</b>
|
<b>Development details:</b>
|
||||||
|
|
||||||
* Ruby 2.3.0
|
* Ruby 2.4.0
|
||||||
|
|
||||||
* Rails 4.2.5
|
* Rails 5.1.1
|
||||||
|
|
||||||
* Install gems without production <tt>bundle install --without production</tt>
|
* Install gems without production <tt>bundle install --without production</tt>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class ApplicationController < ActionController::Base
|
|||||||
# For APIs, you may want to use :null_session instead.
|
# For APIs, you may want to use :null_session instead.
|
||||||
protect_from_forgery with: :exception
|
protect_from_forgery with: :exception
|
||||||
|
|
||||||
after_filter :set_csrf_cookie_for_ng
|
after_action :set_csrf_cookie_for_ng
|
||||||
|
|
||||||
def set_csrf_cookie_for_ng
|
def set_csrf_cookie_for_ng
|
||||||
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
|
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class MatsController < ApplicationController
|
class MatsController < ApplicationController
|
||||||
before_action :set_mat, only: [:show, :edit, :update, :destroy]
|
before_action :set_mat, only: [:show, :edit, :update, :destroy]
|
||||||
before_filter :check_access, only: [:new,:create,:update,:destroy,:edit,:show]
|
before_action :check_access, only: [:new,:create,:update,:destroy,:edit,:show]
|
||||||
before_filter :check_for_matches, only: [:show]
|
before_action :check_for_matches, only: [:show]
|
||||||
|
|
||||||
# GET /mats/1
|
# GET /mats/1
|
||||||
# GET /mats/1.json
|
# GET /mats/1.json
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class SchoolsController < ApplicationController
|
class SchoolsController < ApplicationController
|
||||||
before_action :set_school, only: [:show, :edit, :update, :destroy]
|
before_action :set_school, only: [:show, :edit, :update, :destroy]
|
||||||
before_filter :check_access_director, only: [:new,:create,:destroy]
|
before_action :check_access_director, only: [:new,:create,:destroy]
|
||||||
before_filter :check_access_delegate, only: [:update,:edit]
|
before_action :check_access_delegate, only: [:update,:edit]
|
||||||
|
|
||||||
|
|
||||||
# GET /schools/1
|
# GET /schools/1
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
class TournamentsController < ApplicationController
|
class TournamentsController < ApplicationController
|
||||||
before_action :set_tournament, only: [:swap,:weigh_in_sheet,:error,:teampointadjust,:remove_teampointadjust,:remove_school_delegate,:remove_delegate,:school_delegate,:delegate,:matches,:weigh_in,:weigh_in_weight,:create_custom_weights,:show,:edit,:update,:destroy,:up_matches,:no_matches,:team_scores,:brackets,:generate_matches,:bracket,:all_brackets]
|
before_action :set_tournament, only: [:swap,:weigh_in_sheet,:error,:teampointadjust,:remove_teampointadjust,:remove_school_delegate,:remove_delegate,:school_delegate,:delegate,:matches,:weigh_in,:weigh_in_weight,:create_custom_weights,:show,:edit,:update,:destroy,:up_matches,:no_matches,:team_scores,:brackets,:generate_matches,:bracket,:all_brackets]
|
||||||
before_filter :check_access_manage, only: [:swap,:weigh_in_sheet,:teampointadjust,:remove_teampointadjust,:remove_school_delegate,:school_delegate,:weigh_in,:weigh_in_weight,:create_custom_weights,:update,:edit,:generate_matches,:matches]
|
before_action :check_access_manage, only: [:swap,:weigh_in_sheet,:teampointadjust,:remove_teampointadjust,:remove_school_delegate,:school_delegate,:weigh_in,:weigh_in_weight,:create_custom_weights,:update,:edit,:generate_matches,:matches]
|
||||||
before_filter :check_access_destroy, only: [:destroy,:delegate,:remove_delegate]
|
before_action :check_access_destroy, only: [:destroy,:delegate,:remove_delegate]
|
||||||
before_filter :check_tournament_errors, only: [:generate_matches]
|
before_action :check_tournament_errors, only: [:generate_matches]
|
||||||
before_filter :check_for_matches, only: [:up_matches,:bracket,:all_brackets]
|
before_action :check_for_matches, only: [:up_matches,:bracket,:all_brackets]
|
||||||
|
|
||||||
def weigh_in_sheet
|
def weigh_in_sheet
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ class TournamentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@schools = @tournament.schools(:delegates)
|
@schools = @tournament.schools.includes(:delegates)
|
||||||
@weights = @tournament.weights.sort_by{|x|[x.max]}
|
@weights = @tournament.weights.sort_by{|x|[x.max]}
|
||||||
@mats = @tournament.mats
|
@mats = @tournament.mats
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class WeightsController < ApplicationController
|
class WeightsController < ApplicationController
|
||||||
before_action :set_weight, only: [:show, :edit, :update, :destroy,:re_gen]
|
before_action :set_weight, only: [:show, :edit, :update, :destroy,:re_gen]
|
||||||
before_filter :check_access, only: [:new,:create,:update,:destroy,:edit, :re_gen]
|
before_action :check_access, only: [:new,:create,:update,:destroy,:edit, :re_gen]
|
||||||
|
|
||||||
|
|
||||||
# GET /weights/1
|
# GET /weights/1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class WrestlersController < ApplicationController
|
class WrestlersController < ApplicationController
|
||||||
before_action :set_wrestler, only: [:show, :edit, :update, :destroy]
|
before_action :set_wrestler, only: [:show, :edit, :update, :destroy, :update_pool]
|
||||||
before_filter :check_access, only: [:new,:create,:update,:destroy,:edit]
|
before_action :check_access, only: [:new,:create,:update,:destroy,:edit,:update_pool]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -69,6 +69,25 @@ class WrestlersController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update_pool
|
||||||
|
@tournament = @wrestler.tournament
|
||||||
|
@weight = @wrestler.weight
|
||||||
|
@weights = @tournament.weights.sort_by{|w| w.max}
|
||||||
|
@school = @wrestler.school
|
||||||
|
if params[:wrestler]['pool']
|
||||||
|
@wrestler.pool = params[:wrestler]['pool']
|
||||||
|
respond_to do |format|
|
||||||
|
if @wrestler.update(wrestler_params)
|
||||||
|
format.html { redirect_to "/weights/#{@wrestler.weight.id}/", notice: 'Wrestler was successfully updated. Please re-generate this weight classes matches.' }
|
||||||
|
format.json { head :no_content }
|
||||||
|
else
|
||||||
|
format.html { render action: 'edit' }
|
||||||
|
format.json { render json: @wrestler.errors, status: :unprocessable_entity }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# DELETE /wrestlers/1
|
# DELETE /wrestlers/1
|
||||||
# DELETE /wrestlers/1.json
|
# DELETE /wrestlers/1.json
|
||||||
def destroy
|
def destroy
|
||||||
@@ -88,14 +107,19 @@ class WrestlersController < ApplicationController
|
|||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def wrestler_params
|
def wrestler_params
|
||||||
params.require(:wrestler).permit(:name, :school_id, :weight_id, :seed, :original_seed, :season_win, :season_loss,:criteria,:extra,:offical_weight)
|
params.require(:wrestler).permit(:name, :school_id, :weight_id, :seed, :original_seed, :season_win, :season_loss,:criteria,:extra,:offical_weight,:pool)
|
||||||
end
|
end
|
||||||
def check_access
|
def check_access
|
||||||
if params[:school]
|
if params[:school]
|
||||||
@school = School.find(params[:school])
|
@school = School.find(params[:school])
|
||||||
#@tournament = Tournament.find(@school.tournament.id)
|
#@tournament = Tournament.find(@school.tournament.id)
|
||||||
elsif params[:wrestler]
|
elsif params[:wrestler]
|
||||||
@school = School.find(params[:wrestler]["school_id"])
|
if params[:wrestler]["school_id"]
|
||||||
|
@school = School.find(params[:wrestler]["school_id"])
|
||||||
|
else
|
||||||
|
@wrestler = Wrestler.find(params[:wrestler]["id"])
|
||||||
|
@school = @wrestler.school
|
||||||
|
end
|
||||||
#@tournament = Tournament.find(@school.tournament.id)
|
#@tournament = Tournament.find(@school.tournament.id)
|
||||||
elsif @wrestler
|
elsif @wrestler
|
||||||
@school = @wrestler.school
|
@school = @wrestler.school
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ class Match < ActiveRecord::Base
|
|||||||
belongs_to :mat, touch: true
|
belongs_to :mat, touch: true
|
||||||
has_many :wrestlers, :through => :weight
|
has_many :wrestlers, :through => :weight
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
after_update do
|
|
||||||
|
after_update do
|
||||||
after_update_actions
|
after_update_actions
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_update_actions
|
def after_update_actions
|
||||||
if self.finished == 1 && self.winner_id != nil
|
if self.finished == 1 && self.winner_id != nil
|
||||||
if self.w1 && self.w2
|
if self.w1 && self.w2
|
||||||
@@ -30,9 +30,9 @@ class Match < ActiveRecord::Base
|
|||||||
if self.w1 && self.w2
|
if self.w1 && self.w2
|
||||||
wrestler1.school.calcScore
|
wrestler1.school.calcScore
|
||||||
wrestler2.school.calcScore
|
wrestler2.school.calcScore
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def mat_assigned
|
def mat_assigned
|
||||||
if self.mat
|
if self.mat
|
||||||
@@ -41,7 +41,7 @@ class Match < ActiveRecord::Base
|
|||||||
""
|
""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def pinTime
|
def pinTime
|
||||||
if self.win_type == "Pin"
|
if self.win_type == "Pin"
|
||||||
time = self.score.delete("")
|
time = self.score.delete("")
|
||||||
@@ -54,7 +54,7 @@ class Match < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def advance_wrestlers
|
def advance_wrestlers
|
||||||
if self.w1 && self.w2
|
if self.w1 && self.w2
|
||||||
AdvanceWrestler.new(wrestler1).advance
|
AdvanceWrestler.new(wrestler1).advance
|
||||||
AdvanceWrestler.new(wrestler2).advance
|
AdvanceWrestler.new(wrestler2).advance
|
||||||
end
|
end
|
||||||
@@ -117,7 +117,7 @@ class Match < ActiveRecord::Base
|
|||||||
def weight_max
|
def weight_max
|
||||||
self.weight.max
|
self.weight.max
|
||||||
end
|
end
|
||||||
|
|
||||||
def replaceLoserNameWithWrestler(w,loserName)
|
def replaceLoserNameWithWrestler(w,loserName)
|
||||||
if self.loser1_name == loserName
|
if self.loser1_name == loserName
|
||||||
self.w1 = w.id
|
self.w1 = w.id
|
||||||
@@ -130,9 +130,15 @@ class Match < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
def poolNumber
|
def poolNumber
|
||||||
if self.w1?
|
if self.w1?
|
||||||
wrestler1.generatePoolNumber
|
wrestler1.pool
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def list_w2_stats
|
||||||
|
"#{w2_name}: #{w2_stat}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def list_w1_stats
|
||||||
|
"#{w1_name}: #{w1_stat}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,8 +17,25 @@ class Weight < ActiveRecord::Base
|
|||||||
# self.tournament.destroyAllMatches
|
# self.tournament.destroyAllMatches
|
||||||
end
|
end
|
||||||
|
|
||||||
def wrestlersForPool(pool)
|
def pools_with_bye
|
||||||
self.wrestlers.select{|w| w.generatePoolNumber == pool}
|
pool = 1
|
||||||
|
pools_with_a_bye = []
|
||||||
|
until pool > self.pools do
|
||||||
|
if wrestlersForPool(pool).first.hasAPoolBye
|
||||||
|
pools_with_a_bye << pool
|
||||||
|
end
|
||||||
|
pool = pool + 1
|
||||||
|
end
|
||||||
|
pools_with_a_bye
|
||||||
|
end
|
||||||
|
|
||||||
|
def wrestlersForPool(poolNumber)
|
||||||
|
#For some reason this does not work
|
||||||
|
# wrestlers.select{|w| w.pool == poolNumber}
|
||||||
|
|
||||||
|
#This does...
|
||||||
|
weightWrestlers = Wrestler.where(:weight_id => self.id)
|
||||||
|
weightWrestlers.select{|w| w.pool == poolNumber}
|
||||||
end
|
end
|
||||||
|
|
||||||
def allPoolMatchesFinished(pool)
|
def allPoolMatchesFinished(pool)
|
||||||
@@ -43,7 +60,8 @@ class Weight < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def poolSeedOrder(pool)
|
def poolSeedOrder(pool)
|
||||||
wrestlersForPool(pool).sort_by{|w| [w.original_seed ? 0 : 1, w.original_seed || 0]}
|
# wrestlersForPool(pool).sort_by{|w| [w.original_seed ? 0 : 1, w.original_seed || 0]}
|
||||||
|
return wrestlersForPool(pool).sort_by{|w|w.seed}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -51,79 +69,6 @@ class Weight < ActiveRecord::Base
|
|||||||
SwapWrestlers.new.swapWrestlers(wrestler1_id,wrestler2_id)
|
SwapWrestlers.new.swapWrestlers(wrestler1_id,wrestler2_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def returnPoolNumber(wrestler)
|
|
||||||
if self.pools == 4
|
|
||||||
@wrestlers = fourPoolNumbers(self.wrestlers)
|
|
||||||
elsif self.pools == 2
|
|
||||||
@wrestlers = twoPoolNumbers(self.wrestlers)
|
|
||||||
elsif self.pools == 1
|
|
||||||
@wrestlers = onePoolNumbers(self.wrestlers)
|
|
||||||
end
|
|
||||||
@wrestler = @wrestlers.select{|w| w.id == wrestler.id}.first
|
|
||||||
return @wrestler.poolNumber
|
|
||||||
end
|
|
||||||
|
|
||||||
def onePoolNumbers(poolWrestlers)
|
|
||||||
poolWrestlers.sort_by{|x| x.seed }.each do |w|
|
|
||||||
w.poolNumber = 1
|
|
||||||
end
|
|
||||||
return poolWrestlers
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def twoPoolNumbers(poolWrestlers)
|
|
||||||
pool = 1
|
|
||||||
poolWrestlers.sort_by{|x| x.seed }.reverse.each do |w|
|
|
||||||
if w.seed == 1
|
|
||||||
w.poolNumber = 1
|
|
||||||
elsif w.seed == 2
|
|
||||||
w.poolNumber = 2
|
|
||||||
elsif w.seed == 3
|
|
||||||
w.poolNumber = 2
|
|
||||||
elsif w.seed == 4
|
|
||||||
w.poolNumber = 1
|
|
||||||
else
|
|
||||||
w.poolNumber = pool
|
|
||||||
end
|
|
||||||
if pool < 2
|
|
||||||
pool = pool + 1
|
|
||||||
else
|
|
||||||
pool = 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return poolWrestlers
|
|
||||||
end
|
|
||||||
|
|
||||||
def fourPoolNumbers(poolWrestlers)
|
|
||||||
pool = 1
|
|
||||||
poolWrestlers.sort_by{|x| x.seed }.reverse.each do |w|
|
|
||||||
if w.seed == 1
|
|
||||||
w.poolNumber = 1
|
|
||||||
elsif w.seed == 2
|
|
||||||
w.poolNumber = 2
|
|
||||||
elsif w.seed == 3
|
|
||||||
w.poolNumber = 3
|
|
||||||
elsif w.seed == 4
|
|
||||||
w.poolNumber = 4
|
|
||||||
elsif w.seed == 8
|
|
||||||
w.poolNumber = 1
|
|
||||||
elsif w.seed == 7
|
|
||||||
w.poolNumber = 2
|
|
||||||
elsif w.seed == 6
|
|
||||||
w.poolNumber = 3
|
|
||||||
elsif w.seed == 5
|
|
||||||
w.poolNumber = 4
|
|
||||||
else
|
|
||||||
w.poolNumber = pool
|
|
||||||
end
|
|
||||||
if pool < 4
|
|
||||||
pool = pool + 1
|
|
||||||
else
|
|
||||||
pool = 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return poolWrestlers
|
|
||||||
end
|
|
||||||
|
|
||||||
def bracket_size
|
def bracket_size
|
||||||
wrestlers.size
|
wrestlers.size
|
||||||
@@ -164,5 +109,9 @@ class Weight < ActiveRecord::Base
|
|||||||
def poolOrder(pool)
|
def poolOrder(pool)
|
||||||
PoolOrder.new(wrestlersForPool(pool)).getPoolOrder
|
PoolOrder.new(wrestlersForPool(pool)).getPoolOrder
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def wrestlersWithoutPool
|
||||||
|
wrestlers.select{|w| w.pool == nil}
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Wrestler < ActiveRecord::Base
|
|||||||
has_one :tournament, through: :weight
|
has_one :tournament, through: :weight
|
||||||
has_many :matches, through: :weight
|
has_many :matches, through: :weight
|
||||||
has_many :deductedPoints, class_name: "Teampointadjust"
|
has_many :deductedPoints, class_name: "Teampointadjust"
|
||||||
attr_accessor :poolNumber, :poolAdvancePoints, :originalId, :swapId
|
attr_accessor :poolAdvancePoints, :originalId, :swapId
|
||||||
|
|
||||||
validates :name, :weight_id, :school_id, presence: true
|
validates :name, :weight_id, :school_id, presence: true
|
||||||
|
|
||||||
@@ -103,10 +103,6 @@ class Wrestler < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def generatePoolNumber
|
|
||||||
self.weight.returnPoolNumber(self)
|
|
||||||
end
|
|
||||||
|
|
||||||
def boutByRound(round)
|
def boutByRound(round)
|
||||||
round_match = allMatches.select{|m| m.round == round}.first
|
round_match = allMatches.select{|m| m.round == round}.first
|
||||||
if round_match.blank?
|
if round_match.blank?
|
||||||
@@ -122,7 +118,7 @@ class Wrestler < ActiveRecord::Base
|
|||||||
|
|
||||||
def poolMatches
|
def poolMatches
|
||||||
pool_matches = allMatches.select{|m| m.bracket_position == "Pool"}
|
pool_matches = allMatches.select{|m| m.bracket_position == "Pool"}
|
||||||
pool_matches.select{|m| m.poolNumber == self.generatePoolNumber}
|
pool_matches.select{|m| m.poolNumber == self.pool}
|
||||||
end
|
end
|
||||||
|
|
||||||
def hasAPoolBye
|
def hasAPoolBye
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class PoolAdvance
|
|||||||
end
|
end
|
||||||
|
|
||||||
def advanceWrestler
|
def advanceWrestler
|
||||||
if @wrestler.weight.allPoolMatchesFinished(@wrestler.generatePoolNumber) && @wrestler.finishedBracketMatches.size == 0
|
if @wrestler.weight.allPoolMatchesFinished(@wrestler.pool) && @wrestler.finishedBracketMatches.size == 0
|
||||||
poolToBracketAdvancment
|
poolToBracketAdvancment
|
||||||
end
|
end
|
||||||
if @wrestler.finishedBracketMatches.size > 0
|
if @wrestler.finishedBracketMatches.size > 0
|
||||||
@@ -15,7 +15,7 @@ class PoolAdvance
|
|||||||
end
|
end
|
||||||
|
|
||||||
def poolToBracketAdvancment
|
def poolToBracketAdvancment
|
||||||
pool = @wrestler.generatePoolNumber
|
pool = @wrestler.pool
|
||||||
if @wrestler.weight.wrestlers.size > 6
|
if @wrestler.weight.wrestlers.size > 6
|
||||||
poolOrder = @wrestler.weight.poolOrder(pool)
|
poolOrder = @wrestler.weight.poolOrder(pool)
|
||||||
#Take pool order and move winner and runner up to correct match based on w1_name and w2_name
|
#Take pool order and move winner and runner up to correct match based on w1_name and w2_name
|
||||||
@@ -67,7 +67,7 @@ class PoolAdvance
|
|||||||
|
|
||||||
def loserAdvance
|
def loserAdvance
|
||||||
bout = @wrestler.lastMatch.bout_number
|
bout = @wrestler.lastMatch.bout_number
|
||||||
next_match = Match.where("loser1_name = ? OR loser2_name = ? AND weight_id = ?","Loser of #{bout}","Loser of #{bout}",@wrestler.weight_id)
|
next_match = Match.where("(loser1_name = ? OR loser2_name = ?) AND weight_id = ?","Loser of #{bout}","Loser of #{bout}",@wrestler.weight_id)
|
||||||
if next_match.size > 0
|
if next_match.size > 0
|
||||||
next_match.first.replaceLoserNameWithWrestler(@wrestler,"Loser of #{bout}")
|
next_match.first.replaceLoserNameWithWrestler(@wrestler,"Loser of #{bout}")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ class PoolGeneration
|
|||||||
end
|
end
|
||||||
|
|
||||||
def generatePools
|
def generatePools
|
||||||
|
GeneratePoolNumbers.new(@weight).savePoolNumbers
|
||||||
pools = @weight.pools
|
pools = @weight.pools
|
||||||
while @pool <= pools
|
while @pool <= pools
|
||||||
roundRobin
|
roundRobin
|
||||||
@pool += 1
|
@pool += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def roundRobin
|
def roundRobin
|
||||||
wrestlers = @weight.wrestlersForPool(@pool)
|
wrestlers = @weight.wrestlersForPool(@pool)
|
||||||
|
|||||||
77
app/services/weight_services/generate_pool_numbers.rb
Normal file
77
app/services/weight_services/generate_pool_numbers.rb
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
class GeneratePoolNumbers
|
||||||
|
def initialize( weight )
|
||||||
|
@weight = weight
|
||||||
|
end
|
||||||
|
|
||||||
|
def savePoolNumbers
|
||||||
|
if @weight.pools == 4
|
||||||
|
saveFourPoolNumbers(@weight.wrestlersWithoutPool)
|
||||||
|
elsif @weight.pools == 2
|
||||||
|
saveTwoPoolNumbers(@weight.wrestlersWithoutPool)
|
||||||
|
elsif @weight.pools == 1
|
||||||
|
saveOnePoolNumbers(@weight.wrestlersWithoutPool)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def saveOnePoolNumbers(poolWrestlers)
|
||||||
|
poolWrestlers.sort_by{|x| x.seed }.each do |w|
|
||||||
|
w.pool = 1
|
||||||
|
w.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def saveTwoPoolNumbers(poolWrestlers)
|
||||||
|
pool = 1
|
||||||
|
poolWrestlers.sort_by{|x| x.seed }.reverse.each do |w|
|
||||||
|
if w.seed == 1
|
||||||
|
w.pool = 1
|
||||||
|
elsif w.seed == 2
|
||||||
|
w.pool = 2
|
||||||
|
elsif w.seed == 3
|
||||||
|
w.pool = 2
|
||||||
|
elsif w.seed == 4
|
||||||
|
w.pool = 1
|
||||||
|
else
|
||||||
|
w.pool = pool
|
||||||
|
end
|
||||||
|
if pool < 2
|
||||||
|
pool = pool + 1
|
||||||
|
else
|
||||||
|
pool = 1
|
||||||
|
end
|
||||||
|
w.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def saveFourPoolNumbers(poolWrestlers)
|
||||||
|
pool = 1
|
||||||
|
poolWrestlers.sort_by{|x| x.seed }.reverse.each do |w|
|
||||||
|
if w.seed == 1
|
||||||
|
w.pool = 1
|
||||||
|
elsif w.seed == 2
|
||||||
|
w.pool = 2
|
||||||
|
elsif w.seed == 3
|
||||||
|
w.pool = 3
|
||||||
|
elsif w.seed == 4
|
||||||
|
w.pool = 4
|
||||||
|
elsif w.seed == 8
|
||||||
|
w.pool = 1
|
||||||
|
elsif w.seed == 7
|
||||||
|
w.pool = 2
|
||||||
|
elsif w.seed == 6
|
||||||
|
w.pool = 3
|
||||||
|
elsif w.seed == 5
|
||||||
|
w.pool = 4
|
||||||
|
else
|
||||||
|
w.pool = pool
|
||||||
|
end
|
||||||
|
if pool < 4
|
||||||
|
pool = pool + 1
|
||||||
|
else
|
||||||
|
pool = 1
|
||||||
|
end
|
||||||
|
w.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -11,15 +11,18 @@ class SwapWrestlers
|
|||||||
w3.weight_id = w1.weight_id
|
w3.weight_id = w1.weight_id
|
||||||
w3.original_seed = w1.original_seed
|
w3.original_seed = w1.original_seed
|
||||||
w3.seed = w1.seed
|
w3.seed = w1.seed
|
||||||
|
w3.pool = w1.pool
|
||||||
swapWrestlerMatches(w1.allMatches,w1.id,w3.id)
|
swapWrestlerMatches(w1.allMatches,w1.id,w3.id)
|
||||||
|
|
||||||
#Swap wrestler 1 and wrestler 2
|
#Swap wrestler 1 and wrestler 2
|
||||||
swapWrestlerMatches(w2.allMatches,w2.id,w1.id)
|
swapWrestlerMatches(w2.allMatches,w2.id,w1.id)
|
||||||
w1.seed = w2.seed
|
w1.seed = w2.seed
|
||||||
|
w1.pool = w2.pool
|
||||||
|
|
||||||
|
|
||||||
swapWrestlerMatches(w3.allMatches,w3.id,w2.id)
|
swapWrestlerMatches(w3.allMatches,w3.id,w2.id)
|
||||||
w2.seed = w3.seed
|
w2.seed = w3.seed
|
||||||
|
w2.pool = w3.pool
|
||||||
|
|
||||||
|
|
||||||
w1.save
|
w1.save
|
||||||
|
|||||||
@@ -10,15 +10,15 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<h4>Bout <%= @match.bout_number %></h4>
|
<h4>Bout: <%= @match.bout_number %> </h4><h4>Round: <%= @match.round %></h4><h4>Weight: <%= @match.weight_max %> lbs</h4>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= @w1.name %> <select id="w1-color" onchange="changeW1Color(this)">
|
<th><%= @w1.name %> - <%= @w1.school.name %> <select id="w1-color" onchange="changeW1Color(this)">
|
||||||
<option value="green">Green</option>
|
<option value="green">Green</option>
|
||||||
<option value="red">Red</option>
|
<option value="red">Red</option>
|
||||||
</select><br>Last Match: <%= if @w1.lastMatch != nil then time_ago_in_words(@w1.lastMatch.updated_at) end%></th>
|
</select><br>Last Match: <%= if @w1.lastMatch != nil then time_ago_in_words(@w1.lastMatch.updated_at) end%></th>
|
||||||
<th><%= @w2.name %> <select id="w2-color" onchange="changeW2Color(this)">
|
<th><%= @w2.name %> - <%= @w2.school.name %> <select id="w2-color" onchange="changeW2Color(this)">
|
||||||
<option value="red">Red</option>
|
<option value="red">Red</option>
|
||||||
<option value="green">Green</option>
|
<option value="green">Green</option>
|
||||||
</select><br>Last Match: <%= if @w2.lastMatch != nil then time_ago_in_words(@w2.lastMatch.updated_at) end%></th>
|
</select><br>Last Match: <%= if @w2.lastMatch != nil then time_ago_in_words(@w2.lastMatch.updated_at) end%></th>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<%= f.submit onclick: "return confirm('Is the name of the winner ' + document.getElementById('match_winner_id').options[document.getElementById('match_winner_id').selectedIndex].text + '?')", :class=>"btn btn-success" %>
|
<%= f.submit onclick: "return confirm('Is the name of the winner ' + document.getElementById('match_winner_id').options[document.getElementById('match_winner_id').selectedIndex].text + '?')", :class=>"btn btn-success" %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@@ -116,17 +116,17 @@
|
|||||||
w1.stats=document.getElementById("match_w1_stat").value;
|
w1.stats=document.getElementById("match_w1_stat").value;
|
||||||
w2.stats=document.getElementById("match_w2_stat").value;
|
w2.stats=document.getElementById("match_w2_stat").value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function takedown(wrestler){
|
function takedown(wrestler){
|
||||||
updateStats(wrestler,"T2")
|
updateStats(wrestler,"T2")
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateStats(wrestler,text){
|
function updateStats(wrestler,text){
|
||||||
updatejsvalues();
|
updatejsvalues();
|
||||||
wrestler.stats = wrestler.stats + text + " ";
|
wrestler.stats = wrestler.stats + text + " ";
|
||||||
updatehtmlvalues();
|
updatehtmlvalues();
|
||||||
}
|
}
|
||||||
|
|
||||||
//For Changing button colors
|
//For Changing button colors
|
||||||
function changeW1Color(color){
|
function changeW1Color(color){
|
||||||
if (color.value == "red") {
|
if (color.value == "red") {
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
document.getElementById("w2-color").value = "red";
|
document.getElementById("w2-color").value = "red";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeW2Color(color){
|
function changeW2Color(color){
|
||||||
if (color.value == "red") {
|
if (color.value == "red") {
|
||||||
w2Red();
|
w2Red();
|
||||||
@@ -153,15 +153,15 @@
|
|||||||
document.getElementById("w1-color").value = "red";
|
document.getElementById("w1-color").value = "red";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function redColor(id){
|
function redColor(id){
|
||||||
document.getElementById(id).className = "btn btn-danger btn-sm";
|
document.getElementById(id).className = "btn btn-danger btn-sm";
|
||||||
}
|
}
|
||||||
|
|
||||||
function greenColor(id){
|
function greenColor(id){
|
||||||
document.getElementById(id).className = "btn btn-success btn-sm";
|
document.getElementById(id).className = "btn btn-success btn-sm";
|
||||||
}
|
}
|
||||||
|
|
||||||
function w1Red(){
|
function w1Red(){
|
||||||
redColor("w1-takedown");
|
redColor("w1-takedown");
|
||||||
redColor("w1-escape");
|
redColor("w1-escape");
|
||||||
@@ -177,7 +177,7 @@
|
|||||||
redColor("w1-stalling");
|
redColor("w1-stalling");
|
||||||
redColor("w1-caution");
|
redColor("w1-caution");
|
||||||
}
|
}
|
||||||
|
|
||||||
function w1Green(){
|
function w1Green(){
|
||||||
greenColor("w1-takedown");
|
greenColor("w1-takedown");
|
||||||
greenColor("w1-escape");
|
greenColor("w1-escape");
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
greenColor("w1-stalling");
|
greenColor("w1-stalling");
|
||||||
greenColor("w1-caution");
|
greenColor("w1-caution");
|
||||||
}
|
}
|
||||||
|
|
||||||
function w2Red(){
|
function w2Red(){
|
||||||
redColor("w2-takedown");
|
redColor("w2-takedown");
|
||||||
redColor("w2-escape");
|
redColor("w2-escape");
|
||||||
@@ -209,7 +209,7 @@
|
|||||||
redColor("w2-stalling");
|
redColor("w2-stalling");
|
||||||
redColor("w2-caution");
|
redColor("w2-caution");
|
||||||
}
|
}
|
||||||
|
|
||||||
function w2Green(){
|
function w2Green(){
|
||||||
greenColor("w2-takedown");
|
greenColor("w2-takedown");
|
||||||
greenColor("w2-escape");
|
greenColor("w2-escape");
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<li>Win by major: 1pt extra</li>
|
<li>Win by major: 1pt extra</li>
|
||||||
<li>Win by tech fall: 1.5pt extra</li>
|
<li>Win by tech fall: 1.5pt extra</li>
|
||||||
<li>Win by fall, default, dq: 2pt extra</li>
|
<li>Win by fall, default, dq: 2pt extra</li>
|
||||||
|
<li>BYE points: 2pt (if you win at least 1 match in a pool with a BYE)</li>
|
||||||
<li>1st place: 16pt</li>
|
<li>1st place: 16pt</li>
|
||||||
<li>2nd place: 12pt</li>
|
<li>2nd place: 12pt</li>
|
||||||
<li>3rd place: 10pt</li>
|
<li>3rd place: 10pt</li>
|
||||||
@@ -43,4 +44,4 @@
|
|||||||
<br>
|
<br>
|
||||||
<h4>Contact</h4>
|
<h4>Contact</h4>
|
||||||
<br>
|
<br>
|
||||||
<p>Suggestions, criticism, and kind words are welcomed. Please contact us.</p>
|
<p>Suggestions, criticism, and kind words are welcomed. Please contact us.</p>
|
||||||
|
|||||||
@@ -1,4 +1 @@
|
|||||||
<% if Rails.env.production? %>
|
|
||||||
<script type='text/javascript' src='//eclkmpbn.com/adServe/banners?tid=85597_138467_5&type=shadowbox&size=800x440'></script>
|
|
||||||
<% end %>
|
|
||||||
You do not have permissions to go there.
|
You do not have permissions to go there.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<% @round = 1 %>
|
<% @round = 1 %>
|
||||||
<% @pool = 1 %>
|
<% @pool = 1 %>
|
||||||
<% until @wrestlers.select{|w| w.generatePoolNumber == @pool}.blank? %>
|
<% until @wrestlers.select{|w| w.pool == @pool}.blank? %>
|
||||||
<h5>Pool <%= @pool %></h5>
|
<h5>Pool <%= @pool %></h5>
|
||||||
<table class="table table-striped table-bordered table-condensed">
|
<table class="table table-striped table-bordered table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @wrestlers.select{|w| w.generatePoolNumber == @pool}.sort_by{|w| w.seed}.each do |w| %>
|
<% @wrestlers.select{|w| w.pool == @pool}.sort_by{|w| w.seed}.each do |w| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= w.original_seed %> <%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
|
<td><%= w.original_seed %> <%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
|
||||||
<% @round = 1 %>
|
<% @round = 1 %>
|
||||||
|
|||||||
@@ -103,4 +103,20 @@ li:first-child,li:last-child {
|
|||||||
<br>
|
<br>
|
||||||
<%= submit_tag "Swap", :class=>"btn btn-success"%>
|
<%= submit_tag "Swap", :class=>"btn btn-success"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if can? :manage, @tournament %>
|
||||||
|
<br><br>
|
||||||
|
<h3>Move wrestler to pool with a bye</h3>
|
||||||
|
<%= form_tag '/wrestlers/update_pool' do %>
|
||||||
|
<div class="field">
|
||||||
|
<%= label_tag 'Wrestler to move' %><br>
|
||||||
|
<%= collection_select(:wrestler, :id, @weight.wrestlers, :id, :name) %>
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<%= label_tag 'Pool to move to' %><br>
|
||||||
|
<%= select :wrestler, :pool, @weight.pools_with_bye %>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<%= submit_tag "Move", :class=>"btn btn-success"%>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -1,6 +1,3 @@
|
|||||||
<% if Rails.env.production? %>
|
|
||||||
<script type='text/javascript' src='//eclkmpbn.com/adServe/banners?tid=85597_138467_5&type=shadowbox&size=800x440'></script>
|
|
||||||
<% end %>
|
|
||||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
<% if Rails.env.production? %>
|
|
||||||
<script type='text/javascript' src='//eclkmpbn.com/adServe/banners?tid=85597_138467_5&type=shadowbox&size=800x440'></script>
|
|
||||||
<% end %>
|
|
||||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
<% if params[:print] == nil && Rails.env.production? %>
|
|
||||||
<script type='text/javascript' src='//eclkmpbn.com/adServe/banners?tid=85597_138467_5&type=shadowbox&size=800x440'></script>
|
|
||||||
<% end %>
|
|
||||||
<% cache ["#{@tournament.id}_up_matches", @tournament] do %>
|
<% cache ["#{@tournament.id}_up_matches", @tournament] do %>
|
||||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default"%>
|
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default"%>
|
||||||
<script>
|
<script>
|
||||||
@@ -27,15 +24,15 @@
|
|||||||
<th>Warm Up</th>
|
<th>Warm Up</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @mats.each.map do |m| %>
|
<% @mats.each.map do |m| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= m.name %></td>
|
<td><%= m.name %></td>
|
||||||
<td><% if m.unfinishedMatches.first %><%=m.unfinishedMatches.first.bout_number%><br><%= m.unfinishedMatches.first.w1_name %> vs. <%= m.unfinishedMatches.first.w2_name %><% end %></td>
|
<td><% if m.unfinishedMatches.first %><strong><%=m.unfinishedMatches.first.bout_number%></strong> - <%= m.unfinishedMatches.first.weight_max %> lbs<br><%= m.unfinishedMatches.first.w1_name %> vs. <%= m.unfinishedMatches.first.w2_name %><% end %></td>
|
||||||
<td><% if m.unfinishedMatches.second %><%=m.unfinishedMatches.second.bout_number%><br><%= m.unfinishedMatches.second.w1_name %> vs. <%= m.unfinishedMatches.second.w2_name %><% end %></td>
|
<td><% if m.unfinishedMatches.second %><strong><%=m.unfinishedMatches.second.bout_number%></strong> - <%= m.unfinishedMatches.second.weight_max %> lbs<br><%= m.unfinishedMatches.second.w1_name %> vs. <%= m.unfinishedMatches.second.w2_name %><% end %></td>
|
||||||
<td><% if m.unfinishedMatches.third %><%=m.unfinishedMatches.third.bout_number%><br><%= m.unfinishedMatches.third.w1_name %> vs. <%= m.unfinishedMatches.third.w2_name %><% end %></td>
|
<td><% if m.unfinishedMatches.third %><strong><%=m.unfinishedMatches.third.bout_number%></strong> - <%= m.unfinishedMatches.third.weight_max %> lbs<br><%= m.unfinishedMatches.third.w1_name %> vs. <%= m.unfinishedMatches.third.w2_name %><% end %></td>
|
||||||
<td><% if m.unfinishedMatches.fourth %><%=m.unfinishedMatches.fourth.bout_number%><br><%= m.unfinishedMatches.fourth.w1_name %> vs. <%= m.unfinishedMatches.fourth.w2_name %><% end %></td>
|
<td><% if m.unfinishedMatches.fourth %><strong><%=m.unfinishedMatches.fourth.bout_number%></strong> - <%= m.unfinishedMatches.fourth.weight_max %> lbs<br><%= m.unfinishedMatches.fourth.w1_name %> vs. <%= m.unfinishedMatches.fourth.w2_name %><% end %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -52,7 +49,7 @@
|
|||||||
<th>Matchup</th>
|
<th>Matchup</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<% if @matches.size > 0 %>
|
<% if @matches.size > 0 %>
|
||||||
<% @matches.each.map do |m| %>
|
<% @matches.each.map do |m| %>
|
||||||
@@ -66,6 +63,6 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
|
|
||||||
|
|
||||||
<%= link_to "Back to #{@school.name}", "/schools/#{@school.id}", :class=>"btn btn-default" %>
|
<%= link_to "Back to #{@school.name}", "/schools/#{@school.id}", :class=>"btn btn-default" %>
|
||||||
<% if can? :manage, @school %>
|
<% if can? :manage, @school %>
|
||||||
| <%= link_to "Edit #{@wrestler.name}", edit_wrestler_path(@wrestler), :class=>"btn btn-primary" %>
|
| <%= link_to "Edit #{@wrestler.name}", edit_wrestler_path(@wrestler), :class=>"btn btn-primary" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% cache ["#{@wrestler.id}", @wrestler] do %>
|
<% cache ["#{@wrestler.id}", @wrestler] do %>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<p>
|
<p>
|
||||||
<strong>Name:</strong>
|
<strong>Name:</strong>
|
||||||
<%= @wrestler.name %>
|
<%= @wrestler.name %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>School:</strong>
|
<strong>School:</strong>
|
||||||
<%= @wrestler.school.name %>
|
<%= @wrestler.school.name %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>Weight:</strong>
|
<strong>Weight:</strong>
|
||||||
<%= @wrestler.weight.max %>
|
<%= @wrestler.weight.max %>
|
||||||
@@ -33,12 +33,18 @@
|
|||||||
<strong>Total Team Points Scored:</strong>
|
<strong>Total Team Points Scored:</strong>
|
||||||
<%= @wrestler.totalTeamPoints %>
|
<%= @wrestler.totalTeamPoints %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<h4>Matches</h4>
|
<h4>Matches</h4>
|
||||||
<br>
|
<br>
|
||||||
<% @wrestler.allMatches.each do |m| %>
|
<% @wrestler.allMatches.each do |m| %>
|
||||||
<div> Bout: <%= m.bout_number %> <%= m.bracket_position %> <%= m.wrestler1.name %> vs. <%= m.wrestler2.name %> <%= @wrestler.resultByBout(m.bout_number) %></div>
|
<div> Bout: <%= m.bout_number %> <%= m.bracket_position %> <%= m.wrestler1.name %> vs. <%= m.wrestler2.name %> <%= @wrestler.resultByBout(m.bout_number) %></div>
|
||||||
|
<% if m.w1_stat || m.w2_stat %>
|
||||||
|
<div>Stats:</div>
|
||||||
|
<div><%= m.list_w1_stats %></div>
|
||||||
|
<div><%= m.list_w2_stats %></div>
|
||||||
|
</br>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -29,14 +29,13 @@ module Wrestling
|
|||||||
|
|
||||||
config.active_job.queue_adapter = :delayed_job
|
config.active_job.queue_adapter = :delayed_job
|
||||||
|
|
||||||
config.rails_lineman.lineman_project_location = "frontend"
|
|
||||||
|
|
||||||
config.to_prepare do
|
config.to_prepare do
|
||||||
DeviseController.respond_to :html, :json
|
DeviseController.respond_to :html, :json
|
||||||
end
|
end
|
||||||
|
|
||||||
config.autoload_paths += %W(#{config.root}/app/services/tournament_services)
|
config.autoload_paths += %W(#{config.root}/app/services/tournament_services)
|
||||||
config.autoload_paths += %W(#{config.root}/app/services/wrestler_services)
|
config.autoload_paths += %W(#{config.root}/app/services/wrestler_services)
|
||||||
|
config.autoload_paths += %W(#{config.root}/app/services/weight_services)
|
||||||
config.autoload_paths += %W(#{config.root}/app/services/bracket_advancement)
|
config.autoload_paths += %W(#{config.root}/app/services/bracket_advancement)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ Wrestling::Application.configure do
|
|||||||
|
|
||||||
#THESE ADDED BY ME TO GET RAILS 4 WORKING IN HEROKU
|
#THESE ADDED BY ME TO GET RAILS 4 WORKING IN HEROKU
|
||||||
config.cache_classes = true
|
config.cache_classes = true
|
||||||
config.serve_static_files = true
|
config.public_file_server.enabled = true
|
||||||
config.assets.compile = true
|
config.assets.compile = true
|
||||||
config.assets.digest = true
|
config.assets.digest = true
|
||||||
|
|
||||||
@@ -111,6 +111,4 @@ Wrestling::Application.configure do
|
|||||||
#Devise needs origin of email
|
#Devise needs origin of email
|
||||||
Rails.application.routes.default_url_options[:host] = 'https://wrestlingdev.com'
|
Rails.application.routes.default_url_options[:host] = 'https://wrestlingdev.com'
|
||||||
|
|
||||||
#For lineman creating assets
|
|
||||||
config.serve_static_files = true
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ Wrestling::Application.configure do
|
|||||||
config.eager_load = false
|
config.eager_load = false
|
||||||
|
|
||||||
# Configure static asset server for tests with Cache-Control for performance.
|
# Configure static asset server for tests with Cache-Control for performance.
|
||||||
config.serve_static_files = true
|
config.public_file_server.enabled = true
|
||||||
config.static_cache_control = "public, max-age=3600"
|
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
||||||
|
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ Devise.setup do |config|
|
|||||||
# The secret key used by Devise. Devise uses this key to generate
|
# The secret key used by Devise. Devise uses this key to generate
|
||||||
# random tokens. Changing this key will render invalid all existing
|
# random tokens. Changing this key will render invalid all existing
|
||||||
# confirmation, reset password and unlock tokens in the database.
|
# confirmation, reset password and unlock tokens in the database.
|
||||||
config.secret_key = ENV['WRESTLINGDEV_DEVISE_SECRET_KEY'] if Rails.env.production?
|
if Rails.env.production?
|
||||||
|
config.secret_key = ENV['WRESTLINGDEV_DEVISE_SECRET_KEY']
|
||||||
|
else
|
||||||
|
config.secret_key = "2f29d49db6704377ba263f7cb9db085b386bcb301c0cd501126a674686ab1a109754071165b08cd72af03cec4642a4dd04361c994462254dd5d85e9594e8b9aa"
|
||||||
|
end
|
||||||
|
|
||||||
# ==> Mailer Configuration
|
# ==> Mailer Configuration
|
||||||
# Configure the e-mail address which will be shown in Devise::Mailer,
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
||||||
|
|||||||
@@ -9,4 +9,8 @@
|
|||||||
|
|
||||||
# Make sure your secret_key_base is kept private
|
# Make sure your secret_key_base is kept private
|
||||||
# if you're sharing your code publicly.
|
# if you're sharing your code publicly.
|
||||||
Wrestling::Application.config.secret_key_base = ENV['WRESTLINGDEV_SECRET_KEY_BASE']
|
if Rails.env.production?
|
||||||
|
Wrestling::Application.config.secret_key_base = ENV['WRESTLINGDEV_SECRET_KEY_BASE']
|
||||||
|
else
|
||||||
|
Wrestling::Application.config.secret_key_base = "077cdbef5c2ccf22543fb17a67339f234306b7fa2e1e4463d851c444c10a5611829a2290b253da78339427f131571fac9a42c83d960b2d25ecc10a4a0a7ce1a2"
|
||||||
|
end
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ Wrestling::Application.routes.draw do
|
|||||||
post "/tournaments/:id/swap" => "tournaments#swap", :as => :swap_wrestlers
|
post "/tournaments/:id/swap" => "tournaments#swap", :as => :swap_wrestlers
|
||||||
|
|
||||||
post 'weights/:id/re_gen' => 'weights#re_gen', :as => :regen_weight
|
post 'weights/:id/re_gen' => 'weights#re_gen', :as => :regen_weight
|
||||||
|
post "/wrestlers/update_pool" => "wrestlers#update_pool"
|
||||||
|
|
||||||
#API
|
#API
|
||||||
get "/api/tournaments" => "api#tournaments"
|
get "/api/tournaments" => "api#tournaments"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateSchools < ActiveRecord::Migration
|
class CreateSchools < ActiveRecord::Migration[4.2][4.2]
|
||||||
def change
|
def change
|
||||||
create_table :schools do |t|
|
create_table :schools do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateWeights < ActiveRecord::Migration
|
class CreateWeights < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :weights do |t|
|
create_table :weights do |t|
|
||||||
t.integer :max
|
t.integer :max
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateWrestlers < ActiveRecord::Migration
|
class CreateWrestlers < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :wrestlers do |t|
|
create_table :wrestlers do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateTournaments < ActiveRecord::Migration
|
class CreateTournaments < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :tournaments do |t|
|
create_table :tournaments do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class SchoolAddTournamentId < ActiveRecord::Migration
|
class SchoolAddTournamentId < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :schools, :tournament_id, :integer
|
add_column :schools, :tournament_id, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class DeviseCreateUsers < ActiveRecord::Migration
|
class DeviseCreateUsers < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table(:users) do |t|
|
create_table(:users) do |t|
|
||||||
## Database authenticatable
|
## Database authenticatable
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class WeightAddTournamentId < ActiveRecord::Migration
|
class WeightAddTournamentId < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :weights, :tournament_id, :integer
|
add_column :weights, :tournament_id, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class WrestlerAddWinLossColumn < ActiveRecord::Migration
|
class WrestlerAddWinLossColumn < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :wrestlers, :season_win, :integer
|
add_column :wrestlers, :season_win, :integer
|
||||||
add_column :wrestlers, :season_loss, :integer
|
add_column :wrestlers, :season_loss, :integer
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class DropSchoolScore < ActiveRecord::Migration
|
class DropSchoolScore < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
remove_column :schools, :score
|
remove_column :schools, :score
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddSchoolScore < ActiveRecord::Migration
|
class AddSchoolScore < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :schools, :score, :integer
|
add_column :schools, :score, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateMatches < ActiveRecord::Migration
|
class CreateMatches < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :matches do |t|
|
create_table :matches do |t|
|
||||||
t.integer :r_id
|
t.integer :r_id
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddTournamentIdToMatches < ActiveRecord::Migration
|
class AddTournamentIdToMatches < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :matches, :tournament_id, :integer
|
add_column :matches, :tournament_id, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddRoundToMatch < ActiveRecord::Migration
|
class AddRoundToMatch < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :matches, :round, :integer
|
add_column :matches, :round, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateMats < ActiveRecord::Migration
|
class CreateMats < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :mats do |t|
|
create_table :mats do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddMatIdToWeights < ActiveRecord::Migration
|
class AddMatIdToWeights < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :weights, :mat_id, :integer
|
add_column :weights, :mat_id, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddFinishedFieldToMatches < ActiveRecord::Migration
|
class AddFinishedFieldToMatches < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :matches, :finished, :integer
|
add_column :matches, :finished, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class DropWeightMatId < ActiveRecord::Migration
|
class DropWeightMatId < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
remove_column :weights, :mat_id
|
remove_column :weights, :mat_id
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddSeedCriteriaToWrestler < ActiveRecord::Migration
|
class AddSeedCriteriaToWrestler < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :wrestlers, :criteria, :string
|
add_column :wrestlers, :criteria, :string
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AssignWrestlerPoolNumber < ActiveRecord::Migration
|
class AssignWrestlerPoolNumber < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :wrestlers, :poolNumber, :integer
|
add_column :wrestlers, :poolNumber, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddBoutNumberToMatch < ActiveRecord::Migration
|
class AddBoutNumberToMatch < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :matches, :boutNumber, :integer
|
add_column :matches, :boutNumber, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddExtraFlagForWrestler < ActiveRecord::Migration
|
class AddExtraFlagForWrestler < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :wrestlers, :extra, :boolean
|
add_column :wrestlers, :extra, :boolean
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class DropPoolNumber < ActiveRecord::Migration
|
class DropPoolNumber < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
remove_column :wrestlers, :poolNumber
|
remove_column :wrestlers, :poolNumber
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddMatchupsToTournament < ActiveRecord::Migration
|
class AddMatchupsToTournament < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :tournaments, :matchups, :text
|
add_column :tournaments, :matchups, :text
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RenameTournamentMatchups < ActiveRecord::Migration
|
class RenameTournamentMatchups < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
rename_column :tournaments, :matchups, :matchups_array
|
rename_column :tournaments, :matchups, :matchups_array
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class DropSchoolScoreAgain < ActiveRecord::Migration
|
class DropSchoolScoreAgain < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
remove_column :schools, :score
|
remove_column :schools, :score
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class MatchupToMatch < ActiveRecord::Migration
|
class MatchupToMatch < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :matches, :weight_id, :integer
|
add_column :matches, :weight_id, :integer
|
||||||
add_column :matches, :bracket_position, :string
|
add_column :matches, :bracket_position, :string
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddWNamesToMatch < ActiveRecord::Migration
|
class AddWNamesToMatch < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :matches, :w1_name, :string
|
add_column :matches, :w1_name, :string
|
||||||
add_column :matches, :w2_name, :string
|
add_column :matches, :w2_name, :string
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class ChangeWNameToLoserName < ActiveRecord::Migration
|
class ChangeWNameToLoserName < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
rename_column :matches, :w1_name, :loser1_name
|
rename_column :matches, :w1_name, :loser1_name
|
||||||
rename_column :matches, :w2_name, :loser2_name
|
rename_column :matches, :w2_name, :loser2_name
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class DropMatchupsArray < ActiveRecord::Migration
|
class DropMatchupsArray < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
remove_column :tournaments, :matchups_array
|
remove_column :tournaments, :matchups_array
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddTypeToTournament < ActiveRecord::Migration
|
class AddTypeToTournament < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :tournaments, :type, :text
|
add_column :tournaments, :type, :text
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RenameTypeToTournamentType < ActiveRecord::Migration
|
class RenameTypeToTournamentType < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RenameTypeToTournamentTypeForReal < ActiveRecord::Migration
|
class RenameTypeToTournamentTypeForReal < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
rename_column :tournaments, :type, :tournament_type
|
rename_column :tournaments, :type, :tournament_type
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RenameBoutNumber < ActiveRecord::Migration
|
class RenameBoutNumber < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
rename_column :matches, :boutNumber, :bout_number
|
rename_column :matches, :boutNumber, :bout_number
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class IntroduceIndexes < ActiveRecord::Migration
|
class IntroduceIndexes < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_index :weights, :tournament_id
|
add_index :weights, :tournament_id
|
||||||
add_index :schools, :tournament_id
|
add_index :schools, :tournament_id
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddMatIdToMatch < ActiveRecord::Migration
|
class AddMatIdToMatch < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :matches, :mat_id, :integer
|
add_column :matches, :mat_id, :integer
|
||||||
add_index :matches, :mat_id
|
add_index :matches, :mat_id
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddOfficalWeightWrestlers < ActiveRecord::Migration
|
class AddOfficalWeightWrestlers < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :tournaments, :weigh_in_ref, :text
|
add_column :tournaments, :weigh_in_ref, :text
|
||||||
add_column :wrestlers, :offical_weight, :decimal
|
add_column :wrestlers, :offical_weight, :decimal
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddUserIdToTournaments < ActiveRecord::Migration
|
class AddUserIdToTournaments < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :tournaments, :user_id, :integer
|
add_column :tournaments, :user_id, :integer
|
||||||
add_index :tournaments, :user_id
|
add_index :tournaments, :user_id
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateTeampointadjusts < ActiveRecord::Migration
|
class CreateTeampointadjusts < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :teampointadjusts do |t|
|
create_table :teampointadjusts do |t|
|
||||||
t.integer :points
|
t.integer :points
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddScoreBackToSchool < ActiveRecord::Migration
|
class AddScoreBackToSchool < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :schools, :score, :decimal
|
add_column :schools, :score, :decimal
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class RenameStats < ActiveRecord::Migration
|
class RenameStats < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
rename_column :matches, :g_stat, :w1_stat
|
rename_column :matches, :g_stat, :w1_stat
|
||||||
rename_column :matches, :r_stat, :w2_stat
|
rename_column :matches, :r_stat, :w2_stat
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateDelayedJobs < ActiveRecord::Migration
|
class CreateDelayedJobs < ActiveRecord::Migration[4.2]
|
||||||
def self.up
|
def self.up
|
||||||
create_table :delayed_jobs, force: true do |table|
|
create_table :delayed_jobs, force: true do |table|
|
||||||
table.integer :priority, default: 0, null: false # Allows some jobs to jump to the front of the queue
|
table.integer :priority, default: 0, null: false # Allows some jobs to jump to the front of the queue
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class GeneratingMatches < ActiveRecord::Migration
|
class GeneratingMatches < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :tournaments, :curently_generating_matches, :integer
|
add_column :tournaments, :curently_generating_matches, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class TournamentDate < ActiveRecord::Migration
|
class TournamentDate < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :tournaments, :date, :date
|
add_column :tournaments, :date, :date
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateTournamentDelegates < ActiveRecord::Migration
|
class CreateTournamentDelegates < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :tournament_delegates do |t|
|
create_table :tournament_delegates do |t|
|
||||||
t.integer :user_id
|
t.integer :user_id
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreateSchoolDelegates < ActiveRecord::Migration
|
class CreateSchoolDelegates < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :school_delegates do |t|
|
create_table :school_delegates do |t|
|
||||||
t.integer :user_id
|
t.integer :user_id
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddSchoolIdToTeampointsadjust < ActiveRecord::Migration
|
class AddSchoolIdToTeampointsadjust < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :teampointadjusts, :school_id, :integer
|
add_column :teampointadjusts, :school_id, :integer
|
||||||
end
|
end
|
||||||
|
|||||||
5
db/migrate/20170301174920_add_pool_column.rb
Normal file
5
db/migrate/20170301174920_add_pool_column.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class AddPoolColumn < ActiveRecord::Migration[4.2]
|
||||||
|
def change
|
||||||
|
add_column :wrestlers, :pool, :integer
|
||||||
|
end
|
||||||
|
end
|
||||||
169
db/schema.rb
169
db/schema.rb
@@ -1,4 +1,3 @@
|
|||||||
# encoding: UTF-8
|
|
||||||
# This file is auto-generated from the current state of the database. Instead
|
# This file is auto-generated from the current state of the database. Instead
|
||||||
# of editing this file, please use the migrations feature of Active Record to
|
# of editing this file, please use the migrations feature of Active Record to
|
||||||
# incrementally modify your database, and then regenerate this schema definition.
|
# incrementally modify your database, and then regenerate this schema definition.
|
||||||
@@ -11,151 +10,143 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20160126173424) do
|
ActiveRecord::Schema.define(version: 20170301174920) do
|
||||||
|
|
||||||
create_table "delayed_jobs", force: :cascade do |t|
|
create_table "delayed_jobs", force: :cascade do |t|
|
||||||
t.integer "priority", default: 0, null: false
|
t.integer "priority", default: 0, null: false
|
||||||
t.integer "attempts", default: 0, null: false
|
t.integer "attempts", default: 0, null: false
|
||||||
t.text "handler", null: false
|
t.text "handler", null: false
|
||||||
t.text "last_error"
|
t.text "last_error"
|
||||||
t.datetime "run_at"
|
t.datetime "run_at"
|
||||||
t.datetime "locked_at"
|
t.datetime "locked_at"
|
||||||
t.datetime "failed_at"
|
t.datetime "failed_at"
|
||||||
t.string "locked_by"
|
t.string "locked_by"
|
||||||
t.string "queue"
|
t.string "queue"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
t.index ["priority", "run_at"], name: "delayed_jobs_priority"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority"
|
|
||||||
|
|
||||||
create_table "matches", force: :cascade do |t|
|
create_table "matches", force: :cascade do |t|
|
||||||
t.integer "w1"
|
t.integer "w1"
|
||||||
t.integer "w2"
|
t.integer "w2"
|
||||||
t.text "w1_stat"
|
t.text "w1_stat"
|
||||||
t.text "w2_stat"
|
t.text "w2_stat"
|
||||||
t.integer "winner_id"
|
t.integer "winner_id"
|
||||||
t.string "win_type"
|
t.string "win_type"
|
||||||
t.string "score"
|
t.string "score"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "tournament_id"
|
t.integer "tournament_id"
|
||||||
t.integer "round"
|
t.integer "round"
|
||||||
t.integer "finished"
|
t.integer "finished"
|
||||||
t.integer "bout_number"
|
t.integer "bout_number"
|
||||||
t.integer "weight_id"
|
t.integer "weight_id"
|
||||||
t.string "bracket_position"
|
t.string "bracket_position"
|
||||||
t.integer "bracket_position_number"
|
t.integer "bracket_position_number"
|
||||||
t.string "loser1_name"
|
t.string "loser1_name"
|
||||||
t.string "loser2_name"
|
t.string "loser2_name"
|
||||||
t.integer "mat_id"
|
t.integer "mat_id"
|
||||||
|
t.index ["mat_id"], name: "index_matches_on_mat_id"
|
||||||
|
t.index ["tournament_id"], name: "index_matches_on_tournament_id"
|
||||||
|
t.index ["w1", "w2"], name: "index_matches_on_w1_and_w2"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "matches", ["mat_id"], name: "index_matches_on_mat_id"
|
|
||||||
add_index "matches", ["tournament_id"], name: "index_matches_on_tournament_id"
|
|
||||||
add_index "matches", ["w1", "w2"], name: "index_matches_on_w1_and_w2"
|
|
||||||
|
|
||||||
create_table "mats", force: :cascade do |t|
|
create_table "mats", force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.integer "tournament_id"
|
t.integer "tournament_id"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
t.index ["tournament_id"], name: "index_mats_on_tournament_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "mats", ["tournament_id"], name: "index_mats_on_tournament_id"
|
|
||||||
|
|
||||||
create_table "school_delegates", force: :cascade do |t|
|
create_table "school_delegates", force: :cascade do |t|
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.integer "school_id"
|
t.integer "school_id"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "schools", force: :cascade do |t|
|
create_table "schools", force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "tournament_id"
|
t.integer "tournament_id"
|
||||||
t.decimal "score"
|
t.decimal "score"
|
||||||
|
t.index ["tournament_id"], name: "index_schools_on_tournament_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "schools", ["tournament_id"], name: "index_schools_on_tournament_id"
|
|
||||||
|
|
||||||
create_table "teampointadjusts", force: :cascade do |t|
|
create_table "teampointadjusts", force: :cascade do |t|
|
||||||
t.integer "points"
|
t.integer "points"
|
||||||
t.integer "wrestler_id"
|
t.integer "wrestler_id"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.integer "school_id"
|
t.integer "school_id"
|
||||||
|
t.index ["wrestler_id"], name: "index_teampointadjusts_on_wrestler_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "teampointadjusts", ["wrestler_id"], name: "index_teampointadjusts_on_wrestler_id"
|
|
||||||
|
|
||||||
create_table "tournament_delegates", force: :cascade do |t|
|
create_table "tournament_delegates", force: :cascade do |t|
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.integer "tournament_id"
|
t.integer "tournament_id"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "tournaments", force: :cascade do |t|
|
create_table "tournaments", force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.string "address"
|
t.string "address"
|
||||||
t.string "director"
|
t.string "director"
|
||||||
t.string "director_email"
|
t.string "director_email"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.text "tournament_type"
|
t.text "tournament_type"
|
||||||
t.text "weigh_in_ref"
|
t.text "weigh_in_ref"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.integer "curently_generating_matches"
|
t.integer "curently_generating_matches"
|
||||||
t.date "date"
|
t.date "date"
|
||||||
|
t.index ["user_id"], name: "index_tournaments_on_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "tournaments", ["user_id"], name: "index_tournaments_on_user_id"
|
|
||||||
|
|
||||||
create_table "users", force: :cascade do |t|
|
create_table "users", force: :cascade do |t|
|
||||||
t.string "email", default: "", null: false
|
t.string "email", default: "", null: false
|
||||||
t.string "encrypted_password", default: "", null: false
|
t.string "encrypted_password", default: "", null: false
|
||||||
t.string "reset_password_token"
|
t.string "reset_password_token"
|
||||||
t.datetime "reset_password_sent_at"
|
t.datetime "reset_password_sent_at"
|
||||||
t.datetime "remember_created_at"
|
t.datetime "remember_created_at"
|
||||||
t.integer "sign_in_count", default: 0, null: false
|
t.integer "sign_in_count", default: 0, null: false
|
||||||
t.datetime "current_sign_in_at"
|
t.datetime "current_sign_in_at"
|
||||||
t.datetime "last_sign_in_at"
|
t.datetime "last_sign_in_at"
|
||||||
t.string "current_sign_in_ip"
|
t.string "current_sign_in_ip"
|
||||||
t.string "last_sign_in_ip"
|
t.string "last_sign_in_ip"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
t.index ["email"], name: "index_users_on_email", unique: true
|
||||||
|
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["email"], name: "index_users_on_email", unique: true
|
|
||||||
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
|
||||||
|
|
||||||
create_table "weights", force: :cascade do |t|
|
create_table "weights", force: :cascade do |t|
|
||||||
t.integer "max"
|
t.integer "max"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "tournament_id"
|
t.integer "tournament_id"
|
||||||
|
t.index ["tournament_id"], name: "index_weights_on_tournament_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "weights", ["tournament_id"], name: "index_weights_on_tournament_id"
|
|
||||||
|
|
||||||
create_table "wrestlers", force: :cascade do |t|
|
create_table "wrestlers", force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.integer "school_id"
|
t.integer "school_id"
|
||||||
t.integer "weight_id"
|
t.integer "weight_id"
|
||||||
t.integer "seed"
|
t.integer "seed"
|
||||||
t.integer "original_seed"
|
t.integer "original_seed"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "season_win"
|
t.integer "season_win"
|
||||||
t.integer "season_loss"
|
t.integer "season_loss"
|
||||||
t.string "criteria"
|
t.string "criteria"
|
||||||
t.boolean "extra"
|
t.boolean "extra"
|
||||||
t.decimal "offical_weight"
|
t.decimal "offical_weight"
|
||||||
|
t.integer "pool"
|
||||||
|
t.index ["weight_id"], name: "index_wrestlers_on_weight_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "wrestlers", ["weight_id"], name: "index_wrestlers_on_weight_id"
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,4 +22,4 @@ memcached:
|
|||||||
|
|
||||||
worker:
|
worker:
|
||||||
image: wrestlingdev
|
image: wrestlingdev
|
||||||
command: /bin/bash -c "cd /var/www && bundle exec rake jobs:work RAILS_ENV=production"
|
command: /bin/bash -c "cd /rails && bundle exec rake jobs:work RAILS_ENV=production"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
app:
|
app:
|
||||||
|
image: registry:5000/wrestlingdev:dev
|
||||||
extends:
|
extends:
|
||||||
file: docker-compose-common.yml
|
file: docker-compose-common.yml
|
||||||
service: app
|
service: app
|
||||||
@@ -27,6 +28,7 @@ db:
|
|||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
|
image: registry:5000/wrestlingdev:dev
|
||||||
extends:
|
extends:
|
||||||
file: docker-compose-common.yml
|
file: docker-compose-common.yml
|
||||||
service: worker
|
service: worker
|
||||||
|
|||||||
9
frontend/.gitignore
vendored
9
frontend/.gitignore
vendored
@@ -1,9 +0,0 @@
|
|||||||
.DS_Store
|
|
||||||
|
|
||||||
#ignore node_modules, as the node project is not "deployed" per se: http://www.mikealrogers.com/posts/nodemodules-in-git.html
|
|
||||||
/node_modules
|
|
||||||
|
|
||||||
/dist
|
|
||||||
/generated
|
|
||||||
|
|
||||||
.sass-cache
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
.DS_Store
|
|
||||||
|
|
||||||
#ignore node_modules, as the node project is not "deployed" per se: http://www.mikealrogers.com/posts/nodemodules-in-git.html
|
|
||||||
/node_modules
|
|
||||||
|
|
||||||
/dist
|
|
||||||
/generated
|
|
||||||
|
|
||||||
.sass-cache
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
node_js:
|
|
||||||
- 0.10
|
|
||||||
script: "lineman spec-ci"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
/*global module:false*/
|
|
||||||
module.exports = function(grunt) {
|
|
||||||
require('./config/lineman').config.grunt.run(grunt);
|
|
||||||
};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
web: npm run production
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# My Lineman Application
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
.hello {
|
|
||||||
background-color: #efefef;
|
|
||||||
border: 1px solid #dedede;
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
var app = angular.module("wrestlingdev", ["ngRoute","Devise"]).run(function($rootScope) {
|
|
||||||
// adds some basic utilities to the $rootScope for debugging purposes
|
|
||||||
$rootScope.log = function(thing) {
|
|
||||||
console.log(thing);
|
|
||||||
};
|
|
||||||
|
|
||||||
$rootScope.alert = function(thing) {
|
|
||||||
alert(thing);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
app.controller("loginController", function($scope, $routeParams, Auth, $rootScope) {
|
|
||||||
$scope.credentials = {
|
|
||||||
email: '',
|
|
||||||
password: ''
|
|
||||||
};
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
headers: {
|
|
||||||
'X-HTTP-Method-Override': 'POST'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
$scope.login = function(){
|
|
||||||
Auth.login($scope.credentials, config).then(function(user) {
|
|
||||||
console.log(user); // => {id: 1, ect: '...'}
|
|
||||||
$rootScope.user = user;
|
|
||||||
$rootScope.alertClass = "alert alert-success";
|
|
||||||
$rootScope.alertMessage = "Logged in successfully";
|
|
||||||
}, function(error) {
|
|
||||||
console.log(error);
|
|
||||||
$rootScope.alertClass = "alert alert-danger";
|
|
||||||
$rootScope.alertMessage = "Username and/or password is incorrect";
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.logout = function(){
|
|
||||||
Auth.logout(config).then(function(oldUser) {
|
|
||||||
// alert(oldUser.name + "you're signed out now.");
|
|
||||||
$rootScope.user = null;
|
|
||||||
$rootScope.alertClass = "alert alert-success";
|
|
||||||
$rootScope.alertMessage = "Logged out successfully";
|
|
||||||
}, function(error) {
|
|
||||||
// An error occurred logging out.
|
|
||||||
$rootScope.alertClass = "alert alert-danger";
|
|
||||||
$rootScope.alertMessage = "There was an error logging out";
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
Auth.currentUser().then(function(user) {
|
|
||||||
// User was logged in, or Devise returned
|
|
||||||
// previously authenticated session.
|
|
||||||
$rootScope.user = user;
|
|
||||||
}, function(error) {
|
|
||||||
// unauthenticated error
|
|
||||||
$rootScope.user = null;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
app.controller("myTournamentsController", function($scope, tournamentsService, $rootScope) {
|
|
||||||
|
|
||||||
tournamentsService.getMyTournaments().then(function(data) {
|
|
||||||
//this will execute when the
|
|
||||||
//AJAX call completes.
|
|
||||||
$scope.allTournaments = data;
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
app.controller("tournamentController", function($scope, tournamentsService, $routeParams, Wrestler, Auth, $rootScope) {
|
|
||||||
$scope.message = "Test message in scope.";
|
|
||||||
|
|
||||||
|
|
||||||
// $scope.tournamentData = "test";
|
|
||||||
tournamentsService.tournamentDetails($routeParams.id).then(function(data) {
|
|
||||||
//this will execute when the
|
|
||||||
//AJAX call completes.
|
|
||||||
$scope.tournament = data;
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.refreshTournamentData = function(){
|
|
||||||
tournamentsService.tournamentDetails($routeParams.id).then(function(data) {
|
|
||||||
//this will execute when the
|
|
||||||
//AJAX call completes.
|
|
||||||
$scope.tournament = data;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// refresh tournament data every 10 seconds
|
|
||||||
// setInterval(function(){
|
|
||||||
// tournamentsService.tournamentDetails($routeParams.id).then(function(data) {
|
|
||||||
// //this will execute when the
|
|
||||||
// //AJAX call completes.
|
|
||||||
// $scope.tournament = data;
|
|
||||||
// });
|
|
||||||
// }, 10000);
|
|
||||||
|
|
||||||
$scope.wrestler = Wrestler;
|
|
||||||
|
|
||||||
$scope.showSchools = false;
|
|
||||||
|
|
||||||
$scope.toggleSchools = function(){
|
|
||||||
$scope.showSchools = !$scope.showSchools;
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.showWeightSeeds = false;
|
|
||||||
|
|
||||||
$scope.toggleWeightSeeds = function(){
|
|
||||||
$scope.showWeightSeeds = !$scope.showWeightSeeds;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
$scope.showBoutBoard = false;
|
|
||||||
|
|
||||||
$scope.toggleBoutBoard = function(){
|
|
||||||
$scope.showBoutBoard = !$scope.showBoutBoard;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
$scope.isTournamentOwner = function(tournamentId,userId){
|
|
||||||
if(userId == tournamentId){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
$scope.newSchool = null;
|
|
||||||
|
|
||||||
$scope.saveNewSchool = function(){
|
|
||||||
$scope.newSchool.tournament_id = $scope.tournament.id;
|
|
||||||
tournamentsService.saveNewSchool($scope.newSchool).then(function(data) {
|
|
||||||
$scope.tournament.schools.push(data);
|
|
||||||
});
|
|
||||||
$scope.newSchool = null;
|
|
||||||
$('#NewSchool').modal('hide');
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.deleteSchool = function(school){
|
|
||||||
if (confirm('Are you sure you want to delete ' + school.name + '?')) {
|
|
||||||
tournamentsService.deleteSchool(school).then(function(data) {
|
|
||||||
$scope.tournament.schools.splice( $scope.tournament.schools.indexOf(school), 1 );
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.updateSchool = function(school){
|
|
||||||
tournamentsService.updateSchool(school);
|
|
||||||
$('#EditSchool' + school.id).modal('hide');
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
app.controller("tournamentsController", function($scope, tournamentsService) {
|
|
||||||
|
|
||||||
tournamentsService.getAllTournaments().then(function(data) {
|
|
||||||
//this will execute when the
|
|
||||||
//AJAX call completes.
|
|
||||||
$scope.allTournaments = data;
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.searchTournaments = function (){
|
|
||||||
tournamentsService.searchTournaments($scope.searchTerms).then(function(data) {
|
|
||||||
//this will execute when the
|
|
||||||
//AJAX call completes.
|
|
||||||
$scope.allTournaments = data;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
(function(){
|
|
||||||
app.directive('usSpinner', ['$http', '$rootScope' ,function ($http, $rootScope){
|
|
||||||
return {
|
|
||||||
link: function (scope, elm, attrs)
|
|
||||||
{
|
|
||||||
$rootScope.spinnerActive = false;
|
|
||||||
scope.isLoading = function () {
|
|
||||||
return $http.pendingRequests.length > 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
scope.$watch(scope.isLoading, function (loading)
|
|
||||||
{
|
|
||||||
$rootScope.spinnerActive = loading;
|
|
||||||
if(loading){
|
|
||||||
elm.removeClass('ng-hide');
|
|
||||||
}else{
|
|
||||||
elm.addClass('ng-hide');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
|
||||||
}).call(this);
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
app.factory('Wrestler', function Wrestler(){
|
|
||||||
var vm = this;
|
|
||||||
|
|
||||||
|
|
||||||
vm.matches = function(wrestler,matches){
|
|
||||||
|
|
||||||
console.log(matches);
|
|
||||||
return _.filter(matches, function(match){
|
|
||||||
return match.w1 == wrestler.id || match.w2 == wrestler.id;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
return vm;
|
|
||||||
});
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
// $routeProvider.when('/list-of-books', {
|
|
||||||
// templateUrl: 'angular/books.html',
|
|
||||||
// controller: 'BooksController'
|
|
||||||
// // uncomment if you want to see an example of a route that resolves a request prior to rendering
|
|
||||||
// // resolve: {
|
|
||||||
// // books : function(BookService) {
|
|
||||||
// // return BookService.get();
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app.config(['$routeProvider', '$locationProvider', function($routeProvider,$locationProvider) {
|
|
||||||
|
|
||||||
$routeProvider.when('/', {
|
|
||||||
templateUrl: 'home.html',
|
|
||||||
});
|
|
||||||
|
|
||||||
$routeProvider.when('/tournaments', {
|
|
||||||
templateUrl: 'tournaments-search.html',
|
|
||||||
controller: 'tournamentsController'
|
|
||||||
});
|
|
||||||
|
|
||||||
$routeProvider.when('/tournaments/user', {
|
|
||||||
templateUrl: 'my-tournaments.html',
|
|
||||||
controller: 'myTournamentsController'
|
|
||||||
});
|
|
||||||
|
|
||||||
$routeProvider.when('/tournaments/:id', {
|
|
||||||
templateUrl: 'tournaments-show.html',
|
|
||||||
controller: 'tournamentController'
|
|
||||||
});
|
|
||||||
|
|
||||||
$routeProvider.when('/about', {
|
|
||||||
templateUrl: 'about.html',
|
|
||||||
});
|
|
||||||
|
|
||||||
$routeProvider.when('/tutorials', {
|
|
||||||
templateUrl: 'tutorials.html',
|
|
||||||
});
|
|
||||||
|
|
||||||
$routeProvider.otherwise({redirectTo: '/'});
|
|
||||||
|
|
||||||
//this give me normal routes instead of /#/
|
|
||||||
// $locationProvider.html5Mode(true);
|
|
||||||
}]);
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user