From fbe54253ea8c31796a16d0fb90b7d3b5be717b1c Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Sun, 2 Mar 2014 11:11:04 -0500 Subject: added preliminary homepage --- app/assets/javascripts/static.js.coffee | 3 +++ app/assets/stylesheets/static.css.scss | 3 +++ app/controllers/static_controller.rb | 2 ++ app/helpers/static_helper.rb | 2 ++ db/migrate/20140304015739_create_servers.rb | 8 -------- db/migrate/20140304015742_create_tournaments.rb | 9 --------- db/migrate/20140304015744_create_matches.rb | 9 --------- db/migrate/20140304015746_create_teams.rb | 8 -------- db/migrate/20140304015751_create_users.rb | 11 ----------- db/migrate/20140304015753_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015755_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015757_create_alerts.rb | 10 ---------- db/migrate/20140304015800_create_pms.rb | 11 ----------- db/migrate/20140304015802_create_games.rb | 13 ------------- db/migrate/20140304015804_create_game_attributes.rb | 11 ----------- db/migrate/20140304015807_create_server_settings.rb | 8 -------- db/migrate/20140304015813_create_tournament_options.rb | 8 -------- db/migrate/20140304015824_create_servers.rb | 8 ++++++++ db/migrate/20140304015826_create_tournaments.rb | 9 +++++++++ db/migrate/20140304015828_create_matches.rb | 9 +++++++++ db/migrate/20140304015831_create_teams.rb | 8 ++++++++ db/migrate/20140304015835_create_users.rb | 11 +++++++++++ db/migrate/20140304015837_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304015839_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304015842_create_alerts.rb | 10 ++++++++++ db/migrate/20140304015844_create_pms.rb | 11 +++++++++++ db/migrate/20140304015846_create_games.rb | 13 +++++++++++++ db/migrate/20140304015849_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304015851_create_server_settings.rb | 8 ++++++++ db/migrate/20140304015859_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 1 + spec/controllers/static_controller_spec.rb | 5 +++++ spec/helpers/static_helper_spec.rb | 15 +++++++++++++++ 34 files changed, 158 insertions(+), 127 deletions(-) create mode 100644 app/assets/javascripts/static.js.coffee create mode 100644 app/assets/stylesheets/static.css.scss create mode 100644 app/controllers/static_controller.rb create mode 100644 app/helpers/static_helper.rb delete mode 100644 db/migrate/20140304015739_create_servers.rb delete mode 100644 db/migrate/20140304015742_create_tournaments.rb delete mode 100644 db/migrate/20140304015744_create_matches.rb delete mode 100644 db/migrate/20140304015746_create_teams.rb delete mode 100644 db/migrate/20140304015751_create_users.rb delete mode 100644 db/migrate/20140304015753_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015755_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015757_create_alerts.rb delete mode 100644 db/migrate/20140304015800_create_pms.rb delete mode 100644 db/migrate/20140304015802_create_games.rb delete mode 100644 db/migrate/20140304015804_create_game_attributes.rb delete mode 100644 db/migrate/20140304015807_create_server_settings.rb delete mode 100644 db/migrate/20140304015813_create_tournament_options.rb create mode 100644 db/migrate/20140304015824_create_servers.rb create mode 100644 db/migrate/20140304015826_create_tournaments.rb create mode 100644 db/migrate/20140304015828_create_matches.rb create mode 100644 db/migrate/20140304015831_create_teams.rb create mode 100644 db/migrate/20140304015835_create_users.rb create mode 100644 db/migrate/20140304015837_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015839_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015842_create_alerts.rb create mode 100644 db/migrate/20140304015844_create_pms.rb create mode 100644 db/migrate/20140304015846_create_games.rb create mode 100644 db/migrate/20140304015849_create_game_attributes.rb create mode 100644 db/migrate/20140304015851_create_server_settings.rb create mode 100644 db/migrate/20140304015859_create_tournament_options.rb create mode 100644 spec/controllers/static_controller_spec.rb create mode 100644 spec/helpers/static_helper_spec.rb diff --git a/app/assets/javascripts/static.js.coffee b/app/assets/javascripts/static.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/static.js.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/app/assets/stylesheets/static.css.scss b/app/assets/stylesheets/static.css.scss new file mode 100644 index 0000000..5a803c8 --- /dev/null +++ b/app/assets/stylesheets/static.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the static controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb new file mode 100644 index 0000000..c6df11e --- /dev/null +++ b/app/controllers/static_controller.rb @@ -0,0 +1,2 @@ +class StaticController < ApplicationController +end diff --git a/app/helpers/static_helper.rb b/app/helpers/static_helper.rb new file mode 100644 index 0000000..8cfc9af --- /dev/null +++ b/app/helpers/static_helper.rb @@ -0,0 +1,2 @@ +module StaticHelper +end diff --git a/db/migrate/20140304015739_create_servers.rb b/db/migrate/20140304015739_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015739_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015742_create_tournaments.rb b/db/migrate/20140304015742_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015742_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - t.references :game, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015744_create_matches.rb b/db/migrate/20140304015744_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015744_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.references :tournament, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015746_create_teams.rb b/db/migrate/20140304015746_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015746_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015751_create_users.rb b/db/migrate/20140304015751_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304015751_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.string :name - t.string :email - t.string :user_name - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015753_create_user_team_pairs.rb b/db/migrate/20140304015753_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015753_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateUserTeamPairs < ActiveRecord::Migration - def change - create_table :user_team_pairs do |t| - t.references :user, index: true - t.references :team, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015755_create_team_match_pairs.rb b/db/migrate/20140304015755_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015755_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateTeamMatchPairs < ActiveRecord::Migration - def change - create_table :team_match_pairs do |t| - t.references :team, index: true - t.references :match, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015757_create_alerts.rb b/db/migrate/20140304015757_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015757_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateAlerts < ActiveRecord::Migration - def change - create_table :alerts do |t| - t.references :author, index: true - t.text :message - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015800_create_pms.rb b/db/migrate/20140304015800_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015800_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreatePms < ActiveRecord::Migration - def change - create_table :pms do |t| - t.references :author, index: true - t.references :recipient, index: true - t.text :message - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015802_create_games.rb b/db/migrate/20140304015802_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015802_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateGames < ActiveRecord::Migration - def change - create_table :games do |t| - t.text :name - t.integer :players_per_team - t.integer :teams_per_match - t.integer :set_rounds - t.integer :randomized_teams - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015804_create_game_attributes.rb b/db/migrate/20140304015804_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015804_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateGameAttributes < ActiveRecord::Migration - def change - create_table :game_attributes do |t| - t.references :game, index: true - t.text :key - t.integer :type - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015807_create_server_settings.rb b/db/migrate/20140304015807_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015807_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015813_create_tournament_options.rb b/db/migrate/20140304015813_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015813_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015824_create_servers.rb b/db/migrate/20140304015824_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015824_create_servers.rb @@ -0,0 +1,8 @@ +class CreateServers < ActiveRecord::Migration + def change + create_table :servers do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015826_create_tournaments.rb b/db/migrate/20140304015826_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015826_create_tournaments.rb @@ -0,0 +1,9 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + t.references :game, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015828_create_matches.rb b/db/migrate/20140304015828_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015828_create_matches.rb @@ -0,0 +1,9 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015831_create_teams.rb b/db/migrate/20140304015831_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015831_create_teams.rb @@ -0,0 +1,8 @@ +class CreateTeams < ActiveRecord::Migration + def change + create_table :teams do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015835_create_users.rb b/db/migrate/20140304015835_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304015835_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :name + t.string :email + t.string :user_name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015837_create_user_team_pairs.rb b/db/migrate/20140304015837_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015837_create_user_team_pairs.rb @@ -0,0 +1,10 @@ +class CreateUserTeamPairs < ActiveRecord::Migration + def change + create_table :user_team_pairs do |t| + t.references :user, index: true + t.references :team, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015839_create_team_match_pairs.rb b/db/migrate/20140304015839_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015839_create_team_match_pairs.rb @@ -0,0 +1,10 @@ +class CreateTeamMatchPairs < ActiveRecord::Migration + def change + create_table :team_match_pairs do |t| + t.references :team, index: true + t.references :match, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015842_create_alerts.rb b/db/migrate/20140304015842_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015842_create_alerts.rb @@ -0,0 +1,10 @@ +class CreateAlerts < ActiveRecord::Migration + def change + create_table :alerts do |t| + t.references :author, index: true + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015844_create_pms.rb b/db/migrate/20140304015844_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015844_create_pms.rb @@ -0,0 +1,11 @@ +class CreatePms < ActiveRecord::Migration + def change + create_table :pms do |t| + t.references :author, index: true + t.references :recipient, index: true + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015846_create_games.rb b/db/migrate/20140304015846_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015846_create_games.rb @@ -0,0 +1,13 @@ +class CreateGames < ActiveRecord::Migration + def change + create_table :games do |t| + t.text :name + t.integer :players_per_team + t.integer :teams_per_match + t.integer :set_rounds + t.integer :randomized_teams + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015849_create_game_attributes.rb b/db/migrate/20140304015849_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015849_create_game_attributes.rb @@ -0,0 +1,11 @@ +class CreateGameAttributes < ActiveRecord::Migration + def change + create_table :game_attributes do |t| + t.references :game, index: true + t.text :key + t.integer :type + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015851_create_server_settings.rb b/db/migrate/20140304015851_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015851_create_server_settings.rb @@ -0,0 +1,8 @@ +class CreateServerSettings < ActiveRecord::Migration + def change + create_table :server_settings do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015859_create_tournament_options.rb b/db/migrate/20140304015859_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015859_create_tournament_options.rb @@ -0,0 +1,8 @@ +class CreateTournamentOptions < ActiveRecord::Migration + def change + create_table :tournament_options do |t| + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index ae688b1..4e1da7f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015813) do +ActiveRecord::Schema.define(version: 20140304015859) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index 2bf027a..807b9ef 100755 --- a/generate.sh +++ b/generate.sh @@ -28,6 +28,7 @@ bundle exec rails generate model game_attribute game:references key:text type:in bundle exec rails generate model server_settings $NOTEST bundle exec rails generate controller search $NOTEST bundle exec rails generate controller main $NOTEST +bundle exec rails generate controller static $NOTEST #for the tournament controller to generate options bundle exec rails generate model tournament_option $NOTEST diff --git a/spec/controllers/static_controller_spec.rb b/spec/controllers/static_controller_spec.rb new file mode 100644 index 0000000..a3db7c0 --- /dev/null +++ b/spec/controllers/static_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe StaticController do + +end diff --git a/spec/helpers/static_helper_spec.rb b/spec/helpers/static_helper_spec.rb new file mode 100644 index 0000000..6a1bf5c --- /dev/null +++ b/spec/helpers/static_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the StaticHelper. For example: +# +# describe StaticHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe StaticHelper do + pending "add some examples to (or delete) #{__FILE__}" +end -- cgit v1.2.3-2-g168b