From 36ac8638f694fae1e05a436048c14fa66c0df94c Mon Sep 17 00:00:00 2001 From: yasushiito Date: Wed, 4 Jan 2012 18:44:43 +0900 Subject: [PATCH] replace codes --- app/controllers/panels_controller.rb | 2 +- app/controllers/speach_balloons_controller.rb | 6 +++--- app/models/panel_picture.rb | 2 +- app/views/balloon_templates/index.html.erb | 4 ++-- app/views/balloons/index.html.erb | 12 ++++++------ app/views/comics/index.html.erb | 4 ++-- app/views/comics/play.html.erb | 4 ++-- app/views/comics/show.html.erb | 4 ++-- app/views/panel_pictures/index.html.erb | 8 ++++---- app/views/panels/_standard.html.erb | 6 +++--- app/views/speach_balloons/index.html.erb | 6 +++--- app/views/speach_balloons/show.html.erb | 8 ++++---- app/views/speach_templates/index.html.erb | 4 ++-- app/views/speaches/index.html.erb | 4 ++-- 14 files changed, 37 insertions(+), 37 deletions(-) diff --git a/app/controllers/panels_controller.rb b/app/controllers/panels_controller.rb index e0a7789e..d35751c0 100644 --- a/app/controllers/panels_controller.rb +++ b/app/controllers/panels_controller.rb @@ -38,7 +38,7 @@ class PanelsController < ApplicationController }) + ");" } # format.json { render :json => @frame.to_json(include: { -# :comic => {:only => :title}, :panel_pictures => {:include => {:image => {:only => [:width]}},:only => [:width, :height, :zindex, :image_id]} +# :comic => {:only => :title}, :panel_pictures => {:include => {:image => {:only => [:width]}},:only => [:width, :height, :z, :image_id]} # }, only: [:border]) } end end diff --git a/app/controllers/speach_balloons_controller.rb b/app/controllers/speach_balloons_controller.rb index 54d0f298..1eeba3d3 100644 --- a/app/controllers/speach_balloons_controller.rb +++ b/app/controllers/speach_balloons_controller.rb @@ -6,8 +6,8 @@ class SpeachBalloonsController < ApplicationController def validate_param(ft) res = nil - bl = ft[:border_limit].to_i - tl = ft[:tail_limit].to_i + bl = ft[:size_count].to_i + tl = ft[:tail_count].to_i if bl * tl == ft[:balloon_templates_attributes].size flag = [] bl.times do |i| @@ -17,7 +17,7 @@ class SpeachBalloonsController < ApplicationController end end ft[:balloon_templates_attributes].each do |k, t| - flag[t[:border].to_i - 1][t[:tail].to_i - 1] = nil + flag[t[:size].to_i - 1][t[:tail].to_i - 1] = nil end if flag.flatten.compact.size == 0 else diff --git a/app/models/panel_picture.rb b/app/models/panel_picture.rb index 426248c0..0bc67340 100644 --- a/app/models/panel_picture.rb +++ b/app/models/panel_picture.rb @@ -3,7 +3,7 @@ class PanelPicture < ActiveRecord::Base belongs_to :resource_picture def flip - res = (self.v == 0 ? '' : 'v') + (self.h == 0 ? '' : 'h') + res = (self.flipv == 0 ? '' : 'v') + (self.fliph == 0 ? '' : 'h') res += '/' unless res.empty? res end diff --git a/app/views/balloon_templates/index.html.erb b/app/views/balloon_templates/index.html.erb index 45f2e0df..7e59e7d0 100644 --- a/app/views/balloon_templates/index.html.erb +++ b/app/views/balloon_templates/index.html.erb @@ -5,7 +5,7 @@ speach balloon system_picture Tail - Border + size MinWidth MinHeight MaxWidth @@ -17,7 +17,7 @@ <%= balloon_template.speach_balloon_id %> <%= balloon_template.system_picture_id %> <%= balloon_template.tail %> - <%= balloon_template.border %> + <%= balloon_template.size %> <%= balloon_template.min_width %> <%= balloon_template.min_height %> <%= balloon_template.max_width %> diff --git a/app/views/balloons/index.html.erb b/app/views/balloons/index.html.erb index bf0f8d27..48994b7b 100644 --- a/app/views/balloons/index.html.erb +++ b/app/views/balloons/index.html.erb @@ -6,8 +6,8 @@ balloonTemplate system_picture Tail - Border - Zindex + size + z Top offset Left offset Width @@ -20,10 +20,10 @@ <%= balloon.balloon_template_id %> <%= balloon.system_picture_id %> <%= balloon.tail %> - <%= balloon.border %> - <%= balloon.zindex %> - <%= balloon.top_offset %> - <%= balloon.left_offset %> + <%= balloon.size %> + <%= balloon.z %> + <%= balloon.y %> + <%= balloon.x %> <%= balloon.width %> <%= balloon.height %> diff --git a/app/views/comics/index.html.erb b/app/views/comics/index.html.erb index 022e342a..508620e8 100644 --- a/app/views/comics/index.html.erb +++ b/app/views/comics/index.html.erb @@ -17,8 +17,8 @@ <%= comic.id %> <%= h comic.title %> - <%= comic.default_width %> - <%= comic.default_height %> + <%= comic.width %> + <%= comic.height %> <%= comic.author_id%> <%= comic.updated_at %> <%= link_to 'Show', comic %> diff --git a/app/views/comics/play.html.erb b/app/views/comics/play.html.erb index c038dc01..fd90107b 100644 --- a/app/views/comics/play.html.erb +++ b/app/views/comics/play.html.erb @@ -7,12 +7,12 @@

Default width: - <%= @comic.default_width %> + <%= @comic.width %>

Default height: - <%= @comic.default_height %> + <%= @comic.height %>

<% @comic.panels.each do |panel| %> <% @panel = panel %> diff --git a/app/views/comics/show.html.erb b/app/views/comics/show.html.erb index 7d2fe84f..624205cc 100644 --- a/app/views/comics/show.html.erb +++ b/app/views/comics/show.html.erb @@ -7,12 +7,12 @@

Default width: - <%= @comic.default_width %> + <%= @comic.width %>

Default height: - <%= @comic.default_height %> + <%= @comic.height %>

<%= link_to 'Back', comics_path %> diff --git a/app/views/panel_pictures/index.html.erb b/app/views/panel_pictures/index.html.erb index afb22803..c1c9378c 100644 --- a/app/views/panel_pictures/index.html.erb +++ b/app/views/panel_pictures/index.html.erb @@ -9,7 +9,7 @@ Height Top offset Left offset - Zindex + z flip updated_at @@ -21,9 +21,9 @@ <%= panel_picture.resource_picture_id %> <%= panel_picture.width %> <%= panel_picture.height %> - <%= panel_picture.top_offset %> - <%= panel_picture.left_offset %> - <%= panel_picture.zindex %> + <%= panel_picture.y %> + <%= panel_picture.x %> + <%= panel_picture.z %> <%= panel_picture.flip %> <%= panel_picture.updated_at %> diff --git a/app/views/panels/_standard.html.erb b/app/views/panels/_standard.html.erb index 2d70b3b4..11e32b7b 100644 --- a/app/views/panels/_standard.html.erb +++ b/app/views/panels/_standard.html.erb @@ -3,15 +3,15 @@ Seqno:<%= @panel.seqno %>
<% @panel.panel_pictures.each do |panel_picture| %> -
+
<% end %> <% @panel.balloons.each do |balloon| %> -
+
<% balloon.speaches.each do |speach| %> -
+
<%= h speach.content -%>
<% end %> diff --git a/app/views/speach_balloons/index.html.erb b/app/views/speach_balloons/index.html.erb index bb51d37a..371a2626 100644 --- a/app/views/speach_balloons/index.html.erb +++ b/app/views/speach_balloons/index.html.erb @@ -3,7 +3,7 @@ Name Tail limit - Border limit + size limit @@ -11,8 +11,8 @@ <% @speach_balloons.each do |speach_balloon| %> <%= h speach_balloon.name %> - <%= speach_balloon.tail_limit %> - <%= speach_balloon.border_limit %> + <%= speach_balloon.tail_count %> + <%= speach_balloon.size_count %> <%= link_to 'show', speach_balloon %> <% if admin_signed_in? -%> diff --git a/app/views/speach_balloons/show.html.erb b/app/views/speach_balloons/show.html.erb index 89a2d46d..9f93eeff 100644 --- a/app/views/speach_balloons/show.html.erb +++ b/app/views/speach_balloons/show.html.erb @@ -7,18 +7,18 @@

Tail limit: - <%= @speach_balloon.tail_limit %> + <%= @speach_balloon.tail_count %>

- Border limit: - <%= @speach_balloon.border_limit %> + size limit: + <%= @speach_balloon.size_count %>

<% @speach_balloon.balloon_templates.each do |balloon_template| -%>

Tail:<%= balloon_template.tail -%> - Border:<%= balloon_template.border -%> + Size:<%= balloon_template.size -%>

diff --git a/app/views/speach_templates/index.html.erb b/app/views/speach_templates/index.html.erb index b2fe5a68..6d6f2d37 100644 --- a/app/views/speach_templates/index.html.erb +++ b/app/views/speach_templates/index.html.erb @@ -12,8 +12,8 @@ <% @speach_templates.each do |speach_template| %> <%= speach_template.balloon_template_id %> - <%= speach_template.top_offset %> - <%= speach_template.left_offset %> + <%= speach_template.y %> + <%= speach_template.x %> <%= speach_template.width %> <%= speach_template.height %> diff --git a/app/views/speaches/index.html.erb b/app/views/speaches/index.html.erb index 8eb855bd..9a51fd6d 100644 --- a/app/views/speaches/index.html.erb +++ b/app/views/speaches/index.html.erb @@ -14,8 +14,8 @@ <%= speach.balloon_id %> <%= h speach.content %> - <%= speach.top_offset %> - <%= speach.left_offset %> + <%= speach.y %> + <%= speach.x %> <%= speach.width %> <%= speach.height %> -- 2.11.0