class AuthorsController < ApplicationController
before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse]
+
def index
@authors = Author.all
end
end
+ def list
+ @authors = Author.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ end
+ end
+
+ def browse
+ @author = Author.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ end
+ end
+
end
--- /dev/null
+<p id="notice"><%= notice %></p>
+
+<p>
+ <b>name:</b>
+ <%= h(@author.name) %>
+</p>
+
+<p>
+ <b>email:</b>
+ <%= h(@author.email) %>
+</p>
+
+<p>
+ <b>sign_in_count:</b>
+ <%= @author.sign_in_count %>
+</p>
+
+<p>
+ <b>current_sign_in_at:</b>
+ <%= @author.current_sign_in_at %>
+</p>
+
+<p>
+ <b>last_sign_in_at:</b>
+ <%= @author.last_sign_in_at %>
+</p>
+
+<p>
+ <b>current_sign_in_ip:</b>
+ <%= @author.current_sign_in_ip %>
+</p>
+
+<p>
+ <b>last_sign_in_ip:</b>
+ <%= @author.last_sign_in_ip %>
+</p>
+
+<%= link_to 'Back', :action => :list %>
--- /dev/null
+<h1>Listing authors</h1>
+
+<table>
+ <tr>
+ <th>id</th>
+ <th>name</th>
+ <th>email</th>
+ <th>sign_in_count</th>
+ <th>current_sign_in_at</th>
+ <th>last_sign_in_at</th>
+ <th>current_sign_in_ip</th>
+ <th>last_sign_in_ip</th>
+ <th>created_at</th>
+ <th>updated_at</th>
+ </tr>
+
+<% @authors.each do |author| %>
+ <tr>
+ <td><%= link_to author.id, :action => :show, :id => author.id %></td>
+ <td><%= h(author.name) %></td>
+ <td><%= h(author.email) %></td>
+ <td><%= author.sign_in_count %></td>
+ <td><%= author.current_sign_in_at %></td>
+ <td><%= author.last_sign_in_at %></td>
+ <td><%= author.current_sign_in_ip %></td>
+ <td><%= author.last_sign_in_ip %></td>
+ <td><%= author.created_at %></td>
+ <td><%= author.updated_at %></td>
+ </tr>
+<% end %>
+</table>
<td><%= comic.height %></td>
<td><%= comic.visible %></td>
<td><%= comic.editable %></td>
- <td><%= link_to comic.author_id, :controller => '/comics', :action => :browse, :id => comic.author_id %></td>
+ <td><%= link_to comic.author_id, :controller => '/authors', :action => :browse, :id => comic.author_id %></td>
<td><%= comic.created_at %></td>
<td><%= comic.updated_at %></td>
<td>
<td><%= panel.y %></td>
<td><%= panel.z %></td>
<td><%= panel.t %></td>
- <td><%= panel.author_id %></td>
+ <td><%= link_to panel.author_id, :controller => '/authors', :action => :browse, :id => panel.author_id %></td>
<td><%= panel.created_at %></td>
<td><%= panel.updated_at %></td>
<td>
<table>
<tr>
<td>
+ <%= link_to 'authors', :controller => 'authors', :action => :list %>
+ </td>
+ </tr>
+ <tr>
+ <td>
<%= link_to 'artists', :controller => 'artists', :action => :list %>
</td>
</tr>