OSDN Git Service

t#31957:helperize
[pettanr/pettanr.git] / app / views / ground_colors / _form.html.erb
index 1a0cc89..a42714d 100644 (file)
@@ -7,22 +7,12 @@
   </div>
   <div class="field">
     <%= f.label :code %>
-    <%= f.text_field :code, elm.field_tag_attributes(:code, no_attr, :size => 8 ) %>
-    <div class="colorpicker-wrap">
-      <div class="colorpicker" style="float: left;" <%= raw elm.field_tag_attr(:code_picker, no_attr) -%>>
-        <div id="<%= elm.tag_id(:code_red) -%>" class="colorpicker-red"></div>
-        <div id="<%= elm.tag_id(:code_green) -%>" class="colorpicker-green"></div>
-        <div id="<%= elm.tag_id(:code_blue) -%>" class="colorpicker-blue"></div>
+    <%= f.text_field :code, elm.field_tag_attributes(:code, no_attr, :size => 8) %>
+    <% if elm.has_helper?(:code) %>
+      <div class="ground_color-code-wrap">
+        <%= render elm.form_helper_template(:code), :elm => elm, :no_attr => no_attr %>
       </div>
-      <div style="float: left;">
-        <div id="<%= elm.tag_id(:code_swatch) -%>" class="ui-widget-content ui-corner-all code_swatch"></div>
-      </div>
-      <div style="float: left;">
-        <div id="<%= elm.tag_id(:code_hex) -%>"></div>
-        <div id="<%= elm.tag_id(:code_rgb) -%>"></div>
-      </div>
-      <div style="clear: both;"></div>
-    </div>
+   <% end %>
   </div>
   <div class="field">
     <%= f.label :z %>