diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/games/index.html.erb | 4 | ||||
-rw-r--r-- | app/views/layouts/application.html.erb | 30 | ||||
-rw-r--r-- | app/views/sessions/new.html.erb | 18 | ||||
-rw-r--r-- | app/views/static/homepage.html.erb | 10 | ||||
-rw-r--r-- | app/views/tournaments/_selected.html.erb | 25 | ||||
-rw-r--r-- | app/views/tournaments/index.html.erb | 4 | ||||
-rw-r--r-- | app/views/tournaments/new.html.erb | 8 | ||||
-rw-r--r-- | app/views/users/new.html.erb | 61 | ||||
-rw-r--r-- | app/views/users/show.json.jbuilder | 2 |
9 files changed, 152 insertions, 10 deletions
diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index ccd0f63..2c178f5 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -1,6 +1,6 @@ <h1>Listing games</h1> -<table> +<table class="table table-hover"> <thead> <tr> <th>Name</th> @@ -32,4 +32,4 @@ <br> -<%= link_to 'New Game', new_game_path %> +<%= link_to 'New Game', new_game_path, {:class => "btn btn-warning"} %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index cefd1be..b36c0c5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,10 +5,38 @@ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %> <%= csrf_meta_tags %> + <%= yield :head %> </head> <body> +<div role="navigation" class="navbar navbar-inverse"> +<header> + <div class="navbar-brand no-dec"> + <%= link_to('Leaguer', '/', nil) %> + </div> + <div> + <%= form_tag("/search", method: "get", :class => "navbar-form navbar-right") do %> + <%= text_field_tag(:query, nil, :placeholder => "Search") %> + <%= submit_tag("Go", {:class => "btn btn-warning"}) %> + <% end %> + </div> + <% if signed_in? %> + <li> <%= current_user.user_name.upcase %> </li> + <% end %> + <li> + <%= if signed_in? do %> + <%= link_to "Sign out", signout_path, method: "delete" %> + <% end; end %> + </li> +</header> + </div> +<div class="container"> <%= yield %> - +</div> +<hr> +<footer id="footer"> +<p> Tomer Kimia Andrew Murrell Luke Shumaker Nathaniel Foy Davis Webb Guntas Grewal </p> +<p> The Leaguer System © <%= Time.now.year %> </p> </footer> + <%= debug(params) if Rails.env.development? %> </body> </html> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb new file mode 100644 index 0000000..f942cf6 --- /dev/null +++ b/app/views/sessions/new.html.erb @@ -0,0 +1,18 @@ +<h1>Sign in</h1> + +<div class="row"> + <div class="span6 offset3"> + <%= form_for(:session, url: sessions_path) do |f| %> + + <%= f.label :email %> + <%= f.text_field :email %> + + <%= f.label :password %> + <%= f.password_field :password %> + + <%= f.submit "Sign in", class: "btn btn-large btn-primary" %> + <% end %> + + <p>New user? <%= link_to "Sign up now!", signup_path %></p> + </div> +</div> diff --git a/app/views/static/homepage.html.erb b/app/views/static/homepage.html.erb new file mode 100644 index 0000000..4d52e5b --- /dev/null +++ b/app/views/static/homepage.html.erb @@ -0,0 +1,10 @@ +<div role="main" class="container theme-showcase"> + + <!-- Main jumbotron for a primary marketing message or call to action --> + <div class="jumbotron"> + <h1>Welcome to Leaguer</h1> + <p>This is a tournment management system designed to be used for any team sport. Our peer review system ensures that the best players move on to the next round! Try creating a new tournament and having people sign up for it. </p> + <p id="jumbo-buttons"><%= link_to 'Log In / Sign Up', "signup", :class => "btn btn-warning btn-lg", :role => "button" %> <%= link_to 'See Ongoing Tournaments', tournaments_path, :class => "btn btn-warning btn-lg", :role => "button" %> </p> + </div> + + </div> diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb new file mode 100644 index 0000000..302283d --- /dev/null +++ b/app/views/tournaments/_selected.html.erb @@ -0,0 +1,25 @@ +<form accept-charset="UTF-8" action="/users" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="6WQoPLFISlDYCsi4LhAgT0hgrht19yydD3w5TlKfb7I=" /></div> + <p> + <label for="GameType">Game</label><br> + <input id="GameType" name="League of Legends" type="text" /> + </p> + <p> + <label for="players_per_team">Number of Players</label><br> + <input id="players_per_team" name="5" type="text" /> + </p> + <p> + <label for="teams_per_match">Teams per Match</label><br> + <input id="teams_per_match" name="2" type="text" /> + </p> + <p> + <label for="set_rounds">Set Number of Rounds?</label><br> + <input id="set_rounds" name="1" type="text" /> + </p> + <p> + <label for="randomized_teams">Randomized Teams?</label><br> + <input id="randomized_teams" name="0" type="text" /> + </p> + <p> + <input name="create" type="submit" value="Create Tournament" /> + </p> +</form>
\ No newline at end of file diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index ad2b7cf..6006cad 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -3,7 +3,7 @@ <table> <thead> <tr> - <th>Game</th> + <th></th> <th></th> <th></th> <th></th> @@ -24,4 +24,4 @@ <br> -<%= link_to 'New Tournament', new_tournament_path %> +<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning btn-lg" %> diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index 2a60539..f1dec90 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -1,5 +1,11 @@ <h1>New tournament</h1> -<%= render 'form' %> +<%= select_tag 'tournament_id', options_for_select(["Select a Game Type"] + Game.all.collect {|game| game.name}), :onchange => 'populate()' %> + +<br /> +<div id='ajax-form'> + <% render :partial => "selected" %> +</div> +<br /><br /> <%= link_to 'Back', tournaments_path %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index efc0404..2a745cc 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,5 +1,60 @@ -<h1>New user</h1> +<h1> Sign Up </h1> -<%= render 'form' %> +<% if false %> +<%= form_for :user do |f| %> + <p> + <%= f.label :name %><br> + <%= f.text_field :name %> + </p> + <p> + <%= f.label :email %><br> + <%= f.text_field :email %> + </p> + <p> + <%= f.label :user_name %><br> + <%= f.text_field :user_name %> + </p> + <p> + <%= f.label :password %><br> + <%= f.text_field :password %> + </p> + <p> + <%= f.label :password_confirm %><br> + <%= f.text_field :password_confirmation %> + </p> + <p> + <%= f.submit %> + </p> +<% end %> + + +<% end %> + +<form accept-charset="UTF-8" action="/users" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="6WQoPLFISlDYCsi4LhAgT0hgrht19yydD3w5TlKfb7I=" /></div> + <p> + <label for="user_name">Name</label><br> + <input id="user_name" name="user[name]" type="text" /> + </p> + <p> + <label for="user_email">Email</label><br> + <input id="user_email" name="user[email]" type="text" /> + </p> + <p> + <label for="user_user_name">User name</label><br> + <input id="user_user_name" name="user[user_name]" type="text" /> + </p> + <p> + <label for="user_password">Password</label><br> + <input id="user_password" name="user[password]" type="text" /> + </p> + <p> + <label for="user_password_confirm">Password confirm</label><br> + <input id="user_password_confirmation" name="user[password_confirmation]" type="text" /> + </p> + <p> + <input name="commit" type="submit" value="Save User" /> + </p> +</form> + +<%= link_to 'Already Have an Account? Log in', "signin", :class => "btn btn-warning btn-lg" %> -<%= link_to 'Back', users_path %> diff --git a/app/views/users/show.json.jbuilder b/app/views/users/show.json.jbuilder index 4919af3..1262e80 100644 --- a/app/views/users/show.json.jbuilder +++ b/app/views/users/show.json.jbuilder @@ -1 +1 @@ -json.extract! @user, :id, :name, :email, :user_name, :created_at, :updated_at +json.extract! @user, :id, :name, :pw_hash, :created_at, :updated_at |