summaryrefslogtreecommitdiff
path: root/app/views/sessions
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/sessions')
-rw-r--r--app/views/sessions/_form.html.erb25
-rw-r--r--app/views/sessions/edit.html.erb6
-rw-r--r--app/views/sessions/index.html.erb29
-rw-r--r--app/views/sessions/index.json.jbuilder4
-rw-r--r--app/views/sessions/new.html.erb50
-rw-r--r--app/views/sessions/show.html.erb14
-rw-r--r--app/views/sessions/show.json.jbuilder1
7 files changed, 47 insertions, 82 deletions
diff --git a/app/views/sessions/_form.html.erb b/app/views/sessions/_form.html.erb
deleted file mode 100644
index 90ad0ad..0000000
--- a/app/views/sessions/_form.html.erb
+++ /dev/null
@@ -1,25 +0,0 @@
-<%= form_for(@session) do |f| %>
- <% if @session.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@session.errors.count, "error") %> prohibited this session from being saved:</h2>
-
- <ul>
- <% @session.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <div class="field">
- <%= f.label :user_id %><br>
- <%= f.text_field :user_id %>
- </div>
- <div class="field">
- <%= f.label :token %><br>
- <%= f.text_field :token %>
- </div>
- <div class="actions">
- <%= f.submit %>
- </div>
-<% end %>
diff --git a/app/views/sessions/edit.html.erb b/app/views/sessions/edit.html.erb
deleted file mode 100644
index bbd8407..0000000
--- a/app/views/sessions/edit.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<h1>Editing session</h1>
-
-<%= render 'form' %>
-
-<%= link_to 'Show', @session %> |
-<%= link_to 'Back', sessions_path %>
diff --git a/app/views/sessions/index.html.erb b/app/views/sessions/index.html.erb
deleted file mode 100644
index 43a7e1f..0000000
--- a/app/views/sessions/index.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-<h1>Listing sessions</h1>
-
-<table>
- <thead>
- <tr>
- <th>User</th>
- <th>Token</th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- </thead>
-
- <tbody>
- <% @sessions.each do |session| %>
- <tr>
- <td><%= session.user %></td>
- <td><%= session.token %></td>
- <td><%= link_to 'Show', session %></td>
- <td><%= link_to 'Edit', edit_session_path(session) %></td>
- <td><%= link_to 'Destroy', session, method: :delete, data: { confirm: 'Are you sure?' } %></td>
- </tr>
- <% end %>
- </tbody>
-</table>
-
-<br>
-
-<%= link_to 'New Session', new_session_path %>
diff --git a/app/views/sessions/index.json.jbuilder b/app/views/sessions/index.json.jbuilder
deleted file mode 100644
index 5205ede..0000000
--- a/app/views/sessions/index.json.jbuilder
+++ /dev/null
@@ -1,4 +0,0 @@
-json.array!(@sessions) do |session|
- json.extract! session, :id, :user_id, :token
- json.url session_url(session, format: :json)
-end
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index 55c9eca..ba125e5 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -1,5 +1,49 @@
-<h1>New session</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 in</h1>
-<%= render 'form' %>
+<div>
+ <%= form_tag(sessions_path, method: :post, id: :new_session) do %>
+ <% if params[:action] == "create" %>
+ <div class="alert-danger">
+ <p>The username/password pair you entered did
+ not match our records. Check your typing and
+ try again.</p>
+ </div>
+ <% end %>
+ <div class="field">
+ <%= label_tag(:username_or_email, "Username/Email") %><br/>
+ <%= text_field_tag(:username_or_email) %>
+ </div>
+ <div class="field">
+ <%= label_tag(:password) %><br/>
+ <%= password_field_tag(:password) %>
+ </div>
+ <div class="field">
+ <%= submit_tag("Log in", class: :signin) %>
+ </div>
+ <% end %>
-<%= link_to 'Back', sessions_path %>
+ <p>New user? <%= link_to("Sign up now!", new_user_path) %></p>
+</div>
diff --git a/app/views/sessions/show.html.erb b/app/views/sessions/show.html.erb
deleted file mode 100644
index 230e6bd..0000000
--- a/app/views/sessions/show.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-<p id="notice"><%= notice %></p>
-
-<p>
- <strong>User:</strong>
- <%= @session.user %>
-</p>
-
-<p>
- <strong>Token:</strong>
- <%= @session.token %>
-</p>
-
-<%= link_to 'Edit', edit_session_path(@session) %> |
-<%= link_to 'Back', sessions_path %>
diff --git a/app/views/sessions/show.json.jbuilder b/app/views/sessions/show.json.jbuilder
deleted file mode 100644
index c9efd3b..0000000
--- a/app/views/sessions/show.json.jbuilder
+++ /dev/null
@@ -1 +0,0 @@
-json.extract! @session, :id, :user_id, :token, :created_at, :updated_at