From: yasushiito Date: Sat, 14 Jan 2012 01:14:22 +0000 (+0900) Subject: author browser complated X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=commitdiff_plain;h=f5009ac05c4e620887b6514a95acbc01ab86e5c7 author browser complated --- diff --git a/app/controllers/authors_controller.rb b/app/controllers/authors_controller.rb index 8386ed26..c960bc56 100644 --- a/app/controllers/authors_controller.rb +++ b/app/controllers/authors_controller.rb @@ -1,5 +1,7 @@ class AuthorsController < ApplicationController before_filter :authenticate_author!, :only => [:index, :show] + before_filter :authenticate_admin!, :only => [:list, :browse] + def index @authors = Author.all @@ -16,4 +18,20 @@ class AuthorsController < ApplicationController 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 diff --git a/app/views/authors/browse.html.erb b/app/views/authors/browse.html.erb new file mode 100644 index 00000000..86d0e794 --- /dev/null +++ b/app/views/authors/browse.html.erb @@ -0,0 +1,38 @@ +

<%= notice %>

+ +

+ name: + <%= h(@author.name) %> +

+ +

+ email: + <%= h(@author.email) %> +

+ +

+ sign_in_count: + <%= @author.sign_in_count %> +

+ +

+ current_sign_in_at: + <%= @author.current_sign_in_at %> +

+ +

+ last_sign_in_at: + <%= @author.last_sign_in_at %> +

+ +

+ current_sign_in_ip: + <%= @author.current_sign_in_ip %> +

+ +

+ last_sign_in_ip: + <%= @author.last_sign_in_ip %> +

+ +<%= link_to 'Back', :action => :list %> diff --git a/app/views/authors/list.html.erb b/app/views/authors/list.html.erb new file mode 100644 index 00000000..a5599796 --- /dev/null +++ b/app/views/authors/list.html.erb @@ -0,0 +1,31 @@ +

Listing authors

+ + + + + + + + + + + + + + + +<% @authors.each do |author| %> + + + + + + + + + + + + +<% end %> +
idnameemailsign_in_countcurrent_sign_in_atlast_sign_in_atcurrent_sign_in_iplast_sign_in_ipcreated_atupdated_at
<%= link_to author.id, :action => :show, :id => author.id %><%= h(author.name) %><%= h(author.email) %><%= author.sign_in_count %><%= author.current_sign_in_at %><%= author.last_sign_in_at %><%= author.current_sign_in_ip %><%= author.last_sign_in_ip %><%= author.created_at %><%= author.updated_at %>
diff --git a/app/views/comics/list.html.erb b/app/views/comics/list.html.erb index 33f07bfd..80453818 100644 --- a/app/views/comics/list.html.erb +++ b/app/views/comics/list.html.erb @@ -22,7 +22,7 @@ <%= comic.height %> <%= comic.visible %> <%= comic.editable %> - <%= link_to comic.author_id, :controller => '/comics', :action => :browse, :id => comic.author_id %> + <%= link_to comic.author_id, :controller => '/authors', :action => :browse, :id => comic.author_id %> <%= comic.created_at %> <%= comic.updated_at %> diff --git a/app/views/panels/list.html.erb b/app/views/panels/list.html.erb index 46b7b9a0..90f3ecc3 100644 --- a/app/views/panels/list.html.erb +++ b/app/views/panels/list.html.erb @@ -30,7 +30,7 @@ <%= panel.y %> <%= panel.z %> <%= panel.t %> - <%= panel.author_id %> + <%= link_to panel.author_id, :controller => '/authors', :action => :browse, :id => panel.author_id %> <%= panel.created_at %> <%= panel.updated_at %> diff --git a/app/views/system/browse.html.erb b/app/views/system/browse.html.erb index e70fb5db..d69f8180 100644 --- a/app/views/system/browse.html.erb +++ b/app/views/system/browse.html.erb @@ -61,6 +61,11 @@ + + +
+ <%= link_to 'authors', :controller => 'authors', :action => :list %> +
<%= link_to 'artists', :controller => 'artists', :action => :list %>