end
end
- def picture
- @page = OriginalPicture.page params[:page]
- @page_size = OriginalPicture.page_size params[:page_size]
- @original_pictures = OriginalPicture.mylist(@artist.id, @page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @original_pictures.to_json(OriginalPicture.list_json_opt) }
- end
- end
-
def panel_picture
@page = Author.page params[:page]
@page_size = Author.panel_picture_page_size params[:page_size]
module ApplicationHelper
+ def full_url filename
+ request.protocol + request.host_with_port + filename
+ end
+
end
self.visible > 0
end
- def disp_visible
- visible == 1 ? 'O' : 'X'
- end
-
def self.default_page_size
25
end
end
def opt_img_tag
- {:src => self.url, :vPicture => self.id, :width => self.width.abs, :height => self.height.abs, :style => "top:#{self.y}px; left:#{self.x}px; z-index:#{self.z}; "}
+ {:src => self.url, :vPicture => self.id, :width => self.width.abs, :height => self.height.abs, :alt => self.caption, :style => "top:#{self.y}px; left:#{self.x}px; z-index:#{self.z}; "}
end
def tmb_opt_img_tag
tw, th = PettanImager.thumbnail_size(self.width.abs, self.height.abs)
- {:src => self.url, :width => tw, :height => th}
+ {:src => self.url, :width => tw, :height => th, :alt => self.caption}
end
def self.default_page_size
</div>
<div class="field">
<%= f.label :visible %><br />
- <%= f.collection_select :visible, [['only me', 0], ['everyone', 1]], :last, :first, :html => {:selected => @comic.visible} %>
+ <%= f.collection_select :visible, MagicNumber['comic_visible_items'], :last, :first, :html => {:selected => @comic.visible} %>
</div>
<div class="actions">
--- /dev/null
+<tr>
+ <td>
+ <%= link_to h(truncate(comic.title, :length => 40)), :controller => 'stories', :action => :comic, :id => comic.id %>
+ </td>
+ <td>
+ <%= link_to h(truncate(comic.author.name, :length => 12)), author_path(comic.author) %>
+ </td>
+ <td>
+ <%= comic.updated_at %>
+ </td>
+ <td>
+ <% if comic.own? author %>
+ <%= link_to 'edit', edit_comic_path(comic) %>
+ <%= link_to 'destroy', comic_path(comic), :method => :dellete %>
+ <% end %>
+ </td>
+</tr>
<h1>Listing comics</h1>
-<% @comics.each do |comic| %>
- <div>
- <div>
- <%= link_to h(comic.title), :controller => 'stories', :action => :comic, :id => comic.id %>
- </div>
- <div>
- 作家:<%= h comic.author.name %>
- 更新:<%= comic.updated_at %>
- </div>
- </div>
-<% end %>
+<table>
+ <tr>
+ <th>title</th>
+ <th>author</th>
+ <th>updated_at</th>
+ <th>edit</th>
+ </tr>
+ <% @comics.each do |comic| %>
+ <%= render 'list_item', :comic => comic, :author => @author %>
+ <% end %>
+</table>
<%= link_to 'new comic', new_comic_path %>
+++ /dev/null
-<h1><%= h @comic.title %></h1>
-<% if @comic.own? @author -%>
- <div>
- <%= link_to 'edit comic property', edit_comic_path(@comic), :remote => true %>
- </div>
- <div id="newcomic">
- </div>
-<% end -%>
-
-<% @comic.panels.each do |panel| %>
- <% @panel = panel %>
- <%= render 'panels/standard' %>
-<% end %>
-
-<%= link_to 'Back', comics_path %>
+<h1>コミックの表示</h1>
<p id="notice"><%= notice %></p>
<p>
<b>Title:</b>
- <%= h @comic.title %>
+ <%= link_to h(@comic.title), :controller => 'stories', :action => :comic, :id => @comic.id %>
</p>
<p>
</p>
<p>
- <b>author_id:</b>
- <%= @comic.author_id %>
+ <b>author:</b>
+ <%= link_to h(@comic.author.name), author_path(@comic.author) %>
</p>
<p>
<%= @comic.updated_at %>
</p>
+<%= link_to 'edit', edit_comic_path(@comic) %>
+
<%= link_to 'Back', comics_path %>
<%= render 'comics/form' %>
-<% @comics.each do |comic| %>
- <div>
- <div>
- <%= link_to h(comic.title), :controller => 'comics', :action => :play, :id => comic.id %>
- 一般投稿:<%= comic.disp_editable %>
- 公開:<%= comic.disp_visible %>
- </div>
- <div>
- 更新:<%= comic.updated_at %>
- </div>
- </div>
-<% end %>
+<table>
+ <tr>
+ <th>title</th>
+ <th>author</th>
+ <th>updated_at</th>
+ <th>edit</th>
+ </tr>
+ <% @comics.each do |comic| %>
+ <%= render 'comics/list_item', :comic => comic, :author => @author %>
+ <% end %>
+</table>
<%= render 'original_pictures/artist_register' %>
<% end -%>
</div>
-<%= link_to 'my comics', :action => :comic %>
-<%= link_to 'my panels', :action => :panel %>
-<%= link_to 'my pictures', :action => :picture %>
-<%= link_to 'my panel pictures', :action => :panel_picture %>
-<h1>Listing panels</h1>
+<h1>Listing My panels</h1>
<% @panels.each do |panel| %>
<div>
- <div>
- </div>
- <div>
- 更新:<%= panel.updated_at %>
- </div>
+ <%= render 'panels/standard', :panel => panel, :author => @author %>
</div>
<% end %>
<h1>Listing my panel pictures</h1>
+<table>
+ <tr>
+ <th>picture</th>
+ <th>credit</th>
+ <th>panel</th>
+ <th>link</th>
+ <th>x, y, z</th>
+ <th>t</th>
+ <th>WidthxHeight</th>
+ <th>vh</th>
+ <th>updated_at</th>
+ </tr>
+
<% @panel_pictures.each do |panel_picture| %>
- <div>
- <%= panel_picture.picture.filename %>
- <img src="<%= panel_picture.picture.url() -%>" width="<%= 44 -%>" height="<%= 44 -%>">
- <%= panel_picture.picture.width %>x<%= panel_picture.picture.height %>
- <%= panel_picture.picture.filesize %>bytes
- </div>
+ <%= render 'panel_pictures/list_item', :panel_picture => panel_picture %>
<% end %>
+</table>
+++ /dev/null
-<h1>Listing my pictures</h1>
-<%= render 'original_pictures/uploader' %>
-
-<% @original_pictures.each do |original_picture| %>
- <div>
- <%= original_picture.filename %>
- <img src="<%= original_picture.resource_picture.url('thumbnail') -%>">
- <%= original_picture.width %>x<%= original_picture.height %>
- <%= original_picture.filesize %>bytes
- </div>
-<% end %>
<div>\r
<% if user_signed_in? %>\r
<%= link_to "my home", '/home' %>\r
+ <%= link_to 'my comics', '/home/comic' %>\r
+ <%= link_to 'my panels', '/home/panel' %>\r
+ <%= link_to 'my pictures', main_app.original_pictures_path %>\r
+ <%= link_to 'my panel pictures', '/home/panel_picture' %>\r
+ <%= link_to 'configure', '/home/configure' %>\r
<%= link_to "sign out", main_app.destroy_user_session_path, :method => :delete %>\r
<% else %>\r
<%= link_to "sign in", main_app.new_user_session_path %>\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
--- /dev/null
+<tr>
+ <td><%= link_to(tag(:img, panel_picture.tmb_opt_img_tag), panel_picture.picture) %></td>
+ <td><%= render panel_picture.picture.credit_template, :picture => panel_picture.picture %></td>
+ <td><%= link_to panel_picture.panel.id, panel_path(panel_picture.panel) %></td>
+ <td><%= h panel_picture.link %></td>
+ <td><%= h panel_picture.caption %></td>
+ <td><%= panel_picture.x %>, <%= panel_picture.y %>, <%= panel_picture.z %></td>
+ <td><%= panel_picture.t %></td>
+ <td><%= panel_picture.width %>x<%= panel_picture.height %></td>
+ <td><%= panel_picture.flip %></td>
+ <td><%= panel_picture.updated_at %></td>
+</tr>
<table>
<tr>
- <th>id</th>
- <th>panel</th>
<th>picture</th>
+ <th>credit</th>
+ <th>panel</th>
<th>link</th>
+ <th>caption</th>
<th>x, y, z</th>
<th>t</th>
<th>WidthxHeight</th>
</tr>
<% @panel_pictures.each do |panel_picture| %>
- <tr>
- <td><%= panel_picture.id %></td>
- <td><%= panel_picture.panel_id %></td>
- <td><%= link_to(tag(:img, panel_picture.tmb_opt_img_tag), panel_picture.picture) %></td>
- <td><%= h panel_picture.link %></td>
- <td><%= panel_picture.x %>, <%= panel_picture.y %>, <%= panel_picture.z %></td>
- <td><%= panel_picture.t %></td>
- <td><%= panel_picture.width %>x<%= panel_picture.height %></td>
- <td><%= panel_picture.flip %></td>
- <td><%= panel_picture.updated_at %></td>
- </tr>
+ <%= render 'list_item', :panel_picture => panel_picture %>
<% end %>
</table>
<th>t</th>
<th>Width</th>
<th>Height</th>
+ <th>caption</th>
<th>created_at</th>
<th>updated_at</th>
</tr>
<td><%= panel_picture.t %></td>
<td><%= panel_picture.width %></td>
<td><%= panel_picture.height %></td>
+ <td><%= h panel_picture.caption %></td>
<td><%= panel_picture.created_at %></td>
<td><%= panel_picture.updated_at %></td>
</tr>
--- /dev/null
+<tr>
+ <td><%= link_to(tag(:img, panel_picture.tmb_opt_img_tag), panel_picture.picture) %></td>
+ <td><%= panel_picture.panel_id %></td>
+ <td><%= link_to panel_picture.panel_id, panel_path(panel_picture.panel) %></td>
+ <td><%= h panel_picture.link %></td>
+ <td><%= panel_picture.x %>, <%= panel_picture.y %>, <%= panel_picture.z %></td>
+ <td><%= panel_picture.t %></td>
+ <td><%= panel_picture.width %>x<%= panel_picture.height %></td>
+ <td><%= panel_picture.flip %></td>
+ <td><%= panel_picture.updated_at %></td>
+</tr>
<% case elm.class.to_s %>
<% when 'PanelPicture' %>
<%= tag(:img, elm.opt_img_tag) %>
- <% when Balloon %>
- <div id="vballoon<%= elm.id -%>" class="pettanr-comic-balloon" style="width:<%= elm.width -%>px; height:<%= elm.height -%>px; top:<%= elm.y -%>px; left:<%= elm.x -%>px; z-index:<%= elm.z -%>; ">
- <img src="<%= elm.system_picture.url -%>">
+ <% when 'SpeechBalloon' %>
+ <% balloon = elm.balloons.first %>
+ <div id="vballoon<%= elm.id -%>" class="pettanr-comic-balloon" style="width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; top:<%= balloon.y -%>px; left:<%= balloon.x -%>px; z-index:<%= elm.z -%>; ">
+ <img src="<%= balloon.system_picture.url -%>" alt="<%= balloon.caption -%>">
<% elm.speeches.each do |speech| %>
<p style="top:<%= speech.y -%>px; left:<%= speech.x -%>px;width:<%= speech.width -%>px; height:<%= speech.height -%>px;">
<span><%= h speech.content -%></span>
</p>
<% end %>
</div>
- <% end ; p elm.class %>
+ <% when 'GroundColor' %>
+ <div id="ground-color<%= elm.id -%>" class="pettanr-comic-ground-color" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-color:<%= elm.color.name -%>;">
+
+ </div>
+ <% when 'PanelColor' %>
+ <div id="panel-color<%= elm.id -%>" class="pettanr-comic-panel-color" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-color:#<%= format("%x", elm.code) -%>;">
+
+ </div>
+ <% when 'GroundPicture' %>
+ <div id="ground-picture<%= elm.id -%>" class="pettanr-comic-ground-picture" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-image: url(<%= full_url elm.picture.url -%>); ">
+
+ </div>
+ <% end %>
<% end %>
</div>
<table class="no-border">
<tr>
<td>
+ <%= link_to '■', panel_path(panel) %>
+ </td>
+ <td>
+ <%= link_to h(panel.author.name), author_path(panel.author) %>
+ </td>
+ <td>
<%= panel.width %>x<%= panel.height %>
</td>
<td>
<%= panel.updated_at %>
</td>
+ <td>
+ <% if panel.own? author %>
+ <%= link_to 'edit', edit_panel_path(panel) %>
+ <%= link_to 'destroy', panel_path(panel), :method => :dellete %>
+ <% end %>
+ </td>
</tr>
</table>
<%= form_tag( {:controller => 'panels',:action => "create"}) do %>
+ <% if @panel.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@panel.errors.count, "error") %> prohibited this panel from being saved:</h2>
+
+ <ul>
+ <% @panel.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
<label for="json">json data</label> <%= text_field_tag "json" %>
<%= submit_tag 'upload' -%>
<% end -%>
+++ /dev/null
-<table class="no-border">
- <tr>
- <td>
- ID:<%= link_to panel.id, panel_path(panel) %>
- </td>
- <td>
- <%= link_to h(panel.author.name), author_path(panel.author) %>
- </td>
- </tr>
-</table>
-<%= render 'panels/header', :panel => panel %>
-<%= render 'panels/body', :panel => panel %>
-<%= render 'panels/footer', :panel => panel %>
+<%= render 'panels/body', :panel => panel, :author => author %>
+<%= render 'panels/footer', :panel => panel, :author => author %>
<%= render 'panels/licensed_pictures', :licensed_pictures => panel.licensed_pictures %>
+<h1>コマの編集</h1>
+<%= render 'standard', :panel => @panel, :author => @author %>
<%= render 'form' %>
<h1>Listing panels 最近の投稿</h1>
<% @panels.each do |panel| %>
- <%= render 'standard', :panel => panel %>
+ <%= render 'standard', :panel => panel, :author => @author %>
<% end %>
<%= link_to 'open form', new_panel_path, :remote => true %>
<div id="newpanel">
- uploader
+ ...
</div>
+<h1>コマの新規作成</h1>
<%= render 'form' %>
- <% if @panel.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@panel.errors.count, "error") %> prohibited this panel from being saved:</h2>
-
- <ul>
- <% @panel.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
+<h1>コマの表示</h1>
<p id="notice"><%= notice %></p>
-<%= render 'standard', :panel => @panel %>
+<%= render 'standard', :panel => @panel, :author => @author %>
<%= link_to 'Back', panels_path %>
+++ /dev/null
-<table class="no-border">
- <tr>
- <td>
- <%= story.panel.width %>x<%= story.panel.height %>
- </td>
- <td>
- <%= story.panel.updated_at %>
- </td>
- </tr>
-</table>
<table class="no-border">
<tr>
<td>
- No.<%= link_to story.t, story_path(story) %>
+ No.<%= link_to story.t, story_path(story) %>:
</td>
<td>
<%= link_to h(story.panel.author.name), author_path(story.panel.author) %>
</td>
<td>
- ID:<%= link_to story.panel.id, panel_path(story.panel) %>
+ <%= story.updated_at %>
+ </td>
+ <td>
+ <% if story.own? @author -%>
+ <%= link_to 'edit', edit_story_path(story), :remote => true %>
+ <span id="story-update-<%= @story.id -%>">
+ ...
+ </span>
+ <% end -%>
</td>
</tr>
</table>
-<h1><%= h @comic.title %></h1>
+<h1><%= h @comic.title %> <%= link_to 'p', comic_path(@comic) %> <%= link_to 'edit', edit_comic_path(@comic) %></h1>
<% @stories.each do |story| %>
<% @story = story %>
- <%= render 'header', :story => story %>
- <%= render 'panels/body', :panel => story.panel %>
- <%= render 'footer', :story => story %>
- <% if story.own? @author -%>
- <%= link_to 'move', edit_story_path(story), :remote => true %>
- <span id="story-update-<%= @story.id -%>">
- t
- </span>
- <% end -%>
+ <%= render 'header', :story => story, :author => @author %>
+ <%= render 'panels/body', :panel => story.panel, :author => @author %>
+ <%= render 'panels/footer', :panel => story.panel, :author => @author %>
<% end %>
<%= render 'licensed_pictures', :licensed_pictures => Story.licensed_pictures(@stories) %>
-<h1><%= h @comic.title %></h1>
<% if @comic.own? @author -%>
<%= link_to 'add panel', new_story_path, :remote => true %>
<div id="story-create">
thumbnail_width: 64
thumbnail_height: 64
+
+ comic_visible_items: [['private', 0], ['public', 1]]
--- /dev/null
+class AddCaptionOnPanelPictures < ActiveRecord::Migration
+ def up
+ add_column :panel_pictures, :caption, :string
+ end
+
+ def down
+ remove_column :panel_pictures, :caption
+ end
+end
"new1": {\r
"picture_id": 3,\r
"x": 10,\r
- "y": 135,\r
+ "y": 85,\r
"z": 3,\r
"t": 0,\r
"width": 100,\r
- "height": 103\r
+ "height": 103,\r
+ "caption": "penjiro doing"\r
}\r
},\r
- "ground_pictures_attributes": {\r
+ "speech_balloons_attributes": {\r
"new1": {\r
- "picture_id": 1,\r
- "z": 1\r
+ "speech_balloon_template_id": 1,\r
+ "classname": "Square",\r
+ "z": 1,\r
+ "t": 1,\r
+ "balloons_attributes": {\r
+ "new1": {\r
+ "system_picture_id": 4,\r
+ "x": 110,\r
+ "y": 15,\r
+ "width": 100,\r
+ "height": 43,\r
+ "caption": "penjiro said"\r
+ }\r
+ },\r
+ "speeches_attributes": {\r
+ "new1": {\r
+ "x": 10,\r
+ "y": 135,\r
+ "width": 100,\r
+ "height": 103,\r
+ "content": "Washoy"\r
+ }\r
+ }\r
}\r
},\r
"ground_colors_attributes": {\r
"new1": {\r
- "color_id": 1,\r
- "z": 1\r
- }\r
- },\r
- "panel_colors_attributes": {\r
- "new1": {\r
- "code": 1,\r
- "z": 1\r
+ "color_id": 2,\r
+ "z": 4\r
}\r
}\r
},\r
--- /dev/null
+{\r
+ "panel": {\r
+ "width": 400,\r
+ "height": 200,\r
+ "border": 1,\r
+ "x": 0,\r
+ "y": 0,\r
+ "z": 1,\r
+ "publish": 1,\r
+ "panel_pictures_attributes": {\r
+ "new1": {\r
+ "picture_id": 3,\r
+ "x": 10,\r
+ "y": 135,\r
+ "z": 3,\r
+ "t": 0,\r
+ "width": 100,\r
+ "height": 103\r
+ }\r
+ },\r
+ "ground_pictures_attributes": {\r
+ "new1": {\r
+ "picture_id": 5,\r
+ "z": 1\r
+ }\r
+ }\r
+ },\r
+ "auth_token": "3fhobSVvDxjUSUPSKy5y"\r
+}
\ No newline at end of file
--- /dev/null
+{\r
+ "panel": {\r
+ "width": 400,\r
+ "height": 200,\r
+ "border": 1,\r
+ "x": 0,\r
+ "y": 0,\r
+ "z": 1,\r
+ "publish": 1,\r
+ "panel_pictures_attributes": {\r
+ "new1": {\r
+ "picture_id": 3,\r
+ "x": 10,\r
+ "y": 135,\r
+ "z": 3,\r
+ "t": 0,\r
+ "width": 100,\r
+ "height": 103\r
+ }\r
+ },\r
+ "panel_colors_attributes": {\r
+ "new1": {\r
+ "code": 10526848,\r
+ "z": 1\r
+ }\r
+ }\r
+ },\r
+ "auth_token": "3fhobSVvDxjUSUPSKy5y"\r
+}
\ No newline at end of file