From ab2ad7392aa6c65f1c6fb5f6dd09c137707c2df2 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Tue, 23 Jul 2013 18:05:03 +0900 Subject: [PATCH] t#31705:fix elements-tab-face --- app/assets/stylesheets/test.css.scss | 52 +++++++-------- app/views/ground_colors/_element_face.html.erb | 7 +++ app/views/ground_pictures/_element_face.html.erb | 7 +++ app/views/panel_pictures/_element_face.html.erb | 9 +++ app/views/panels/_form.html.erb | 80 +++--------------------- app/views/speech_balloons/_element_face.html.erb | 8 +++ config/environment.rb | 2 +- 7 files changed, 68 insertions(+), 97 deletions(-) create mode 100644 app/views/ground_colors/_element_face.html.erb create mode 100644 app/views/ground_pictures/_element_face.html.erb create mode 100644 app/views/panel_pictures/_element_face.html.erb create mode 100644 app/views/speech_balloons/_element_face.html.erb diff --git a/app/assets/stylesheets/test.css.scss b/app/assets/stylesheets/test.css.scss index dbed6340..bc7f1dae 100644 --- a/app/assets/stylesheets/test.css.scss +++ b/app/assets/stylesheets/test.css.scss @@ -116,6 +116,7 @@ div.md5 { } .tsort-box { float: left; + font-size: 12px; } .scenario { float: left; @@ -123,6 +124,10 @@ div.md5 { .tsort-row-break { clear: both; } +.tsort-tabs-nav { + padding: .2em .1em .2em .2em; + width: 220px; +} .tsort { list-style-type: none; margin: 0; @@ -132,13 +137,19 @@ div.md5 { margin: 0 3px 3px 3px; padding: 0.3em; padding-left: 1em; - font-size: 15px; - font-weight: bold; + font-size: 12px; cursor: move; } .tsort-row-break { clear: both; } +.zsort-box { + font-size: 12px; +} +.zsort-tabs-nav { + padding: .2em .1em .2em .2em; + width: 220px; +} .zsort { list-style-type: none; margin: 0; @@ -148,16 +159,7 @@ div.md5 { margin: 0 3px 3px 3px; padding: 0.3em; padding-left: 1em; - font-size: 15px; - font-weight: bold; - cursor: move; -} -#z-sortable tr { - margin: 0 3px 3px 3px; - padding: 0.3em; - padding-left: 1em; - font-size: 15px; - font-weight: bold; + font-size: 12px; cursor: move; } .ui-slider .ui-slider-handle { @@ -171,11 +173,11 @@ div.md5 { font-size: 12px; } .ui-tabs-vertical { - width: 65em; } .ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; - float: left; width: 220px; + float: left; + width: 220px; } .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; @@ -195,16 +197,15 @@ div.md5 { } .ui-tabs-vertical .ui-tabs-panel { padding: 1em; - float: right; + float: left; width: 35em; + float: right; } .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: 0.2em; } .elements-tab { width: 100%; -} -.elements-tab { overflow: hidden; height: auto; } @@ -220,15 +221,14 @@ div.md5 { overflow: hidden; height: auto; } -.elements-tab-caption { - white-space: pre; /* CSS 2.0 */ - white-space: pre-wrap; /* CSS 2.1 */ - white-space: pre-line; /* CSS 3.0 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - white-space: -moz-pre-wrap; /* Mozilla */ - white-space: -hp-pre-wrap; /* HP Printers */ - word-wrap: break-word; /* IE 5+ */ +.elements-tab-face-icon { + float: left; +} +.elements-tab-face-caption { + float: left; +} +.elements-tab-face-end { + clear: both; } .ui-button .ui-icon.ui-icon-destroy { width: 16px; diff --git a/app/views/ground_colors/_element_face.html.erb b/app/views/ground_colors/_element_face.html.erb new file mode 100644 index 00000000..3004efb8 --- /dev/null +++ b/app/views/ground_colors/_element_face.html.erb @@ -0,0 +1,7 @@ +
; background-color: #<%= format("%06x", elm.code) -%>; width: 48px; height: 48px; "> + <%= format("%06x", elm.code) %> +
+<%= h(truncate(elm.caption, :length => 15)) -%> + +
+
diff --git a/app/views/ground_pictures/_element_face.html.erb b/app/views/ground_pictures/_element_face.html.erb new file mode 100644 index 00000000..648eef33 --- /dev/null +++ b/app/views/ground_pictures/_element_face.html.erb @@ -0,0 +1,7 @@ +
+ <%= tag(:img, elm.tmb_opt_img_tag) -%> +
+<%= h(truncate(elm.caption, :length => 15)) -%> + +
+
diff --git a/app/views/panel_pictures/_element_face.html.erb b/app/views/panel_pictures/_element_face.html.erb new file mode 100644 index 00000000..1517d3aa --- /dev/null +++ b/app/views/panel_pictures/_element_face.html.erb @@ -0,0 +1,9 @@ +
+ <%= tag(:img, elm.tmb_opt_img_tag) %> +
+ + <% -%> + <%= h(truncate(elm.caption, :length => 15)) -%> + +
+
diff --git a/app/views/panels/_form.html.erb b/app/views/panels/_form.html.erb index 38e609de..a3e33a2a 100644 --- a/app/views/panels/_form.html.erb +++ b/app/views/panels/_form.html.erb @@ -43,30 +43,8 @@
  • - <% case elm.class.to_s %> - <% when 'PanelPicture' %> - <%= tag(:img, elm.tmb_opt_img_tag) %> -

    - <% -%> - <%= h(truncate(elm.caption, :length => 15)) -%> -

    - <% when 'SpeechBalloon' %> - <%= tag(:img, elm.speech_balloon_template.system_picture.tmb_opt_img_tag) %> -

    <%= h(truncate(elm.caption, :length => 15)) -%> -
    <%= h(truncate(elm.speech.content, :length => 15)) -%> -

    - <% when 'GroundPicture' %> - <%= tag(:img, elm.tmb_opt_img_tag) -%> -

    <%= h(truncate(elm.caption, :length => 15)) -%> -

    - <% when 'GroundColor' %> -
    ; background-color: #<%= format("%06x", elm.code) -%>; width: 48px; height: 48px; "> - <%= format("%06x", elm.code) %> -
    -

    <%= h(truncate(elm.caption, :length => 15)) -%> -

    - <% end %> -
    + <%= render elm.class.to_s.tableize + '/element_face', :elm => elm %> +
  • @@ -106,31 +84,12 @@
    -
      +
        <% @panel.panel_elements.each do |elm| %>
      • - <% case elm.class.to_s %> - <% when 'PanelPicture' %> - - <%= tag(:img, elm.tmb_opt_img_tag) %> - - <% when 'SpeechBalloon' %> - - <%= elm.id -%> - <%= h(truncate(elm.speech.content, :length => 12)) -%> - - <% when 'GroundPicture' %> - - <%= tag(:img, elm.tmb_opt_img_tag) -%> - - <% when 'GroundColor' %> - ; background-color: #<%= format("%06x", elm.code) -%>;"> - <%= format("%06x", elm.code ^ 0xffffff) %> - - <% end %> - - <%= h(truncate(elm.caption, :length => 12)) %> - +
        + <%= render elm.class.to_s.tableize + '/element_face', :elm => elm %> +
      • <% end %>
      @@ -156,31 +115,12 @@
    -
      +
        <% @panel.zorderd_elements.each do |elm| %>
      • - <% case elm.class.to_s %> - <% when 'PanelPicture' %> - - <%= tag(:img, elm.tmb_opt_img_tag) %> - - <% when 'SpeechBalloon' %> - - <%= elm.id -%> - <%= elm.caption -%> - - <% when 'GroundPicture' %> - - <%= tag(:img, elm.tmb_opt_img_tag) -%> - - <% when 'GroundColor' %> - ; background-color: #<%= format("%06x", elm.code) -%>;"> - <%= format("%06x", elm.code ^ 0xffffff) %> - - <% end %> - - <%= h(truncate(elm.caption, :length => 12)) %> - +
        + <%= render elm.class.to_s.tableize + '/element_face', :elm => elm %> +
      • <% end %>
      diff --git a/app/views/speech_balloons/_element_face.html.erb b/app/views/speech_balloons/_element_face.html.erb new file mode 100644 index 00000000..c7f858d5 --- /dev/null +++ b/app/views/speech_balloons/_element_face.html.erb @@ -0,0 +1,8 @@ +
      + <%= tag(:img, elm.speech_balloon_template.system_picture.tmb_opt_img_tag) %> +
      + + <%= h(truncate(elm.speech.content, :length => 15)) -%> + +
      +
      diff --git a/config/environment.rb b/config/environment.rb index 64c53061..7bb8189d 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,6 +2,7 @@ require File.expand_path('../application', __FILE__) require 'RMagick' require 'rest_client' +require 'inspire' # Initialize the rails application Pettanr::Application.initialize! @@ -10,5 +11,4 @@ require 'pettan_imager' require 'ar_helper' require 'import_result' require 'common' -require 'inspire' -- 2.11.0