commit 857aa1af52a94d73a5713fa798f4a250015ec853 Author: Anthony Correa Date: Thu Sep 7 14:23:30 2023 -0500 initial commit diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e69de29 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..31eeee0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d9da8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,143 @@ +.env +var + +#ide +/.nova + +# certs +config/certs/*.pem + +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-* + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/ +!/tmp/pids/.keep + +# Ignore uploaded files in development. +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/ +!/tmp/storage/.keep + +/public/assets + +# Ignore master key for decrypting credentials and more. +/config/master.key + +# MacOS +# https://github.com/github/gitignore/blob/main/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +*.rbc +capybara-*.html +.rspec +/db/*.sqlite3 +/db/*.sqlite3-journal +/db/*.sqlite3-[0-9]* +/public/system +/coverage/ +/spec/tmp +*.orig +rerun.txt +pickle-email-*.html + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# TODO Comment out this rule if you are OK with secrets being uploaded to the repo +config/initializers/secret_token.rb +config/master.key + +# Only include if you have production secrets in this file, which is no longer a Rails default +# config/secrets.yml + +# dotenv, dotenv-rails +# TODO Comment out these rules if environment variables can be committed +.env +.env*.local + +## Environment normalization: +/.bundle +/vendor/bundle + +# these should all be checked in to normalize the environment: +# Gemfile.lock, .ruby-version, .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# if using bower-rails ignore default bower_components path bower.json files +/vendor/assets/bower_components +*.bowerrc +bower.json + +# Ignore pow environment settings +.powenv + +# Ignore Byebug command history file. +.byebug_history + +# Ignore node_modules +node_modules/ + +# Ignore precompiled javascript packs +/public/packs +/public/packs-test +/public/assets + +# Ignore yarn files +/yarn-error.log +yarn-debug.log* +.yarn-integrity + +# Ignore uploaded files in development +/storage/* +!/storage/.keep +/public/uploads \ No newline at end of file diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..9e79f6c --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby-3.2.2 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9615fcf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM ruby:3 +RUN apt-get update +WORKDIR /app +COPY Gemfile* . +RUN bundle install +COPY . . +EXPOSE 3000 +CMD ["rails", "server", "-b", "0.0.0.0"] \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..248517d --- /dev/null +++ b/Gemfile @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +ruby '3.2.2' + +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem 'rails', '~> 7.0.7' + +# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] +gem 'sprockets-rails' + +# Use sqlite3 as the database for Active Record +gem 'sqlite3', '~> 1.4' + +# Use the Puma web server [https://github.com/puma/puma] +gem 'puma', '~> 5.0' + +# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +gem 'importmap-rails' + +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem 'turbo-rails' + +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem 'stimulus-rails' + +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem 'jbuilder' + +# Use Redis adapter to run Action Cable in production +# gem "redis", "~> 4.0" + +# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] +# gem "kredis" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] + +# Reduces boot times through caching; required in config/boot.rb +gem 'bootsnap', require: false + +# Use Sass to process CSS +# gem "sassc-rails" + +# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] +# gem "image_processing", "~> 1.2" + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem 'debug', platforms: %i[mri mingw x64_mingw] +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem 'web-console' + + # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] + # gem "rack-mini-profiler" + + # Speed up commands on slow machines / big apps [https://github.com/rails/spring] + # gem "spring" +end + +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem 'capybara' + gem 'selenium-webdriver' + gem 'webdrivers' +end + +gem 'teamsnap_rb', '~> 3.0' + +gem 'omniauth', '~> 1.9' +gem 'omniauth-rails_csrf_protection', '~> 0.1.2' +gem 'omniauth-teamsnap', '~> 1.3' + +gem 'slim', '~> 5.1' + +gem 'slim-rails', '~> 3.6' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..14e878e --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,331 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.7) + actionpack (= 7.0.7) + activesupport (= 7.0.7) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.7) + actionpack (= 7.0.7) + activejob (= 7.0.7) + activerecord (= 7.0.7) + activestorage (= 7.0.7) + activesupport (= 7.0.7) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.7) + actionpack (= 7.0.7) + actionview (= 7.0.7) + activejob (= 7.0.7) + activesupport (= 7.0.7) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.7) + actionview (= 7.0.7) + activesupport (= 7.0.7) + rack (~> 2.0, >= 2.2.4) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.7) + actionpack (= 7.0.7) + activerecord (= 7.0.7) + activestorage (= 7.0.7) + activesupport (= 7.0.7) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.7) + activesupport (= 7.0.7) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.7) + activesupport (= 7.0.7) + globalid (>= 0.3.6) + activemodel (7.0.7) + activesupport (= 7.0.7) + activerecord (7.0.7) + activemodel (= 7.0.7) + activesupport (= 7.0.7) + activestorage (7.0.7) + actionpack (= 7.0.7) + activejob (= 7.0.7) + activerecord (= 7.0.7) + activesupport (= 7.0.7) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.7) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + axiom-types (0.1.1) + descendants_tracker (~> 0.0.4) + ice_nine (~> 0.11.0) + thread_safe (~> 0.3, >= 0.3.1) + bindex (0.8.1) + bootsnap (1.16.0) + msgpack (~> 1.2) + builder (3.2.4) + capybara (3.39.2) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + coercible (1.0.0) + descendants_tracker (~> 0.0.1) + concurrent-ruby (1.2.2) + crass (1.0.6) + date (3.3.3) + debug (1.8.0) + irb (>= 1.5.0) + reline (>= 0.3.1) + descendants_tracker (0.0.4) + thread_safe (~> 0.3, >= 0.3.1) + equalizer (0.0.11) + erubi (1.12.0) + ethon (0.16.0) + ffi (>= 1.15.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + ffi (1.15.5) + globalid (1.1.0) + activesupport (>= 5.0) + hashie (5.0.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + ice_nine (0.11.2) + importmap-rails (1.2.1) + actionpack (>= 6.0.0) + railties (>= 6.0.0) + inflecto (0.0.2) + io-console (0.6.0) + irb (1.7.4) + reline (>= 0.3.6) + jbuilder (2.11.5) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + jwt (2.7.1) + loofah (2.21.3) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + matrix (0.4.2) + method_source (1.0.0) + mini_mime (1.1.5) + minitest (5.19.0) + msgpack (1.7.2) + multi_xml (0.6.0) + multipart-post (2.3.0) + net-imap (0.3.7) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol + nio4r (2.5.9) + nokogiri (1.15.4-aarch64-linux) + racc (~> 1.4) + nokogiri (1.15.4-arm64-darwin) + racc (~> 1.4) + oauth2 (2.0.9) + faraday (>= 0.17.3, < 3.0) + jwt (>= 1.0, < 3.0) + multi_xml (~> 0.5) + rack (>= 1.2, < 4) + snaky_hash (~> 2.0) + version_gem (~> 1.1) + omniauth (1.9.2) + hashie (>= 3.4.6) + rack (>= 1.6.2, < 3) + omniauth-oauth2 (1.7.3) + oauth2 (>= 1.4, < 3) + omniauth (>= 1.9, < 3) + omniauth-rails_csrf_protection (0.1.2) + actionpack (>= 4.2) + omniauth (>= 1.3.1) + omniauth-teamsnap (1.3.0) + omniauth (~> 1.8) + omniauth-oauth2 (~> 1.5) + public_suffix (5.0.3) + puma (5.6.7) + nio4r (~> 2.0) + racc (1.7.1) + rack (2.2.8) + rack-test (2.1.0) + rack (>= 1.3) + rails (7.0.7) + actioncable (= 7.0.7) + actionmailbox (= 7.0.7) + actionmailer (= 7.0.7) + actionpack (= 7.0.7) + actiontext (= 7.0.7) + actionview (= 7.0.7) + activejob (= 7.0.7) + activemodel (= 7.0.7) + activerecord (= 7.0.7) + activestorage (= 7.0.7) + activesupport (= 7.0.7) + bundler (>= 1.15.0) + railties (= 7.0.7) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.0.7) + actionpack (= 7.0.7) + activesupport (= 7.0.7) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rake (13.0.6) + regexp_parser (2.8.1) + reline (0.3.7) + io-console (~> 0.5) + rexml (3.2.6) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + selenium-webdriver (4.10.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + slim (5.1.1) + temple (~> 0.10.0) + tilt (>= 2.1.0) + slim-rails (3.6.2) + actionpack (>= 3.1) + railties (>= 3.1) + slim (>= 3.0, < 6.0, != 5.0.0) + snaky_hash (2.0.1) + hashie + version_gem (~> 1.1, >= 1.1.1) + sprockets (4.2.0) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sqlite3 (1.6.3-aarch64-linux) + sqlite3 (1.6.3-arm64-darwin) + stimulus-rails (1.2.2) + railties (>= 6.0.0) + teamsnap_rb (3.0.3) + faraday (< 2.0) + inflecto (~> 0.0.2) + typhoeus (>= 1.3, < 1.5) + virtus (~> 1.0.4) + temple (0.10.2) + thor (1.2.2) + thread_safe (0.3.6) + tilt (2.2.0) + timeout (0.4.0) + turbo-rails (1.4.0) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + version_gem (1.1.3) + virtus (1.0.5) + axiom-types (~> 0.1) + coercible (~> 1.0) + descendants_tracker (~> 0.0, >= 0.0.3) + equalizer (~> 0.0, >= 0.0.9) + web-console (4.2.0) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webdrivers (5.3.1) + nokogiri (~> 1.6) + rubyzip (>= 1.3.0) + selenium-webdriver (~> 4.0, < 4.11) + websocket (1.2.9) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.11) + +PLATFORMS + aarch64-linux + arm64-darwin-22 + +DEPENDENCIES + bootsnap + capybara + debug + importmap-rails + jbuilder + omniauth (~> 1.9) + omniauth-rails_csrf_protection (~> 0.1.2) + omniauth-teamsnap (~> 1.3) + puma (~> 5.0) + rails (~> 7.0.7) + selenium-webdriver + slim (~> 5.1) + slim-rails (~> 3.6) + sprockets-rails + sqlite3 (~> 1.4) + stimulus-rails + teamsnap_rb (~> 3.0) + turbo-rails + tzinfo-data + web-console + webdrivers + +RUBY VERSION + ruby 3.2.2p53 + +BUNDLED WITH + 2.4.19 diff --git a/README.md b/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..488c551 --- /dev/null +++ b/Rakefile @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative 'config/application' + +Rails.application.load_tasks diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000..ddd546a --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,4 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css +//= link_tree ../../javascript .js +//= link_tree ../../../vendor/javascript .js diff --git a/app/assets/fonts/Graduate.ttf b/app/assets/fonts/Graduate.ttf new file mode 100755 index 0000000..29061d9 Binary files /dev/null and b/app/assets/fonts/Graduate.ttf differ diff --git a/app/assets/fonts/Oswald.ttf b/app/assets/fonts/Oswald.ttf new file mode 100755 index 0000000..938e912 Binary files /dev/null and b/app/assets/fonts/Oswald.ttf differ diff --git a/app/assets/fonts/futura-now.ttf b/app/assets/fonts/futura-now.ttf new file mode 100644 index 0000000..03fd100 Binary files /dev/null and b/app/assets/fonts/futura-now.ttf differ diff --git a/app/assets/fonts/helvetica-now.ttf b/app/assets/fonts/helvetica-now.ttf new file mode 100644 index 0000000..e2b0703 Binary files /dev/null and b/app/assets/fonts/helvetica-now.ttf differ diff --git a/app/assets/fonts/inconsolata-vf.ttf b/app/assets/fonts/inconsolata-vf.ttf new file mode 100644 index 0000000..07c991b Binary files /dev/null and b/app/assets/fonts/inconsolata-vf.ttf differ diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/images/baseball-diamond.svg b/app/assets/images/baseball-diamond.svg new file mode 100644 index 0000000..0b523a9 --- /dev/null +++ b/app/assets/images/baseball-diamond.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/app/assets/images/benchcoach.svg b/app/assets/images/benchcoach.svg new file mode 100644 index 0000000..858d545 --- /dev/null +++ b/app/assets/images/benchcoach.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/icons/add-event.svg b/app/assets/images/icons/add-event.svg new file mode 100644 index 0000000..9baba35 --- /dev/null +++ b/app/assets/images/icons/add-event.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/add-member.svg b/app/assets/images/icons/add-member.svg new file mode 100644 index 0000000..0e51d43 --- /dev/null +++ b/app/assets/images/icons/add-member.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/alert.svg b/app/assets/images/icons/alert.svg new file mode 100644 index 0000000..be6fbec --- /dev/null +++ b/app/assets/images/icons/alert.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/alerts.svg b/app/assets/images/icons/alerts.svg new file mode 100644 index 0000000..c7c8b88 --- /dev/null +++ b/app/assets/images/icons/alerts.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/archive.svg b/app/assets/images/icons/archive.svg new file mode 100644 index 0000000..75e7ebe --- /dev/null +++ b/app/assets/images/icons/archive.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/arrow-left.svg b/app/assets/images/icons/arrow-left.svg new file mode 100644 index 0000000..a274466 --- /dev/null +++ b/app/assets/images/icons/arrow-left.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/arrow-right.svg b/app/assets/images/icons/arrow-right.svg new file mode 100644 index 0000000..70d81c1 --- /dev/null +++ b/app/assets/images/icons/arrow-right.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/arrow-up.svg b/app/assets/images/icons/arrow-up.svg new file mode 100644 index 0000000..ffc7788 --- /dev/null +++ b/app/assets/images/icons/arrow-up.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/assignments.svg b/app/assets/images/icons/assignments.svg new file mode 100644 index 0000000..5dba8de --- /dev/null +++ b/app/assets/images/icons/assignments.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/availability.svg b/app/assets/images/icons/availability.svg new file mode 100644 index 0000000..021f1f9 --- /dev/null +++ b/app/assets/images/icons/availability.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/caret-down.svg b/app/assets/images/icons/caret-down.svg new file mode 100644 index 0000000..f443989 --- /dev/null +++ b/app/assets/images/icons/caret-down.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/caret-left.svg b/app/assets/images/icons/caret-left.svg new file mode 100644 index 0000000..f6d9a5f --- /dev/null +++ b/app/assets/images/icons/caret-left.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/caret-right.svg b/app/assets/images/icons/caret-right.svg new file mode 100644 index 0000000..896e514 --- /dev/null +++ b/app/assets/images/icons/caret-right.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/caret-up.svg b/app/assets/images/icons/caret-up.svg new file mode 100644 index 0000000..8ed8b7f --- /dev/null +++ b/app/assets/images/icons/caret-up.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/cart.svg b/app/assets/images/icons/cart.svg new file mode 100644 index 0000000..40a8065 --- /dev/null +++ b/app/assets/images/icons/cart.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/check.svg b/app/assets/images/icons/check.svg new file mode 100644 index 0000000..55330b9 --- /dev/null +++ b/app/assets/images/icons/check.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/columns.svg b/app/assets/images/icons/columns.svg new file mode 100644 index 0000000..730316a --- /dev/null +++ b/app/assets/images/icons/columns.svg @@ -0,0 +1 @@ +columns-updated \ No newline at end of file diff --git a/app/assets/images/icons/computer.svg b/app/assets/images/icons/computer.svg new file mode 100644 index 0000000..52ab1c1 --- /dev/null +++ b/app/assets/images/icons/computer.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/credit-card.svg b/app/assets/images/icons/credit-card.svg new file mode 100644 index 0000000..4bb6082 --- /dev/null +++ b/app/assets/images/icons/credit-card.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/dashboard.svg b/app/assets/images/icons/dashboard.svg new file mode 100644 index 0000000..a561c74 --- /dev/null +++ b/app/assets/images/icons/dashboard.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/directory.svg b/app/assets/images/icons/directory.svg new file mode 100644 index 0000000..125e5d4 --- /dev/null +++ b/app/assets/images/icons/directory.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/icons/dismiss.svg b/app/assets/images/icons/dismiss.svg new file mode 100644 index 0000000..21e6c1f --- /dev/null +++ b/app/assets/images/icons/dismiss.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/divisions.svg b/app/assets/images/icons/divisions.svg new file mode 100644 index 0000000..c2cd473 --- /dev/null +++ b/app/assets/images/icons/divisions.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/doc.svg b/app/assets/images/icons/doc.svg new file mode 100644 index 0000000..0307152 --- /dev/null +++ b/app/assets/images/icons/doc.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/down.svg b/app/assets/images/icons/down.svg new file mode 100644 index 0000000..996d05b --- /dev/null +++ b/app/assets/images/icons/down.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/download.svg b/app/assets/images/icons/download.svg new file mode 100644 index 0000000..2eae37b --- /dev/null +++ b/app/assets/images/icons/download.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/drag.svg b/app/assets/images/icons/drag.svg new file mode 100644 index 0000000..cf4f5e4 --- /dev/null +++ b/app/assets/images/icons/drag.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/edit.svg b/app/assets/images/icons/edit.svg new file mode 100644 index 0000000..2dbb908 --- /dev/null +++ b/app/assets/images/icons/edit.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/export.svg b/app/assets/images/icons/export.svg new file mode 100644 index 0000000..f49f0e3 --- /dev/null +++ b/app/assets/images/icons/export.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/fees.svg b/app/assets/images/icons/fees.svg new file mode 100644 index 0000000..9692aae --- /dev/null +++ b/app/assets/images/icons/fees.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/female-user.svg b/app/assets/images/icons/female-user.svg new file mode 100644 index 0000000..30a57f9 --- /dev/null +++ b/app/assets/images/icons/female-user.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/file.svg b/app/assets/images/icons/file.svg new file mode 100644 index 0000000..184ea85 --- /dev/null +++ b/app/assets/images/icons/file.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/flag.svg b/app/assets/images/icons/flag.svg new file mode 100644 index 0000000..74573ba --- /dev/null +++ b/app/assets/images/icons/flag.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/forms.svg b/app/assets/images/icons/forms.svg new file mode 100644 index 0000000..e04d6b7 --- /dev/null +++ b/app/assets/images/icons/forms.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/grid.svg b/app/assets/images/icons/grid.svg new file mode 100644 index 0000000..ca6b53c --- /dev/null +++ b/app/assets/images/icons/grid.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/help.svg b/app/assets/images/icons/help.svg new file mode 100644 index 0000000..7f22b32 --- /dev/null +++ b/app/assets/images/icons/help.svg @@ -0,0 +1 @@ +help-updated \ No newline at end of file diff --git a/app/assets/images/icons/home.svg b/app/assets/images/icons/home.svg new file mode 100644 index 0000000..3e78ffe --- /dev/null +++ b/app/assets/images/icons/home.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/import.svg b/app/assets/images/icons/import.svg new file mode 100644 index 0000000..26b3e61 --- /dev/null +++ b/app/assets/images/icons/import.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/inbox.svg b/app/assets/images/icons/inbox.svg new file mode 100644 index 0000000..7963e47 --- /dev/null +++ b/app/assets/images/icons/inbox.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/info.svg b/app/assets/images/icons/info.svg new file mode 100644 index 0000000..56594f6 --- /dev/null +++ b/app/assets/images/icons/info.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/installments.svg b/app/assets/images/icons/installments.svg new file mode 100644 index 0000000..eaa8182 --- /dev/null +++ b/app/assets/images/icons/installments.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/left.svg b/app/assets/images/icons/left.svg new file mode 100644 index 0000000..a713378 --- /dev/null +++ b/app/assets/images/icons/left.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/loader.svg b/app/assets/images/icons/loader.svg new file mode 100644 index 0000000..e709c3f --- /dev/null +++ b/app/assets/images/icons/loader.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/icons/location.svg b/app/assets/images/icons/location.svg new file mode 100644 index 0000000..202c6f2 --- /dev/null +++ b/app/assets/images/icons/location.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/lock.svg b/app/assets/images/icons/lock.svg new file mode 100644 index 0000000..120f62a --- /dev/null +++ b/app/assets/images/icons/lock.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/mail.svg b/app/assets/images/icons/mail.svg new file mode 100644 index 0000000..5ee91fc --- /dev/null +++ b/app/assets/images/icons/mail.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/medal.svg b/app/assets/images/icons/medal.svg new file mode 100644 index 0000000..afd3a1c --- /dev/null +++ b/app/assets/images/icons/medal.svg @@ -0,0 +1 @@ +medal-updated \ No newline at end of file diff --git a/app/assets/images/icons/media.svg b/app/assets/images/icons/media.svg new file mode 100644 index 0000000..2294134 --- /dev/null +++ b/app/assets/images/icons/media.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/megaphone.svg b/app/assets/images/icons/megaphone.svg new file mode 100644 index 0000000..b3561a8 --- /dev/null +++ b/app/assets/images/icons/megaphone.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/merge.svg b/app/assets/images/icons/merge.svg new file mode 100644 index 0000000..4b2d792 --- /dev/null +++ b/app/assets/images/icons/merge.svg @@ -0,0 +1 @@ +merge-updated \ No newline at end of file diff --git a/app/assets/images/icons/messages.svg b/app/assets/images/icons/messages.svg new file mode 100644 index 0000000..c1141f6 --- /dev/null +++ b/app/assets/images/icons/messages.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/money.svg b/app/assets/images/icons/money.svg new file mode 100644 index 0000000..5a56099 --- /dev/null +++ b/app/assets/images/icons/money.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/new-season.svg b/app/assets/images/icons/new-season.svg new file mode 100644 index 0000000..8b64eec --- /dev/null +++ b/app/assets/images/icons/new-season.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/non-player.svg b/app/assets/images/icons/non-player.svg new file mode 100644 index 0000000..260c4ab --- /dev/null +++ b/app/assets/images/icons/non-player.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/notifications.svg b/app/assets/images/icons/notifications.svg new file mode 100644 index 0000000..42d3066 --- /dev/null +++ b/app/assets/images/icons/notifications.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/page-layout.svg b/app/assets/images/icons/page-layout.svg new file mode 100644 index 0000000..3b3fdcd --- /dev/null +++ b/app/assets/images/icons/page-layout.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/photos.svg b/app/assets/images/icons/photos.svg new file mode 100644 index 0000000..3ae172c --- /dev/null +++ b/app/assets/images/icons/photos.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/piggybank.svg b/app/assets/images/icons/piggybank.svg new file mode 100644 index 0000000..199fed0 --- /dev/null +++ b/app/assets/images/icons/piggybank.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/plus.svg b/app/assets/images/icons/plus.svg new file mode 100644 index 0000000..0418b9a --- /dev/null +++ b/app/assets/images/icons/plus.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/pointer.svg b/app/assets/images/icons/pointer.svg new file mode 100644 index 0000000..815b023 --- /dev/null +++ b/app/assets/images/icons/pointer.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/posts.svg b/app/assets/images/icons/posts.svg new file mode 100644 index 0000000..db4660a --- /dev/null +++ b/app/assets/images/icons/posts.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/preview.svg b/app/assets/images/icons/preview.svg new file mode 100644 index 0000000..1c1cc85 --- /dev/null +++ b/app/assets/images/icons/preview.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/public.svg b/app/assets/images/icons/public.svg new file mode 100644 index 0000000..483c8bf --- /dev/null +++ b/app/assets/images/icons/public.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/refresh.svg b/app/assets/images/icons/refresh.svg new file mode 100644 index 0000000..1118cc6 --- /dev/null +++ b/app/assets/images/icons/refresh.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/registration.svg b/app/assets/images/icons/registration.svg new file mode 100644 index 0000000..ab2c72f --- /dev/null +++ b/app/assets/images/icons/registration.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/icons/remove-member.svg b/app/assets/images/icons/remove-member.svg new file mode 100644 index 0000000..8fcac28 --- /dev/null +++ b/app/assets/images/icons/remove-member.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/retweet.svg b/app/assets/images/icons/retweet.svg new file mode 100644 index 0000000..91f1e6a --- /dev/null +++ b/app/assets/images/icons/retweet.svg @@ -0,0 +1 @@ +retweet-updated \ No newline at end of file diff --git a/app/assets/images/icons/right.svg b/app/assets/images/icons/right.svg new file mode 100644 index 0000000..726202a --- /dev/null +++ b/app/assets/images/icons/right.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/roster.svg b/app/assets/images/icons/roster.svg new file mode 100644 index 0000000..9b12574 --- /dev/null +++ b/app/assets/images/icons/roster.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/rostering.svg b/app/assets/images/icons/rostering.svg new file mode 100644 index 0000000..bf85672 --- /dev/null +++ b/app/assets/images/icons/rostering.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/rows.svg b/app/assets/images/icons/rows.svg new file mode 100644 index 0000000..a309745 --- /dev/null +++ b/app/assets/images/icons/rows.svg @@ -0,0 +1 @@ +rows-updated \ No newline at end of file diff --git a/app/assets/images/icons/scale.svg b/app/assets/images/icons/scale.svg new file mode 100644 index 0000000..1d29bc8 --- /dev/null +++ b/app/assets/images/icons/scale.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/schedule.svg b/app/assets/images/icons/schedule.svg new file mode 100644 index 0000000..a7eaf0a --- /dev/null +++ b/app/assets/images/icons/schedule.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/search.svg b/app/assets/images/icons/search.svg new file mode 100644 index 0000000..6224667 --- /dev/null +++ b/app/assets/images/icons/search.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/seasons.svg b/app/assets/images/icons/seasons.svg new file mode 100644 index 0000000..1126dc8 --- /dev/null +++ b/app/assets/images/icons/seasons.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/send.svg b/app/assets/images/icons/send.svg new file mode 100644 index 0000000..444c54d --- /dev/null +++ b/app/assets/images/icons/send.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/sent.svg b/app/assets/images/icons/sent.svg new file mode 100644 index 0000000..ac35c0d --- /dev/null +++ b/app/assets/images/icons/sent.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/settings.svg b/app/assets/images/icons/settings.svg new file mode 100644 index 0000000..4138a39 --- /dev/null +++ b/app/assets/images/icons/settings.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/share.svg b/app/assets/images/icons/share.svg new file mode 100644 index 0000000..d5b7e66 --- /dev/null +++ b/app/assets/images/icons/share.svg @@ -0,0 +1 @@ +share-updated \ No newline at end of file diff --git a/app/assets/images/icons/sort.svg b/app/assets/images/icons/sort.svg new file mode 100644 index 0000000..eb1cd29 --- /dev/null +++ b/app/assets/images/icons/sort.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/star.svg b/app/assets/images/icons/star.svg new file mode 100644 index 0000000..63e29ce --- /dev/null +++ b/app/assets/images/icons/star.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/statistics.svg b/app/assets/images/icons/statistics.svg new file mode 100644 index 0000000..c519574 --- /dev/null +++ b/app/assets/images/icons/statistics.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/stopwatch.svg b/app/assets/images/icons/stopwatch.svg new file mode 100644 index 0000000..3d8372b --- /dev/null +++ b/app/assets/images/icons/stopwatch.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/team.svg b/app/assets/images/icons/team.svg new file mode 100644 index 0000000..95fbb16 --- /dev/null +++ b/app/assets/images/icons/team.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/tracking.svg b/app/assets/images/icons/tracking.svg new file mode 100644 index 0000000..bdf51a7 --- /dev/null +++ b/app/assets/images/icons/tracking.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/trash.svg b/app/assets/images/icons/trash.svg new file mode 100644 index 0000000..a8bc3ad --- /dev/null +++ b/app/assets/images/icons/trash.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/unlock.svg b/app/assets/images/icons/unlock.svg new file mode 100644 index 0000000..a85c289 --- /dev/null +++ b/app/assets/images/icons/unlock.svg @@ -0,0 +1 @@ +unlock-updated \ No newline at end of file diff --git a/app/assets/images/icons/up.svg b/app/assets/images/icons/up.svg new file mode 100644 index 0000000..eebb752 --- /dev/null +++ b/app/assets/images/icons/up.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/user.svg b/app/assets/images/icons/user.svg new file mode 100644 index 0000000..a4f7208 --- /dev/null +++ b/app/assets/images/icons/user.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/video.svg b/app/assets/images/icons/video.svg new file mode 100644 index 0000000..d8701b1 --- /dev/null +++ b/app/assets/images/icons/video.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/waiver.svg b/app/assets/images/icons/waiver.svg new file mode 100644 index 0000000..b4a56dd --- /dev/null +++ b/app/assets/images/icons/waiver.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/icons/wrench.svg b/app/assets/images/icons/wrench.svg new file mode 100644 index 0000000..18fe43e --- /dev/null +++ b/app/assets/images/icons/wrench.svg @@ -0,0 +1 @@ +wrench-updated \ No newline at end of file diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000..41e594c --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,246 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ +:root { + --bc-text-muted: #6c757d; + --bc-avail-color-yes: #7fc243; + --bc-avail-color-no: #cb5958; + --bc-avail-color-maybe: #113b63; +} + +.availability-bar.going { + background-color: var(--bc-avail-color-yes); +} +.availability-bar.not-going { + background-color: var(--bc-avail-color-no); +} +.availability-bar.maybe { + background-color: var(--bc-avail-color-maybe); +} +.availability-bar.unknown { + background-color: gray; +} + +header.Header { + background: #323669; + padding: 8px 0; + box-shadow: 0 4px 0 rgba(0, 0, 25, 0.1); + border-bottom: 1px solid #d6d6d6; + color: white; +} + +body { + background-color: rgb(246, 246, 246); +} + +/* .u-padSm.u-border.u-borderRadiusLg.u-spaceEndsSm.u-maxWidthXs */ + +.event-card { + font-family: "Open Sans", Helvetica, sans-serif; + border: 1px solid #e6e6e6; + border-radius: 8px; + max-width: 480px; + margin-top: 8px; + margin-bottom: 8px; + background: white; +} + +.event-card .title { + margin-bottom: 4px; +} + +.event-card .event-card-body { + padding: 8px 8px 8px 8px; +} + +.event-card-body > .availability-bar { + margin: 4px; +} + +.event-card-body > .availability-bar.fullwidth { + margin-top: 4px; + margin-bottom: -8px; + margin-left: -8px; + margin-right: -8px; +} + +.event-card-body .availability-bar.fullwidth .progress { + border-radius: 0; +} + +.event-card .date, +.event-card .location { + color: #7a7a7a; + font-size: 0.9em; +} + +.event-card .opponent { +} + +.event-card .Button span { + margin-left: 4px; +} + +.event-card .event-card-footer { + padding: 8px; + border-radius: 0px 0px 8px 8px; + background-color: rgb(251, 251, 251); + border-top: solid 1px rgb(214, 214, 214); +} + +.event-card-footer div { + text-align: center; +} + +.Header-bannerLogo, +.Header-bannerTitle { + margin: 0; + padding: 0; +} + +.Header-bannerLogo img { + heigh: 48px; + width: 48px; +} + +.Header-bannerTitle { + font-family: "Helvetica", sans-serif; + text-transform: uppercase; + font-weight: bold; + text-align: left; + color: white; +} + +.benchcoach-nav { + background-color: #323669; + margin-bottom: 2em; + padding: 0.5em; + color: white; +} + +a.Panel-row { + color: inherit; +} + +.benchcoach-nav h3 { + font-family: "Helvetica", sans-serif; + font-weight: bolder; + color: white; + text-transform: uppercase; +} + +.lineup-slot .Panel-cell { + display: flex; + align-items: center; +} + +div[id^="event-lineup"] { + counter-reset: lineup-sequence-counter 0; +} + +.lineup-slot { + counter-increment: lineup-sequence-counter 1; +} + +.lineup-slot .Panel-cell.Panel-cell--header { + background: rgba(256, 256, 256, 0); +} + +.lineup-slot .Panel-cell:has(.drag-handle) { + flex-direction: column; +} + +.lineup-slot [class*="availability-status-code"]::before, +li [class*="availability-status-code"]::before { + padding-right: 6px; + font-family: "bootstrap-icons"; +} + +.lineup-slot .availability-status-code-1::before, +li .availability-status-code-1 { + content: "\F26C"; + color: var(--bc-avail-color-yes); +} + +.lineup-slot .availability-status-code-2::before, +li .availability-status-code-2 { + font-family: "bootstrap-icons"; + content: "\F50A"; + color: var(--bc-avail-color-maybe); +} + +.lineup-slot .availability-status-code-0::before, +li .availability-status-code-0 { + content: "\F628"; + color: var(--bc-avail-color-no); +} + +.lineup-slot .availability-status-code-nil::before, +.lineup-slot .availability-status-code-::before, +li .availability-status-code- { + content: "\F50B"; + color: var(--bs-secondary); +} + +.lineup-slot .lastname { + text-transform: uppercase; + font-weight: bold; +} + +.lineup-slot .jerseynumber { + text-transform: uppercase; + font-weight: light; + color: var(--bc-text-muted); + font-size: 0.8em; +} + +.lineup-slot .jerseynumber::before { + content: "-"; + margin-right: 4px; + margin-left: 4px; +} + +.lineup-slot .sequence::before { + content: counter(lineup-sequence-counter); + margin-left: 0.5em; +} + +div[id^="event-lineup"] .Panel.position-only .sequence { + display: none; +} + +div[id^="event-lineup"] .Panel.bench .sequence { + display: none; +} + +div[id^="event-lineup"] .Panel.out .sequence, +div[id^="event-lineup"] .Panel.out .drag-handle, +div[id^="event-lineup"] .Panel.out .SelectBox { + display: none; +} + +.Tooltip:after { + padding: 2px !important; + font-size: inherit !important; +} + +/* if lineup_entry.availabilityStatusCode == 2 + i.bi.bi-question-circle-fill.text-info.u-spaceRightXs + else if lineup_entry.availabilityStatusCode == 1 + i.bi.bi-check-circle-fill.text-success.u-spaceRightXs + else if lineup_entry.availabilityStatusCode == 0 + i.bi.bi-x-circle-fill.text-danger.u-spaceRightXs + else + i.bi.bi-question-circle.u-spaceRightXs */ diff --git a/app/assets/stylesheets/futura-now.css b/app/assets/stylesheets/futura-now.css new file mode 100644 index 0000000..4fdee7c --- /dev/null +++ b/app/assets/stylesheets/futura-now.css @@ -0,0 +1,6 @@ +@font-face { + font-family: "Futura Now"; + src: url('futura-now.ttf') format('truetype'); + font-style: normal; + font-weight: 100 900; +} diff --git a/app/assets/stylesheets/gamecard.css b/app/assets/stylesheets/gamecard.css new file mode 100644 index 0000000..2df2724 --- /dev/null +++ b/app/assets/stylesheets/gamecard.css @@ -0,0 +1,819 @@ +@font-face { + font-family: "Helvetica Now"; + src: url("/assets/helvetica-now.ttf") format("truetype"); + font-weight: 125 900; + font-stretch: 50% 150%; +} + +@font-face { + font-family: "Inconsolata"; + src: url("/assets/inconsolata-vf.ttf") format("truetype"); +} + +@font-face { + font-family: "Futura Now"; + src: url("/assets/futura-now.ttf") format("truetype"); + font-weight: 125 900; + font-stretch: 50% 150%; +} + +@font-face { + font-family: "Oswald"; + src: url("/assets/Oswald.ttf") format("truetype"); +} + +@font-face { + font-family: "Graduate"; + src: url("/assets/Graduate.ttf") format("truetype"); +} + +@page { + margin: 0; +} + +/** For Print **/ +@media print { + body .sheet { + size: B5; + padding: 0.2in; + } +} + +/** For screen preview **/ +@media screen { + body .sheet { + padding: 0.2in; + } + body { + background: #e0e0e0; + } + .sheet { + background: white; + box-shadow: 0 0.5mm 2mm rgba(0, 0, 0, 0.3); + } +} + +.sheet { + overflow: hidden; + position: relative; + box-sizing: border-box; + page-break-after: always; +} + +/** Paper sizes **/ +body.B5 .sheet { + width: 176mm; + height: 250mm; +} + +body.index-card .sheet { + width: 3.5in; + height: 5in; +} + +:root { + --color-success: #b7e1cd; + --color-danger: #f4c7c3; + --color-neutral: #acc9fe; + --color-warning: rgb(249, 228, 180); + --color-grey-100: #f8f9fa; + --color-grey-200: #e9ecef; + --color-grey-300: #dee2e6; + --color-grey-400: #ced4da; + --color-grey-500: #adb5bd; + --color-grey-600: #6c757d; + --color-grey-700: #495057; + --color-grey-800: #343a40; + --color-grey-900: #212529; + --row-height: 14px; + --monospace-font: "Inconsolata", monospace; +} + +body { + font-family: "Helvetica Now", "Helvetica", sans-serif; + position: relative; + font-size: 11px; +} + +table { + position: inherit; + font-size: inherit; + border-collapse: collapse; + empty-cells: show; + white-space: nowrap; + text-overflow: ellipsis; + overflow-x: hidden; + overflow-y: hidden; + width: 100%; + border: 0.5px solid black; + display: inline-table; +} + +.float-right { + float: right; +} + +.float-left { + float: left; +} + +th, +td { + /* vertical-align: middle; */ + /* line-height: 1.3em; */ + overflow: hidden; + padding: 0 2px 0 2px; /* top right bottom left */ +} + +tr { + border-bottom-width: 0.5px; + border-color: grey; + border-bottom-style: solid; +} + +tr:nth-child(odd) { + background-color: rgb(242, 242, 242, 0.85); +} + +tr:nth-child(even) { + background-color: rgb(256, 256, 256, 0.85); +} + +th, +td { + border-left: 0.5px solid grey; + border-right: 0.5px solid grey; +} + +table.notes th { + border-left: none; + border-right: none; + vertical-align: top; +} + +th { + font-stretch: extra-condensed; + width: 1em; + text-align: center; + text-transform: uppercase; +} + +td:empty::after, +th:empty::after { + content: "\00a0"; +} + +td.player-name { + text-transform: uppercase; + font-stretch: 80%; + /* font-family: var(--monospace-font); */ +} + +td.position, +td.jersey-number { + font-family: var(--monospace-font); + width: 2ch; + text-align: right; + overflow: hidden; +} + +.B5 > .gamecard { + display: grid; + grid-template-columns: 1fr 1fr; + grid-template-rows: 1fr 1fr; + column-gap: 0.2in; + row-gap: 0.2in; + background-size: 100%; +} + +.gamecard > section { + box-sizing: content-box; + overflow: hidden; + /* outline: 0.5px dashed lightgrey; */ + display: flex; + flex-direction: column; + align-items: stretch; +} + +.gamecard > section > div { + display: flex; + flex: 1; + align-items: stretch; + height: auto; +} + +.lineup-card th { + width: inherit; +} + +#lineup-card-dugout div.grid-container, +#lineup-card-dugout-blank div.grid-container { + display: grid; + grid-template-columns: 60% auto; + grid-template-rows: fit-content(16px) auto; + grid-template-areas: + "header header" + "sarting-lineup-table substitution-table"; +} + +#lineup-card-exchange div.grid-container, +#lineup-card-exchange-blank div.grid-container { + display: grid; + grid-template-columns: auto; + grid-template-rows: fit-content(16px) auto; + grid-template-areas: + "header" + "sarting-lineup-table"; +} + +#lineup-card-exchange .substitution, +#lineup-card-exchange .homeaway, +#lineup-card-blank .substitution, +#lineup-card-blank .homeaway { + display: none; +} + +.lineup-card div.grid-container > header { + grid-area: "header"; + font-size: 14px; + font-weight: bold; +} + +.lineup-card div.grid-container > header:empty::after { + content: "\00a0"; +} + +div.grid-container > .starting-lineup-table { + grid-area: "starting-lineup-table"; +} + +div.grid-container > .substitution-table { + grid-area: "substitution-table"; +} + +.lineup-card thead th { + color: var(--color-grey-600); + font-size: 0.7em; +} + +.lineup-card th.sequence { + color: var(--color-grey-600); + font-size: inherit; + width: 2ch; +} + +.lineup-card table { + font-size: 22px; +} + +.lineup-card td { + /* height: 34px; */ +} + +.lineup-card td.substitution { + width: 8ch; +} + +.lineup-card td.substitution::after { + content: ""; +} + +#lineup-card-exchange tr, +#lineup-card-exchange-blank tr, +#lineup-card-dugout .starting-lineup-table tr, +#lineup-card-dugout-blank .starting-lineup-table tr, +#lineup-card-dugout .substitution-table tr:nth-child(odd) { + border-top: 1px solid black; +} + +#lineup-card-exchange tr, +#lineup-card-exchange-blank tr, +#lineup-card-dugout .starting-lineup-table tr, +#lineup-card-dugout-blank .starting-lineup-table tr, +#lineup-card-dugout .substitution-table tr:nth-child(even) { + border-bottom: 1px solid black; +} + +td.substitution { + border-left: 1px solid black; +} + +#lineup-card-exchange td.player-name { + font-stretch: 100%; +} + +#lineup-card-dugout td.player-name { + width: 10ch; +} + +.lineup-card .position, +.lineup-card .jersey-number { + width: 2ch; +} + +#lineup-card-dugout .position, +#lineup-card-dugout .jersey-number { + font-stretch: 75%; + padding-left: 2.5px; + padding-right: 2.5px; +} + +.lineup-card header { + font-size: inherit; + text-transform: uppercase; + font-stretch: 85%; +} + +#todays-game > div { + display: grid; + grid-template-columns: 110px auto; + grid-template-rows: auto auto; + grid-template-areas: + "offense defense" + "footer footer"; +} + +#defense-pane { + position: relative; + grid-area: defense; + padding: 4px 4px 0px 4px; /* top right bottom left */ + display: flex; + border-right: 0.5px solid grey; + border-bottom: 0.5px solid grey; +} + +#defense-pane .field-container { + display: grid; + grid-template-columns: repeat(4, 1fr); + grid-template-rows: repeat(6, 1fr); + grid-column-gap: 4px; + width: 100%; + z-index: 2; +} + +#defense-pane img { + position: absolute; + z-index: -1; +} + +#defense-pane .slot-set { + display: flex; + align-items: center; +} + +#defense-pane .slot-set .pos-slot-p { + align-items: end; + margin-bottom: 4px; +} + +#defense-pane .pos-slot-cf { + justify-content: center; + align-items: start; + grid-area: 1 / 1 / 2 / 5; +} +#defense-pane .pos-slot-lf { + justify-content: flex-start; + grid-area: 2 / 1 / 3 / 3; +} +#defense-pane .pos-slot-rf { + justify-content: flex-end; + grid-area: 2 / 3 / 3 / 5; +} +#defense-pane .pos-slot-ss { + justify-content: flex-end; + grid-area: 3 / 1 / 4 / 3; +} +#defense-pane .pos-slot-2b { + justify-content: flex-start; + grid-area: 3 / 3 / 4 / 5; +} +#defense-pane .pos-slot-3b { + justify-content: flex-start; + grid-area: 4 / 1 / 5 / 3; +} +#defense-pane .pos-slot-1b { + justify-content: flex-end; + grid-area: 4 / 3 / 5 / 5; +} +#defense-pane .pos-slot-c { + justify-content: center; + grid-area: 5 / 1 / 6 / 5; +} +#defense-pane .pos-slot-p { + grid-area: 6 / 1 / 7 / 5; +} + +#defense-pane .pos-slot-cf th.position:empty::after { + content: "CF"; +} + +#defense-pane .pos-slot-lf th.position:empty::after { + content: "lf"; +} + +#defense-pane .pos-slot-rf th.position:empty::after { + content: "rf"; +} + +#defense-pane .pos-slot-ss th.position:empty::after { + content: "ss"; +} + +#defense-pane .pos-slot-2b th.position:empty::after { + content: "2B"; +} + +#defense-pane .pos-slot-3b th.position:empty::after { + content: "3B"; +} + +#defense-pane .pos-slot-1b th.position:empty::after { + content: "1B"; +} + +#defense-pane .pos-slot-c th.position:empty::after { + content: "C"; +} + +#defense-pane .pos-slot-p th.position:empty::after { + content: "P"; +} + +#defense-pane .pos-slot-rp-1 th.position:empty::after { + content: "RP"; +} + +#defense-pane .pos-slot-rp-2 th.position:empty::after { + content: "RP"; +} + +#offense-pane { + position: relative; + /* box-sizing: border-box; */ + height: 100%; + grid-area: offense; + border-bottom: 0.5px solid black; + /* outline: 0.5px solid black; */ +} + +#offense-pane table { + height: 100%; + border: none; +} + +.slot-set table { + width: 77px; +} + +.slot-set.pos-slot-p table { + width: 100%; +} + +.index-card .defense-slot-set { + width: 65px; +} + +.index-card .defense-slot-set .player-name { + font-stretch: 70%; +} + +.container .row { + width: 100%; + display: flex; + align-items: center; +} + +header { + background-color: #cadcf9; + font-family: "Oswald"; + /* font-size: 8.8px; */ + /* outline: 1px solid black; */ + /* height: var(--row-height); */ + width: auto; + grid-area: header; + text-align: center; + padding-left: 10px; + padding-right: 10px; + border: 0.5px solid black; + z-index: 1; +} + +.footer { + /* height:var(--row-height); */ + position: relative; + box-sizing: border-box; + grid-area: footer; + /* border: 1px solid black; */ + height: 100%; + border-right: 0.5px solid grey; + border-left: 0.5px solid grey; +} + +.footer table { + height: 100%; + outline: none; + border-style: none; +} + +.footer tr { + background-color: white; + outline: none; + border-bottom: 0.5px solid var(--color-grey-500); +} + +.footer tr :last-child { + background-color: white; + outline: none; + border-bottom-style: none; +} +.footer th { + text-align: left; + color: var(--color-grey-600); +} +.footer td { + height: var(--row-height); + + border: none; +} + +.footer td:empty::after { + content: ""; +} + +.cell-checkbox { + font-size: 0.75em; +} + +.in-starting-lineup { + font-weight: bold; +} + +.gametitle { + font-weight: bold; + text-transform: uppercase; + font-stretch: semi-condensed; +} + +.homeaway { + text-transform: uppercase; + font-stretch: normal; + font-weight: bolder; + float: right; + text-transform: uppercase; +} + +.cell-smalltext { + font-stretch: condensed; + font-size: 10px; +} + +.statscell { + font-family: "m+1m"; + text-align: center; + font-stretch: extra-condensed; + font-size: 9px; + width: 60px; +} + + { + text-transform: uppercase; +} + +.condensedNameCell { + width: 70px; + text-transform: uppercase; + font-stretch: condensed; +} + +.cell-square { + height: var(--row-height); + width: 14px; + text-align: center; +} + +.cell-square.narrow { + width: 10px; +} +.cell-mono { + font-family: "m+1m"; +} + +.cell-condensed { + font-stretch: condensed; +} + +.available-status-code-1 { + color: rgb(0, 85, 0); + background-color: #b7e1cd; +} + +.available-status-code-0 { + color: rgb(170, 0, 0); + background-color: #f4c7c3; +} + +.past.available-status-code-0, +.past.available-status-code-null { + color: var(--color-grey-600); + background-color: inherit; +} + +.past.available-status-code-1 { + color: inherit; + background-color: var(--color-warning); +} + +.past.available-status-code-1.started { + color: inherit; + background-color: inherit; +} + +.available-status-code-2 { + color: blue; + background-color: #acc9fe; +} + +#roster-and-history .player-name, +#roster-and-history .jersey-number { + color: black; +} + +#roster-and-history .player-name { + font-stretch: 95%; +} + +.starting { + font-weight: bold; +} + +#roster-and-history > div > table { + /* font-size: 10.5px; */ + padding: 0; + line-height: 1em; + /* outline: 0.5px black; */ +} + +#roster-and-history td, +#roster-and-history th { + border-left: none; + border-right: none; + padding: 0.2em 0.1em 0.2em 0.1em; /* top right bottom left */ +} + +#roster-and-history td.player-name { + text-align: left; +} + +#roster-and-history th { + background-color: #cadcf9; + color: black; + border: none; +} + +#roster-and-history thead > tr, +#roster-and-history tfoot > tr { + border-bottom: solid black 1px; +} + +#roster-and-history tbody { + border-bottom: solid black 1px; +} + +#roster-and-history td.avail-today-plus-1, +#roster-and-history .pitcher, +#roster-and-history .player-stats, +#roster-and-history td.avail-today-minus-1 { + border-left-width: 1px; + border-left-style: solid; + border-left-color: black; +} + +#roster-and-history td.jersey-number { + border-left: 0.5px solid lightgrey; +} + +#roster-and-history td.today-minus-4 { + border-right: 1px solid black; +} + +#roster-and-history tr.border-top { + border-top: 1px solid black; +} + +#roster-and-history #today-availability { + font-stretch: normal; + text-transform: uppercase; + font-size: 0.8em; +} + +.player-stats { + font-family: var(--monospace-font); + font-size: 1em; + font-stretch: 60%; + font-weight: 300; +} + +#roster-and-history td.position-capability, +th.position-capability { + font-size: 8px; + font-stretch: 50%; + width: 5px; + text-align: center; + padding: 0; +} + +#roster-and-history th.position-capability { + font-size: inherit; +} + +td.position-capability:not(:empty) { + color: var(--color-grey-700); + background-color: var(--color-grey-200); +} + +td.is-present-checkbox { + font-size: 0.5em; + text-align: center; + color: white; + /* text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, + 1px 1px 0 #000; */ +} + +td.is-present-checkbox.available-status-code-0 > span { + display: none; +} + +td.is-present-checkbox.available-status-code-None > span { + display: none; +} + +td.availability { + font-family: var(--monospace-font); + font-stretch: condensed; + text-align: center; + max-width: 0.8em; + min-width: 0.8em; +} + +.availability.future, +.availability.past { + font-family: var(--monospace-font); + font-stretch: condensed; + font-weight: normal; + font-size: 0.8em; + padding: 0.1em; + text-transform: uppercase; +} + +#roster-test .player-name { + font-weight: bold; + text-transform: uppercase; + grid-area: player-name; +} + +#roster-test .jersey-number { + font-weight: bolder; + font-stretch: extra-condensed; + grid-area: jersey-number; +} + +#roster-test .player-stats { + grid-area: player-stats; +} + +#roster-test .diamond { + grid-area: diamond; + overflow: hidden; + display: inline-block; + height: 10px; + /* height:10px; */ +} + +th[class^="avail-today-"] div { + transform: rotate(270deg); +} + +.delimiter, +.decimal-point { + font-family: Helvetica Now; + font-stretch: expanded; + color: var(--color-grey-500); +} + +th .decimal-point { + color: rgb(0, 0, 0, 0); +} + +th .delimiter { + color: var(--color-grey-500); +} + +#front-cover .container { + display: grid; + grid-template-columns: 1fr; + grid-template-rows: repeat(3, 1fr); + grid-column-gap: 0px; + grid-row-gap: 0px; + text-align: center; + align-items: center; +} diff --git a/app/assets/stylesheets/helvetica-now.css b/app/assets/stylesheets/helvetica-now.css new file mode 100644 index 0000000..c512683 --- /dev/null +++ b/app/assets/stylesheets/helvetica-now.css @@ -0,0 +1,7 @@ +@font-face { + font-family: "Helvetica Now"; + src: url('helvetica-now.ttf') format('truetype'); + font-weight: 125 900; + font-stretch: 50% 150%; + font-style: normal; +} \ No newline at end of file diff --git a/app/assets/stylesheets/helvetica.css b/app/assets/stylesheets/helvetica.css new file mode 100644 index 0000000..c512683 --- /dev/null +++ b/app/assets/stylesheets/helvetica.css @@ -0,0 +1,7 @@ +@font-face { + font-family: "Helvetica Now"; + src: url('helvetica-now.ttf') format('truetype'); + font-weight: 125 900; + font-stretch: 50% 150%; + font-style: normal; +} \ No newline at end of file diff --git a/app/assets/stylesheets/inconsolata.css b/app/assets/stylesheets/inconsolata.css new file mode 100644 index 0000000..76a3a5f --- /dev/null +++ b/app/assets/stylesheets/inconsolata.css @@ -0,0 +1,4 @@ +@font-face { + font-family: "Inconsolata"; + src: url("inconsolata-vf.ttf") format("truetype"); +} diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..9aec230 --- /dev/null +++ b/app/channels/application_cable/channel.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..8d6c2a1 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..9a4c197 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class ApplicationController < ActionController::Base + # Database: You can store session data in your application's database. This + # requires additional setup, but it can be useful if you need to store large + # amounts of data or want to share session data between multiple web servers. + # + # To configure the session storage option, you can edit your Rails application's + # config/application.rb file. + # For example, to use the database for session + # storage, you can add the following line: + config.session_store :active_record_store +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/event_controller.rb b/app/controllers/event_controller.rb new file mode 100644 index 0000000..2f93f1c --- /dev/null +++ b/app/controllers/event_controller.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true +class EventController < ApplicationController + include SessionsHelper + before_action :logged_in_user + skip_before_action :verify_authenticity_token, only: :lineup_email + + def show + team_id = params[:team_id] + event_id = params[:event_id] + team = TeamSnap::Team.find(@teamsnap_client, team_id) + event = TeamSnap::Event.find(@teamsnap_client, event_id) + availability_summary = TeamSnap::AvailabilitySummary.find(@teamsnap_client, event_id) + render 'show', locals: { team:, event:, availability_summary: } + end + + def list + team_id = params[:team_id] + team = TeamSnap::Team.find(@teamsnap_client, team_id) + events = TeamSnap::Event.search(@teamsnap_client, { team_id: }) + availability_summaries = TeamSnap::AvailabilitySummary.search(@teamsnap_client, { team_id: }) + availability_summaries_by_event = {} + events.each_with_index do |event, _index| + availability_summary = availability_summaries.find { |a| a.event_id == event.id } + availability_summaries_by_event[event] = availability_summary + end + render 'list', + locals: { team:, events:, availability_summaries_by_event: } + end + + def lineup + team_id = params[:team_id].to_i + event_id = params[:event_id].to_i + context = helpers.event_context_with_timeline(team_id, event_id, 4) + render 'lineup', locals: context + end + + def lineup_params(params) + params.permit( + :event_lineup_id, + :event_lineup_entry_original, + event_lineup_entries: [ + :label, + :sequence, + :member_id, + :event_id, + :id, + :availability_status_code, + member: [ + :last_name, + :first_name, + :jersey_number, + :email_addresses + ] + + ] + + ) + end + + def lineup_email + params_hash = lineup_params(params).to_h + p params_hash + render "lineup_email", locals:params_hash, layout: false + end + + def lineup_submit + params_hash = lineup_params(params).to_h + unless params_hash[:event_lineup_id].blank? + event_lineup = TeamSnap::EventLineup.find(@teamsnap_client, params_hash[:event_lineup_id]) + event_lineup_id = event_lineup.id + event_lineup_entries_existing = event_lineup.event_lineup_entries + else + event_lineup = TeamSnap::EventLineup.create(@teamsnap_client, { + :team_id => params[:team_id].to_i, + :event_id => params[:event_id].to_i + }) + event_lineup_id = event_lineup.id + event_lineup_entries_existing = [] + end + + params_hash[:event_lineup_entries].each do |lue| + unless lue[:label] == "" + if existing_entry = event_lineup_entries_existing.find{|entry| entry.id.to_s == lue[:id]} + # Exists, update + # Check if exactly the same and update if not + unless ( + existing_entry["member_id"].to_s ==lue[:member_id] and + existing_entry["label"] ==lue[:label] and + existing_entry["sequence"].to_s ==lue[:sequence] + ) + TeamSnap::EventLineupEntry.update(@teamsnap_client, lue[:id], + {:member_id => lue[:member_id], + :label => lue[:label], + :sequence => lue[:sequence] + } + ) + end + + # remove from list + event_lineup_entries_existing.delete_at(event_lineup_entries_existing.index(existing_entry)) + else + lue[:sequence] + TeamSnap::EventLineupEntry.create(@teamsnap_client, + {:member_id => lue[:member_id], + :label => lue[:label], + :sequence => lue[:sequence], + :event_lineup_id => event_lineup_id + } + ) + end + end + end + + event_lineup_entries_existing.each do |lue_existing| + response = TeamSnap::Api.run(@teamsnap_client, :delete, :event_lineup_entry, lue_existing["id"]) + unless response.status == 204 + raise "Unsuccessful" + end + end + + render :plain => "Successfully Done!" + end + + def lineup_card + team_id = params[:team_id].to_i + event_id = params[:event_id].to_i + context = helpers.event_context_with_timeline(team_id, event_id, 4) + render 'lineup_card', locals: context, layout: false + end + + def lineup_card_template + params[:team_id].to_i + params[:event_id].to_i + # context = helpers.event_data_with_additional_contexts(team_id, event_id) + context = {} + render 'lineup_card_template', locals: { context: }, layout: false + end +end diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb new file mode 100644 index 0000000..4836a4e --- /dev/null +++ b/app/controllers/main_controller.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'teamsnap' +class MainController < ApplicationController + include SessionsHelper + before_action :logged_in_user + def index + TeamSnap.init(token: @credentials['token'], + headers: { 'Authorization' => "Bearer #{@credentials['token']}" }) + @teamsnap_client = TeamSnap.root_client + if session[:team_id] + redirect_to team_path(team_id: session[:team_id]) + else + teams = TeamSnap::Team.search(@teamsnap_client, { user_id: @user_id }) + redirect_to team_list_url + end + end +end diff --git a/app/controllers/opponent_controller.rb b/app/controllers/opponent_controller.rb new file mode 100644 index 0000000..3a288ba --- /dev/null +++ b/app/controllers/opponent_controller.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +class OpponentController < ApplicationController + include SessionsHelper + before_action :logged_in_user + protect_from_forgery with: :exception + + def show + team_id = params[:team_id] + opponent_id = params[:opponent_id] + team = TeamSnap::Team.find(@teamsnap_client, team_id) + opponent = TeamSnap::Opponent.find(@teamsnap_client, opponent_id) + team_media = TeamSnap::TeamMedium.search(@teamsnap_client, {team_id: team_id}) + team_media_groups = TeamSnap::TeamMedium.search(@teamsnap_client, {team_id: team_id}) + opponent_logo = team_media.find{|tm| tm.description == "opponent-logo-#{opponent_id}.png"} + render 'show', locals: { team: team, opponent: opponent, opponent_logo: opponent_logo } + end + + def list + team_id = params[:team_id] + team = TeamSnap::Team.find(@teamsnap_client, team_id) + opponents = TeamSnap::Opponent.search(@teamsnap_client, { team_id: }) + render 'list', locals: { team:, opponents: } + end + + def upload_logo_get + team_id = params[:team_id] + opponent_id = params[:opponent_id] + member_id = @user_id + render 'upload_logo', locals: { team_id:, opponent_id:, member_id: } + end + + + def upload_logo_post + team_id = params[:team_id] + opponent_id = params[:opponent_id] + member_results = TeamSnap::Member.search(@teamsnap_client, {user_id: @user_id, team_id: team_id}) + member_id = member_results[0].id + file = params['file'] + + + new_team_medium = TeamSnap::TeamMedium.upload_team_medium(@teamsnap_client, + {:media_format=> "file", + :file=> file.open(), + :member_id=> member_id, + :team_id=> team_id, + :team_media_group_id=> "4927028", + :description=> "team-logo-#{"test"}.png",position:0} + ) + + render plain: "Posted." + end + + +end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 0000000..2986a44 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Returns true if the user is logged in, false otherwise. +def logged_in? + p 'session is ', session + !session[:user].nil? +end + +# Confirms a logged-in user. +def logged_in_user + p 'checking login status' + unless logged_in? + p 'Please log in' + flash[:danger] = 'Please log in.' + redirect_to login_url + end + @user = session[:user] + @user_id = session[:user_id] + @credentials = session[:credentials] + TeamSnap.init(token: @credentials['token'], + headers: { 'Authorization' => "Bearer #{@credentials['token']}" }) + @teamsnap_client = TeamSnap.root_client +end + +class SessionsController < ApplicationController + def new + render :new + end + + def create + user_info = request.env['omniauth.auth'] + session[:user] = user_info.info + session[:user_id] = user_info.uid + session[:credentials] = user_info.credentials + redirect_to root_path, notice: 'Succesful Login' + end +end diff --git a/app/controllers/team_controller.rb b/app/controllers/team_controller.rb new file mode 100644 index 0000000..2f2687a --- /dev/null +++ b/app/controllers/team_controller.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'teamsnap' +require 'net/http' +require 'uri' +require 'date' + +class TeamController < ApplicationController + include SessionsHelper + before_action :logged_in_user + + def show + team_id = params[:team_id] + session[:team_id] = team_id + team = TeamSnap::Team.find(@teamsnap_client, team_id) + upcoming_events = TeamSnap::Event.search(@teamsnap_client, { + team_id: team_id, started_after: Date.today.strftime("%Y-%m-%d"), page_size: 4 + }) + past_events = TeamSnap::Event.search(@teamsnap_client, { + team_id: team_id, started_before: Date.today.strftime("%Y-%m-%d"), page_size: 4, sort_start_date: "desc" + }) + + items = TeamSnap::AvailabilitySummary.search(@teamsnap_client, {:event_id => upcoming_events.map{|e|e.id}.join(",")}) + + render 'show', locals: { team: team, upcoming_events: upcoming_events, past_events: past_events, availability_summaries: items } + end + + def list + teams = TeamSnap::Team.search(@teamsnap_client, { user_id: @user_id }) + render 'list', locals: { teams: teams } + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000..15b06f0 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +module ApplicationHelper +end diff --git a/app/helpers/event_helper.rb b/app/helpers/event_helper.rb new file mode 100644 index 0000000..dcaf110 --- /dev/null +++ b/app/helpers/event_helper.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true +module PositionLabelFlag + POSITION_ONLY = 'PO' + DESIGNATED_RUNNER_FOR = 'DRd' + + # Reverse lookup function + def self.find_key_by_value(value) + constants.find { |const| const_get(const) == value.to_s } + end +end + +module PositionCapabilityFlag + INFIELD = "IF" + OUTFIELD = "OF" + CATCHER = "C" + PITCHER = "P" + + # Reverse lookup function + def self.find_key_by_value(value) + constants.find { |const| const_get(const) == value.to_s } + end +end + +module Availability + YES = 1 + NO = 0 + MAYBE = 2 + UNKNOWN = nil + + def self.sort_order + [ + UNKNOWN, + NO, + MAYBE, + YES + ].reverse + end + + def self.sort_by(a) + sort_order.index(a.status_code) + end + + # availabilities.sort_by do |a| + # [a.status_code || -2, members.find do |m| + # m.id == a.member_id + # end.last_name] + # end, + +end + +def padleft(a, n, x) + Array.new([0, n-a.length].max, x)+a +end +def padright(a, n, x) + a.dup.fill(x, a.length...n) +end + +module EventHelper + + def event_context_with_timeline(team_id, event_id, timeline_width) + current_event = TeamSnap::Event.find(@teamsnap_client, event_id) + upcoming_events = TeamSnap::Event.search(@teamsnap_client, { + team_id: team_id, started_after: current_event.start_date, page_size: timeline_width + 1 + }) + future_events = upcoming_events.slice(1,upcoming_events.length) + past_events = TeamSnap::Event.search(@teamsnap_client, { + team_id: team_id, started_before: current_event.start_date, page_size: timeline_width, sort_start_date: "desc" + }) + + past_events.fill(nil, past_events.length...timeline_width) + future_events.fill(nil, future_events.length...timeline_width) + event_timeline = past_events.reverse.concat([current_event]).concat(future_events) + items = TeamSnap.bulk_load(@teamsnap_client, + { :team_id => team_id, + :types => 'team,member,availability_summary,event,event_lineup_entry,opponent,location', + :event__id => event_timeline.reject(&:nil?).map(&:id).join(","), + :scope_to => "event" + }) + + availabilities = TeamSnap::Availability.search(@teamsnap_client, { event_id: event_timeline.reject(&:nil?).map(&:id).join(',') }) + event_lineups = TeamSnap::EventLineup.search(@teamsnap_client, { event_id: event_timeline.reject(&:nil?).map(&:id).join(',') }) + items.concat(availabilities).concat(event_lineups) + team = items.find { |item| item.type == 'team' and item.id == team_id } + members = items.select { |item| item.type == 'member' } + + context = { "team": team, "members": members } + + timeline = {} + + event_timeline.each_with_index do |event, i| + timepoint = Hash[] + timepoint[:comparison_to_selected] = i - timeline_width + if event.nil? + timepoint[:event].nil? + %w[availability_summary event_lineup event_lineup_entry opponent location].each do |t| + timepoint[t.to_sym].nil? + end + else + timepoint[:event] = event + timepoint[:event_lineup] = event_lineups.find{|l| l.event_id == event.id} + timepoint[:event_lineup_entry] = items.select{ |item| item.type == "event_lineup_entry" and item.event_lineup_id == timepoint[:event_lineup].id } + %w[availability_summary].each do |t| + timepoint[t.to_sym] = items.find { |item| item.type == t and item.event_id == event.id } + end + %w[].each do |t| + timepoint[t.to_sym] = items.select { |item| item.type == t and item.event_id == event.id } + end + %w[opponent location].each do |t| + timepoint[t.to_sym] = items.find { |item| item.type == t and item.id == event["#{t}_id"] } + end + timepoint[:by_member] = {} + members.each do |member| + timepoint[:by_member][member] = {} + %w[event_lineup_entry availability].each do |t| + timepoint[:by_member][member][t.to_sym] = items.find do |item| + item.type == t and item.event_id == event.id and item.member_id == member.id + end + end + end + timepoint[:by_member] = Hash[timepoint[:by_member].sort_by{|member, d| [ Availability::sort_by(d[:availability]), member.last_name]}] + end + timeline[event] = timepoint + + end + context[:timeline] = timeline.map { |k, v| v } + context[:timeline][timeline_width].each { |k, v| context[k] = v } + context + end + + def extract_flags(event_lineup_entry) + if matches = event_lineup_entry[:label].match(/(?