@panels = Panel.mylist(@author, @page, @page_size)
respond_to do |format|
- format.html # index.html.erb
+ format.html
format.json { render text: Panel.list_as_json_text(@panels) }
end
end
@panel = Panel.show(params[:id], [@user, @admin])
respond_to do |format|
- format.html # show.html.erb
+ format.html {
+ if @author
+ @new_comics = Comic.mylist(@author, 0, 5)
+ @fresh_comics = Story.mylist(@author, 0, 5).map {|s| s.comic}
+ end
+ }
format.json { render json: @panel.panel_elements_as_json }
format.jsonp {
render :json => "callback(" + @panel.panel_elements_as_json + ");"
@panel_count = Story.panel_count cnt, params[:count]
@stories = Story.play_list(@comic, @author, @offset, @panel_count)
respond_to do |format|
- format.html # index.html.erb
+ format.html {
+ if @author
+ @new_panels = Panel.mylist(@author, 0, 5)
+ end
+ }
format.json {render text: Story.list_as_json_text(@stories, @author)}
format.jsonp {
render :json => "callback(" + @stories.to_json_list + ");"
--- /dev/null
+<tr>
+ <td>
+ <%= link_to comic_icon(:object => comic, :size => 25), comic_path(comic) %>
+ <%= link_to h(truncate(comic.title, :length => 40)), :controller => 'stories', :action => :comic, :id => comic.id %>
+ (<%= comic.stories.size -%>)
+ </td>
+ <td>
+ <%= distance_of_time_in_words_to_now comic.updated_at %>
+ </td>
+ <td>
+ <%= link_to author_icon(:object => comic.author, :size => 25), comic_path(comic.author) %>
+ <%= link_to h(truncate(comic.author.name, :length => 12)), author_path(comic.author) %>
+ </td>
+ <td>
+ <% if comic.own? author %>
+ <% @story = Story.new :comic_id => comic.id, :panel_id => panel.id %>
+ <%= form_for(@story) do |f| %>
+ <%= f.hidden_field :comic_id %>
+ <%= f.hidden_field :t %>
+ <%= f.hidden_field :panel_id %>
+ <div class="actions">
+ <%= f.submit t('panels.show.append') %>
+ </div>
+ <% end %>
+ <% end %>
+ </td>
+</tr>
+<tr>
+ <td colspan="4">
+ <%= h(truncate(comic.description, :length => 40)) %>
+ </td>
+</tr>
<%= link_to t('link.edit'), edit_panel_path(@panel) %>
<%= link_to t('link.destroy'), panel_path(@panel), :method => :delete %>
+
+<h2><%= t('panels.show.new_comics') -%></h2>
+<table>
+ <% @new_comics.each do |comic| %>
+ <%= render 'append_comic', :panel => @panel, :comic => comic, :author => @author %>
+ <% end %>
+</table>
+<h2><%= t('panels.show.fresh_comics') -%></h2>
+<table>
+ <% @fresh_comics.each do |comic| %>
+ <%= render 'append_comic', :panel => @panel, :comic => comic, :author => @author %>
+ <% end %>
+</table>
--- /dev/null
+<tr>
+ <td>
+ <%= link_to panel_icon(:object => panel, :size => 25), panel_path(panel) %>
+ <%= link_to author_icon(:object => panel.author, :size => 17), author_path(panel.author) %>
+ </td>
+ <td>
+ <%= link_to h(truncate(h(panel.caption), :length => 40)), :controller => 'stories', :action => :comic, :id => comic.id %>
+ </td>
+ <td>
+ <%= l panel.updated_at %>
+ </td>
+ <td>
+ <% @story = Story.new :comic_id => comic.id, :panel_id => panel.id -%>
+ <%= form_for(@story) do |f| %>
+ <%= f.hidden_field :comic_id %>
+ <%= f.hidden_field :t %>
+ <%= f.hidden_field :panel_id %>
+ <%= f.submit t('stories.comic.append') %>
+ <% end %>
+ </td>
+</tr>
<%= render 'licensed_pictures', :licensed_pictures => Story.licensed_pictures(@stories) %>
<% end %>
<% if @comic.own? @author -%>
- <h3><%= t('stories.new.title') %></h3>
- <% @story = Story.new ; @story.comic_id = @comic.id ; @story.t = Story.new_t @comic.id -%>
- <%= form_for(@story) do |f| %>
-
- <div class="field">
- <%= f.hidden_field :comic_id %>
- </div>
- <div class="field">
- <%= f.label :t %><br />
- <%= f.number_field :t %>
- </div>
- <div class="field">
- <%= f.label :panel_id %><br />
- <%= f.number_field :panel_id %>
- </div>
-
- <div class="actions">
- <%= f.submit %>
- </div>
- <% end %>
+ <h3><%= t('stories.comic.new_panels') -%></h3>
+ <table>
+ <% @new_panels.each do |panel| %>
+ <%= render 'append_panel', :comic => @comic, :panel => panel, :author => @author %>
+ <% end %>
+ </table>
<% end %>
comic:
title: コミックを読む
empty: ストーリーはありません
+ append: このコマを追加する
+ new_panels: 最近作成したコマ
list:
title: ストーリー 生一覧
browse:
title: コマ一覧
show:
title: コマ詳細
+ append: このコミックに追加する
+ new_comics: 最近作成したコミック
+ fresh_comics: 最近更新したコミック
new:
title: コマ作成
edit: