From 5522a6702e4586d219c8b332f1e311ca94746158 Mon Sep 17 00:00:00 2001
From: Tomer Kimia
Date: Mon, 3 Mar 2014 19:37:26 -0500
Subject: made two distinct buttons on homepage
---
app/views/static/homepage.html.erb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
(limited to 'app')
diff --git a/app/views/static/homepage.html.erb b/app/views/static/homepage.html.erb
index 4d52e5b..29ae4f0 100644
--- a/app/views/static/homepage.html.erb
+++ b/app/views/static/homepage.html.erb
@@ -4,7 +4,11 @@
Welcome to Leaguer
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.
-
<%= 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" %>
+
+ <%= link_to 'Log In', "/signin", :class => "btn btn-warning btn-lg", :role => "button" %>
+ <%= link_to '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" %>
+
--
cgit v1.2.3-2-g168b
From 254f8b72b2d92787d2e1f9e7589935b2c0dae66d Mon Sep 17 00:00:00 2001
From: Tomer Kimia
Date: Mon, 3 Mar 2014 19:43:25 -0500
Subject: Changed password input to password type so that passwords are hidden
as *** when typed, also why are we using an html form?
---
app/views/users/new.html.erb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'app')
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
index 2a745cc..aa71f00 100644
--- a/app/views/users/new.html.erb
+++ b/app/views/users/new.html.erb
@@ -16,11 +16,11 @@
<%= f.label :password %>
- <%= f.text_field :password %>
+ <%= f.password_field :password %>
<%= f.label :password_confirm %>
- <%= f.text_field :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
<%= f.submit %>
@@ -45,11 +45,11 @@
Password
-
+
Password confirm
-
+
--
cgit v1.2.3-2-g168b
From b8c14b654255376d79fae55e139a968930be4569 Mon Sep 17 00:00:00 2001
From: Tomer Kimia
Date: Mon, 3 Mar 2014 19:51:30 -0500
Subject: fixed users table
---
app/controllers/users_controller.rb | 6 +++++-
app/views/users/index.html.erb | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
(limited to 'app')
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 6436e4e..c14f67c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -15,9 +15,13 @@ class UsersController < ApplicationController
end
def show
- @user = User.find(param[:id])
+ @user = User.find(params[:id])
end
+ def index
+ @users = User.all
+ end
+
private
def user_params
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 8b9056b..10f19f4 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -1,6 +1,6 @@
Listing users
-
+
Name
@@ -15,7 +15,7 @@
<% @users.each do |user| %>
<%= user.name %>
- <%= user.pw_hash %>
+ *******
<%= link_to 'Show', user %>
<%= link_to 'Edit', edit_user_path(user) %>
<%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>
--
cgit v1.2.3-2-g168b
From 25ec3364c15751207cd9dd56157e103a4ee9d782 Mon Sep 17 00:00:00 2001
From: Tomer Kimia
Date: Mon, 3 Mar 2014 20:40:08 -0500
Subject: dont see log in if logged in
---
app/views/static/homepage.html.erb | 5 +++--
app/views/users/index.html.erb | 5 ++---
2 files changed, 5 insertions(+), 5 deletions(-)
(limited to 'app')
diff --git a/app/views/static/homepage.html.erb b/app/views/static/homepage.html.erb
index 29ae4f0..5887d5f 100644
--- a/app/views/static/homepage.html.erb
+++ b/app/views/static/homepage.html.erb
@@ -1,12 +1,13 @@
-
Welcome to Leaguer
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.
+ <% if !signed_in? %>
<%= link_to 'Log In', "/signin", :class => "btn btn-warning btn-lg", :role => "button" %>
- <%= link_to 'Sign Up', "/signup", :class => "btn btn-warning btn-lg", :role => "button" %>
+ <%= link_to 'Sign Up', "/signup", :class => "btn btn-warning btn-lg", :role => "button" %>
+ <% end %>
<%= link_to 'See Ongoing Tournaments', tournaments_path, :class => "btn btn-warning btn-lg", :role => "button" %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 10f19f4..c128661 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -6,7 +6,7 @@
Name
Pw hash
-
+
@@ -14,9 +14,8 @@
<% @users.each do |user| %>
- <%= user.name %>
+ <%= link_to("#{user.name}", user, nil) %>
*******
- <%= link_to 'Show', user %>
<%= link_to 'Edit', edit_user_path(user) %>
<%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>
--
cgit v1.2.3-2-g168b
From d8ce62fa89705ff9d93d28c3ce626ce9268a01af Mon Sep 17 00:00:00 2001
From: Tomer Kimia
Date: Mon, 3 Mar 2014 20:46:18 -0500
Subject: signed in people see a link to make a new tournament
---
app/views/static/homepage.html.erb | 3 +++
1 file changed, 3 insertions(+)
(limited to 'app')
diff --git a/app/views/static/homepage.html.erb b/app/views/static/homepage.html.erb
index 5887d5f..8b96e11 100644
--- a/app/views/static/homepage.html.erb
+++ b/app/views/static/homepage.html.erb
@@ -7,8 +7,11 @@
<% if !signed_in? %>
<%= link_to 'Log In', "/signin", :class => "btn btn-warning btn-lg", :role => "button" %>
<%= link_to 'Sign Up', "/signup", :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" %>
+
--
cgit v1.2.3-2-g168b
From d5f15d40e0c0168bb430ebae39371590266d0eb5 Mon Sep 17 00:00:00 2001
From: Tomer Kimia
Date: Mon, 3 Mar 2014 21:02:13 -0500
Subject: links no longer look like shit
---
app/assets/stylesheets/scaffolds.css.scss | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
(limited to 'app')
diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss
index 8279f4f..dc22c99 100644
--- a/app/assets/stylesheets/scaffolds.css.scss
+++ b/app/assets/stylesheets/scaffolds.css.scss
@@ -28,8 +28,9 @@ a {
color: #666;
}
&:hover {
- color: #fff;
- background-color: #000;
+ color: #000;
+ font-weight:bold;
+ text-decoration: none;
}
}
@@ -84,6 +85,16 @@ hr {
margin: 18px 0;
}
+.navbar-brand {
+ a{
+ &:hover {
+ color: #FFF;
+ font-weight: normal;
+ text-decoration: none;
+ }
+ }
+}
+
#footer{
text-align: center;
}
--
cgit v1.2.3-2-g168b
From 661dbaf902d770dfbefa9ba1d9e4c28fc7abf891 Mon Sep 17 00:00:00 2001
From: Tomer Kimia
Date: Mon, 3 Mar 2014 21:49:38 -0500
Subject: small things
---
app/assets/stylesheets/scaffolds.css.scss | 1 -
app/controllers/sessions_controller.rb | 17 ++++++++++-------
app/views/sessions/new.html.erb | 4 +++-
app/views/users/index.html.erb | 4 +++-
4 files changed, 16 insertions(+), 10 deletions(-)
(limited to 'app')
diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss
index dc22c99..f4c3040 100644
--- a/app/assets/stylesheets/scaffolds.css.scss
+++ b/app/assets/stylesheets/scaffolds.css.scss
@@ -29,7 +29,6 @@ a {
}
&:hover {
color: #000;
- font-weight:bold;
text-decoration: none;
}
}
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 68cb949..3417332 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -1,22 +1,25 @@
class SessionsController < ApplicationController
def new
+ if @user.nil?
+ @user = User.new
+ end
end
# find the user and create a new session
def create
- user = User.find_by(email: params[:session][:email].downcase)
- if user && user.authenticate(params[:session][:password])
- sign_in user
+ @user = User.find_by(email: params[:session][:email].downcase)
+ if @user && @user.authenticate(params[:session][:password])
+ sign_in @user
redirect_to root_path
else
- render 'new'
- end
+ redirect_to signin_path
+ end
end
def destroy
- sign_out
- redirect_to root_path
+ sign_out
+ redirect_to root_path
end
end
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index f942cf6..2e7a0d3 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -1,5 +1,7 @@
Sign in
-
+<% if @fail %>
+ Email and password combination not found
+<% end %>
<%= form_for(:session, url: sessions_path) do |f| %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index c128661..d92da4d 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -3,6 +3,7 @@
+ Username
Name
Pw hash
@@ -14,7 +15,8 @@
<% @users.each do |user| %>
- <%= link_to("#{user.name}", user, nil) %>
+ <%= link_to("#{user.user_name}", user, nil) %>
+ <%= user.name %>
*******
<%= link_to 'Edit', edit_user_path(user) %>
<%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>
--
cgit v1.2.3-2-g168b