summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/alerts/show.html.erb2
-rw-r--r--app/views/application/permission_denied.html.erb1
-rw-r--r--app/views/common/_error_messages.html.erb11
-rw-r--r--app/views/games/index.html.erb6
-rw-r--r--app/views/games/show.html.erb2
-rw-r--r--app/views/layouts/application.html.erb28
-rw-r--r--app/views/matches/show.html.erb2
-rw-r--r--app/views/pms/show.html.erb2
-rw-r--r--app/views/servers/show.html.erb2
-rw-r--r--app/views/sessions/_form.html.erb21
-rw-r--r--app/views/sessions/edit.html.erb6
-rw-r--r--app/views/sessions/index.html.erb27
-rw-r--r--app/views/sessions/index.json.jbuilder4
-rw-r--r--app/views/sessions/new.html.erb24
-rw-r--r--app/views/sessions/show.html.erb9
-rw-r--r--app/views/sessions/show.json.jbuilder1
-rw-r--r--app/views/static/homepage.html.erb18
-rw-r--r--app/views/tournaments/_selected.html.erb31
-rw-r--r--app/views/tournaments/index.html.erb11
-rw-r--r--app/views/tournaments/new.html.erb18
-rw-r--r--app/views/tournaments/show.html.erb2
-rw-r--r--app/views/users/already_signed_in.html.erb1
-rw-r--r--app/views/users/index.html.erb6
-rw-r--r--app/views/users/new.html.erb33
-rw-r--r--app/views/users/show.html.erb2
25 files changed, 171 insertions, 99 deletions
diff --git a/app/views/alerts/show.html.erb b/app/views/alerts/show.html.erb
index eeab7f7..5dda2c9 100644
--- a/app/views/alerts/show.html.erb
+++ b/app/views/alerts/show.html.erb
@@ -1,5 +1,3 @@
-<p id="notice"><%= notice %></p>
-
<p>
<strong>Author:</strong>
<%= @alert.author %>
diff --git a/app/views/application/permission_denied.html.erb b/app/views/application/permission_denied.html.erb
new file mode 100644
index 0000000..1ef883c
--- /dev/null
+++ b/app/views/application/permission_denied.html.erb
@@ -0,0 +1 @@
+<h1>Permission denied</h1>
diff --git a/app/views/common/_error_messages.html.erb b/app/views/common/_error_messages.html.erb
new file mode 100644
index 0000000..731f62c
--- /dev/null
+++ b/app/views/common/_error_messages.html.erb
@@ -0,0 +1,11 @@
+<%# http://railscasts.com/episodes/211-validations-in-rails-3 %>
+<% if target.errors.any? %>
+<div id="errorExplanation">
+ <h2><%= pluralize(target.errors.count, "error") %> prohibited this form from being submitted:</h2>
+ <ul>
+ <% target.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+</div>
+<% end %>
diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb
index 27c5860..79acd1e 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>
@@ -36,4 +36,6 @@
<br>
-<%= link_to 'New Game', new_game_path %>
+
+<%= link_to 'New Game', new_game_path, {:class => "btn btn-warning"} %>
+
diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb
index 1f1a154..39d4a97 100644
--- a/app/views/games/show.html.erb
+++ b/app/views/games/show.html.erb
@@ -1,5 +1,3 @@
-<p id="notice"><%= notice %></p>
-
<p>
<strong>Name:</strong>
<%= @game.name %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index cefd1be..976ee85 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -5,10 +5,36 @@
<%= 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>
+<header><nav>
+ <div class="navbar-brand"><%= link_to('Leaguer', root_path) %></div>
+ <div>
+ <%= form_tag("/search", method: "get", :class => "search") do %>
+ <%= text_field_tag(:query, nil, :placeholder => "Search") %>
+ <%= submit_tag("Go") %>
+ <% end %>
+ </div>
-<%= yield %>
+ <div id="log-buttons">
+ <% if signed_in? %>
+ <%= link_to current_user.user_name, current_user, :class => "user" %>
+ <%= link_to "Sign out", session_path("current"), method: "delete", :class => "signout" %>
+ <% else %>
+ <%= link_to "Log in", new_session_path, :class => "signin" %>
+ <%= link_to "Sign up", new_user_path, :class => "signup" %>
+ <% end %>
+ </div>
+</nav></header>
+<% if notice %><div id="notice"><p><%= notice %></p></div><% end %>
+
+<div class="container"><%= yield %></div>
+
+<footer>
+ <p>Leaguer &copy; 2014, Tomer Kimia, Andrew Murrell, Luke Shumaker, Nathaniel Foy, Davis Webb, and Guntas Grewal</p>
+</footer>
+<%= debug(params) if Rails.env.development? %>
</body>
</html>
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index 0b02ae7..9c9cbb4 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -1,5 +1,3 @@
-<p id="notice"><%= notice %></p>
-
<p>
<strong>Tournament:</strong>
<%= @match.tournament %>
diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb
index 5ee483f..2a03716 100644
--- a/app/views/pms/show.html.erb
+++ b/app/views/pms/show.html.erb
@@ -1,5 +1,3 @@
-<p id="notice"><%= notice %></p>
-
<p>
<strong>Author:</strong>
<%= @pm.author %>
diff --git a/app/views/servers/show.html.erb b/app/views/servers/show.html.erb
index 039cd8f..67f7647 100644
--- a/app/views/servers/show.html.erb
+++ b/app/views/servers/show.html.erb
@@ -1,4 +1,2 @@
-<p id="notice"><%= notice %></p>
-
<%= link_to 'Edit', edit_server_path(@server) %> |
<%= link_to 'Back', servers_path %>
diff --git a/app/views/sessions/_form.html.erb b/app/views/sessions/_form.html.erb
deleted file mode 100644
index 1b94e77..0000000
--- a/app/views/sessions/_form.html.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<%= form_for(@session) do |f| %>
- <% if @session.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@session.errors.count, "error") %> prohibited this session from being saved:</h2>
-
- <ul>
- <% @session.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <div class="field">
- <%= f.label :user_id %><br>
- <%= f.text_field :user_id %>
- </div>
- <div class="actions">
- <%= f.submit %>
- </div>
-<% end %>
diff --git a/app/views/sessions/edit.html.erb b/app/views/sessions/edit.html.erb
deleted file mode 100644
index bbd8407..0000000
--- a/app/views/sessions/edit.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<h1>Editing session</h1>
-
-<%= render 'form' %>
-
-<%= link_to 'Show', @session %> |
-<%= link_to 'Back', sessions_path %>
diff --git a/app/views/sessions/index.html.erb b/app/views/sessions/index.html.erb
deleted file mode 100644
index 707a47d..0000000
--- a/app/views/sessions/index.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<h1>Listing sessions</h1>
-
-<table>
- <thead>
- <tr>
- <th>User</th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- </thead>
-
- <tbody>
- <% @sessions.each do |session| %>
- <tr>
- <td><%= session.user %></td>
- <td><%= link_to 'Show', session %></td>
- <td><%= link_to 'Edit', edit_session_path(session) %></td>
- <td><%= link_to 'Destroy', session, method: :delete, data: { confirm: 'Are you sure?' } %></td>
- </tr>
- <% end %>
- </tbody>
-</table>
-
-<br>
-
-<%= link_to 'New Session', new_session_path %>
diff --git a/app/views/sessions/index.json.jbuilder b/app/views/sessions/index.json.jbuilder
deleted file mode 100644
index 18fd4fa..0000000
--- a/app/views/sessions/index.json.jbuilder
+++ /dev/null
@@ -1,4 +0,0 @@
-json.array!(@sessions) do |session|
- json.extract! session, :id, :user_id
- json.url session_url(session, format: :json)
-end
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index 55c9eca..398cb49 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -1,5 +1,23 @@
-<h1>New session</h1>
+<h1>Sign in</h1>
+<% if @user.nil? %>
+ <p class="errors"> The email or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current email and password. </p>
+<% end %>
-<%= render 'form' %>
+ <div class="span6 offset3">
+ <%= form_for(:session, url: sessions_path) do |f| %>
+ <p>
+ <%= f.label(:username_or_email, "Username/Email") %><br/>
+ <%= f.text_field :username_or_email%>
+ </p>
+ <p>
+ <%= f.label :password %><br/>
+ <%= f.password_field :password %>
+ </p>
+ <p>
+ <%= f.submit "Sign in", class: "btn btn-large btn-primary" %>
+ </p>
+ <% end %>
+
+ <p>New user? <%= link_to("Sign up now!", new_user_path) %></p>
+ </div>
-<%= link_to 'Back', sessions_path %>
diff --git a/app/views/sessions/show.html.erb b/app/views/sessions/show.html.erb
deleted file mode 100644
index 5176869..0000000
--- a/app/views/sessions/show.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-<p id="notice"><%= notice %></p>
-
-<p>
- <strong>User:</strong>
- <%= @session.user %>
-</p>
-
-<%= link_to 'Edit', edit_session_path(@session) %> |
-<%= link_to 'Back', sessions_path %>
diff --git a/app/views/sessions/show.json.jbuilder b/app/views/sessions/show.json.jbuilder
deleted file mode 100644
index 4ebf936..0000000
--- a/app/views/sessions/show.json.jbuilder
+++ /dev/null
@@ -1 +0,0 @@
-json.extract! @session, :id, :user_id, :created_at, :updated_at
diff --git a/app/views/static/homepage.html.erb b/app/views/static/homepage.html.erb
new file mode 100644
index 0000000..3ca8176
--- /dev/null
+++ b/app/views/static/homepage.html.erb
@@ -0,0 +1,18 @@
+<div role="main" class="container theme-showcase">
+
+ <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">
+ <% if !signed_in? %>
+ <%= link_to 'Log In', new_session_path, :class => "btn btn-warning btn-lg", :role => "button" %>
+ <%= link_to 'Sign Up', new_user_path, :class => "btn btn-warning btn-lg", :role => "button" %>
+ <% else %>
+ <%= link_to 'Start a Tournament', new_tournament_path, :class => "btn btn-warning btn-lg", :role => "button" %>
+ <% end %>
+ <%= 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..5058c56
--- /dev/null
+++ b/app/views/tournaments/_selected.html.erb
@@ -0,0 +1,31 @@
+<%= form_for(@tournament) do |f| %>
+ <% if @tournament.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@tournament.errors.count, "error") %> prohibited this tournament from being saved:</h2>
+
+ <ul>
+ <% @tournament.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <%# this is the dynamic script to output fields to the form %>
+ <% @chosen = Game.find(@game) %>
+ <% @chosen.attributes.each do |name, value| %>
+ <% if name == "id" %>
+ <% next %>
+ <% end %>
+ <% if name == "created_at" %>
+ <% break %>
+ <% end %>
+ <p>
+ <label for=<%= name %>><%= name.capitalize.gsub('_', ' ') %></label>
+ <br />
+ <input type="text" id=<%= name %> value=<%= value %>>
+ </p>
+ <% end %>
+
+ <%= f.submit %>
+<% end %>
diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb
index dec16d1..80d68a3 100644
--- a/app/views/tournaments/index.html.erb
+++ b/app/views/tournaments/index.html.erb
@@ -1,6 +1,7 @@
-<h1>Listing tournaments</h1>
+<h1>Listing Tournaments</h1>
-<table>
+<% if @tournaments.length > 0 %>
+<table class="table table-hover">
<thead>
<tr>
<th>Game</th>
@@ -35,7 +36,9 @@
<% end %>
</tbody>
</table>
-
+<% else %>
+ <p class="no-entries"> No tournaments going on right now... Why not start your own? </p>
+<% end %>
<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..3d6d142 100644
--- a/app/views/tournaments/new.html.erb
+++ b/app/views/tournaments/new.html.erb
@@ -1,5 +1,19 @@
-<h1>New tournament</h1>
+<%= javascript_include_tag :defaults %>
-<%= render 'form' %>
+<h1>New Tournament</h1>
+
+<%= select_tag 'tournament_id', options_for_select(["Select a Game Type"] + Game.all.collect {|game| game.name}), :onchange => 'populate()' %> <%= link_to 'Select', 'new?game=1', :class => "btn btn-success btn-xs" %>
+
+
+
+<br />
+<div id='ajax-form'>
+ <% if not @game.nil? %>
+ <%= render 'selected' %>
+ <% end %>
+</div>
+<br /><br />
+
+<%= link_to 'Select', 'selected', :class => "btn btn-success btn-xs" %>
<%= link_to 'Back', tournaments_path %>
diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb
index 355bc90..4f97c7c 100644
--- a/app/views/tournaments/show.html.erb
+++ b/app/views/tournaments/show.html.erb
@@ -1,5 +1,3 @@
-<p id="notice"><%= notice %></p>
-
<p>
<strong>Game:</strong>
<%= @tournament.game %>
diff --git a/app/views/users/already_signed_in.html.erb b/app/views/users/already_signed_in.html.erb
new file mode 100644
index 0000000..04b4248
--- /dev/null
+++ b/app/views/users/already_signed_in.html.erb
@@ -0,0 +1 @@
+<h1>You are currently signed in</h1>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 3692112..89e369a 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -1,8 +1,9 @@
<h1>Listing users</h1>
-<table>
+<table class="table table-hover">
<thead>
<tr>
+ <th>Username</th>
<th>Name</th>
<th>Email</th>
<th>User name</th>
@@ -15,8 +16,9 @@
<tbody>
<% @users.each do |user| %>
<tr>
+ <td><%= link_to("#{user.user_name}", user, nil) %></td>
<td><%= user.name %></td>
- <td><%= user.email %></td>
+ <td> ******* </td>
<td><%= user.user_name %></td>
<td><%= link_to 'Show', user %></td>
<td><%= link_to 'Edit', edit_user_path(user) %></td>
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
index efc0404..c23f76d 100644
--- a/app/views/users/new.html.erb
+++ b/app/views/users/new.html.erb
@@ -1,5 +1,32 @@
-<h1>New user</h1>
+<h1> Sign Up </h1>
-<%= render 'form' %>
+<%= form_for @user do |f| %>
+ <%= render "common/error_messages", :target => @user %>
+ <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.password_field :password %>
+ </p>
+ <p>
+ <%= f.label(:password_confirmation, "Confirm Password") %><br>
+ <%= f.password_field :password_confirmation %>
+ </p>
+ <p>
+ <%= f.submit("Be a Leaguer", :class => "signup") %>
+ </p>
+<% end %>
+
+
+<%= link_to 'Already Have an Account? Log in', new_session_path, :class => "signin" %>
-<%= link_to 'Back', users_path %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 9455a3c..d8cc82b 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -1,5 +1,3 @@
-<p id="notice"><%= notice %></p>
-
<p>
<strong>Name:</strong>
<%= @user.name %>