From 289caaa1c82db4895efaf01b33160712d169bc84 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Thu, 6 Mar 2014 12:07:17 -0500 Subject: Minor visual changes --- app/views/layouts/application.html.erb | 2 +- app/views/tournaments/new.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7578d82..976ee85 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -33,7 +33,7 @@
<%= yield %>
<%= debug(params) if Rails.env.development? %> diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index 428487a..3d6d142 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -2,7 +2,7 @@

New Tournament

-<%= 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-warning btn-lg" %> +<%= 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" %> @@ -14,6 +14,6 @@

-<%= link_to 'Select', 'selected', :class => "btn btn-warning btn-lg" %> +<%= link_to 'Select', 'selected', :class => "btn btn-success btn-xs" %> <%= link_to 'Back', tournaments_path %> -- cgit v1.2.3-2-g168b From cd020cb3c9f8a1d40af4958c26dcdfb97e1a80c1 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Thu, 6 Mar 2014 14:23:11 -0500 Subject: Users can now log in with user_name and email but I could not make one text box for both --- app/views/sessions/new.html.erb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 550a54d..6d73b1f 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,13 +1,16 @@

Sign in

<% if @user.nil? %> -

The username or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current username and password.

+

The email or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current email and password.

<% end %>
<%= form_for(:session, url: sessions_path) do |f| %> <%= f.label :email %> - <%= f.text_field :email %> + <%= f.text_field :email%> + + <%= f.label :user_name %> + <%= f.text_field :user_name%> <%= f.label :password %> <%= f.password_field :password %> -- cgit v1.2.3-2-g168b From a421aace7383bb6718d23eed1bde02659a7a93ff Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Thu, 6 Mar 2014 15:57:26 -0500 Subject: login fixed and some views look better --- app/views/games/index.html.erb | 2 +- app/views/sessions/new.html.erb | 22 +++++++++++----------- app/views/tournaments/_selected.html.erb | 2 +- app/views/users/new.html.erb | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'app/views') diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index 7ee69d1..9893cbc 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -1,6 +1,6 @@

Listing games

- +
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 6d73b1f..6439b9f 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -2,22 +2,22 @@ <% if @user.nil? %>

The email or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current email and password.

<% end %> -
+
<%= form_for(:session, url: sessions_path) do |f| %> - - <%= f.label :email %> - <%= f.text_field :email%> - - <%= f.label :user_name %> - <%= f.text_field :user_name%> - - <%= f.label :password %> +

+ <%= f.label(:username_or_email, "Username/Email") %>
+ <%= f.text_field :username_or_email%> +

+

+ <%= f.label :password %>
<%= f.password_field :password %> - +

+

<%= f.submit "Sign in", class: "btn btn-large btn-primary" %> +

<% end %>

New user? <%= link_to "Sign up now!", new_user_path %>

-
+ diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index 4277d8e..5058c56 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -18,7 +18,7 @@ <% next %> <% end %> <% if name == "created_at" %> - <% break %> + <% break %> <% end %>

diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 704aa10..c23f76d 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -19,14 +19,14 @@ <%= f.password_field :password %>

- <%= f.label :password_confirm %>
+ <%= f.label(:password_confirmation, "Confirm Password") %>
<%= f.password_field :password_confirmation %>

- <%= f.submit %> + <%= f.submit("Be a Leaguer", :class => "signup") %>

<% end %> -<%= link_to 'Already Have an Account? Log in', new_session_path, :class => "btn btn-warning btn-lg" %> +<%= link_to 'Already Have an Account? Log in', new_session_path, :class => "signin" %> -- cgit v1.2.3-2-g168b From 240d8602fb6aaf249b33db7b0c2f8a72add63658 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Thu, 6 Mar 2014 16:09:22 -0500 Subject: tournaments table only shows if tournaments exits --- app/views/sessions/new.html.erb | 2 +- app/views/tournaments/index.html.erb | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 6439b9f..398cb49 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -18,6 +18,6 @@

<% end %> -

New user? <%= link_to "Sign up now!", new_user_path %>

+

New user? <%= link_to("Sign up now!", new_user_path) %>

diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 26d0643..e9147f6 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -1,6 +1,7 @@ -

Listing tournaments

+

Listing Tournaments

-
Name
+<% if @tournaments.length > 0 %> +
@@ -21,7 +22,9 @@ <% end %>
Tournament ID
- +<% else %> +

No tournaments going on right now... Why not start your own?

+<% end %>
<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning btn-lg" %> -- cgit v1.2.3-2-g168b From 110d67f433c091a3b739c5bbebe110d963efaa73 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Thu, 6 Mar 2014 17:38:47 -0500 Subject: no --- app/views/sessions/new.html.erb | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'app/views') diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 6d73b1f..2b40ed9 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,23 +1,22 @@

Sign in

<% if @user.nil? %> -

The email or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current email and password.

+

The email/username or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current email/username and password.

<% end %> -
+
<%= form_for(:session, url: sessions_path) do |f| %> - - <%= f.label :email %> - <%= f.text_field :email%> - - <%= f.label :user_name %> - <%= f.text_field :user_name%> - - <%= f.label :password %> +

+ <%= f.label(:username_or_email, "Username/Email") %>
+ <%= f.text_field :username_or_email%> +

+

+ <%= f.label :password %>
<%= f.password_field :password %> - +

+

<%= f.submit "Sign in", class: "btn btn-large btn-primary" %> +

<% end %> -

New user? <%= link_to "Sign up now!", new_user_path %>

+

New user? <%= link_to("Sign up now!", new_user_path) %>

-
-- cgit v1.2.3-2-g168b From 1ec0bbad344790e7181a586cd24914c677d20d32 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Thu, 6 Mar 2014 18:36:14 -0500 Subject: Here's Luke's stuff because he doesn't have wifi. --- app/views/tournaments/_selected.html.erb | 34 +++++++++----------------------- app/views/tournaments/new.html.erb | 14 ++++++------- 2 files changed, 16 insertions(+), 32 deletions(-) (limited to 'app/views') diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index 5058c56..cfa91fa 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -1,31 +1,15 @@ <%= form_for(@tournament) do |f| %> - <% if @tournament.errors.any? %> -
-

<%= pluralize(@tournament.errors.count, "error") %> prohibited this tournament from being saved:

+ <%= render "common/error_messages", :target => @tournament %> + <%= f.hidden_field(:game_id) %> -
    - <% @tournament.errors.full_messages.each do |msg| %> -
  • <%= msg %>
  • - <% end %> -
-
- <% 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" %> + <% @tournament.attributes.each do |name, value| %> + <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") %> <% next %> <% end %> - <% if name == "created_at" %> - <% break %> - <% end %> -

- -
- value=<%= value %>> -

+

+ <%= f.label name %>
+ <%= f.text_field name %> +

<% end %> - <%= f.submit %> -<% end %> +<% end %> \ No newline at end of file diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index 3d6d142..1e80147 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -2,18 +2,18 @@

New Tournament

-<%= 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" %> +<%= form_tag(new_tournament_path, method: "get") do %> + <%= select_tag('game', + options_from_collection_for_select(@games, 'id', 'name', @tournament.game.nil? || @tournament.game.id), + :prompt => "Select a Game Type") %> + <%= submit_tag("Select", :class => "btn btn-success btn-xs") %> +<% end %> - -
- <% if not @game.nil? %> + <% if not @tournament.game.nil? %> <%= render 'selected' %> <% end %>
-

- -<%= link_to 'Select', 'selected', :class => "btn btn-success btn-xs" %> <%= link_to 'Back', tournaments_path %> -- cgit v1.2.3-2-g168b From 8e1ca0e4f9107a43fbdf0dac315e3467b0158356 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Thu, 6 Mar 2014 19:12:48 -0500 Subject: defaults now come in --- app/views/tournaments/_selected.html.erb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index cfa91fa..9b1b7f8 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -2,14 +2,21 @@ <%= render "common/error_messages", :target => @tournament %> <%= f.hidden_field(:game_id) %> + <% @chosen = Game.find_by(params[:game]) %> <% @tournament.attributes.each do |name, value| %> - <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") %> + <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") %> <% next %> <% end %>

<%= f.label name %>
- <%= f.text_field name %> + <% if !@chosen.attributes[name].nil? %> + <%= f.text_field(name, :value => @chosen.attributes[name] ) %> + <% else %> + <%= f.text_field name %> + <% end %> +

+ <% end %> <%= f.submit %> -<% end %> \ No newline at end of file +<% end %> -- cgit v1.2.3-2-g168b