diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/alerts/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/common/_show_tournament.html.erb | 6 | ||||
-rw-r--r-- | app/views/games/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/simple_captcha/_simple_captcha.erb | 41 | ||||
-rw-r--r-- | app/views/teams/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/tournaments/show.html.erb | 8 | ||||
-rw-r--r-- | app/views/users/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/users/new.html.erb | 33 |
8 files changed, 39 insertions, 57 deletions
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 @@ <td><%= alert.message %></td> <td><%= link_to 'Show', alert %></td> <td><%= link_to 'Edit', edit_alert_path(alert) %></td> - <td><%= link_to 'Destroy', alert, method: :delete, data: { confirm: 'Are you sure?' } %></td> + <td><%= button_to 'Destroy', alert, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% 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 @@ <div class="col-md-2 col-sm-2 col-xs-2"> <% 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 %> <input type="hidden" name="update_action" value="join"> <%= 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 %> <input type="hidden" name="update_action" value="results"> <%= 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 @@ <td><%= game.scoring_method %></td> <td><%= link_to 'Show', game %></td> <td><%= link_to 'Edit', edit_game_path(game) %></td> - <td><%= link_to 'Destroy', game, method: :delete, data: { confirm: 'Are you sure?' } %></td> + <td><%= button_to 'Destroy', game, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% end %> </tbody> 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 @@ -<style type="text/CSS"> - .simple_captcha{border: 1px solid #ccc; padding: 5px !important;} - .simple_captcha, - .simple_captcha div{display: table;} - .simple_captcha .simple_captcha_field, - .simple_captcha .simple_captcha_image{ - border: 1px solid #ccc; - margin: 0px 0px 2px 0px !important; - padding: 0px !important; - } - .simple_captcha .simple_captcha_image img{ - margin: 0px !important; - padding: 0px !important; - width: 110px !important; - } - .simple_captcha .simple_captcha_label{font-size: 12px;} - .simple_captcha .simple_captcha_field input{ - width: 150px !important; - font-size: 16px; - border: none; - background-color: #efefef; - } -</style> - -<div class='simple_captcha'> - <div class='simple_captcha_image'> - <%= simple_captcha_options[:image] %> - </div> - - <div class='simple_captcha_field'> - <%= simple_captcha_options[:field] %> - </div> - - <div class='simple_captcha_label'> - <%= simple_captcha_options[:label] %> - </div> +<div class="field simple_captcha"> + <label for="captcha"><%= simple_captcha_options[:label] %></label> + <%= simple_captcha_options[:image] %> + <span class="help-block">To make sure you aren't a robot.</span> + <%= simple_captcha_options[:field] %> </div> 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 @@ <tr> <td><%= link_to 'Show', team %></td> <td><%= link_to 'Edit', edit_team_path(team) %></td> - <td><%= link_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %></td> + <td><%= button_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% end %> </tbody> 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 @@ <div class="actions"> <%# 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 %> <input type="hidden" name="update_action" value="join"> <%= 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 %> <input type="hidden" name="update_action" value="leave"> <%= 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 %> <input type="hidden" name="update_action" value="start"> <%= 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 %> </div> 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 @@ <td><%= user.user_name %></td> <td><%= link_to 'Show', user %></td> <td><%= link_to 'Edit', edit_user_path(user) %></td> - <td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td> + <td><%= button_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% end %> </tbody> 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 %> <div class="field"> - <%= f.label :name %><br> - <%= f.text_field :name %> + <%= f.label :user_name %> + <span class="help-block"> + This is the name you will use to log in. + It may consist of letters, numbers, <kbd>_</kbd>, and <kbd>-</kbd>. + </span> + <br> + <%= f.text_field :user_name %> </div> <div class="field"> - <%= f.label :email %><br> - <%= f.text_field(:email, type: "email") %> + <%= f.label :password %> + <span class="help-block"> + Must be at least 6 characters long. + </span> + <br> + <%= f.password_field(:password, required: :required, minlength: 6) %> </div> <div class="field"> - <%= f.label :user_name %><br> - <%= f.text_field :user_name %> + <%= f.label(:password_confirmation, "Confirm Password") %><br> + <%= f.password_field(:password_confirmation, required: :required, minlength: 6) %> </div> <div class="field"> - <%= f.label :password %><br> - <%= f.password_field :password %> + <%= f.label :name %> + <span class="help-block"> + A display name; perhaps your real name, or perhaps an alias. + </span> + <br> + <%= f.text_field :name %> </div> <div class="field"> - <%= f.label(:password_confirmation, "Confirm Password") %><br> - <%= f.password_field :password_confirmation %> + <%= f.label :email %><br> + <%= f.email_field(:email) %> </div> <div class="field"> <%= show_simple_captcha %> |