diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..282e559 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index bab620d..1df311a 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,13 @@ # Ignore Byebug command history file. .byebug_history + +artifacts/ERD_refined.mwb.bak + +artifacts/ERD.mwb.bak + +.DS_Store + +.DS_Store + +.DS_Store diff --git a/artifacts/ERD.mwb b/artifacts/ERD.mwb new file mode 100644 index 0000000..c8c4731 Binary files /dev/null and b/artifacts/ERD.mwb differ diff --git a/artifacts/ERD.png b/artifacts/ERD.png new file mode 100644 index 0000000..b8fc832 Binary files /dev/null and b/artifacts/ERD.png differ diff --git a/artifacts/ERD_refined.mwb b/artifacts/ERD_refined.mwb new file mode 100644 index 0000000..d86e76b Binary files /dev/null and b/artifacts/ERD_refined.mwb differ diff --git a/artifacts/ERD_refined.pdf b/artifacts/ERD_refined.pdf new file mode 100644 index 0000000..407959d Binary files /dev/null and b/artifacts/ERD_refined.pdf differ diff --git a/artifacts/Instructions.pdf b/artifacts/Instructions.pdf new file mode 100644 index 0000000..4888899 Binary files /dev/null and b/artifacts/Instructions.pdf differ diff --git a/artifacts/TeamManager.pdf b/artifacts/TeamManager.pdf new file mode 100644 index 0000000..45212aa Binary files /dev/null and b/artifacts/TeamManager.pdf differ diff --git a/artifacts/Terminal Lines.txt b/artifacts/Terminal Lines.txt new file mode 100644 index 0000000..c049689 --- /dev/null +++ b/artifacts/Terminal Lines.txt @@ -0,0 +1,177 @@ +=== Terminal/Command Line === + +== Scaffolds == +rails g scaffold organization org_name + +rails g scaffold team team_name age_group wins:integer loses:integer ties:integer team_start:date team_end:date is_archived:boolean + +rails g scaffold person first_name last_name dob:date gender ethnicity + +rails g scaffold address addr1 addr2 city state country zip address_type + +rails g scaffold phone phone_number phone_type + +rails g scaffold parent person:references + +rails g scaffold child person:references + +rails g scaffold staff person:references + +rails g scaffold manager person:references + +rails g scaffold coach license_num license_exp:date person:references + +rails g scaffold team_has_coaches coach_type person:references team:references + +rails g scaffold event event_name event_type event_start_time:datetime event_end_time:datetime + +rails g scaffold player_stats jersey_number player_bio:text height:integer weight:integer person:references team:references + +rails g scaffold stat_record record_value:text record_type record_date:datetime references:player_stats + +rails g scaffold payment_type payment_type check_num cc_num acct_num routing_num + +rails g scaffold fees fee_amt paid_amt created_on:datetime paid_on:datetime references:payment_type + +rails g home index + +== Migrations == +rails g migration CreateJoinTablePeoplePhones people phones +rails g migration CreateJoinTablePeopleAddresses people addresses +rails g migration CreateJoinTableParentsChildren parents children +rails g migration CreateJoinTablePeopleFees people fees +rails g migration CreateJoinTableManagersTeams managers teams +rails g migration CreateJoinTablePeopleTeams people teams +rails g migration CreateJoinTableStaffsOrganizations staffs organizations +rails g migration CreateJoinTableEventsOrganizations events organizations +rails g migration CreateJoinTableEventsTeams events teams +rails g migration CreateJoinTableTeamsOrganizations teams organizations + +=== Application Records === +class Address < ApplicationRecord + has_and_belongs_to_many :people + validates_presence_of :addr1 + validates_presence_of :addr2 + validates_presence_of :city + validates_presence_of :state + validates_presence_of :country + validates_presence_of :zip + validates_presence_of :address_type +end + +class Child < ApplicationRecord + belongs_to :person + has_and_belongs_to_many :parent +end + +class Coach < ApplicationRecord + belongs_to :person + validates_presence_of :license_num + validates_presence_of :license_exp +end + +class Event < ApplicationRecord + has_many :organization + has_many :team + validates_presence_of :event_name + validates_presence_of :event_type + validates_presence_of :event_start_time + validates_presence_of :event_end_time +end + +class Fee < ApplicationRecord + belongs_to :person + has_one :payment_type + validates_presence_of :fee_amt + validates_presence_of :created_on +end + +class Manager < ApplicationRecord + belongs_to :person + has_many :team +end + +class Organization < ApplicationRecord + has_many :team + has_many :staff + has_many :event + validates_presence_of :org_name +end + +class Parent < ApplicationRecord + belongs_to :person + has_many :child +end + +class PaymentType < ApplicationRecord + belongs_to :fee + validates_presence_of :payment_type +end + +class Person < ApplicationRecord + has_many :phone + has_and_belongs_to_many :addresses + has_many :team + has_many :fee + validates_presence_of :first_name + validates_presence_of :last_name + validates_presence_of :dob + validates_presence_of :gender +end + +class Phone < ApplicationRecord + belongs_to :person + validates_presence_of :phone_number + validates_presence_of :phone_type +end + +class PlayerStat < ApplicationRecord + belongs_to :person + belongs_to :team + has_many :stat_record, dependent: :destroy +end + +class Staff < ApplicationRecord + belongs_to :person +end + +class StatRecord < ApplicationRecord + belongs_to :player_stat +end + +class TeamHasCoach < ApplicationRecord + belongs_to :person + belongs_to :team + validates_presence_of :coach_type +end + +class Team < ApplicationRecord + has_many :person + has_many :manager + has_many :event + belongs_to :organization + validates_presence_of :team_name + validates_presence_of :age_group +end + +=== Routes === +Rails.application.routes.draw do + root 'home#index' + resources :fees + resources :payment_types + resources :stat_records + resources :player_stats + resources :events + resources :team_has_coaches + resources :coaches + resources :managers + resources :staffs + resources :children + resources :parents + resources :phones + resources :addresses + resources :people + resources :teams + resources :organizations + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html +end diff --git a/artifacts/artifacts.md b/artifacts/artifacts.md index 904b006..44d81dd 100644 --- a/artifacts/artifacts.md +++ b/artifacts/artifacts.md @@ -1,3 +1,95 @@ -# Artifacts +# Accompanying Documentation for Team Manager ERD +### Bhanu Rayini, Alexander Roessner, Krithika Saravanan, Karthick Krishnamurthy -Place things like entity-relationship diagrams and documentation in here. +##Organization (organization) +Organization (or Club) for Entire League +* idorganization - ID for the Organization +* name - Organization Name + +##Team (team) +One of potentially many teams within an organization +* idteam - ID for the Team +* name - Name of the Team +* team_type - Type of team (competitive teams, versus recreational teams, etc.) +* wins - Number of wins for a team. +* loses - Number of loses for a team. +* ties - Number of ties for a team. +* organization_idorganization - FK for related organization +* age_group - Team age group. + +##Team Training Sessions (team_training_sessions) +List of a team's training sessions and date of session. +* team_idteam - FK ID of Team +* team_organization_idorganization - FK ID of Organization +* training_date - Date of training session. + +##Person Roles (person_roles) +Join table for a person and their potential roles in a team and organization. Team roster can be pulled from this in SQL select statement. +* roles_idroles - FK ID from Roles +* person_idperson - FK ID from Person +* organization_idorganization - FK ID from Organization +* team_idteam - FK ID from Team +* team_organization_idorganization - FK Related Organization ID from Team table (might be redundant, but autogenerated by MySQL Workbench). + +##Roles (roles) +Different roles one can have in the database - one might hold multiple roles. +* idroles - Role ID +* isCoach - Is a coach (Yes/No) +* isPlayer - Is a player (Yes/No) +* isParent - Is a parent (Yes/No) +* isAdmin - Is an administrator (Yes/No) +* isManager - Is a manager (Yes/No) + +##Person Evaluation (person_evaluation) +Small database to hold evaluations of a player. Currently limited to a body (memo) of the evaluation and a date/time of said evaluation. +* idperson_evaluation - ID of evaluation +* evaluation_memo - Content of evaluation +* evaluation_height - Height of individual at time of evaluation. +* evaluation_weight - Weight of individual at time of evaluation. +* evaluation_date - Date of evaluation +* person_idperson - FK Persion ID + +##Person (person) +Person/User of this database. +* idperson - ID of Person +* first_name - First name of person. +* last_name - Last name of person. +* dob - Date of birth. +* gender - Gender +* ethn - Ethnicity +* email - Person's e-mail +* parent_guardian_person_id - Possibly null, but a referenced Person ID to one's parent or legal guardian. +* jersey_number - Jersey Number +* bio - Biography + +##Scholarships (scholarships) +Scholarships a person may hold. +* idscholarships - Scholarship ID +* scholarship_name - Name of scholarship +* scholarship_ammt - Amount of scholarship +* person_idperson - FK of Person ID + +##Person Has Address (person_has_address) +Join table of Person & Address. +* person_idperson - FK ID of Person +* address_idaddress - FK ID of Address + +##Address (address) +Address +* idaddress - ID of Address +* addr1 - Address Line #1 +* addr2 - Address Line #2 +* city - City +* state - State +* country - Country +* ZIP - ZIP/Postal Code + +##Person Has Phone (person_has_phone) +Join table for phone and person. +* person_idperson - FK ID of Person +* phone_idphone - FK ID of Phone + +##Phone (phone) +Phone number. +* idphone - ID of phone +* phone-num - The phone number. diff --git a/artifacts/team-manager/.gitignore b/artifacts/team-manager/.gitignore new file mode 100644 index 0000000..bab620d --- /dev/null +++ b/artifacts/team-manager/.gitignore @@ -0,0 +1,21 @@ +# 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-journal + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore Byebug command history file. +.byebug_history diff --git a/artifacts/team-manager/Gemfile b/artifacts/team-manager/Gemfile new file mode 100644 index 0000000..c1c01c0 --- /dev/null +++ b/artifacts/team-manager/Gemfile @@ -0,0 +1,49 @@ +source 'https://rubygems.org' + +# Rolify +gem 'rolify' +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.0.0', '>= 5.0.0.1' +# Use sqlite3 as the database for Active Record +gem 'sqlite3' +# Use Puma as the app server +gem 'puma', '~> 3.0' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.2' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use jquery as the JavaScript library +gem 'jquery-rails' +# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks +gem 'turbolinks', '~> 5' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.5' +# Use Redis adapter to run Action Cable in production +# gem 'redis', '~> 3.0' +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platform: :mri +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. + gem 'web-console' + gem 'listen', '~> 3.0.5' + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' + gem 'spring-watcher-listen', '~> 2.0.0' +end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/artifacts/team-manager/Gemfile.lock b/artifacts/team-manager/Gemfile.lock new file mode 100644 index 0000000..abb7285 --- /dev/null +++ b/artifacts/team-manager/Gemfile.lock @@ -0,0 +1,177 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.0.0.1) + actionpack (= 5.0.0.1) + nio4r (~> 1.2) + websocket-driver (~> 0.6.1) + actionmailer (5.0.0.1) + actionpack (= 5.0.0.1) + actionview (= 5.0.0.1) + activejob (= 5.0.0.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.0.0.1) + actionview (= 5.0.0.1) + activesupport (= 5.0.0.1) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.0.0.1) + activesupport (= 5.0.0.1) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (5.0.0.1) + activesupport (= 5.0.0.1) + globalid (>= 0.3.6) + activemodel (5.0.0.1) + activesupport (= 5.0.0.1) + activerecord (5.0.0.1) + activemodel (= 5.0.0.1) + activesupport (= 5.0.0.1) + arel (~> 7.0) + activesupport (5.0.0.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + arel (7.1.2) + builder (3.2.2) + byebug (9.0.5) + coffee-rails (4.2.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.2.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + concurrent-ruby (1.0.2) + debug_inspector (0.0.2) + erubis (2.7.0) + execjs (2.7.0) + ffi (1.9.14) + globalid (0.3.7) + activesupport (>= 4.1.0) + i18n (0.7.0) + jbuilder (2.6.0) + activesupport (>= 3.0.0, < 5.1) + multi_json (~> 1.2) + jquery-rails (4.2.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.4) + mime-types (>= 1.16, < 4) + method_source (0.8.2) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.1.0) + minitest (5.9.1) + multi_json (1.12.1) + nio4r (1.2.1) + nokogiri (1.6.8) + mini_portile2 (~> 2.1.0) + pkg-config (~> 1.1.7) + pkg-config (1.1.7) + puma (3.6.0) + rack (2.0.1) + rack-test (0.6.3) + rack (>= 1.0) + rails (5.0.0.1) + actioncable (= 5.0.0.1) + actionmailer (= 5.0.0.1) + actionpack (= 5.0.0.1) + actionview (= 5.0.0.1) + activejob (= 5.0.0.1) + activemodel (= 5.0.0.1) + activerecord (= 5.0.0.1) + activesupport (= 5.0.0.1) + bundler (>= 1.3.0, < 2.0) + railties (= 5.0.0.1) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.1) + activesupport (>= 4.2.0, < 6.0) + nokogiri (~> 1.6.0) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (5.0.0.1) + actionpack (= 5.0.0.1) + activesupport (= 5.0.0.1) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (11.3.0) + rb-fsevent (0.9.7) + rb-inotify (0.9.7) + ffi (>= 0.5.0) + rolify (5.1.0) + sass (3.4.22) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + spring (1.7.2) + spring-watcher-listen (2.0.0) + listen (>= 2.7, < 4.0) + spring (~> 1.2) + sprockets (3.7.0) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.0) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.11) + thor (0.19.1) + thread_safe (0.3.5) + tilt (2.0.5) + turbolinks (5.0.1) + turbolinks-source (~> 5) + turbolinks-source (5.0.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (3.0.2) + execjs (>= 0.3.0, < 3) + web-console (3.3.1) + actionview (>= 5.0) + activemodel (>= 5.0) + debug_inspector + railties (>= 5.0) + websocket-driver (0.6.4) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + +PLATFORMS + ruby + +DEPENDENCIES + byebug + coffee-rails (~> 4.2) + jbuilder (~> 2.5) + jquery-rails + listen (~> 3.0.5) + puma (~> 3.0) + rails (~> 5.0.0, >= 5.0.0.1) + rolify + sass-rails (~> 5.0) + spring + spring-watcher-listen (~> 2.0.0) + sqlite3 + turbolinks (~> 5) + tzinfo-data + uglifier (>= 1.3.0) + web-console + +BUNDLED WITH + 1.12.5 diff --git a/artifacts/team-manager/README.md b/artifacts/team-manager/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/artifacts/team-manager/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/artifacts/team-manager/Rakefile b/artifacts/team-manager/Rakefile new file mode 100644 index 0000000..e85f913 --- /dev/null +++ b/artifacts/team-manager/Rakefile @@ -0,0 +1,6 @@ +# 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/artifacts/team-manager/app/assets/config/manifest.js b/artifacts/team-manager/app/assets/config/manifest.js new file mode 100644 index 0000000..b16e53d --- /dev/null +++ b/artifacts/team-manager/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css diff --git a/artifacts/team-manager/app/assets/images/.keep b/artifacts/team-manager/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/team-manager/app/assets/javascripts/addresses.coffee b/artifacts/team-manager/app/assets/javascripts/addresses.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/addresses.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/application.js b/artifacts/team-manager/app/assets/javascripts/application.js new file mode 100644 index 0000000..b12018d --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. JavaScript code in this file should be added after the last require_* statement. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require jquery +//= require jquery_ujs +//= require turbolinks +//= require_tree . diff --git a/artifacts/team-manager/app/assets/javascripts/cable.js b/artifacts/team-manager/app/assets/javascripts/cable.js new file mode 100644 index 0000000..71ee1e6 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/cable.js @@ -0,0 +1,13 @@ +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the rails generate channel command. +// +//= require action_cable +//= require_self +//= require_tree ./channels + +(function() { + this.App || (this.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); diff --git a/artifacts/team-manager/app/assets/javascripts/channels/.keep b/artifacts/team-manager/app/assets/javascripts/channels/.keep new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/team-manager/app/assets/javascripts/children.coffee b/artifacts/team-manager/app/assets/javascripts/children.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/children.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/coaches.coffee b/artifacts/team-manager/app/assets/javascripts/coaches.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/coaches.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/events.coffee b/artifacts/team-manager/app/assets/javascripts/events.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/events.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/fees.coffee b/artifacts/team-manager/app/assets/javascripts/fees.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/fees.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/home.coffee b/artifacts/team-manager/app/assets/javascripts/home.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/home.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/managers.coffee b/artifacts/team-manager/app/assets/javascripts/managers.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/managers.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/organizations.coffee b/artifacts/team-manager/app/assets/javascripts/organizations.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/organizations.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/parents.coffee b/artifacts/team-manager/app/assets/javascripts/parents.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/parents.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/payment_types.coffee b/artifacts/team-manager/app/assets/javascripts/payment_types.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/payment_types.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/people.coffee b/artifacts/team-manager/app/assets/javascripts/people.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/people.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/phones.coffee b/artifacts/team-manager/app/assets/javascripts/phones.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/phones.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/player_stats.coffee b/artifacts/team-manager/app/assets/javascripts/player_stats.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/player_stats.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/staffs.coffee b/artifacts/team-manager/app/assets/javascripts/staffs.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/staffs.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/stat_records.coffee b/artifacts/team-manager/app/assets/javascripts/stat_records.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/stat_records.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/team_has_coaches.coffee b/artifacts/team-manager/app/assets/javascripts/team_has_coaches.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/team_has_coaches.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/javascripts/teams.coffee b/artifacts/team-manager/app/assets/javascripts/teams.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/artifacts/team-manager/app/assets/javascripts/teams.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/artifacts/team-manager/app/assets/stylesheets/addresses.scss b/artifacts/team-manager/app/assets/stylesheets/addresses.scss new file mode 100644 index 0000000..2d3819e --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/addresses.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the addresses controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/application.css b/artifacts/team-manager/app/assets/stylesheets/application.css new file mode 100644 index 0000000..0ebd7fe --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or 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/SCSS + * 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 + */ diff --git a/artifacts/team-manager/app/assets/stylesheets/children.scss b/artifacts/team-manager/app/assets/stylesheets/children.scss new file mode 100644 index 0000000..e8bb1ad --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/children.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the children controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/coaches.scss b/artifacts/team-manager/app/assets/stylesheets/coaches.scss new file mode 100644 index 0000000..7d97a41 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/coaches.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the coaches controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/events.scss b/artifacts/team-manager/app/assets/stylesheets/events.scss new file mode 100644 index 0000000..04d79bd --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/events.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the events controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/fees.scss b/artifacts/team-manager/app/assets/stylesheets/fees.scss new file mode 100644 index 0000000..46fcf00 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/fees.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the fees controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/home.scss b/artifacts/team-manager/app/assets/stylesheets/home.scss new file mode 100644 index 0000000..f0ddc68 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/home.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the home controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/managers.scss b/artifacts/team-manager/app/assets/stylesheets/managers.scss new file mode 100644 index 0000000..ebf5d38 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/managers.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the managers controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/organizations.scss b/artifacts/team-manager/app/assets/stylesheets/organizations.scss new file mode 100644 index 0000000..3981988 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/organizations.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the organizations controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/parents.scss b/artifacts/team-manager/app/assets/stylesheets/parents.scss new file mode 100644 index 0000000..8caaba7 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/parents.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the parents controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/payment_types.scss b/artifacts/team-manager/app/assets/stylesheets/payment_types.scss new file mode 100644 index 0000000..ce28760 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/payment_types.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the payment_types controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/people.scss b/artifacts/team-manager/app/assets/stylesheets/people.scss new file mode 100644 index 0000000..e6ee13d --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/people.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the people controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/phones.scss b/artifacts/team-manager/app/assets/stylesheets/phones.scss new file mode 100644 index 0000000..dfef027 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/phones.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the phones controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/player_stats.scss b/artifacts/team-manager/app/assets/stylesheets/player_stats.scss new file mode 100644 index 0000000..c563437 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/player_stats.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the player_stats controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/scaffolds.scss b/artifacts/team-manager/app/assets/stylesheets/scaffolds.scss new file mode 100644 index 0000000..4ce4266 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/scaffolds.scss @@ -0,0 +1,89 @@ +body { + background-color: #fff; + color: #333; + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; + margin: 33px; +} + +p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; + margin: 33px; +} + +pre { + background-color: #eee; + padding: 10px; + font-size: 11px; +} + +a { + color: #000; + + &:visited { + color: #666; + } + + &:hover { + color: #fff; + background-color: #000; + } +} + +th { + padding-bottom: 5px; +} + +td { + padding-bottom: 7px; + padding-left: 5px; + padding-right: 5px; +} + +div { + &.field, &.actions { + margin-bottom: 10px; + } +} + +#notice { + color: green; +} + +.field_with_errors { + padding: 2px; + background-color: red; + display: table; +} + +#error_explanation { + width: 450px; + border: 2px solid red; + padding: 7px; + padding-bottom: 0; + margin-bottom: 20px; + background-color: #f0f0f0; + + h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + margin-bottom: 0; + background-color: #c00; + color: #fff; + } + + ul li { + font-size: 12px; + list-style: square; + } +} + +label { + display: block; +} diff --git a/artifacts/team-manager/app/assets/stylesheets/staffs.scss b/artifacts/team-manager/app/assets/stylesheets/staffs.scss new file mode 100644 index 0000000..34bc6a0 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/staffs.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the staffs controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/stat_records.scss b/artifacts/team-manager/app/assets/stylesheets/stat_records.scss new file mode 100644 index 0000000..9d83294 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/stat_records.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the stat_records controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/team_has_coaches.scss b/artifacts/team-manager/app/assets/stylesheets/team_has_coaches.scss new file mode 100644 index 0000000..95fb5b9 --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/team_has_coaches.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the team_has_coaches controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/assets/stylesheets/teams.scss b/artifacts/team-manager/app/assets/stylesheets/teams.scss new file mode 100644 index 0000000..320d00d --- /dev/null +++ b/artifacts/team-manager/app/assets/stylesheets/teams.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the teams controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/artifacts/team-manager/app/channels/application_cable/channel.rb b/artifacts/team-manager/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/artifacts/team-manager/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/artifacts/team-manager/app/channels/application_cable/connection.rb b/artifacts/team-manager/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/artifacts/team-manager/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/artifacts/team-manager/app/controllers/addresses_controller.rb b/artifacts/team-manager/app/controllers/addresses_controller.rb new file mode 100644 index 0000000..dfda147 --- /dev/null +++ b/artifacts/team-manager/app/controllers/addresses_controller.rb @@ -0,0 +1,74 @@ +class AddressesController < ApplicationController + before_action :set_address, only: [:show, :edit, :update, :destroy] + + # GET /addresses + # GET /addresses.json + def index + @addresses = Address.all + end + + # GET /addresses/1 + # GET /addresses/1.json + def show + end + + # GET /addresses/new + def new + @address = Address.new + end + + # GET /addresses/1/edit + def edit + end + + # POST /addresses + # POST /addresses.json + def create + @address = Address.new(address_params) + + respond_to do |format| + if @address.save + format.html { redirect_to @address, notice: 'Address was successfully created.' } + format.json { render :show, status: :created, location: @address } + else + format.html { render :new } + format.json { render json: @address.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /addresses/1 + # PATCH/PUT /addresses/1.json + def update + respond_to do |format| + if @address.update(address_params) + format.html { redirect_to @address, notice: 'Address was successfully updated.' } + format.json { render :show, status: :ok, location: @address } + else + format.html { render :edit } + format.json { render json: @address.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /addresses/1 + # DELETE /addresses/1.json + def destroy + @address.destroy + respond_to do |format| + format.html { redirect_to addresses_url, notice: 'Address was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_address + @address = Address.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def address_params + params.require(:address).permit(:addr1, :addr2, :city, :state, :country, :zip, :address_type) + end +end diff --git a/artifacts/team-manager/app/controllers/application_controller.rb b/artifacts/team-manager/app/controllers/application_controller.rb new file mode 100644 index 0000000..1c07694 --- /dev/null +++ b/artifacts/team-manager/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery with: :exception +end diff --git a/artifacts/team-manager/app/controllers/children_controller.rb b/artifacts/team-manager/app/controllers/children_controller.rb new file mode 100644 index 0000000..55f3f5e --- /dev/null +++ b/artifacts/team-manager/app/controllers/children_controller.rb @@ -0,0 +1,74 @@ +class ChildrenController < ApplicationController + before_action :set_child, only: [:show, :edit, :update, :destroy] + + # GET /children + # GET /children.json + def index + @children = Child.all + end + + # GET /children/1 + # GET /children/1.json + def show + end + + # GET /children/new + def new + @child = Child.new + end + + # GET /children/1/edit + def edit + end + + # POST /children + # POST /children.json + def create + @child = Child.new(child_params) + + respond_to do |format| + if @child.save + format.html { redirect_to @child, notice: 'Child was successfully created.' } + format.json { render :show, status: :created, location: @child } + else + format.html { render :new } + format.json { render json: @child.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /children/1 + # PATCH/PUT /children/1.json + def update + respond_to do |format| + if @child.update(child_params) + format.html { redirect_to @child, notice: 'Child was successfully updated.' } + format.json { render :show, status: :ok, location: @child } + else + format.html { render :edit } + format.json { render json: @child.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /children/1 + # DELETE /children/1.json + def destroy + @child.destroy + respond_to do |format| + format.html { redirect_to children_url, notice: 'Child was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_child + @child = Child.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def child_params + params.require(:child).permit(:person_id) + end +end diff --git a/artifacts/team-manager/app/controllers/coaches_controller.rb b/artifacts/team-manager/app/controllers/coaches_controller.rb new file mode 100644 index 0000000..4bf8cdf --- /dev/null +++ b/artifacts/team-manager/app/controllers/coaches_controller.rb @@ -0,0 +1,74 @@ +class CoachesController < ApplicationController + before_action :set_coach, only: [:show, :edit, :update, :destroy] + + # GET /coaches + # GET /coaches.json + def index + @coaches = Coach.all + end + + # GET /coaches/1 + # GET /coaches/1.json + def show + end + + # GET /coaches/new + def new + @coach = Coach.new + end + + # GET /coaches/1/edit + def edit + end + + # POST /coaches + # POST /coaches.json + def create + @coach = Coach.new(coach_params) + + respond_to do |format| + if @coach.save + format.html { redirect_to @coach, notice: 'Coach was successfully created.' } + format.json { render :show, status: :created, location: @coach } + else + format.html { render :new } + format.json { render json: @coach.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /coaches/1 + # PATCH/PUT /coaches/1.json + def update + respond_to do |format| + if @coach.update(coach_params) + format.html { redirect_to @coach, notice: 'Coach was successfully updated.' } + format.json { render :show, status: :ok, location: @coach } + else + format.html { render :edit } + format.json { render json: @coach.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /coaches/1 + # DELETE /coaches/1.json + def destroy + @coach.destroy + respond_to do |format| + format.html { redirect_to coaches_url, notice: 'Coach was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_coach + @coach = Coach.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def coach_params + params.require(:coach).permit(:license_num, :license_exp, :person_id) + end +end diff --git a/artifacts/team-manager/app/controllers/concerns/.keep b/artifacts/team-manager/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/team-manager/app/controllers/events_controller.rb b/artifacts/team-manager/app/controllers/events_controller.rb new file mode 100644 index 0000000..eb1311f --- /dev/null +++ b/artifacts/team-manager/app/controllers/events_controller.rb @@ -0,0 +1,74 @@ +class EventsController < ApplicationController + before_action :set_event, only: [:show, :edit, :update, :destroy] + + # GET /events + # GET /events.json + def index + @events = Event.all + end + + # GET /events/1 + # GET /events/1.json + def show + end + + # GET /events/new + def new + @event = Event.new + end + + # GET /events/1/edit + def edit + end + + # POST /events + # POST /events.json + def create + @event = Event.new(event_params) + + respond_to do |format| + if @event.save + format.html { redirect_to @event, notice: 'Event was successfully created.' } + format.json { render :show, status: :created, location: @event } + else + format.html { render :new } + format.json { render json: @event.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /events/1 + # PATCH/PUT /events/1.json + def update + respond_to do |format| + if @event.update(event_params) + format.html { redirect_to @event, notice: 'Event was successfully updated.' } + format.json { render :show, status: :ok, location: @event } + else + format.html { render :edit } + format.json { render json: @event.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /events/1 + # DELETE /events/1.json + def destroy + @event.destroy + respond_to do |format| + format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_event + @event = Event.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def event_params + params.require(:event).permit(:event_name, :event_type, :event_start_time, :event_end_time) + end +end diff --git a/artifacts/team-manager/app/controllers/fees_controller.rb b/artifacts/team-manager/app/controllers/fees_controller.rb new file mode 100644 index 0000000..ac09c29 --- /dev/null +++ b/artifacts/team-manager/app/controllers/fees_controller.rb @@ -0,0 +1,74 @@ +class FeesController < ApplicationController + before_action :set_fee, only: [:show, :edit, :update, :destroy] + + # GET /fees + # GET /fees.json + def index + @fees = Fee.all + end + + # GET /fees/1 + # GET /fees/1.json + def show + end + + # GET /fees/new + def new + @fee = Fee.new + end + + # GET /fees/1/edit + def edit + end + + # POST /fees + # POST /fees.json + def create + @fee = Fee.new(fee_params) + + respond_to do |format| + if @fee.save + format.html { redirect_to @fee, notice: 'Fee was successfully created.' } + format.json { render :show, status: :created, location: @fee } + else + format.html { render :new } + format.json { render json: @fee.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /fees/1 + # PATCH/PUT /fees/1.json + def update + respond_to do |format| + if @fee.update(fee_params) + format.html { redirect_to @fee, notice: 'Fee was successfully updated.' } + format.json { render :show, status: :ok, location: @fee } + else + format.html { render :edit } + format.json { render json: @fee.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /fees/1 + # DELETE /fees/1.json + def destroy + @fee.destroy + respond_to do |format| + format.html { redirect_to fees_url, notice: 'Fee was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_fee + @fee = Fee.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def fee_params + params.require(:fee).permit(:fee_amt, :paid_amt, :created_on, :paid_on, :references) + end +end diff --git a/artifacts/team-manager/app/controllers/home_controller.rb b/artifacts/team-manager/app/controllers/home_controller.rb new file mode 100644 index 0000000..95f2992 --- /dev/null +++ b/artifacts/team-manager/app/controllers/home_controller.rb @@ -0,0 +1,4 @@ +class HomeController < ApplicationController + def index + end +end diff --git a/artifacts/team-manager/app/controllers/managers_controller.rb b/artifacts/team-manager/app/controllers/managers_controller.rb new file mode 100644 index 0000000..65a7b1a --- /dev/null +++ b/artifacts/team-manager/app/controllers/managers_controller.rb @@ -0,0 +1,74 @@ +class ManagersController < ApplicationController + before_action :set_manager, only: [:show, :edit, :update, :destroy] + + # GET /managers + # GET /managers.json + def index + @managers = Manager.all + end + + # GET /managers/1 + # GET /managers/1.json + def show + end + + # GET /managers/new + def new + @manager = Manager.new + end + + # GET /managers/1/edit + def edit + end + + # POST /managers + # POST /managers.json + def create + @manager = Manager.new(manager_params) + + respond_to do |format| + if @manager.save + format.html { redirect_to @manager, notice: 'Manager was successfully created.' } + format.json { render :show, status: :created, location: @manager } + else + format.html { render :new } + format.json { render json: @manager.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /managers/1 + # PATCH/PUT /managers/1.json + def update + respond_to do |format| + if @manager.update(manager_params) + format.html { redirect_to @manager, notice: 'Manager was successfully updated.' } + format.json { render :show, status: :ok, location: @manager } + else + format.html { render :edit } + format.json { render json: @manager.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /managers/1 + # DELETE /managers/1.json + def destroy + @manager.destroy + respond_to do |format| + format.html { redirect_to managers_url, notice: 'Manager was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_manager + @manager = Manager.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def manager_params + params.require(:manager).permit(:person_id) + end +end diff --git a/artifacts/team-manager/app/controllers/organizations_controller.rb b/artifacts/team-manager/app/controllers/organizations_controller.rb new file mode 100644 index 0000000..a697c9d --- /dev/null +++ b/artifacts/team-manager/app/controllers/organizations_controller.rb @@ -0,0 +1,74 @@ +class OrganizationsController < ApplicationController + before_action :set_organization, only: [:show, :edit, :update, :destroy] + + # GET /organizations + # GET /organizations.json + def index + @organizations = Organization.all + end + + # GET /organizations/1 + # GET /organizations/1.json + def show + end + + # GET /organizations/new + def new + @organization = Organization.new + end + + # GET /organizations/1/edit + def edit + end + + # POST /organizations + # POST /organizations.json + def create + @organization = Organization.new(organization_params) + + respond_to do |format| + if @organization.save + format.html { redirect_to @organization, notice: 'Organization was successfully created.' } + format.json { render :show, status: :created, location: @organization } + else + format.html { render :new } + format.json { render json: @organization.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /organizations/1 + # PATCH/PUT /organizations/1.json + def update + respond_to do |format| + if @organization.update(organization_params) + format.html { redirect_to @organization, notice: 'Organization was successfully updated.' } + format.json { render :show, status: :ok, location: @organization } + else + format.html { render :edit } + format.json { render json: @organization.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /organizations/1 + # DELETE /organizations/1.json + def destroy + @organization.destroy + respond_to do |format| + format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_organization + @organization = Organization.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def organization_params + params.require(:organization).permit(:org_name) + end +end diff --git a/artifacts/team-manager/app/controllers/parents_controller.rb b/artifacts/team-manager/app/controllers/parents_controller.rb new file mode 100644 index 0000000..270a016 --- /dev/null +++ b/artifacts/team-manager/app/controllers/parents_controller.rb @@ -0,0 +1,74 @@ +class ParentsController < ApplicationController + before_action :set_parent, only: [:show, :edit, :update, :destroy] + + # GET /parents + # GET /parents.json + def index + @parents = Parent.all + end + + # GET /parents/1 + # GET /parents/1.json + def show + end + + # GET /parents/new + def new + @parent = Parent.new + end + + # GET /parents/1/edit + def edit + end + + # POST /parents + # POST /parents.json + def create + @parent = Parent.new(parent_params) + + respond_to do |format| + if @parent.save + format.html { redirect_to @parent, notice: 'Parent was successfully created.' } + format.json { render :show, status: :created, location: @parent } + else + format.html { render :new } + format.json { render json: @parent.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /parents/1 + # PATCH/PUT /parents/1.json + def update + respond_to do |format| + if @parent.update(parent_params) + format.html { redirect_to @parent, notice: 'Parent was successfully updated.' } + format.json { render :show, status: :ok, location: @parent } + else + format.html { render :edit } + format.json { render json: @parent.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /parents/1 + # DELETE /parents/1.json + def destroy + @parent.destroy + respond_to do |format| + format.html { redirect_to parents_url, notice: 'Parent was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_parent + @parent = Parent.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def parent_params + params.require(:parent).permit(:person_id) + end +end diff --git a/artifacts/team-manager/app/controllers/payment_types_controller.rb b/artifacts/team-manager/app/controllers/payment_types_controller.rb new file mode 100644 index 0000000..8dfc971 --- /dev/null +++ b/artifacts/team-manager/app/controllers/payment_types_controller.rb @@ -0,0 +1,74 @@ +class PaymentTypesController < ApplicationController + before_action :set_payment_type, only: [:show, :edit, :update, :destroy] + + # GET /payment_types + # GET /payment_types.json + def index + @payment_types = PaymentType.all + end + + # GET /payment_types/1 + # GET /payment_types/1.json + def show + end + + # GET /payment_types/new + def new + @payment_type = PaymentType.new + end + + # GET /payment_types/1/edit + def edit + end + + # POST /payment_types + # POST /payment_types.json + def create + @payment_type = PaymentType.new(payment_type_params) + + respond_to do |format| + if @payment_type.save + format.html { redirect_to @payment_type, notice: 'Payment type was successfully created.' } + format.json { render :show, status: :created, location: @payment_type } + else + format.html { render :new } + format.json { render json: @payment_type.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /payment_types/1 + # PATCH/PUT /payment_types/1.json + def update + respond_to do |format| + if @payment_type.update(payment_type_params) + format.html { redirect_to @payment_type, notice: 'Payment type was successfully updated.' } + format.json { render :show, status: :ok, location: @payment_type } + else + format.html { render :edit } + format.json { render json: @payment_type.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /payment_types/1 + # DELETE /payment_types/1.json + def destroy + @payment_type.destroy + respond_to do |format| + format.html { redirect_to payment_types_url, notice: 'Payment type was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_payment_type + @payment_type = PaymentType.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def payment_type_params + params.require(:payment_type).permit(:payment_type, :check_num, :cc_num, :acct_num, :routing_num) + end +end diff --git a/artifacts/team-manager/app/controllers/people_controller.rb b/artifacts/team-manager/app/controllers/people_controller.rb new file mode 100644 index 0000000..c340ca8 --- /dev/null +++ b/artifacts/team-manager/app/controllers/people_controller.rb @@ -0,0 +1,74 @@ +class PeopleController < ApplicationController + before_action :set_person, only: [:show, :edit, :update, :destroy] + + # GET /people + # GET /people.json + def index + @people = Person.all + end + + # GET /people/1 + # GET /people/1.json + def show + end + + # GET /people/new + def new + @person = Person.new + end + + # GET /people/1/edit + def edit + end + + # POST /people + # POST /people.json + def create + @person = Person.new(person_params) + + respond_to do |format| + if @person.save + format.html { redirect_to @person, notice: 'Person was successfully created.' } + format.json { render :show, status: :created, location: @person } + else + format.html { render :new } + format.json { render json: @person.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /people/1 + # PATCH/PUT /people/1.json + def update + respond_to do |format| + if @person.update(person_params) + format.html { redirect_to @person, notice: 'Person was successfully updated.' } + format.json { render :show, status: :ok, location: @person } + else + format.html { render :edit } + format.json { render json: @person.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /people/1 + # DELETE /people/1.json + def destroy + @person.destroy + respond_to do |format| + format.html { redirect_to people_url, notice: 'Person was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_person + @person = Person.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def person_params + params.require(:person).permit(:first_name, :last_name, :dob, :gender, :ethnicity) + end +end diff --git a/artifacts/team-manager/app/controllers/phones_controller.rb b/artifacts/team-manager/app/controllers/phones_controller.rb new file mode 100644 index 0000000..90c11ed --- /dev/null +++ b/artifacts/team-manager/app/controllers/phones_controller.rb @@ -0,0 +1,74 @@ +class PhonesController < ApplicationController + before_action :set_phone, only: [:show, :edit, :update, :destroy] + + # GET /phones + # GET /phones.json + def index + @phones = Phone.all + end + + # GET /phones/1 + # GET /phones/1.json + def show + end + + # GET /phones/new + def new + @phone = Phone.new + end + + # GET /phones/1/edit + def edit + end + + # POST /phones + # POST /phones.json + def create + @phone = Phone.new(phone_params) + + respond_to do |format| + if @phone.save + format.html { redirect_to @phone, notice: 'Phone was successfully created.' } + format.json { render :show, status: :created, location: @phone } + else + format.html { render :new } + format.json { render json: @phone.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /phones/1 + # PATCH/PUT /phones/1.json + def update + respond_to do |format| + if @phone.update(phone_params) + format.html { redirect_to @phone, notice: 'Phone was successfully updated.' } + format.json { render :show, status: :ok, location: @phone } + else + format.html { render :edit } + format.json { render json: @phone.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /phones/1 + # DELETE /phones/1.json + def destroy + @phone.destroy + respond_to do |format| + format.html { redirect_to phones_url, notice: 'Phone was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_phone + @phone = Phone.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def phone_params + params.require(:phone).permit(:phone_number, :phone_type) + end +end diff --git a/artifacts/team-manager/app/controllers/player_stats_controller.rb b/artifacts/team-manager/app/controllers/player_stats_controller.rb new file mode 100644 index 0000000..883afa3 --- /dev/null +++ b/artifacts/team-manager/app/controllers/player_stats_controller.rb @@ -0,0 +1,74 @@ +class PlayerStatsController < ApplicationController + before_action :set_player_stat, only: [:show, :edit, :update, :destroy] + + # GET /player_stats + # GET /player_stats.json + def index + @player_stats = PlayerStat.all + end + + # GET /player_stats/1 + # GET /player_stats/1.json + def show + end + + # GET /player_stats/new + def new + @player_stat = PlayerStat.new + end + + # GET /player_stats/1/edit + def edit + end + + # POST /player_stats + # POST /player_stats.json + def create + @player_stat = PlayerStat.new(player_stat_params) + + respond_to do |format| + if @player_stat.save + format.html { redirect_to @player_stat, notice: 'Player stat was successfully created.' } + format.json { render :show, status: :created, location: @player_stat } + else + format.html { render :new } + format.json { render json: @player_stat.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /player_stats/1 + # PATCH/PUT /player_stats/1.json + def update + respond_to do |format| + if @player_stat.update(player_stat_params) + format.html { redirect_to @player_stat, notice: 'Player stat was successfully updated.' } + format.json { render :show, status: :ok, location: @player_stat } + else + format.html { render :edit } + format.json { render json: @player_stat.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /player_stats/1 + # DELETE /player_stats/1.json + def destroy + @player_stat.destroy + respond_to do |format| + format.html { redirect_to player_stats_url, notice: 'Player stat was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_player_stat + @player_stat = PlayerStat.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def player_stat_params + params.require(:player_stat).permit(:jersey_number, :player_bio, :height, :weight, :person_id, :team_id) + end +end diff --git a/artifacts/team-manager/app/controllers/staffs_controller.rb b/artifacts/team-manager/app/controllers/staffs_controller.rb new file mode 100644 index 0000000..593b2a5 --- /dev/null +++ b/artifacts/team-manager/app/controllers/staffs_controller.rb @@ -0,0 +1,74 @@ +class StaffsController < ApplicationController + before_action :set_staff, only: [:show, :edit, :update, :destroy] + + # GET /staffs + # GET /staffs.json + def index + @staffs = Staff.all + end + + # GET /staffs/1 + # GET /staffs/1.json + def show + end + + # GET /staffs/new + def new + @staff = Staff.new + end + + # GET /staffs/1/edit + def edit + end + + # POST /staffs + # POST /staffs.json + def create + @staff = Staff.new(staff_params) + + respond_to do |format| + if @staff.save + format.html { redirect_to @staff, notice: 'Staff was successfully created.' } + format.json { render :show, status: :created, location: @staff } + else + format.html { render :new } + format.json { render json: @staff.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /staffs/1 + # PATCH/PUT /staffs/1.json + def update + respond_to do |format| + if @staff.update(staff_params) + format.html { redirect_to @staff, notice: 'Staff was successfully updated.' } + format.json { render :show, status: :ok, location: @staff } + else + format.html { render :edit } + format.json { render json: @staff.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /staffs/1 + # DELETE /staffs/1.json + def destroy + @staff.destroy + respond_to do |format| + format.html { redirect_to staffs_url, notice: 'Staff was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_staff + @staff = Staff.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def staff_params + params.require(:staff).permit(:person_id) + end +end diff --git a/artifacts/team-manager/app/controllers/stat_records_controller.rb b/artifacts/team-manager/app/controllers/stat_records_controller.rb new file mode 100644 index 0000000..d43f898 --- /dev/null +++ b/artifacts/team-manager/app/controllers/stat_records_controller.rb @@ -0,0 +1,74 @@ +class StatRecordsController < ApplicationController + before_action :set_stat_record, only: [:show, :edit, :update, :destroy] + + # GET /stat_records + # GET /stat_records.json + def index + @stat_records = StatRecord.all + end + + # GET /stat_records/1 + # GET /stat_records/1.json + def show + end + + # GET /stat_records/new + def new + @stat_record = StatRecord.new + end + + # GET /stat_records/1/edit + def edit + end + + # POST /stat_records + # POST /stat_records.json + def create + @stat_record = StatRecord.new(stat_record_params) + + respond_to do |format| + if @stat_record.save + format.html { redirect_to @stat_record, notice: 'Stat record was successfully created.' } + format.json { render :show, status: :created, location: @stat_record } + else + format.html { render :new } + format.json { render json: @stat_record.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /stat_records/1 + # PATCH/PUT /stat_records/1.json + def update + respond_to do |format| + if @stat_record.update(stat_record_params) + format.html { redirect_to @stat_record, notice: 'Stat record was successfully updated.' } + format.json { render :show, status: :ok, location: @stat_record } + else + format.html { render :edit } + format.json { render json: @stat_record.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /stat_records/1 + # DELETE /stat_records/1.json + def destroy + @stat_record.destroy + respond_to do |format| + format.html { redirect_to stat_records_url, notice: 'Stat record was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_stat_record + @stat_record = StatRecord.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def stat_record_params + params.require(:stat_record).permit(:record_value, :record_type, :record_date, :references) + end +end diff --git a/artifacts/team-manager/app/controllers/team_has_coaches_controller.rb b/artifacts/team-manager/app/controllers/team_has_coaches_controller.rb new file mode 100644 index 0000000..632591f --- /dev/null +++ b/artifacts/team-manager/app/controllers/team_has_coaches_controller.rb @@ -0,0 +1,74 @@ +class TeamHasCoachesController < ApplicationController + before_action :set_team_has_coach, only: [:show, :edit, :update, :destroy] + + # GET /team_has_coaches + # GET /team_has_coaches.json + def index + @team_has_coaches = TeamHasCoach.all + end + + # GET /team_has_coaches/1 + # GET /team_has_coaches/1.json + def show + end + + # GET /team_has_coaches/new + def new + @team_has_coach = TeamHasCoach.new + end + + # GET /team_has_coaches/1/edit + def edit + end + + # POST /team_has_coaches + # POST /team_has_coaches.json + def create + @team_has_coach = TeamHasCoach.new(team_has_coach_params) + + respond_to do |format| + if @team_has_coach.save + format.html { redirect_to @team_has_coach, notice: 'Team has coach was successfully created.' } + format.json { render :show, status: :created, location: @team_has_coach } + else + format.html { render :new } + format.json { render json: @team_has_coach.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /team_has_coaches/1 + # PATCH/PUT /team_has_coaches/1.json + def update + respond_to do |format| + if @team_has_coach.update(team_has_coach_params) + format.html { redirect_to @team_has_coach, notice: 'Team has coach was successfully updated.' } + format.json { render :show, status: :ok, location: @team_has_coach } + else + format.html { render :edit } + format.json { render json: @team_has_coach.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /team_has_coaches/1 + # DELETE /team_has_coaches/1.json + def destroy + @team_has_coach.destroy + respond_to do |format| + format.html { redirect_to team_has_coaches_url, notice: 'Team has coach was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_team_has_coach + @team_has_coach = TeamHasCoach.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def team_has_coach_params + params.require(:team_has_coach).permit(:coach_type, :person_id, :team_id) + end +end diff --git a/artifacts/team-manager/app/controllers/teams_controller.rb b/artifacts/team-manager/app/controllers/teams_controller.rb new file mode 100644 index 0000000..269258d --- /dev/null +++ b/artifacts/team-manager/app/controllers/teams_controller.rb @@ -0,0 +1,74 @@ +class TeamsController < ApplicationController + before_action :set_team, only: [:show, :edit, :update, :destroy] + + # GET /teams + # GET /teams.json + def index + @teams = Team.all + end + + # GET /teams/1 + # GET /teams/1.json + def show + end + + # GET /teams/new + def new + @team = Team.new + end + + # GET /teams/1/edit + def edit + end + + # POST /teams + # POST /teams.json + def create + @team = Team.new(team_params) + + respond_to do |format| + if @team.save + format.html { redirect_to @team, notice: 'Team was successfully created.' } + format.json { render :show, status: :created, location: @team } + else + format.html { render :new } + format.json { render json: @team.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /teams/1 + # PATCH/PUT /teams/1.json + def update + respond_to do |format| + if @team.update(team_params) + format.html { redirect_to @team, notice: 'Team was successfully updated.' } + format.json { render :show, status: :ok, location: @team } + else + format.html { render :edit } + format.json { render json: @team.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /teams/1 + # DELETE /teams/1.json + def destroy + @team.destroy + respond_to do |format| + format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_team + @team = Team.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def team_params + params.require(:team).permit(:team_name, :age_group, :wins, :loses, :ties, :team_start, :team_end, :is_archived) + end +end diff --git a/artifacts/team-manager/app/helpers/addresses_helper.rb b/artifacts/team-manager/app/helpers/addresses_helper.rb new file mode 100644 index 0000000..5f4dc13 --- /dev/null +++ b/artifacts/team-manager/app/helpers/addresses_helper.rb @@ -0,0 +1,2 @@ +module AddressesHelper +end diff --git a/artifacts/team-manager/app/helpers/application_helper.rb b/artifacts/team-manager/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/artifacts/team-manager/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/artifacts/team-manager/app/helpers/children_helper.rb b/artifacts/team-manager/app/helpers/children_helper.rb new file mode 100644 index 0000000..7ad6bc5 --- /dev/null +++ b/artifacts/team-manager/app/helpers/children_helper.rb @@ -0,0 +1,2 @@ +module ChildrenHelper +end diff --git a/artifacts/team-manager/app/helpers/coaches_helper.rb b/artifacts/team-manager/app/helpers/coaches_helper.rb new file mode 100644 index 0000000..4a533de --- /dev/null +++ b/artifacts/team-manager/app/helpers/coaches_helper.rb @@ -0,0 +1,2 @@ +module CoachesHelper +end diff --git a/artifacts/team-manager/app/helpers/events_helper.rb b/artifacts/team-manager/app/helpers/events_helper.rb new file mode 100644 index 0000000..8a9a878 --- /dev/null +++ b/artifacts/team-manager/app/helpers/events_helper.rb @@ -0,0 +1,2 @@ +module EventsHelper +end diff --git a/artifacts/team-manager/app/helpers/fees_helper.rb b/artifacts/team-manager/app/helpers/fees_helper.rb new file mode 100644 index 0000000..94ab56d --- /dev/null +++ b/artifacts/team-manager/app/helpers/fees_helper.rb @@ -0,0 +1,2 @@ +module FeesHelper +end diff --git a/artifacts/team-manager/app/helpers/home_helper.rb b/artifacts/team-manager/app/helpers/home_helper.rb new file mode 100644 index 0000000..23de56a --- /dev/null +++ b/artifacts/team-manager/app/helpers/home_helper.rb @@ -0,0 +1,2 @@ +module HomeHelper +end diff --git a/artifacts/team-manager/app/helpers/managers_helper.rb b/artifacts/team-manager/app/helpers/managers_helper.rb new file mode 100644 index 0000000..bc2ab9a --- /dev/null +++ b/artifacts/team-manager/app/helpers/managers_helper.rb @@ -0,0 +1,2 @@ +module ManagersHelper +end diff --git a/artifacts/team-manager/app/helpers/organizations_helper.rb b/artifacts/team-manager/app/helpers/organizations_helper.rb new file mode 100644 index 0000000..24cc9a8 --- /dev/null +++ b/artifacts/team-manager/app/helpers/organizations_helper.rb @@ -0,0 +1,2 @@ +module OrganizationsHelper +end diff --git a/artifacts/team-manager/app/helpers/parents_helper.rb b/artifacts/team-manager/app/helpers/parents_helper.rb new file mode 100644 index 0000000..2b0361c --- /dev/null +++ b/artifacts/team-manager/app/helpers/parents_helper.rb @@ -0,0 +1,2 @@ +module ParentsHelper +end diff --git a/artifacts/team-manager/app/helpers/payment_types_helper.rb b/artifacts/team-manager/app/helpers/payment_types_helper.rb new file mode 100644 index 0000000..8e7fbac --- /dev/null +++ b/artifacts/team-manager/app/helpers/payment_types_helper.rb @@ -0,0 +1,2 @@ +module PaymentTypesHelper +end diff --git a/artifacts/team-manager/app/helpers/people_helper.rb b/artifacts/team-manager/app/helpers/people_helper.rb new file mode 100644 index 0000000..b682fbf --- /dev/null +++ b/artifacts/team-manager/app/helpers/people_helper.rb @@ -0,0 +1,2 @@ +module PeopleHelper +end diff --git a/artifacts/team-manager/app/helpers/phones_helper.rb b/artifacts/team-manager/app/helpers/phones_helper.rb new file mode 100644 index 0000000..69ebd13 --- /dev/null +++ b/artifacts/team-manager/app/helpers/phones_helper.rb @@ -0,0 +1,2 @@ +module PhonesHelper +end diff --git a/artifacts/team-manager/app/helpers/player_stats_helper.rb b/artifacts/team-manager/app/helpers/player_stats_helper.rb new file mode 100644 index 0000000..4dfa239 --- /dev/null +++ b/artifacts/team-manager/app/helpers/player_stats_helper.rb @@ -0,0 +1,2 @@ +module PlayerStatsHelper +end diff --git a/artifacts/team-manager/app/helpers/staffs_helper.rb b/artifacts/team-manager/app/helpers/staffs_helper.rb new file mode 100644 index 0000000..067f4e3 --- /dev/null +++ b/artifacts/team-manager/app/helpers/staffs_helper.rb @@ -0,0 +1,2 @@ +module StaffsHelper +end diff --git a/artifacts/team-manager/app/helpers/stat_records_helper.rb b/artifacts/team-manager/app/helpers/stat_records_helper.rb new file mode 100644 index 0000000..ac912ea --- /dev/null +++ b/artifacts/team-manager/app/helpers/stat_records_helper.rb @@ -0,0 +1,2 @@ +module StatRecordsHelper +end diff --git a/artifacts/team-manager/app/helpers/team_has_coaches_helper.rb b/artifacts/team-manager/app/helpers/team_has_coaches_helper.rb new file mode 100644 index 0000000..2fe224c --- /dev/null +++ b/artifacts/team-manager/app/helpers/team_has_coaches_helper.rb @@ -0,0 +1,2 @@ +module TeamHasCoachesHelper +end diff --git a/artifacts/team-manager/app/helpers/teams_helper.rb b/artifacts/team-manager/app/helpers/teams_helper.rb new file mode 100644 index 0000000..5fb41eb --- /dev/null +++ b/artifacts/team-manager/app/helpers/teams_helper.rb @@ -0,0 +1,2 @@ +module TeamsHelper +end diff --git a/artifacts/team-manager/app/jobs/application_job.rb b/artifacts/team-manager/app/jobs/application_job.rb new file mode 100644 index 0000000..a009ace --- /dev/null +++ b/artifacts/team-manager/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/artifacts/team-manager/app/mailers/application_mailer.rb b/artifacts/team-manager/app/mailers/application_mailer.rb new file mode 100644 index 0000000..286b223 --- /dev/null +++ b/artifacts/team-manager/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/artifacts/team-manager/app/models/address.rb b/artifacts/team-manager/app/models/address.rb new file mode 100644 index 0000000..05c591a --- /dev/null +++ b/artifacts/team-manager/app/models/address.rb @@ -0,0 +1,10 @@ +class Address < ApplicationRecord + has_and_belongs_to_many :people + validates_presence_of :addr1 + validates_presence_of :addr2 + validates_presence_of :city + validates_presence_of :state + validates_presence_of :country + validates_presence_of :zip + validates_presence_of :address_type +end diff --git a/artifacts/team-manager/app/models/application_record.rb b/artifacts/team-manager/app/models/application_record.rb new file mode 100644 index 0000000..10a4cba --- /dev/null +++ b/artifacts/team-manager/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/artifacts/team-manager/app/models/child.rb b/artifacts/team-manager/app/models/child.rb new file mode 100644 index 0000000..938416b --- /dev/null +++ b/artifacts/team-manager/app/models/child.rb @@ -0,0 +1,4 @@ +class Child < ApplicationRecord + belongs_to :person + has_and_belongs_to_many :parent +end diff --git a/artifacts/team-manager/app/models/coach.rb b/artifacts/team-manager/app/models/coach.rb new file mode 100644 index 0000000..d18b8ee --- /dev/null +++ b/artifacts/team-manager/app/models/coach.rb @@ -0,0 +1,5 @@ +class Coach < ApplicationRecord + belongs_to :person + validates_presence_of :license_num + validates_presence_of :license_exp +end diff --git a/artifacts/team-manager/app/models/concerns/.keep b/artifacts/team-manager/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/team-manager/app/models/event.rb b/artifacts/team-manager/app/models/event.rb new file mode 100644 index 0000000..6a8ab7b --- /dev/null +++ b/artifacts/team-manager/app/models/event.rb @@ -0,0 +1,8 @@ +class Event < ApplicationRecord + has_many :organization + has_many :team + validates_presence_of :event_name + validates_presence_of :event_type + validates_presence_of :event_start_time + validates_presence_of :event_end_time +end diff --git a/artifacts/team-manager/app/models/fee.rb b/artifacts/team-manager/app/models/fee.rb new file mode 100644 index 0000000..5421aec --- /dev/null +++ b/artifacts/team-manager/app/models/fee.rb @@ -0,0 +1,6 @@ +class Fee < ApplicationRecord + belongs_to :person + has_one :payment_type + validates_presence_of :fee_amt + validates_presence_of :created_on +end diff --git a/artifacts/team-manager/app/models/manager.rb b/artifacts/team-manager/app/models/manager.rb new file mode 100644 index 0000000..64599ac --- /dev/null +++ b/artifacts/team-manager/app/models/manager.rb @@ -0,0 +1,4 @@ +class Manager < ApplicationRecord + belongs_to :person + has_many :team +end diff --git a/artifacts/team-manager/app/models/organization.rb b/artifacts/team-manager/app/models/organization.rb new file mode 100644 index 0000000..5b1926f --- /dev/null +++ b/artifacts/team-manager/app/models/organization.rb @@ -0,0 +1,6 @@ +class Organization < ApplicationRecord + has_many :team + has_many :staff + has_many :event + validates_presence_of :org_name +end diff --git a/artifacts/team-manager/app/models/parent.rb b/artifacts/team-manager/app/models/parent.rb new file mode 100644 index 0000000..e480dc1 --- /dev/null +++ b/artifacts/team-manager/app/models/parent.rb @@ -0,0 +1,4 @@ +class Parent < ApplicationRecord + belongs_to :person + has_many :child +end diff --git a/artifacts/team-manager/app/models/payment_type.rb b/artifacts/team-manager/app/models/payment_type.rb new file mode 100644 index 0000000..32e7449 --- /dev/null +++ b/artifacts/team-manager/app/models/payment_type.rb @@ -0,0 +1,4 @@ +class PaymentType < ApplicationRecord + belongs_to :fee + validates_presence_of :payment_type +end diff --git a/artifacts/team-manager/app/models/person.rb b/artifacts/team-manager/app/models/person.rb new file mode 100644 index 0000000..21b1a07 --- /dev/null +++ b/artifacts/team-manager/app/models/person.rb @@ -0,0 +1,10 @@ +class Person < ApplicationRecord + has_many :phone + has_and_belongs_to_many :addresses + has_many :team + has_many :fee + validates_presence_of :first_name + validates_presence_of :last_name + validates_presence_of :dob + validates_presence_of :gender +end diff --git a/artifacts/team-manager/app/models/phone.rb b/artifacts/team-manager/app/models/phone.rb new file mode 100644 index 0000000..52a0446 --- /dev/null +++ b/artifacts/team-manager/app/models/phone.rb @@ -0,0 +1,5 @@ +class Phone < ApplicationRecord + belongs_to :person + validates_presence_of :phone_number + validates_presence_of :phone_type +end diff --git a/artifacts/team-manager/app/models/player_stat.rb b/artifacts/team-manager/app/models/player_stat.rb new file mode 100644 index 0000000..92ae9e9 --- /dev/null +++ b/artifacts/team-manager/app/models/player_stat.rb @@ -0,0 +1,5 @@ +class PlayerStat < ApplicationRecord + belongs_to :person + belongs_to :team + has_many :stat_record, dependent: :destroy +end diff --git a/artifacts/team-manager/app/models/staff.rb b/artifacts/team-manager/app/models/staff.rb new file mode 100644 index 0000000..c4f8c3e --- /dev/null +++ b/artifacts/team-manager/app/models/staff.rb @@ -0,0 +1,3 @@ +class Staff < ApplicationRecord + belongs_to :person +end diff --git a/artifacts/team-manager/app/models/stat_record.rb b/artifacts/team-manager/app/models/stat_record.rb new file mode 100644 index 0000000..fa3d5bb --- /dev/null +++ b/artifacts/team-manager/app/models/stat_record.rb @@ -0,0 +1,3 @@ +class StatRecord < ApplicationRecord + belongs_to :player_stat +end diff --git a/artifacts/team-manager/app/models/team.rb b/artifacts/team-manager/app/models/team.rb new file mode 100644 index 0000000..371e1de --- /dev/null +++ b/artifacts/team-manager/app/models/team.rb @@ -0,0 +1,8 @@ +class Team < ApplicationRecord + has_many :person + has_many :manager + has_many :event + belongs_to :organization + validates_presence_of :team_name + validates_presence_of :age_group +end diff --git a/artifacts/team-manager/app/models/team_has_coach.rb b/artifacts/team-manager/app/models/team_has_coach.rb new file mode 100644 index 0000000..1383f2a --- /dev/null +++ b/artifacts/team-manager/app/models/team_has_coach.rb @@ -0,0 +1,5 @@ +class TeamHasCoach < ApplicationRecord + belongs_to :person + belongs_to :team + validates_presence_of :coach_type +end diff --git a/artifacts/team-manager/app/views/addresses/_address.json.jbuilder b/artifacts/team-manager/app/views/addresses/_address.json.jbuilder new file mode 100644 index 0000000..8540e74 --- /dev/null +++ b/artifacts/team-manager/app/views/addresses/_address.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! address, :id, :addr1, :addr2, :city, :state, :country, :zip, :address_type, :created_at, :updated_at +json.url address_url(address, format: :json) \ No newline at end of file diff --git a/artifacts/team-manager/app/views/addresses/_form.html.erb b/artifacts/team-manager/app/views/addresses/_form.html.erb new file mode 100644 index 0000000..39552dc --- /dev/null +++ b/artifacts/team-manager/app/views/addresses/_form.html.erb @@ -0,0 +1,52 @@ +<%= form_for(address) do |f| %> + <% if address.errors.any? %> +
<%= notice %>
+ +| Addr1 | +Addr2 | +City | +State | +Country | +Zip | +Address type | ++ | ||
|---|---|---|---|---|---|---|---|---|---|
| <%= address.addr1 %> | +<%= address.addr2 %> | +<%= address.city %> | +<%= address.state %> | +<%= address.country %> | +<%= address.zip %> | +<%= address.address_type %> | +<%= link_to 'Show', address %> | +<%= link_to 'Edit', edit_address_path(address) %> | +<%= link_to 'Destroy', address, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Addr1: + <%= @address.addr1 %> +
+ ++ Addr2: + <%= @address.addr2 %> +
+ ++ City: + <%= @address.city %> +
+ ++ State: + <%= @address.state %> +
+ ++ Country: + <%= @address.country %> +
+ ++ Zip: + <%= @address.zip %> +
+ ++ Address type: + <%= @address.address_type %> +
+ +<%= link_to 'Edit', edit_address_path(@address) %> | +<%= link_to 'Back', addresses_path %> diff --git a/artifacts/team-manager/app/views/addresses/show.json.jbuilder b/artifacts/team-manager/app/views/addresses/show.json.jbuilder new file mode 100644 index 0000000..e47c94a --- /dev/null +++ b/artifacts/team-manager/app/views/addresses/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "addresses/address", address: @address \ No newline at end of file diff --git a/artifacts/team-manager/app/views/children/_child.json.jbuilder b/artifacts/team-manager/app/views/children/_child.json.jbuilder new file mode 100644 index 0000000..87c4b4f --- /dev/null +++ b/artifacts/team-manager/app/views/children/_child.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! child, :id, :person_id, :created_at, :updated_at +json.url child_url(child, format: :json) \ No newline at end of file diff --git a/artifacts/team-manager/app/views/children/_form.html.erb b/artifacts/team-manager/app/views/children/_form.html.erb new file mode 100644 index 0000000..78ad78e --- /dev/null +++ b/artifacts/team-manager/app/views/children/_form.html.erb @@ -0,0 +1,22 @@ +<%= form_for(child) do |f| %> + <% if child.errors.any? %> +<%= notice %>
+ +| Person | ++ | ||
|---|---|---|---|
| <%= child.person %> | +<%= link_to 'Show', child %> | +<%= link_to 'Edit', edit_child_path(child) %> | +<%= link_to 'Destroy', child, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Person: + <%= @child.person %> +
+ +<%= link_to 'Edit', edit_child_path(@child) %> | +<%= link_to 'Back', children_path %> diff --git a/artifacts/team-manager/app/views/children/show.json.jbuilder b/artifacts/team-manager/app/views/children/show.json.jbuilder new file mode 100644 index 0000000..7145cd7 --- /dev/null +++ b/artifacts/team-manager/app/views/children/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "children/child", child: @child \ No newline at end of file diff --git a/artifacts/team-manager/app/views/coaches/_coach.json.jbuilder b/artifacts/team-manager/app/views/coaches/_coach.json.jbuilder new file mode 100644 index 0000000..94328ac --- /dev/null +++ b/artifacts/team-manager/app/views/coaches/_coach.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! coach, :id, :license_num, :license_exp, :person_id, :created_at, :updated_at +json.url coach_url(coach, format: :json) \ No newline at end of file diff --git a/artifacts/team-manager/app/views/coaches/_form.html.erb b/artifacts/team-manager/app/views/coaches/_form.html.erb new file mode 100644 index 0000000..ac60e92 --- /dev/null +++ b/artifacts/team-manager/app/views/coaches/_form.html.erb @@ -0,0 +1,32 @@ +<%= form_for(coach) do |f| %> + <% if coach.errors.any? %> +<%= notice %>
+ +| License num | +License exp | +Person | ++ | ||
|---|---|---|---|---|---|
| <%= coach.license_num %> | +<%= coach.license_exp %> | +<%= coach.person %> | +<%= link_to 'Show', coach %> | +<%= link_to 'Edit', edit_coach_path(coach) %> | +<%= link_to 'Destroy', coach, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ License num: + <%= @coach.license_num %> +
+ ++ License exp: + <%= @coach.license_exp %> +
+ ++ Person: + <%= @coach.person %> +
+ +<%= link_to 'Edit', edit_coach_path(@coach) %> | +<%= link_to 'Back', coaches_path %> diff --git a/artifacts/team-manager/app/views/coaches/show.json.jbuilder b/artifacts/team-manager/app/views/coaches/show.json.jbuilder new file mode 100644 index 0000000..00a9132 --- /dev/null +++ b/artifacts/team-manager/app/views/coaches/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "coaches/coach", coach: @coach \ No newline at end of file diff --git a/artifacts/team-manager/app/views/events/_event.json.jbuilder b/artifacts/team-manager/app/views/events/_event.json.jbuilder new file mode 100644 index 0000000..4bd29ad --- /dev/null +++ b/artifacts/team-manager/app/views/events/_event.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! event, :id, :event_name, :event_type, :event_start_time, :event_end_time, :created_at, :updated_at +json.url event_url(event, format: :json) \ No newline at end of file diff --git a/artifacts/team-manager/app/views/events/_form.html.erb b/artifacts/team-manager/app/views/events/_form.html.erb new file mode 100644 index 0000000..caac3b5 --- /dev/null +++ b/artifacts/team-manager/app/views/events/_form.html.erb @@ -0,0 +1,37 @@ +<%= form_for(event) do |f| %> + <% if event.errors.any? %> +<%= notice %>
+ +| Event name | +Event type | +Event start time | +Event end time | ++ | ||
|---|---|---|---|---|---|---|
| <%= event.event_name %> | +<%= event.event_type %> | +<%= event.event_start_time %> | +<%= event.event_end_time %> | +<%= link_to 'Show', event %> | +<%= link_to 'Edit', edit_event_path(event) %> | +<%= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Event name: + <%= @event.event_name %> +
+ ++ Event type: + <%= @event.event_type %> +
+ ++ Event start time: + <%= @event.event_start_time %> +
+ ++ Event end time: + <%= @event.event_end_time %> +
+ +<%= link_to 'Edit', edit_event_path(@event) %> | +<%= link_to 'Back', events_path %> diff --git a/artifacts/team-manager/app/views/events/show.json.jbuilder b/artifacts/team-manager/app/views/events/show.json.jbuilder new file mode 100644 index 0000000..7e59004 --- /dev/null +++ b/artifacts/team-manager/app/views/events/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "events/event", event: @event \ No newline at end of file diff --git a/artifacts/team-manager/app/views/fees/_fee.json.jbuilder b/artifacts/team-manager/app/views/fees/_fee.json.jbuilder new file mode 100644 index 0000000..377749d --- /dev/null +++ b/artifacts/team-manager/app/views/fees/_fee.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! fee, :id, :fee_amt, :paid_amt, :created_on, :paid_on, :references, :created_at, :updated_at +json.url fee_url(fee, format: :json) \ No newline at end of file diff --git a/artifacts/team-manager/app/views/fees/_form.html.erb b/artifacts/team-manager/app/views/fees/_form.html.erb new file mode 100644 index 0000000..f970b63 --- /dev/null +++ b/artifacts/team-manager/app/views/fees/_form.html.erb @@ -0,0 +1,42 @@ +<%= form_for(fee) do |f| %> + <% if fee.errors.any? %> +<%= notice %>
+ +| Fee amt | +Paid amt | +Created on | +Paid on | +References | ++ | ||
|---|---|---|---|---|---|---|---|
| <%= fee.fee_amt %> | +<%= fee.paid_amt %> | +<%= fee.created_on %> | +<%= fee.paid_on %> | +<%= fee.references %> | +<%= link_to 'Show', fee %> | +<%= link_to 'Edit', edit_fee_path(fee) %> | +<%= link_to 'Destroy', fee, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Fee amt: + <%= @fee.fee_amt %> +
+ ++ Paid amt: + <%= @fee.paid_amt %> +
+ ++ Created on: + <%= @fee.created_on %> +
+ ++ Paid on: + <%= @fee.paid_on %> +
+ ++ References: + <%= @fee.references %> +
+ +<%= link_to 'Edit', edit_fee_path(@fee) %> | +<%= link_to 'Back', fees_path %> diff --git a/artifacts/team-manager/app/views/fees/show.json.jbuilder b/artifacts/team-manager/app/views/fees/show.json.jbuilder new file mode 100644 index 0000000..d6eb159 --- /dev/null +++ b/artifacts/team-manager/app/views/fees/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "fees/fee", fee: @fee \ No newline at end of file diff --git a/artifacts/team-manager/app/views/home/index.html.erb b/artifacts/team-manager/app/views/home/index.html.erb new file mode 100644 index 0000000..9df3fbd --- /dev/null +++ b/artifacts/team-manager/app/views/home/index.html.erb @@ -0,0 +1,2 @@ +Some stuff will go here soon.
diff --git a/artifacts/team-manager/app/views/layouts/application.html.erb b/artifacts/team-manager/app/views/layouts/application.html.erb new file mode 100644 index 0000000..b4a753f --- /dev/null +++ b/artifacts/team-manager/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + +<%= notice %>
+ +| Person | ++ | ||
|---|---|---|---|
| <%= manager.person %> | +<%= link_to 'Show', manager %> | +<%= link_to 'Edit', edit_manager_path(manager) %> | +<%= link_to 'Destroy', manager, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Person: + <%= @manager.person %> +
+ +<%= link_to 'Edit', edit_manager_path(@manager) %> | +<%= link_to 'Back', managers_path %> diff --git a/artifacts/team-manager/app/views/managers/show.json.jbuilder b/artifacts/team-manager/app/views/managers/show.json.jbuilder new file mode 100644 index 0000000..8428a61 --- /dev/null +++ b/artifacts/team-manager/app/views/managers/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "managers/manager", manager: @manager \ No newline at end of file diff --git a/artifacts/team-manager/app/views/organizations/_form.html.erb b/artifacts/team-manager/app/views/organizations/_form.html.erb new file mode 100644 index 0000000..2ac264f --- /dev/null +++ b/artifacts/team-manager/app/views/organizations/_form.html.erb @@ -0,0 +1,22 @@ +<%= form_for(organization) do |f| %> + <% if organization.errors.any? %> +<%= notice %>
+ +| Org name | ++ | ||
|---|---|---|---|
| <%= organization.org_name %> | +<%= link_to 'Show', organization %> | +<%= link_to 'Edit', edit_organization_path(organization) %> | +<%= link_to 'Destroy', organization, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Org name: + <%= @organization.org_name %> +
+ +<%= link_to 'Edit', edit_organization_path(@organization) %> | +<%= link_to 'Back', organizations_path %> diff --git a/artifacts/team-manager/app/views/organizations/show.json.jbuilder b/artifacts/team-manager/app/views/organizations/show.json.jbuilder new file mode 100644 index 0000000..1f684e2 --- /dev/null +++ b/artifacts/team-manager/app/views/organizations/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "organizations/organization", organization: @organization \ No newline at end of file diff --git a/artifacts/team-manager/app/views/parents/_form.html.erb b/artifacts/team-manager/app/views/parents/_form.html.erb new file mode 100644 index 0000000..651e1f8 --- /dev/null +++ b/artifacts/team-manager/app/views/parents/_form.html.erb @@ -0,0 +1,22 @@ +<%= form_for(parent) do |f| %> + <% if parent.errors.any? %> +<%= notice %>
+ +| Person | ++ | ||
|---|---|---|---|
| <%= parent.person %> | +<%= link_to 'Show', parent %> | +<%= link_to 'Edit', edit_parent_path(parent) %> | +<%= link_to 'Destroy', parent, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Person: + <%= @parent.person %> +
+ +<%= link_to 'Edit', edit_parent_path(@parent) %> | +<%= link_to 'Back', parents_path %> diff --git a/artifacts/team-manager/app/views/parents/show.json.jbuilder b/artifacts/team-manager/app/views/parents/show.json.jbuilder new file mode 100644 index 0000000..2dd2d4b --- /dev/null +++ b/artifacts/team-manager/app/views/parents/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "parents/parent", parent: @parent \ No newline at end of file diff --git a/artifacts/team-manager/app/views/payment_types/_form.html.erb b/artifacts/team-manager/app/views/payment_types/_form.html.erb new file mode 100644 index 0000000..d991114 --- /dev/null +++ b/artifacts/team-manager/app/views/payment_types/_form.html.erb @@ -0,0 +1,42 @@ +<%= form_for(payment_type) do |f| %> + <% if payment_type.errors.any? %> +<%= notice %>
+ +| Payment type | +Check num | +Cc num | +Acct num | +Routing num | ++ | ||
|---|---|---|---|---|---|---|---|
| <%= payment_type.payment_type %> | +<%= payment_type.check_num %> | +<%= payment_type.cc_num %> | +<%= payment_type.acct_num %> | +<%= payment_type.routing_num %> | +<%= link_to 'Show', payment_type %> | +<%= link_to 'Edit', edit_payment_type_path(payment_type) %> | +<%= link_to 'Destroy', payment_type, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Payment type: + <%= @payment_type.payment_type %> +
+ ++ Check num: + <%= @payment_type.check_num %> +
+ ++ Cc num: + <%= @payment_type.cc_num %> +
+ ++ Acct num: + <%= @payment_type.acct_num %> +
+ ++ Routing num: + <%= @payment_type.routing_num %> +
+ +<%= link_to 'Edit', edit_payment_type_path(@payment_type) %> | +<%= link_to 'Back', payment_types_path %> diff --git a/artifacts/team-manager/app/views/payment_types/show.json.jbuilder b/artifacts/team-manager/app/views/payment_types/show.json.jbuilder new file mode 100644 index 0000000..9e0b262 --- /dev/null +++ b/artifacts/team-manager/app/views/payment_types/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "payment_types/payment_type", payment_type: @payment_type \ No newline at end of file diff --git a/artifacts/team-manager/app/views/people/_form.html.erb b/artifacts/team-manager/app/views/people/_form.html.erb new file mode 100644 index 0000000..3eedc5f --- /dev/null +++ b/artifacts/team-manager/app/views/people/_form.html.erb @@ -0,0 +1,42 @@ +<%= form_for(person) do |f| %> + <% if person.errors.any? %> +<%= notice %>
+ +| First name | +Last name | +Dob | +Gender | +Ethnicity | ++ | ||
|---|---|---|---|---|---|---|---|
| <%= person.first_name %> | +<%= person.last_name %> | +<%= person.dob %> | +<%= person.gender %> | +<%= person.ethnicity %> | +<%= link_to 'Show', person %> | +<%= link_to 'Edit', edit_person_path(person) %> | +<%= link_to 'Destroy', person, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ First name: + <%= @person.first_name %> +
+ ++ Last name: + <%= @person.last_name %> +
+ ++ Dob: + <%= @person.dob %> +
+ ++ Gender: + <%= @person.gender %> +
+ ++ Ethnicity: + <%= @person.ethnicity %> +
+ +<%= link_to 'Edit', edit_person_path(@person) %> | +<%= link_to 'Back', people_path %> diff --git a/artifacts/team-manager/app/views/people/show.json.jbuilder b/artifacts/team-manager/app/views/people/show.json.jbuilder new file mode 100644 index 0000000..727d7ec --- /dev/null +++ b/artifacts/team-manager/app/views/people/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "people/person", person: @person \ No newline at end of file diff --git a/artifacts/team-manager/app/views/phones/_form.html.erb b/artifacts/team-manager/app/views/phones/_form.html.erb new file mode 100644 index 0000000..082aa9d --- /dev/null +++ b/artifacts/team-manager/app/views/phones/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_for(phone) do |f| %> + <% if phone.errors.any? %> +<%= notice %>
+ +| Phone number | +Phone type | ++ | ||
|---|---|---|---|---|
| <%= phone.phone_number %> | +<%= phone.phone_type %> | +<%= link_to 'Show', phone %> | +<%= link_to 'Edit', edit_phone_path(phone) %> | +<%= link_to 'Destroy', phone, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Phone number: + <%= @phone.phone_number %> +
+ ++ Phone type: + <%= @phone.phone_type %> +
+ +<%= link_to 'Edit', edit_phone_path(@phone) %> | +<%= link_to 'Back', phones_path %> diff --git a/artifacts/team-manager/app/views/phones/show.json.jbuilder b/artifacts/team-manager/app/views/phones/show.json.jbuilder new file mode 100644 index 0000000..9508943 --- /dev/null +++ b/artifacts/team-manager/app/views/phones/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "phones/phone", phone: @phone \ No newline at end of file diff --git a/artifacts/team-manager/app/views/player_stats/_form.html.erb b/artifacts/team-manager/app/views/player_stats/_form.html.erb new file mode 100644 index 0000000..aed251e --- /dev/null +++ b/artifacts/team-manager/app/views/player_stats/_form.html.erb @@ -0,0 +1,47 @@ +<%= form_for(player_stat) do |f| %> + <% if player_stat.errors.any? %> +<%= notice %>
+ +| Jersey number | +Player bio | +Height | +Weight | +Person | +Team | ++ | ||
|---|---|---|---|---|---|---|---|---|
| <%= player_stat.jersey_number %> | +<%= player_stat.player_bio %> | +<%= player_stat.height %> | +<%= player_stat.weight %> | +<%= player_stat.person %> | +<%= player_stat.team %> | +<%= link_to 'Show', player_stat %> | +<%= link_to 'Edit', edit_player_stat_path(player_stat) %> | +<%= link_to 'Destroy', player_stat, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Jersey number: + <%= @player_stat.jersey_number %> +
+ ++ Player bio: + <%= @player_stat.player_bio %> +
+ ++ Height: + <%= @player_stat.height %> +
+ ++ Weight: + <%= @player_stat.weight %> +
+ ++ Person: + <%= @player_stat.person %> +
+ ++ Team: + <%= @player_stat.team %> +
+ +<%= link_to 'Edit', edit_player_stat_path(@player_stat) %> | +<%= link_to 'Back', player_stats_path %> diff --git a/artifacts/team-manager/app/views/player_stats/show.json.jbuilder b/artifacts/team-manager/app/views/player_stats/show.json.jbuilder new file mode 100644 index 0000000..e1ccccb --- /dev/null +++ b/artifacts/team-manager/app/views/player_stats/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "player_stats/player_stat", player_stat: @player_stat \ No newline at end of file diff --git a/artifacts/team-manager/app/views/staffs/_form.html.erb b/artifacts/team-manager/app/views/staffs/_form.html.erb new file mode 100644 index 0000000..0744548 --- /dev/null +++ b/artifacts/team-manager/app/views/staffs/_form.html.erb @@ -0,0 +1,22 @@ +<%= form_for(staff) do |f| %> + <% if staff.errors.any? %> +<%= notice %>
+ +| Person | ++ | ||
|---|---|---|---|
| <%= staff.person %> | +<%= link_to 'Show', staff %> | +<%= link_to 'Edit', edit_staff_path(staff) %> | +<%= link_to 'Destroy', staff, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Person: + <%= @staff.person %> +
+ +<%= link_to 'Edit', edit_staff_path(@staff) %> | +<%= link_to 'Back', staffs_path %> diff --git a/artifacts/team-manager/app/views/staffs/show.json.jbuilder b/artifacts/team-manager/app/views/staffs/show.json.jbuilder new file mode 100644 index 0000000..977f52a --- /dev/null +++ b/artifacts/team-manager/app/views/staffs/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "staffs/staff", staff: @staff \ No newline at end of file diff --git a/artifacts/team-manager/app/views/stat_records/_form.html.erb b/artifacts/team-manager/app/views/stat_records/_form.html.erb new file mode 100644 index 0000000..d310a48 --- /dev/null +++ b/artifacts/team-manager/app/views/stat_records/_form.html.erb @@ -0,0 +1,37 @@ +<%= form_for(stat_record) do |f| %> + <% if stat_record.errors.any? %> +<%= notice %>
+ +| Record value | +Record type | +Record date | +References | ++ | ||
|---|---|---|---|---|---|---|
| <%= stat_record.record_value %> | +<%= stat_record.record_type %> | +<%= stat_record.record_date %> | +<%= stat_record.references %> | +<%= link_to 'Show', stat_record %> | +<%= link_to 'Edit', edit_stat_record_path(stat_record) %> | +<%= link_to 'Destroy', stat_record, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Record value: + <%= @stat_record.record_value %> +
+ ++ Record type: + <%= @stat_record.record_type %> +
+ ++ Record date: + <%= @stat_record.record_date %> +
+ ++ References: + <%= @stat_record.references %> +
+ +<%= link_to 'Edit', edit_stat_record_path(@stat_record) %> | +<%= link_to 'Back', stat_records_path %> diff --git a/artifacts/team-manager/app/views/stat_records/show.json.jbuilder b/artifacts/team-manager/app/views/stat_records/show.json.jbuilder new file mode 100644 index 0000000..9017190 --- /dev/null +++ b/artifacts/team-manager/app/views/stat_records/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "stat_records/stat_record", stat_record: @stat_record \ No newline at end of file diff --git a/artifacts/team-manager/app/views/team_has_coaches/_form.html.erb b/artifacts/team-manager/app/views/team_has_coaches/_form.html.erb new file mode 100644 index 0000000..324f2c7 --- /dev/null +++ b/artifacts/team-manager/app/views/team_has_coaches/_form.html.erb @@ -0,0 +1,32 @@ +<%= form_for(team_has_coach) do |f| %> + <% if team_has_coach.errors.any? %> +<%= notice %>
+ +| Coach type | +Person | +Team | ++ | ||
|---|---|---|---|---|---|
| <%= team_has_coach.coach_type %> | +<%= team_has_coach.person %> | +<%= team_has_coach.team %> | +<%= link_to 'Show', team_has_coach %> | +<%= link_to 'Edit', edit_team_has_coach_path(team_has_coach) %> | +<%= link_to 'Destroy', team_has_coach, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Coach type: + <%= @team_has_coach.coach_type %> +
+ ++ Person: + <%= @team_has_coach.person %> +
+ ++ Team: + <%= @team_has_coach.team %> +
+ +<%= link_to 'Edit', edit_team_has_coach_path(@team_has_coach) %> | +<%= link_to 'Back', team_has_coaches_path %> diff --git a/artifacts/team-manager/app/views/team_has_coaches/show.json.jbuilder b/artifacts/team-manager/app/views/team_has_coaches/show.json.jbuilder new file mode 100644 index 0000000..4053952 --- /dev/null +++ b/artifacts/team-manager/app/views/team_has_coaches/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "team_has_coaches/team_has_coach", team_has_coach: @team_has_coach \ No newline at end of file diff --git a/artifacts/team-manager/app/views/teams/_form.html.erb b/artifacts/team-manager/app/views/teams/_form.html.erb new file mode 100644 index 0000000..5ac80bc --- /dev/null +++ b/artifacts/team-manager/app/views/teams/_form.html.erb @@ -0,0 +1,57 @@ +<%= form_for(team) do |f| %> + <% if team.errors.any? %> +<%= notice %>
+ +| Team name | +Age group | +Wins | +Loses | +Ties | +Team start | +Team end | +Is archived | ++ | ||
|---|---|---|---|---|---|---|---|---|---|---|
| <%= team.team_name %> | +<%= team.age_group %> | +<%= team.wins %> | +<%= team.loses %> | +<%= team.ties %> | +<%= team.team_start %> | +<%= team.team_end %> | +<%= team.is_archived %> | +<%= link_to 'Show', team %> | +<%= link_to 'Edit', edit_team_path(team) %> | +<%= link_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Team name: + <%= @team.team_name %> +
+ ++ Age group: + <%= @team.age_group %> +
+ ++ Wins: + <%= @team.wins %> +
+ ++ Loses: + <%= @team.loses %> +
+ ++ Ties: + <%= @team.ties %> +
+ ++ Team start: + <%= @team.team_start %> +
+ ++ Team end: + <%= @team.team_end %> +
+ ++ Is archived: + <%= @team.is_archived %> +
+ +<%= link_to 'Edit', edit_team_path(@team) %> | +<%= link_to 'Back', teams_path %> diff --git a/artifacts/team-manager/app/views/teams/show.json.jbuilder b/artifacts/team-manager/app/views/teams/show.json.jbuilder new file mode 100644 index 0000000..8a3edb3 --- /dev/null +++ b/artifacts/team-manager/app/views/teams/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "teams/team", team: @team \ No newline at end of file diff --git a/artifacts/team-manager/bin/bundle b/artifacts/team-manager/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/artifacts/team-manager/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/artifacts/team-manager/bin/rails b/artifacts/team-manager/bin/rails new file mode 100755 index 0000000..5badb2f --- /dev/null +++ b/artifacts/team-manager/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/artifacts/team-manager/bin/rake b/artifacts/team-manager/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/artifacts/team-manager/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/artifacts/team-manager/bin/setup b/artifacts/team-manager/bin/setup new file mode 100755 index 0000000..e620b4d --- /dev/null +++ b/artifacts/team-manager/bin/setup @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # puts "\n== Copying sample files ==" + # unless File.exist?('config/database.yml') + # cp 'config/database.yml.sample', 'config/database.yml' + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:setup' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/artifacts/team-manager/bin/spring b/artifacts/team-manager/bin/spring new file mode 100755 index 0000000..7fe232c --- /dev/null +++ b/artifacts/team-manager/bin/spring @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) + Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } + gem 'spring', match[1] + require 'spring/binstub' + end +end diff --git a/artifacts/team-manager/bin/update b/artifacts/team-manager/bin/update new file mode 100755 index 0000000..a8e4462 --- /dev/null +++ b/artifacts/team-manager/bin/update @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/artifacts/team-manager/config.ru b/artifacts/team-manager/config.ru new file mode 100644 index 0000000..f7ba0b5 --- /dev/null +++ b/artifacts/team-manager/config.ru @@ -0,0 +1,5 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application diff --git a/artifacts/team-manager/config/application.rb b/artifacts/team-manager/config/application.rb new file mode 100644 index 0000000..ab236a2 --- /dev/null +++ b/artifacts/team-manager/config/application.rb @@ -0,0 +1,15 @@ +require_relative 'boot' + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module TeamManager + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + end +end diff --git a/artifacts/team-manager/config/boot.rb b/artifacts/team-manager/config/boot.rb new file mode 100644 index 0000000..30f5120 --- /dev/null +++ b/artifacts/team-manager/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/artifacts/team-manager/config/cable.yml b/artifacts/team-manager/config/cable.yml new file mode 100644 index 0000000..0bbde6f --- /dev/null +++ b/artifacts/team-manager/config/cable.yml @@ -0,0 +1,9 @@ +development: + adapter: async + +test: + adapter: async + +production: + adapter: redis + url: redis://localhost:6379/1 diff --git a/artifacts/team-manager/config/database.yml b/artifacts/team-manager/config/database.yml new file mode 100644 index 0000000..1c1a37c --- /dev/null +++ b/artifacts/team-manager/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/artifacts/team-manager/config/environment.rb b/artifacts/team-manager/config/environment.rb new file mode 100644 index 0000000..426333b --- /dev/null +++ b/artifacts/team-manager/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/artifacts/team-manager/config/environments/development.rb b/artifacts/team-manager/config/environments/development.rb new file mode 100644 index 0000000..6f71970 --- /dev/null +++ b/artifacts/team-manager/config/environments/development.rb @@ -0,0 +1,54 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable/disable caching. By default caching is disabled. + if Rails.root.join('tmp/caching-dev.txt').exist? + config.action_controller.perform_caching = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => 'public, max-age=172800' + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true + + # Use an evented file watcher to asynchronously detect changes in source code, + # routes, locales, etc. This feature depends on the listen gem. + config.file_watcher = ActiveSupport::EventedFileUpdateChecker +end diff --git a/artifacts/team-manager/config/environments/production.rb b/artifacts/team-manager/config/environments/production.rb new file mode 100644 index 0000000..20a2ace --- /dev/null +++ b/artifacts/team-manager/config/environments/production.rb @@ -0,0 +1,86 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "team-manager_#{Rails.env}" + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/artifacts/team-manager/config/environments/test.rb b/artifacts/team-manager/config/environments/test.rb new file mode 100644 index 0000000..30587ef --- /dev/null +++ b/artifacts/team-manager/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + 'Cache-Control' => 'public, max-age=3600' + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/artifacts/team-manager/config/initializers/application_controller_renderer.rb b/artifacts/team-manager/config/initializers/application_controller_renderer.rb new file mode 100644 index 0000000..51639b6 --- /dev/null +++ b/artifacts/team-manager/config/initializers/application_controller_renderer.rb @@ -0,0 +1,6 @@ +# Be sure to restart your server when you modify this file. + +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) diff --git a/artifacts/team-manager/config/initializers/assets.rb b/artifacts/team-manager/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/artifacts/team-manager/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/artifacts/team-manager/config/initializers/backtrace_silencers.rb b/artifacts/team-manager/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/artifacts/team-manager/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/artifacts/team-manager/config/initializers/cookies_serializer.rb b/artifacts/team-manager/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..5a6a32d --- /dev/null +++ b/artifacts/team-manager/config/initializers/cookies_serializer.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Specify a serializer for the signed and encrypted cookie jars. +# Valid options are :json, :marshal, and :hybrid. +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/artifacts/team-manager/config/initializers/filter_parameter_logging.rb b/artifacts/team-manager/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/artifacts/team-manager/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/artifacts/team-manager/config/initializers/inflections.rb b/artifacts/team-manager/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/artifacts/team-manager/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/artifacts/team-manager/config/initializers/mime_types.rb b/artifacts/team-manager/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/artifacts/team-manager/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/artifacts/team-manager/config/initializers/new_framework_defaults.rb b/artifacts/team-manager/config/initializers/new_framework_defaults.rb new file mode 100644 index 0000000..0706caf --- /dev/null +++ b/artifacts/team-manager/config/initializers/new_framework_defaults.rb @@ -0,0 +1,24 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains migration options to ease your Rails 5.0 upgrade. +# +# Read the Rails 5.0 release notes for more info on each option. + +# Enable per-form CSRF tokens. Previous versions had false. +Rails.application.config.action_controller.per_form_csrf_tokens = true + +# Enable origin-checking CSRF mitigation. Previous versions had false. +Rails.application.config.action_controller.forgery_protection_origin_check = true + +# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`. +# Previous versions had false. +ActiveSupport.to_time_preserves_timezone = true + +# Require `belongs_to` associations by default. Previous versions had false. +Rails.application.config.active_record.belongs_to_required_by_default = true + +# Do not halt callback chains when a callback returns false. Previous versions had true. +ActiveSupport.halt_callback_chains_on_return_false = false + +# Configure SSL options to enable HSTS with subdomains. Previous versions had false. +Rails.application.config.ssl_options = { hsts: { subdomains: true } } diff --git a/artifacts/team-manager/config/initializers/session_store.rb b/artifacts/team-manager/config/initializers/session_store.rb new file mode 100644 index 0000000..af27b29 --- /dev/null +++ b/artifacts/team-manager/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_team-manager_session' diff --git a/artifacts/team-manager/config/initializers/wrap_parameters.rb b/artifacts/team-manager/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..bbfc396 --- /dev/null +++ b/artifacts/team-manager/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/artifacts/team-manager/config/locales/en.yml b/artifacts/team-manager/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/artifacts/team-manager/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/artifacts/team-manager/config/puma.rb b/artifacts/team-manager/config/puma.rb new file mode 100644 index 0000000..c7f311f --- /dev/null +++ b/artifacts/team-manager/config/puma.rb @@ -0,0 +1,47 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum, this matches the default thread size of Active Record. +# +threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests, default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked webserver processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. If you use this option +# you need to make sure to reconnect any threads in the `on_worker_boot` +# block. +# +# preload_app! + +# The code in the `on_worker_boot` will be called if you are using +# clustered mode by specifying a number of `workers`. After each worker +# process is booted this block will be run, if you are using `preload_app!` +# option you will want to use this block to reconnect to any threads +# or connections that may have been created at application boot, Ruby +# cannot share connections between processes. +# +# on_worker_boot do +# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) +# end + +# Allow puma to be restarted by `rails restart` command. +plugin :tmp_restart diff --git a/artifacts/team-manager/config/routes.rb b/artifacts/team-manager/config/routes.rb new file mode 100644 index 0000000..0a3994f --- /dev/null +++ b/artifacts/team-manager/config/routes.rb @@ -0,0 +1,20 @@ +Rails.application.routes.draw do + root 'home#index' + resources :fees + resources :payment_types + resources :stat_records + resources :player_stats + resources :events + resources :team_has_coaches + resources :coaches + resources :managers + resources :staffs + resources :children + resources :parents + resources :phones + resources :addresses + resources :people + resources :teams + resources :organizations + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html +end diff --git a/artifacts/team-manager/config/secrets.yml b/artifacts/team-manager/config/secrets.yml new file mode 100644 index 0000000..70b7390 --- /dev/null +++ b/artifacts/team-manager/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rails secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 8b328b944b3371c718609da0d2da55eaa636a681dfc384156995390e4be80fbe074bff048fb1d63183e36f5ae4409d8cbecb22e91c0c2b39def71cf4ef2a1dbf + +test: + secret_key_base: 882b2096c1b8d66656577a1e9d34628b07624dab74ed7eb04e090ff3c9894bcc5351ae771930c692dbcd070a79b4b547f2fc1c6582ace5a1e4f39a3e76f5a83d + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/artifacts/team-manager/config/spring.rb b/artifacts/team-manager/config/spring.rb new file mode 100644 index 0000000..c9119b4 --- /dev/null +++ b/artifacts/team-manager/config/spring.rb @@ -0,0 +1,6 @@ +%w( + .ruby-version + .rbenv-vars + tmp/restart.txt + tmp/caching-dev.txt +).each { |path| Spring.watch(path) } diff --git a/artifacts/team-manager/db/migrate/20160926143545_create_organizations.rb b/artifacts/team-manager/db/migrate/20160926143545_create_organizations.rb new file mode 100644 index 0000000..449fafd --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926143545_create_organizations.rb @@ -0,0 +1,9 @@ +class CreateOrganizations < ActiveRecord::Migration[5.0] + def change + create_table :organizations do |t| + t.string :org_name + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926144111_create_teams.rb b/artifacts/team-manager/db/migrate/20160926144111_create_teams.rb new file mode 100644 index 0000000..4f626a8 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926144111_create_teams.rb @@ -0,0 +1,16 @@ +class CreateTeams < ActiveRecord::Migration[5.0] + def change + create_table :teams do |t| + t.string :team_name + t.string :age_group + t.integer :wins + t.integer :loses + t.integer :ties + t.date :team_start + t.date :team_end + t.boolean :is_archived + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926144241_create_people.rb b/artifacts/team-manager/db/migrate/20160926144241_create_people.rb new file mode 100644 index 0000000..80c9b6e --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926144241_create_people.rb @@ -0,0 +1,13 @@ +class CreatePeople < ActiveRecord::Migration[5.0] + def change + create_table :people do |t| + t.string :first_name + t.string :last_name + t.date :dob + t.string :gender + t.string :ethnicity + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926144418_create_addresses.rb b/artifacts/team-manager/db/migrate/20160926144418_create_addresses.rb new file mode 100644 index 0000000..2d551ab --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926144418_create_addresses.rb @@ -0,0 +1,15 @@ +class CreateAddresses < ActiveRecord::Migration[5.0] + def change + create_table :addresses do |t| + t.string :addr1 + t.string :addr2 + t.string :city + t.string :state + t.string :country + t.string :zip + t.string :address_type + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926144558_create_phones.rb b/artifacts/team-manager/db/migrate/20160926144558_create_phones.rb new file mode 100644 index 0000000..bd6f723 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926144558_create_phones.rb @@ -0,0 +1,10 @@ +class CreatePhones < ActiveRecord::Migration[5.0] + def change + create_table :phones do |t| + t.string :phone_number + t.string :phone_type + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926144709_create_parents.rb b/artifacts/team-manager/db/migrate/20160926144709_create_parents.rb new file mode 100644 index 0000000..3b3f6b7 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926144709_create_parents.rb @@ -0,0 +1,9 @@ +class CreateParents < ActiveRecord::Migration[5.0] + def change + create_table :parents do |t| + t.references :person, foreign_key: true + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926144725_create_children.rb b/artifacts/team-manager/db/migrate/20160926144725_create_children.rb new file mode 100644 index 0000000..654f001 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926144725_create_children.rb @@ -0,0 +1,9 @@ +class CreateChildren < ActiveRecord::Migration[5.0] + def change + create_table :children do |t| + t.references :person, foreign_key: true + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926144814_create_staffs.rb b/artifacts/team-manager/db/migrate/20160926144814_create_staffs.rb new file mode 100644 index 0000000..0bbd8bc --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926144814_create_staffs.rb @@ -0,0 +1,9 @@ +class CreateStaffs < ActiveRecord::Migration[5.0] + def change + create_table :staffs do |t| + t.references :person, foreign_key: true + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926144852_create_managers.rb b/artifacts/team-manager/db/migrate/20160926144852_create_managers.rb new file mode 100644 index 0000000..d21a74d --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926144852_create_managers.rb @@ -0,0 +1,9 @@ +class CreateManagers < ActiveRecord::Migration[5.0] + def change + create_table :managers do |t| + t.references :person, foreign_key: true + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926145021_create_coaches.rb b/artifacts/team-manager/db/migrate/20160926145021_create_coaches.rb new file mode 100644 index 0000000..3bcbfc2 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926145021_create_coaches.rb @@ -0,0 +1,11 @@ +class CreateCoaches < ActiveRecord::Migration[5.0] + def change + create_table :coaches do |t| + t.string :license_num + t.date :license_exp + t.references :person, foreign_key: true + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926145129_create_team_has_coaches.rb b/artifacts/team-manager/db/migrate/20160926145129_create_team_has_coaches.rb new file mode 100644 index 0000000..9a79ccc --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926145129_create_team_has_coaches.rb @@ -0,0 +1,11 @@ +class CreateTeamHasCoaches < ActiveRecord::Migration[5.0] + def change + create_table :team_has_coaches do |t| + t.string :coach_type + t.references :person, foreign_key: true + t.references :team, foreign_key: true + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926145219_create_events.rb b/artifacts/team-manager/db/migrate/20160926145219_create_events.rb new file mode 100644 index 0000000..20a48a4 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926145219_create_events.rb @@ -0,0 +1,12 @@ +class CreateEvents < ActiveRecord::Migration[5.0] + def change + create_table :events do |t| + t.string :event_name + t.string :event_type + t.datetime :event_start_time + t.datetime :event_end_time + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926145324_create_player_stats.rb b/artifacts/team-manager/db/migrate/20160926145324_create_player_stats.rb new file mode 100644 index 0000000..2ea3e29 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926145324_create_player_stats.rb @@ -0,0 +1,14 @@ +class CreatePlayerStats < ActiveRecord::Migration[5.0] + def change + create_table :player_stats do |t| + t.string :jersey_number + t.text :player_bio + t.integer :height + t.integer :weight + t.references :person, foreign_key: true + t.references :team, foreign_key: true + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926145408_create_stat_records.rb b/artifacts/team-manager/db/migrate/20160926145408_create_stat_records.rb new file mode 100644 index 0000000..822cae0 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926145408_create_stat_records.rb @@ -0,0 +1,12 @@ +class CreateStatRecords < ActiveRecord::Migration[5.0] + def change + create_table :stat_records do |t| + t.text :record_value + t.string :record_type + t.datetime :record_date + t.references :player_stats, foreign_key: true + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926145458_create_payment_types.rb b/artifacts/team-manager/db/migrate/20160926145458_create_payment_types.rb new file mode 100644 index 0000000..839e2ed --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926145458_create_payment_types.rb @@ -0,0 +1,13 @@ +class CreatePaymentTypes < ActiveRecord::Migration[5.0] + def change + create_table :payment_types do |t| + t.string :payment_type + t.string :check_num + t.string :cc_num + t.string :acct_num + t.string :routing_num + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926145529_create_fees.rb b/artifacts/team-manager/db/migrate/20160926145529_create_fees.rb new file mode 100644 index 0000000..29b3945 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926145529_create_fees.rb @@ -0,0 +1,14 @@ +class CreateFees < ActiveRecord::Migration[5.0] + def change + create_table :fees do |t| + t.string :fee_amt + t.string :paid_amt + t.datetime :created_on + t.datetime :paid_on + t.references :people, foreign_key: true + t.references :player_stats, foreign_key: true + + t.timestamps + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153256_create_join_table_people_phones.rb b/artifacts/team-manager/db/migrate/20160926153256_create_join_table_people_phones.rb new file mode 100644 index 0000000..3e1a5de --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153256_create_join_table_people_phones.rb @@ -0,0 +1,8 @@ +class CreateJoinTablePeoplePhones < ActiveRecord::Migration[5.0] + def change + create_join_table :people, :phones do |t| + # t.index [:person_id, :phone_id] + # t.index [:phone_id, :person_id] + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153303_create_join_table_people_addresses.rb b/artifacts/team-manager/db/migrate/20160926153303_create_join_table_people_addresses.rb new file mode 100644 index 0000000..f447bcf --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153303_create_join_table_people_addresses.rb @@ -0,0 +1,8 @@ +class CreateJoinTablePeopleAddresses < ActiveRecord::Migration[5.0] + def change + create_join_table :people, :addresses do |t| + # t.index [:person_id, :address_id] + # t.index [:address_id, :person_id] + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153308_create_join_table_parents_children.rb b/artifacts/team-manager/db/migrate/20160926153308_create_join_table_parents_children.rb new file mode 100644 index 0000000..389bdde --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153308_create_join_table_parents_children.rb @@ -0,0 +1,8 @@ +class CreateJoinTableParentsChildren < ActiveRecord::Migration[5.0] + def change + create_join_table :parents, :children do |t| + # t.index [:parent_id, :child_id] + # t.index [:child_id, :parent_id] + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153312_create_join_table_people_fees.rb b/artifacts/team-manager/db/migrate/20160926153312_create_join_table_people_fees.rb new file mode 100644 index 0000000..323c24a --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153312_create_join_table_people_fees.rb @@ -0,0 +1,8 @@ +class CreateJoinTablePeopleFees < ActiveRecord::Migration[5.0] + def change + create_join_table :people, :fees do |t| + # t.index [:person_id, :fee_id] + # t.index [:fee_id, :person_id] + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153315_create_join_table_managers_teams.rb b/artifacts/team-manager/db/migrate/20160926153315_create_join_table_managers_teams.rb new file mode 100644 index 0000000..1c08d85 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153315_create_join_table_managers_teams.rb @@ -0,0 +1,8 @@ +class CreateJoinTableManagersTeams < ActiveRecord::Migration[5.0] + def change + create_join_table :managers, :teams do |t| + # t.index [:manager_id, :team_id] + # t.index [:team_id, :manager_id] + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153318_create_join_table_people_teams.rb b/artifacts/team-manager/db/migrate/20160926153318_create_join_table_people_teams.rb new file mode 100644 index 0000000..e9dda67 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153318_create_join_table_people_teams.rb @@ -0,0 +1,8 @@ +class CreateJoinTablePeopleTeams < ActiveRecord::Migration[5.0] + def change + create_join_table :people, :teams do |t| + # t.index [:person_id, :team_id] + # t.index [:team_id, :person_id] + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153321_create_join_table_staffs_organizations.rb b/artifacts/team-manager/db/migrate/20160926153321_create_join_table_staffs_organizations.rb new file mode 100644 index 0000000..70cb6e2 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153321_create_join_table_staffs_organizations.rb @@ -0,0 +1,8 @@ +class CreateJoinTableStaffsOrganizations < ActiveRecord::Migration[5.0] + def change + create_join_table :staffs, :organizations do |t| + # t.index [:staff_id, :organization_id] + # t.index [:organization_id, :staff_id] + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153324_create_join_table_events_organizations.rb b/artifacts/team-manager/db/migrate/20160926153324_create_join_table_events_organizations.rb new file mode 100644 index 0000000..2bac4de --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153324_create_join_table_events_organizations.rb @@ -0,0 +1,8 @@ +class CreateJoinTableEventsOrganizations < ActiveRecord::Migration[5.0] + def change + create_join_table :events, :organizations do |t| + # t.index [:event_id, :organization_id] + # t.index [:organization_id, :event_id] + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153327_create_join_table_events_teams.rb b/artifacts/team-manager/db/migrate/20160926153327_create_join_table_events_teams.rb new file mode 100644 index 0000000..984bf5b --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153327_create_join_table_events_teams.rb @@ -0,0 +1,8 @@ +class CreateJoinTableEventsTeams < ActiveRecord::Migration[5.0] + def change + create_join_table :events, :teams do |t| + # t.index [:event_id, :team_id] + # t.index [:team_id, :event_id] + end + end +end diff --git a/artifacts/team-manager/db/migrate/20160926153332_create_join_table_teams_organizations.rb b/artifacts/team-manager/db/migrate/20160926153332_create_join_table_teams_organizations.rb new file mode 100644 index 0000000..d67eb30 --- /dev/null +++ b/artifacts/team-manager/db/migrate/20160926153332_create_join_table_teams_organizations.rb @@ -0,0 +1,8 @@ +class CreateJoinTableTeamsOrganizations < ActiveRecord::Migration[5.0] + def change + create_join_table :teams, :organizations do |t| + # t.index [:team_id, :organization_id] + # t.index [:organization_id, :team_id] + end + end +end diff --git a/artifacts/team-manager/db/schema.rb b/artifacts/team-manager/db/schema.rb new file mode 100644 index 0000000..a12e6db --- /dev/null +++ b/artifacts/team-manager/db/schema.rb @@ -0,0 +1,215 @@ +# 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 +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20160926153332) do + + create_table "addresses", force: :cascade do |t| + t.string "addr1" + t.string "addr2" + t.string "city" + t.string "state" + t.string "country" + t.string "zip" + t.string "address_type" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "addresses_people", id: false, force: :cascade do |t| + t.integer "person_id", null: false + t.integer "address_id", null: false + end + + create_table "children", force: :cascade do |t| + t.integer "person_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["person_id"], name: "index_children_on_person_id" + end + + create_table "children_parents", id: false, force: :cascade do |t| + t.integer "parent_id", null: false + t.integer "child_id", null: false + end + + create_table "coaches", force: :cascade do |t| + t.string "license_num" + t.date "license_exp" + t.integer "person_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["person_id"], name: "index_coaches_on_person_id" + end + + create_table "events", force: :cascade do |t| + t.string "event_name" + t.string "event_type" + t.datetime "event_start_time" + t.datetime "event_end_time" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "events_organizations", id: false, force: :cascade do |t| + t.integer "event_id", null: false + t.integer "organization_id", null: false + end + + create_table "events_teams", id: false, force: :cascade do |t| + t.integer "event_id", null: false + t.integer "team_id", null: false + end + + create_table "fees", force: :cascade do |t| + t.string "fee_amt" + t.string "paid_amt" + t.datetime "created_on" + t.datetime "paid_on" + t.integer "people_id" + t.integer "player_stats_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["people_id"], name: "index_fees_on_people_id" + t.index ["player_stats_id"], name: "index_fees_on_player_stats_id" + end + + create_table "fees_people", id: false, force: :cascade do |t| + t.integer "person_id", null: false + t.integer "fee_id", null: false + end + + create_table "managers", force: :cascade do |t| + t.integer "person_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["person_id"], name: "index_managers_on_person_id" + end + + create_table "managers_teams", id: false, force: :cascade do |t| + t.integer "manager_id", null: false + t.integer "team_id", null: false + end + + create_table "organizations", force: :cascade do |t| + t.string "org_name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "organizations_staffs", id: false, force: :cascade do |t| + t.integer "staff_id", null: false + t.integer "organization_id", null: false + end + + create_table "organizations_teams", id: false, force: :cascade do |t| + t.integer "team_id", null: false + t.integer "organization_id", null: false + end + + create_table "parents", force: :cascade do |t| + t.integer "person_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["person_id"], name: "index_parents_on_person_id" + end + + create_table "payment_types", force: :cascade do |t| + t.string "payment_type" + t.string "check_num" + t.string "cc_num" + t.string "acct_num" + t.string "routing_num" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "people", force: :cascade do |t| + t.string "first_name" + t.string "last_name" + t.date "dob" + t.string "gender" + t.string "ethnicity" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "people_phones", id: false, force: :cascade do |t| + t.integer "person_id", null: false + t.integer "phone_id", null: false + end + + create_table "people_teams", id: false, force: :cascade do |t| + t.integer "person_id", null: false + t.integer "team_id", null: false + end + + create_table "phones", force: :cascade do |t| + t.string "phone_number" + t.string "phone_type" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "player_stats", force: :cascade do |t| + t.string "jersey_number" + t.text "player_bio" + t.integer "height" + t.integer "weight" + t.integer "person_id" + t.integer "team_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["person_id"], name: "index_player_stats_on_person_id" + t.index ["team_id"], name: "index_player_stats_on_team_id" + end + + create_table "staffs", force: :cascade do |t| + t.integer "person_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["person_id"], name: "index_staffs_on_person_id" + end + + create_table "stat_records", force: :cascade do |t| + t.text "record_value" + t.string "record_type" + t.datetime "record_date" + t.integer "player_stats_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["player_stats_id"], name: "index_stat_records_on_player_stats_id" + end + + create_table "team_has_coaches", force: :cascade do |t| + t.string "coach_type" + t.integer "person_id" + t.integer "team_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["person_id"], name: "index_team_has_coaches_on_person_id" + t.index ["team_id"], name: "index_team_has_coaches_on_team_id" + end + + create_table "teams", force: :cascade do |t| + t.string "team_name" + t.string "age_group" + t.integer "wins" + t.integer "loses" + t.integer "ties" + t.date "team_start" + t.date "team_end" + t.boolean "is_archived" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/artifacts/team-manager/db/seeds.rb b/artifacts/team-manager/db/seeds.rb new file mode 100644 index 0000000..1beea2a --- /dev/null +++ b/artifacts/team-manager/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) +# Character.create(name: 'Luke', movie: movies.first) diff --git a/artifacts/team-manager/lib/assets/.keep b/artifacts/team-manager/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/team-manager/lib/tasks/.keep b/artifacts/team-manager/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/team-manager/log/.keep b/artifacts/team-manager/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/team-manager/public/404.html b/artifacts/team-manager/public/404.html new file mode 100644 index 0000000..b612547 --- /dev/null +++ b/artifacts/team-manager/public/404.html @@ -0,0 +1,67 @@ + + + +You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+