end
before_filter :authenticate_admin!, :only => [:list, :browse]
+ def index
+ @page = Story.page params[:page]
+ @page_size = Story.page_size params[:page_size]
+ @stories = Story.list(@page, @page_size)
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render :json => @stories.to_json(Story.list_json_opt) }
+ end
+ end
+
def show
@story = Story.show(params[:id], @author)
}}
end
+ def self.default_page_size
+ 25
+ end
+
+ def self.max_page_size
+ 100
+ end
+
+ def self.page prm = nil
+ page = prm.to_i
+ page = 1 if page < 1
+ page
+ end
+
+ def self.page_size prm = self.default_page_size
+ page_size = prm.to_i
+ page_size = self.max_page_size if page_size > self.max_page_size
+ page_size = self.default_page_size if page_size < 1
+ page_size
+ end
+
+ def self.list page = 1, page_size = self.default_page_size
+ opt = {}
+ opt.merge!(self.list_opt)
+ opt.merge!({:limit => page_size, :offset => (page -1) * page_size}) if page_size > 0
+ opt.merge!({:order => 'updated_at desc'})
+ Story.find(:all, opt)
+ end
+
def self.mylist au, page = 1, page_size = Author.default_story_page_size
opt = {}
opt.merge!(Story.list_opt)
+<h1><%= t '.title' -%></h1>\r
+\r
+<h2><%= t('comics.top.user_resources') -%></h2>\r
+<table>\r
+ <tr height="100px">\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('Comic'), main_app.comics_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('Story'), main_app.stories_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('Panel'), main_app.panels_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('ResourcePicture'), main_app.resource_pictures_path %>\r
+ </td>\r
+ </tr>\r
+ <tr height="100px">\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('PanelPicture'), main_app.panel_pictures_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('GroundPicture'), main_app.ground_pictures_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('GroundColor'), main_app.ground_colors_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('PanelColor'), main_app.panel_colors_path %>\r
+ </td>\r
+ </tr>\r
+</table>\r
+<h2><%= t('comics.top.human_resources') -%></h2>\r
+<table>\r
+ <tr height="100px">\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('Author'), main_app.authors_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('Artist'), main_app.artists_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ </td>\r
+ </tr>\r
+</table>\r
+<h2><%= t('comics.top.system_resources') -%></h2>\r
+<table>\r
+ <tr height="100px">\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('SpeechBalloonTemplate'), main_app.speech_balloon_templates_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('LicenseGroup'), main_app.license_groups_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('License'), main_app.licenses_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('Color'), main_app.colors_path %>\r
+ </td>\r
+ </tr>\r
+ <tr height="100px">\r
+ <td width="200px" align="center" valign="middle">\r
+ <%= link_to t_m('SystemPicture'), main_app.system_pictures_path %>\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ </td>\r
+ <td width="200px" align="center" valign="middle">\r
+ </td>\r
+ </tr>\r
+</table>\r
-<h1>Listing Ground Colors</h1>
+<h1><%= t '.title' -%></h1>
<table>
<tr>
- <th>id</th>
- <th>panel_id</th>
- <th>color_id</th>
- <th>z</th>
+ <th><%= t_m 'GroundColor.color_id' -%></th>
+ <th><%= t_m 'GroundColor.panel_id' -%></th>
+ <th><%= t_m 'GroundColor.z' -%></th>
+ <th><%= t_m 'GroundColor.updated_at' -%></th>
</tr>
-<% @ground_colors.each do |gc| %>
- <tr>
- <td><%= gc.id %></td>
- <td><%= link_to gc.panel_id, panel_path(gc.panel_id) %></td>
- <td><%= link_to gc.color_id, color_path(gc.color_id) %></td>
- <td><%= gc.z %></td>
- </tr>
-<% end -%>
+ <% @ground_colors.each do |gc| %>
+ <%= render 'ground_colors/list_item', :ground_color => gc, :author => @author %>
+ <% end -%>
</table>
-<h1><%= h(@author.name) -%>(<%= h(@user.email) -%>)</h1>
+<h1><%= t '.title' -%></h1>
-<div>
-<p>絵師活動</p>
+<h2><%= link_to h(@author.name), main_app.author_path(@author) -%></h2>
+<h3><%= t('.updated_comic') -%></h3>
+<table>
+ <tr height="100px">
+ <td width="200px" align="center" valign="middle">
+ <%= link_to t_m('Comic'), '/home/comic' %>
+ </td>
+ <td width="200px" align="center" valign="middle">
+ <%= link_to t_m('Story'), '/home/story' %>
+ </td>
+ <td width="200px" align="center" valign="middle">
+ <%= link_to t_m('Panel'), '/home/panel' %>
+ </td>
+ <td width="200px" align="center" valign="middle">
+ </td>
+ </tr>
+</table>
+<h3><%= t('.used_element') -%></h3>
+<table>
+ <tr height="100px">
+ <td width="200px" align="center" valign="middle">
+ <%= link_to t_m('PanelPicture'), '/home/panel_picture' %>
+ </td>
+ <td width="200px" align="center" valign="middle">
+ <%= link_to t_m('GroundPicture'), '/home/ground_picture' %>
+ </td>
+ <td width="200px" align="center" valign="middle">
+ <%= link_to t_m('GroundColor'), '/home/ground_color' %>
+ </td>
+ <td width="200px" align="center" valign="middle">
+ <%= link_to t_m('PanelColor'), '/home/panel_color' %>
+ </td>
+ </tr>
+</table>
<% if @author.artist? -%>
- <%= link_to h(@author.artist.name), @author.artist %>です
+ <h2><%= link_to h(@artist.name), main_app.artist_path(@artist) -%></h2>
+ <h3><%= t('.updated_picture') -%></h3>
+ <table>
+ <tr height="100px">
+ <td width="200px" align="center" valign="middle">
+ <%= link_to t_m('OriginalPicture'), main_app.original_pictures_path %>
+ </td>
+ <td width="200px" align="center" valign="middle">
+ <%= %>
+ </td>
+ <td width="200px" align="center" valign="middle">
+ <%= %>
+ </td>
+ <td width="200px" align="center" valign="middle">
+ <%= %>
+ </td>
+ </tr>
+ </table>
<% else -%>
- <p>まだ絵師登録していません。</p>
- <p>登録する</p>
- <%= render 'original_pictures/artist_register' %>
+ <h2><%= t('artist.noregister') -%></h2>
<% end -%>
-</div>
</head>\r
<body>\r
\r
-<div>\r
-<% if user_signed_in? %>\r
- <%= link_to t('home.index.title'), '/home' %>\r
- <%= link_to t('home.comic.title'), '/home/comic' %>\r
- <%= link_to t('home.panel.title'), '/home/panel' %>\r
- <%= link_to t('home.panel_picture.title'), '/home/panel_picture' %>\r
- <%= link_to h(truncate(@author.name, :length => 12)), main_app.author_path(@author) %>\r
- <% if @artist %>\r
- <%= link_to t('home.picture.title'), main_app.original_pictures_path %>\r
- <%= link_to h(truncate(@artist.name, :length => 12)), main_app.artist_path(@artist) %>\r
- <% end %>\r
- <%= link_to t('home.configure.title'), '/home/configure' %>\r
- <%= link_to t('home.sign_out.title'), main_app.destroy_user_session_path, :method => :delete %>\r
-<% else %>\r
- <%= link_to "sign in", main_app.new_user_session_path %>\r
-<% end %>\r
-</div>\r
-<div>\r
-<% if admin_signed_in? %>\r
- <%= link_to "system", '/system' %>\r
- <%= link_to "browse", '/system/browse' %>\r
- <%= link_to "approve", '/system/waiting_list' %>\r
- <%= link_to "token", '/system/auth_token' %>\r
- layout:\r
- <%= link_to "test", '/system/test_layout' %>\r
- <%= link_to "production", '/system/production_layout' %>\r
- <%= link_to "sign out", main_app.destroy_admin_session_path, :method => :delete %>\r
-<% else %>\r
- <%= link_to "sign in", main_app.new_admin_session_path %>\r
-<% end %>\r
+<div width="100%">\r
+<table class="no-border">\r
+ <tr>\r
+ <td width="80%">\r
+ <h3>PettanR</h3>\r
+ </td>\r
+ <td>\r
+ <div>\r
+ <%= link_to h(truncate(@author.name, :length => 12)), main_app.author_path(@author) %>\r
+ </div>\r
+ <div>\r
+ <% if @artist %>\r
+ <%= link_to h(truncate(@artist.name, :length => 12)), main_app.artist_path(@artist) %>\r
+ <% end %>\r
+ </div>\r
+ </td>\r
+ <td>\r
+ <%= link_to t('home.configure.title'), '/home/configure' %>\r
+ <%= link_to t('home.sign_out.title'), main_app.destroy_user_session_path, :method => :delete %>\r
+ </td>\r
+ </tr>\r
+</table>\r
</div>\r
-<div>\r
-user.resources\r
-<%= link_to t_m('Comic'), main_app.comics_path %>\r
-<%= link_to t_m('Story'), main_app.new_story_path %>\r
-<%= link_to t_m('Panel'), main_app.panels_path %>\r
-<%= link_to t_m('ResourcePicture'), main_app.resource_pictures_path %>\r
-<%= link_to t_m('PanelPicture'), main_app.panel_pictures_path %>\r
-<%= link_to t_m('GroundPicture'), main_app.ground_pictures_path %>\r
-<%= link_to t_m('GroundColor'), main_app.ground_colors_path %>\r
-<%= link_to t_m('PanelColor'), main_app.panel_colors_path %>\r
- : \r
-<%= link_to t_m('Author'), main_app.authors_path %>\r
-<%= link_to t_m('Artist'), main_app.artists_path %>\r
+<div width="100%" style="background-color: #ddfadd; padding: 5px;">\r
+ <%= link_to t('tab.reader.title'), '/' %>\r
+ <%= link_to t_m('Comic'), main_app.comics_path %>\r
+ <%= link_to t_m('Panel'), main_app.panels_path %>\r
+ <%= link_to t_m('ResourcePicture'), main_app.resource_pictures_path %>\r
+ : \r
+ <%= link_to t_m('Author'), main_app.authors_path %>\r
+ <%= link_to t_m('Artist'), main_app.artists_path %>\r
</div>\r
-<div>\r
-system.resources\r
-<%= link_to 'speech_balloon_templates', main_app.speech_balloon_templates_path %>\r
-<%= link_to 'license_groups', main_app.license_groups_path %>\r
-<%= link_to 'licenses', main_app.licenses_path %>\r
-<%= link_to 'colors', main_app.colors_path %>\r
-<%= link_to 'system_pictures', main_app.system_pictures_path %>\r
+<div width="100%" style="background-color: #fadddd; padding: 5px;">\r
+ <% if user_signed_in? %>\r
+ <%= link_to t('tab.creator.home'), '/home' %>\r
+ <%= link_to t('tab.creator.comic'), '/home/comic' %>\r
+ <%= link_to t('tab.creator.panel'), '/home/panel' %>\r
+ <% if @artist %>\r
+ <%= link_to t('tab.creator.picture'), main_app.original_pictures_path %>\r
+ <% end %>\r
+ <% else %>\r
+ <%= link_to "sign in", main_app.new_user_session_path %>\r
+ <% end %>\r
</div>\r
<%= yield %>\r
+<div width="100%" style="background-color: #ddddfa; padding: 5px;">\r
+ <% if admin_signed_in? %>\r
+ <%= link_to t('tab.system.title'), '/system' %>\r
+ <%= link_to "browse", '/system/browse' %>\r
+ <%= link_to "approve", '/system/waiting_list' %>\r
+ <%= link_to "token", '/system/auth_token' %>\r
+ layout:\r
+ <%= link_to "test", '/system/test_layout' %>\r
+ <%= link_to "production", '/system/production_layout' %>\r
+ <%= link_to "sign out", main_app.destroy_admin_session_path, :method => :delete %>\r
+ <% else %>\r
+ <%= link_to "sign in", main_app.new_admin_session_path %>\r
+ <% end %>\r
+</div>\r
<%= javascript_tag 'var server_result=' + @server_result.to_json + ';' %>\r
\r
</body>\r
- <%= render 'panels/standard', :panel => @story.panel %>
+ <%= render 'panels/standard', :panel => @story.panel, :author => @author %>
<% if @story.author.id == @author.id -%>
<span>
t:<%= @story.t %>
home:
index:
title: ホーム
+ updated_comic: 最近更新した漫画
+ used_element: 最近使った部品
+ updated_picture: 最近更新した画像
comic:
- title: コミック
+ title: 最近更新したコミック
panel:
- title: コマ
+ title: 最近更新したコマ
picture:
- title: 原画
+ title: 最近更新した原画
panel_picture:
- title: コマ絵
+ title: 最近使ったコマ絵
+ ground_picture:
+ title: 最近使った絵地
+ ground_color:
+ title: 最近選択した色地
+ panel_color:
+ title: 最近指定した色地
configure:
title: 設定
sign_out:
title: コミック 生一覧
browse:
title: コミック 生単票
+ top:
+ title: 読む・探す
+ user_resources: 発表作品から
+ human_resources: 人物から
+ system_resources: システムリソースから
stories:
index:
title: ストーリー一覧
destroy: 削除
back: 戻る
marker: ■
+ tab:
+ creator:
+ home: 作る・見せる
+ comic: コミック
+ panel: コマ
+ picture: 原画
+ reader:
+ title: 読む・探す
+ system:
+ title: 管理者メンテナンス
end
resources :speeches do
collection do
+ get :index
+ get :show
get :list
end
member do
end
resources :balloons do
collection do
+ get :index
+ get :show
get :list
end
member do
end
resources :speech_balloons do
collection do
+ get :index
+ get :show
get :list
end
member do
resources :resource_pictures do
collection do
get :index
- get :new
get :show
+ get :new
post :create
get :count
get :list
resources :colors do
collection do
get :index
+ get :show
get :list
end
member do
resources :panel_colors do
collection do
get :index
+ get :show
end
member do
get :browse
resources :ground_colors do
collection do
get :index
+ get :show
end
member do
get :browse
resources :ground_pictures do
collection do
get :index
+ get :show
end
member do
get :browse
get :new
end
collection do
+ get :index
get :show
post :create
get :list