From 32df12ee322bbe07b11758b87599ba192e4515d4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 9 Jul 2014 23:28:37 -0400 Subject: clean up some styles and form stuff Just look at the diff. --- app/views/alerts/index.html.erb | 2 +- app/views/common/_show_tournament.html.erb | 6 ++-- app/views/games/index.html.erb | 2 +- app/views/simple_captcha/_simple_captcha.erb | 41 ++++------------------------ app/views/teams/index.html.erb | 2 +- app/views/tournaments/show.html.erb | 8 +++--- app/views/users/index.html.erb | 2 +- app/views/users/new.html.erb | 33 +++++++++++++++------- 8 files changed, 39 insertions(+), 57 deletions(-) (limited to 'app/views') diff --git a/app/views/alerts/index.html.erb b/app/views/alerts/index.html.erb index c978bea..5695486 100644 --- a/app/views/alerts/index.html.erb +++ b/app/views/alerts/index.html.erb @@ -19,7 +19,7 @@ <%= alert.message %> <%= link_to 'Show', alert %> <%= link_to 'Edit', edit_alert_path(alert) %> - <%= link_to 'Destroy', alert, method: :delete, data: { confirm: 'Are you sure?' } %> + <%= button_to 'Destroy', alert, method: :delete, data: { confirm: 'Are you sure?' } %> <% end %> <% else %> diff --git a/app/views/common/_show_tournament.html.erb b/app/views/common/_show_tournament.html.erb index 02c70c6..3d4b066 100644 --- a/app/views/common/_show_tournament.html.erb +++ b/app/views/common/_show_tournament.html.erb @@ -47,7 +47,7 @@
<% if signed_in? %> <% if !target.players.include?(current_user) && target.status == 0 %> - <%= form_tag(tournament_path(target), method: "put", role: :button) do %> + <%= form_tag(tournament_path(target), method: "put", class: :button_to) do %> <%= submit_tag("Join")%> <% end %> @@ -56,11 +56,11 @@ <% end %> <% @user_bracket = target.brackets.find_by(user: current_user) %> <% if target.status == 1 && target.stages.order(:id).first.scheduling_method == "elimination" && target.stages.order(:id).first.matches.order(:id).first.status < 2 && !@user_bracket %> - <%= form_tag(tournament_brackets_path(target), method: "post", role: :button) do %> + <%= form_tag(tournament_brackets_path(target), method: "post", class: :button_to) do %> <%= submit_tag("Make Bracket") %> <% end %> <% elsif @user_bracket && target.status == 4 %> - <%= form_tag(tournament_bracket_path(@tournament, @bracket), method: 'put', role: :button) do %> + <%= form_tag(tournament_bracket_path(@tournament, @bracket), method: 'put', class: :button_to) do %> <%= submit_tag("Bracket Results") %> <% end %> diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index f12253c..5a1a270 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -28,7 +28,7 @@ <%= game.scoring_method %> <%= link_to 'Show', game %> <%= link_to 'Edit', edit_game_path(game) %> - <%= link_to 'Destroy', game, method: :delete, data: { confirm: 'Are you sure?' } %> + <%= button_to 'Destroy', game, method: :delete, data: { confirm: 'Are you sure?' } %> <% end %> diff --git a/app/views/simple_captcha/_simple_captcha.erb b/app/views/simple_captcha/_simple_captcha.erb index 9968910..5e9da76 100644 --- a/app/views/simple_captcha/_simple_captcha.erb +++ b/app/views/simple_captcha/_simple_captcha.erb @@ -1,37 +1,6 @@ - - -
-
- <%= simple_captcha_options[:image] %> -
- -
- <%= simple_captcha_options[:field] %> -
- -
- <%= simple_captcha_options[:label] %> -
+
+ + <%= simple_captcha_options[:image] %> + To make sure you aren't a robot. + <%= simple_captcha_options[:field] %>
diff --git a/app/views/teams/index.html.erb b/app/views/teams/index.html.erb index b077e10..397bfc6 100644 --- a/app/views/teams/index.html.erb +++ b/app/views/teams/index.html.erb @@ -14,7 +14,7 @@ <%= link_to 'Show', team %> <%= link_to 'Edit', edit_team_path(team) %> - <%= link_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %> + <%= button_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %> <% end %> diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index 8d56f46..55a8f14 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -100,23 +100,23 @@
<%# If user can join, and user hasn't joined already, show a join tournment button %> <% if @tournament.joinable_by?(current_user) && !@tournament.players.include?(current_user) %> - <%= form_tag(tournament_path(@tournament), method: "put", role: :button) do %> + <%= form_tag(tournament_path(@tournament), method: "put", class: :button_to) do %> <%= submit_tag("Join Tournament") %> <% end %> <% elsif @tournament.players.include?(current_user) %> - <%= form_tag(tournament_path(@tournament), method: "put", role: :button) do %> + <%= form_tag(tournament_path(@tournament), method: "put", class: :button_to) do %> <%= submit_tag("Leave Tournament") %> <% end %> <% end %> <%# If user is the host, let them start the tournment %> <% if @tournament.check_permission(current_user, :edit) %> - <%= form_tag(tournament_path(@tournament), method: "put", role: :button) do %> + <%= form_tag(tournament_path(@tournament), method: "put", class: :button_to) do %> <%= submit_tag("Start Tournament", disabled: (@tournament.players.count < @tournament.min_players_per_team * @tournament.min_teams_per_match)) %> <% end %> <%= link_to 'Edit Tournament', edit_tournament_path(@tournament), role: :button %> - <%= link_to 'Cancel Tournament', @tournament, method: :delete, data: { confirm: 'Are you sure?' }, role: :button %> + <%= button_to 'Cancel Tournament', @tournament, method: :delete, data: { confirm: 'Are you sure?' } %> <% end %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index b2d5675..53b37b8 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -45,7 +45,7 @@ <%= user.user_name %> <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %> - <%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %> + <%= button_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %> <% end %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 03041d9..1445a0d 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -26,24 +26,37 @@ <%= form_for @user do |f| %> <%= render "common/error_messages", :target => @user %>
- <%= f.label :name %>
- <%= f.text_field :name %> + <%= f.label :user_name %> + + This is the name you will use to log in. + It may consist of letters, numbers, _, and -. + +
+ <%= f.text_field :user_name %>
- <%= f.label :email %>
- <%= f.text_field(:email, type: "email") %> + <%= f.label :password %> + + Must be at least 6 characters long. + +
+ <%= f.password_field(:password, required: :required, minlength: 6) %>
- <%= f.label :user_name %>
- <%= f.text_field :user_name %> + <%= f.label(:password_confirmation, "Confirm Password") %>
+ <%= f.password_field(:password_confirmation, required: :required, minlength: 6) %>
- <%= f.label :password %>
- <%= f.password_field :password %> + <%= f.label :name %> + + A display name; perhaps your real name, or perhaps an alias. + +
+ <%= f.text_field :name %>
- <%= f.label(:password_confirmation, "Confirm Password") %>
- <%= f.password_field :password_confirmation %> + <%= f.label :email %>
+ <%= f.email_field(:email) %>
<%= show_simple_captcha %> -- cgit v1.2.3