OSDN Git Service

t#30009:fix views
authoryasushiito <yas@pen-chan.jp>
Tue, 6 Nov 2012 09:27:57 +0000 (18:27 +0900)
committeryasushiito <yas@pen-chan.jp>
Tue, 6 Nov 2012 09:27:57 +0000 (18:27 +0900)
36 files changed:
app/controllers/home_controller.rb
app/helpers/application_helper.rb
app/models/comic.rb
app/models/panel_picture.rb
app/views/comics/_form.html.erb
app/views/comics/_list_item.html.erb [new file with mode: 0644]
app/views/comics/index.html.erb
app/views/comics/play.html.erb [deleted file]
app/views/comics/show.html.erb
app/views/home/comic.html.erb
app/views/home/index.html.erb
app/views/home/panel.html.erb
app/views/home/panel_picture.html.erb
app/views/home/picture.html.erb [deleted file]
app/views/layouts/test.html.erb
app/views/panel_pictures/_list_item.html.erb [new file with mode: 0644]
app/views/panel_pictures/index.html.erb
app/views/panel_pictures/list.html.erb
app/views/panel_pictures/list_item.html.erb [new file with mode: 0644]
app/views/panels/_body.html.erb
app/views/panels/_footer.html.erb
app/views/panels/_form.html.erb
app/views/panels/_header.html.erb [deleted file]
app/views/panels/_standard.html.erb
app/views/panels/edit.html.erb
app/views/panels/index.html.erb
app/views/panels/new.html.erb
app/views/panels/show.html.erb
app/views/stories/_footer.html.erb [deleted file]
app/views/stories/_header.html.erb
app/views/stories/comic.html.erb
config/magic_number.yml
db/migrate/20121106083518_add_caption_on_panel_pictures.rb [new file with mode: 0644]
spec/cli/u/panels/create.json
spec/cli/u/panels/create_gp.json [new file with mode: 0644]
spec/cli/u/panels/create_pc.json [new file with mode: 0644]

index fdc3fe3..83142c5 100644 (file)
@@ -90,17 +90,6 @@ class HomeController < ApplicationController
     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]
index de6be79..b3709d1 100644 (file)
@@ -1,2 +1,6 @@
 module ApplicationHelper
+  def full_url filename
+    request.protocol + request.host_with_port + filename
+  end
+  
 end
index 7802ba5..f32b0bd 100644 (file)
@@ -31,10 +31,6 @@ class Comic < ActiveRecord::Base
     self.visible > 0
   end
   
-  def disp_visible
-    visible == 1 ? 'O' : 'X'
-  end
-  
   def self.default_page_size
     25
   end
index 47b293e..31c4305 100644 (file)
@@ -27,12 +27,12 @@ class PanelPicture < ActiveRecord::Base
   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
index 636f7fd..c547013 100644 (file)
@@ -17,7 +17,7 @@
   </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">
diff --git a/app/views/comics/_list_item.html.erb b/app/views/comics/_list_item.html.erb
new file mode 100644 (file)
index 0000000..532ca64
--- /dev/null
@@ -0,0 +1,17 @@
+<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>
index 246b92e..0fdac37 100644 (file)
@@ -1,14 +1,14 @@
 <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 %>
diff --git a/app/views/comics/play.html.erb b/app/views/comics/play.html.erb
deleted file mode 100644 (file)
index 2134033..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<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 %>
index 1515429..83b669f 100644 (file)
@@ -1,8 +1,9 @@
+<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>
@@ -11,8 +12,8 @@
 </p>
 
 <p>
-  <b>author_id:</b>
-  <%= @comic.author_id %>
+  <b>author:</b>
+  <%= link_to h(@comic.author.name), author_path(@comic.author) %>
 </p>
 
 <p>
@@ -20,4 +21,6 @@
   <%= @comic.updated_at %>
 </p>
 
+<%= link_to 'edit', edit_comic_path(@comic) %>
+
 <%= link_to 'Back', comics_path %>
index f608802..687265c 100644 (file)
@@ -3,15 +3,14 @@
 
 <%= 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>
index 85659b5..26ddf73 100644 (file)
@@ -10,7 +10,3 @@
     <%= 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 %>
index 3afba88..d0aa666 100644 (file)
@@ -1,11 +1,7 @@
-<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 %>
index 0770b64..88801c9 100644 (file)
@@ -1,10 +1,19 @@
 <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>
diff --git a/app/views/home/picture.html.erb b/app/views/home/picture.html.erb
deleted file mode 100644 (file)
index 403add7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<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 %>
index 017ef84..64b5dfe 100644 (file)
 <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
diff --git a/app/views/panel_pictures/_list_item.html.erb b/app/views/panel_pictures/_list_item.html.erb
new file mode 100644 (file)
index 0000000..0bd0af4
--- /dev/null
@@ -0,0 +1,12 @@
+<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>
index d0ba00b..21f5124 100644 (file)
@@ -2,10 +2,11 @@
 
 <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>
index 640c79b..ed929ca 100644 (file)
@@ -12,6 +12,7 @@
     <th>t</th>
     <th>Width</th>
     <th>Height</th>
+    <th>caption</th>
     <th>created_at</th>
     <th>updated_at</th>
   </tr>
@@ -28,6 +29,7 @@
     <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>
diff --git a/app/views/panel_pictures/list_item.html.erb b/app/views/panel_pictures/list_item.html.erb
new file mode 100644 (file)
index 0000000..9f0fa4c
--- /dev/null
@@ -0,0 +1,11 @@
+<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>
index 0b622fa..ce1d04b 100644 (file)
@@ -3,15 +3,28 @@
     <% 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>
index b1c8efc..b77c9ce 100644 (file)
@@ -1,10 +1,22 @@
 <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>
index b3f0c10..08e6d60 100644 (file)
@@ -1,4 +1,15 @@
 <%= 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 -%>
diff --git a/app/views/panels/_header.html.erb b/app/views/panels/_header.html.erb
deleted file mode 100644 (file)
index 3aed425..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<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>
index 778ac0f..02c0dfd 100644 (file)
@@ -1,5 +1,4 @@
-<%= 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 %>
 
index 2d34363..208c00d 100644 (file)
@@ -1 +1,3 @@
+<h1>コマの編集</h1>
+<%= render 'standard', :panel => @panel, :author => @author %>
 <%= render 'form' %>
index 8fd3127..a46a178 100644 (file)
@@ -1,8 +1,8 @@
 <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>
index 2d34363..2e796ef 100644 (file)
@@ -1 +1,2 @@
+<h1>コマの新規作成</h1>
 <%= render 'form' %>
index 02df25f..90a1de8 100644 (file)
@@ -1,15 +1,5 @@
-  <% 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 %>
diff --git a/app/views/stories/_footer.html.erb b/app/views/stories/_footer.html.erb
deleted file mode 100644 (file)
index d850cd8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<table class="no-border">
-  <tr>
-    <td>
-      <%= story.panel.width %>x<%= story.panel.height %>
-    </td>
-    <td>
-      <%= story.panel.updated_at %>
-    </td>
-  </tr>
-</table>
index 103f960..50b563b 100644 (file)
@@ -1,13 +1,21 @@
 <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>
index 2801f31..305621d 100644 (file)
@@ -1,19 +1,12 @@
-<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">
index 7412f3f..e8e218d 100644 (file)
@@ -2,3 +2,5 @@
 
   thumbnail_width: 64
   thumbnail_height: 64
+
+  comic_visible_items: [['private', 0], ['public', 1]]
diff --git a/db/migrate/20121106083518_add_caption_on_panel_pictures.rb b/db/migrate/20121106083518_add_caption_on_panel_pictures.rb
new file mode 100644 (file)
index 0000000..178c493
--- /dev/null
@@ -0,0 +1,9 @@
+class AddCaptionOnPanelPictures < ActiveRecord::Migration
+  def up
+    add_column :panel_pictures, :caption, :string
+  end
+
+  def down
+    remove_column :panel_pictures, :caption
+  end
+end
index a9d642c..3cd2188 100644 (file)
       "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
diff --git a/spec/cli/u/panels/create_gp.json b/spec/cli/u/panels/create_gp.json
new file mode 100644 (file)
index 0000000..4c197be
--- /dev/null
@@ -0,0 +1,29 @@
+{\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
diff --git a/spec/cli/u/panels/create_pc.json b/spec/cli/u/panels/create_pc.json
new file mode 100644 (file)
index 0000000..f0d68f5
--- /dev/null
@@ -0,0 +1,29 @@
+{\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