summaryrefslogtreecommitdiff
path: root/app/views/users
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/users')
-rw-r--r--app/views/users/_form.html.erb63
-rw-r--r--app/views/users/already_signed_in.html.erb1
-rw-r--r--app/views/users/edit.html.erb2
-rw-r--r--app/views/users/index.html.erb31
-rw-r--r--app/views/users/new.html.erb71
-rw-r--r--app/views/users/show.html.erb80
6 files changed, 219 insertions, 29 deletions
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb
index 4d28738..e4e49f4 100644
--- a/app/views/users/_form.html.erb
+++ b/app/views/users/_form.html.erb
@@ -1,29 +1,68 @@
+<%
+# Copyright (C) 2014 Andrew Murrell
+# Copyright (C) 2014 Davis Webb
+# Copyright (C) 2014 Guntas Grewal
+# Copyright (C) 2014 Luke Shumaker
+# Copyright (C) 2014 Nathaniel Foy
+# Copyright (C) 2014 Tomer Kimia
+#
+# This file is part of Leaguer.
+#
+# Leaguer is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Leaguer is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the Affero GNU General Public License
+# along with Leaguer. If not, see <http://www.gnu.org/licenses/>.
+%>
<%= form_for(@user) do |f| %>
- <% if @user.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
-
- <ul>
- <% @user.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
+ <%= render "common/error_messages", :target => @user %>
<div class="field">
<%= f.label :name %><br>
<%= f.text_field :name %>
</div>
+
<div class="field">
<%= f.label :email %><br>
- <%= f.text_field :email %>
+ <%= f.email_field(:email) %>
</div>
+
<div class="field">
<%= f.label :user_name %><br>
<%= f.text_field :user_name %>
</div>
+
+ <div>
+ <%= f.label(:password, "New Password (or use old)") %><br>
+ <%= f.password_field :password %>
+ </div>
+ <div>
+ <%= f.label(:password_confirmation, "Confirm Password") %><br>
+ <%= f.password_field :password_confirmation %>
+ </div>
+
+ <% if current_user.can? :edit_permissions %>
+ <fieldset>
+ <legend>User permissions</legend>
+ <ul>
+ <%= fields_for "user[abilities]", @user.abilities do |abilities_fields| %>
+ <% @user.abilities.keys.each do |ability| %>
+ <li><%= abilities_fields.check_box(ability) %> <%= abilities_fields.label(ability) %></li>
+ <% end %>
+ <% end %>
+ </ul>
+ </fieldset>
+ <% end %>
+
<div class="actions">
<%= f.submit %>
</div>
+
<% end %>
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/edit.html.erb b/app/views/users/edit.html.erb
index 99bd4cc..52f32a2 100644
--- a/app/views/users/edit.html.erb
+++ b/app/views/users/edit.html.erb
@@ -3,4 +3,4 @@
<%= render 'form' %>
<%= link_to 'Show', @user %> |
-<%= link_to 'Back', users_path %>
+<%= link_to 'Users', users_path %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 3692112..53b37b8 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -1,8 +1,32 @@
+<%
+# Copyright (C) 2014 Andrew Murrell
+# Copyright (C) 2014 Davis Webb
+# Copyright (C) 2014 Guntas Grewal
+# Copyright (C) 2014 Luke Shumaker
+# Copyright (C) 2014 Nathaniel Foy
+# Copyright (C) 2014 Tomer Kimia
+#
+# This file is part of Leaguer.
+#
+# Leaguer is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Leaguer is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the Affero GNU General Public License
+# along with Leaguer. If not, see <http://www.gnu.org/licenses/>.
+%>
<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,12 +39,13 @@
<tbody>
<% @users.each do |user| %>
<tr>
+ <td><%= image_tag('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(user.email) + '?s=30&d=identicon') %> <%= 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>
- <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 efc0404..1445a0d 100644
--- a/app/views/users/new.html.erb
+++ b/app/views/users/new.html.erb
@@ -1,5 +1,70 @@
-<h1>New user</h1>
+<%
+# Copyright (C) 2014 Andrew Murrell
+# Copyright (C) 2014 Davis Webb
+# Copyright (C) 2014 Guntas Grewal
+# Copyright (C) 2014 Luke Shumaker
+# Copyright (C) 2014 Nathaniel Foy
+# Copyright (C) 2014 Tomer Kimia
+#
+# This file is part of Leaguer.
+#
+# Leaguer is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Leaguer is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the Affero GNU General Public License
+# along with Leaguer. If not, see <http://www.gnu.org/licenses/>.
+%>
+<h1> Sign Up </h1>
-<%= render 'form' %>
+<%= form_for @user do |f| %>
+ <%= render "common/error_messages", :target => @user %>
+ <div class="field">
+ <%= 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 :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(:password_confirmation, "Confirm Password") %><br>
+ <%= f.password_field(:password_confirmation, required: :required, minlength: 6) %>
+ </div>
+ <div class="field">
+ <%= 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 :email %><br>
+ <%= f.email_field(:email) %>
+ </div>
+ <div class="field">
+ <%= show_simple_captcha %>
+ </div>
+ <div class="actions">
+ <%= f.submit("Be a Leaguer", :class => "signup") %>
+ </div>
+<% 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..ab17b9a 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -1,19 +1,79 @@
-<p id="notice"><%= notice %></p>
+<%
+# Copyright (C) 2014 Andrew Murrell
+# Copyright (C) 2014 Davis Webb
+# Copyright (C) 2014 Guntas Grewal
+# Copyright (C) 2014 Luke Shumaker
+# Copyright (C) 2014 Nathaniel Foy
+# Copyright (C) 2014 Tomer Kimia
+#
+# This file is part of Leaguer.
+#
+# Leaguer is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Leaguer is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the Affero GNU General Public License
+# along with Leaguer. If not, see <http://www.gnu.org/licenses/>.
+%>
+
+<h1> <%= @user.user_name %>'s Profile </h1>
<p>
- <strong>Name:</strong>
- <%= @user.name %>
+ <%= image_tag 'http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(@user.email) + '?s=100&d=identicon' %>
</p>
<p>
- <strong>Email:</strong>
- <%= @user.email %>
-</p>
+ <strong>Name:</strong>
+ <%= @user.name %>
+<p>
<p>
- <strong>User name:</strong>
- <%= @user.user_name %>
+ <strong>Alias:</strong>
+ <%= @user.user_name %>
+<p>
+ <strong>Email:</strong>
+ <%= @user.email %>
</p>
-<%= link_to 'Edit', edit_user_path(@user) %> |
-<%= link_to 'Back', users_path %>
+<% if @user.remote_usernames.empty? and @user.check_permission(current_user, :edit) %>
+ <%= form_for @user do |f| %>
+ <div class="field">
+ <label for="summoner_name">Have a League of Legends Account?</label>
+ <div class="simple-input-group">
+ <input type="text" id="summoner_name" name="user[remote_usernames][League of Legends]">
+ <%= f.submit "Add Username", :class => 'signup' %>
+ </div>
+ </div>
+ <% end %>
+<% end %>
+
+<div class="row">
+ <div class="col-md-6">
+ <h3>Recent Tournaments Played</h3>
+ <ul>
+ <% @user.tournaments_played.each do |t| %>
+ <li><%= t.name %></li>
+ <% end %>
+ </ul>
+ </div>
+ <div class="col-md-6">
+ <h3>Recent Tournaments Hosted</h3>
+ <% if @user.tournaments_hosted.empty? %>
+ <p><%= @user.user_name %> has never hosted a tournament.</p>
+ <% else %>
+ <ul>
+ <% @user.tournaments_hosted.each do |t| %>
+ <li><%= t.name %></li>
+ <% end %>
+ </ul>
+ <% end %>
+ </div>
+</div>
+
+<%= link_to 'Edit', edit_user_path(@user), role: :button %>