X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fviews%2Fpanels%2F_form.html.erb;h=fb8ce514eea31cb1c3b7006d427ec53f8449e3fc;hb=bf89ae0a5c0f77ce2e9782b28023ff8ac521c501;hp=08f12962fbc8976af88f32b1f952f6cab51c6d23;hpb=418be292310a1adaa5113d2eeaf668aa97fce0b1;p=pettanr%2Fpettanr.git diff --git a/app/views/panels/_form.html.erb b/app/views/panels/_form.html.erb index 08f12962..fb8ce514 100644 --- a/app/views/panels/_form.html.erb +++ b/app/views/panels/_form.html.erb @@ -1,10 +1,258 @@ -<%= form_tag( {:controller => 'panels',:action => "create"}) do %> - <%= render 'system/error_explanation', :obj => @panel %> -
- +
+ +
+ <%= form_for(@panel) do |f| %> + <%= render 'system/error_explanation', :obj => @panel %> + +
+ <%= f.label :caption %>
+ <%= f.text_field :caption %> +
+
+ <%= f.label :width %>
+ <%= f.number_field :width, :id => 'panel-width' %> +
+
+ <%= f.label :height %>
+ <%= f.number_field :height, :id => 'panel-height' %> +
+
+ <%= f.label :border %>
+ <%= f.number_field :border %> +
+
+ <%= f.label :publish %>
+ <%= f.collection_select :publish, t_select_items(MagicNumber['panel_visible_items']), :last, :first, :html => {:selected => @panel.publish} %> +
+
+ <%= f.submit %> +
+ <% end %> +

<%= t 'panels.create_from_json' -%>

+ <%= form_for(@panel) do |f| %> + <%= render 'system/error_explanation', :obj => @panel %> + +
+ +
+ <%= text_field_tag "json" %> +
+ <%= submit_tag t('panels.create_from_json') -%> +
+ <% end %>
- <%= text_field_tag "json" %> -
- <%= submit_tag t('panels.create_from_json') -%> +
+

<%= 't reorder' -%>

+ + + <% @panel.panel_elements.each do |elm| %> + + <% case elm.class.to_s %> + <% when 'PanelPicture' %> + + <% when 'SpeechBalloon' %> + + <% when 'GroundPicture' %> + + <% when 'GroundColor' %> + + <% end %> + + + <% end %> + +
+ <%= tag(:img, elm.tmb_opt_img_tag) %> + + <%= elm.id -%> + <%= elm.caption -%> + + <%= tag(:img, elm.tmb_opt_img_tag) -%> + ; background-color: #<%= format("%06x", elm.code) -%>;"> + <%= format("%06x", elm.code ^ 0xffffff) %> + + <%= h(truncate(elm.caption, :length => 12)) %> +
+ <%= form_for(@panel) do |f| %> + <%= hidden_field_tag "json", nil, :id => 't-reorder' %> + <% unless @panel.new_record? -%> + <%= content_tag :div, '', :id => "panel-id-elm", :oid => @panel.id -%> + <% end %> +
+ <%= submit_tag t('panels.create.title') -%> +
+ <% end %>
-<% end -%> +
+

<%= 'z reorder' -%>

+ + + <% @panel.zorderd_elements.each do |elm| %> + + <% case elm.class.to_s %> + <% when 'PanelPicture' %> + + <% when 'SpeechBalloon' %> + + <% when 'GroundPicture' %> + + <% when 'GroundColor' %> + + <% end %> + + + <% end %> + +
+ <%= tag(:img, elm.tmb_opt_img_tag) %> + + <%= elm.id -%> + <%= elm.caption -%> + + <%= tag(:img, elm.tmb_opt_img_tag) -%> + ; background-color: #<%= format("%06x", elm.code) -%>;"> + <%= format("%06x", elm.code ^ 0xffffff) %> + + <%= h(truncate(elm.caption, :length => 12)) %> +
+ <%= form_for(@panel) do |f| %> + <%= hidden_field_tag "json", nil, :id => 'z-reorder' %> + <% unless @panel.new_record? -%> + <%= content_tag :div, '', :id => "panel-id-zorderd", :oid => @panel.id -%> + <% end %> +
+ <%= submit_tag t('panels.create.title') -%> +
+ <% end %> +
+
+ +