OSDN Git Service

t#32246:add sheet
[pettanr/pettanr.git] / app / views / sheet_panels / _form.html.erb
index 238fe21..6f178a8 100644 (file)
@@ -1,32 +1,28 @@
-<%= form_for(@sheet_panel) do |f| %>
-  <%= render 'system/error_explanation', :obj => @sheet_panel %>
+<%= form_for(elm) do |f| %>
+  <%= render 'system/error_explanation', :obj => elm %>
 
   <div class="field">
-    <%= f.label :sheet_id %><br />
-    <%= f.number_field :sheet_id %>
-  </div>
-  <div class="field">
-    <%= f.label :x %><br />
-    <%= f.number_field :x %>
-  </div>
-  <div class="field">
-    <%= f.label :y %><br />
-    <%= f.number_field :y %>
-  </div>
-  <div class="field">
-    <%= f.label :z %><br />
-    <%= f.number_field :z %>
-  </div>
-  <div class="field">
-    <%= f.label :t %><br />
-    <%= f.number_field :t %>
+    <%= f.label :x %>
+    <%= f.number_field :x, elm.field_tag_attributes(:x, no_attr, :size => 5) %>
+
+    <%= f.label :y %>
+    <%= f.number_field :y, elm.field_tag_attributes(:y, no_attr, :size => 5) %>
   </div>
   <div class="field">
-    <%= f.label :panel_id %><br />
-    <%= f.number_field :panel_id %>
+    <%= f.label :z %>
+    <%= f.number_field :z, elm.field_tag_attributes(:z, no_attr, :size => 5) %>
+
+    <%= f.label :t %>
+    <%= f.number_field :t, elm.field_tag_attributes(:t, no_attr, :size => 5) %>
   </div>
 
+  <%= f.hidden_field :panel_id, elm.field_tag_attributes(:panel_id, no_attr) %>
+  <%= f.hidden_field :sheet_id, elm.field_tag_attributes(:sheet_id, no_attr) %>
+  <% unless elm.new_record?  %>
+    <%= f.hidden_field :id, elm.field_tag_attributes(:id, no_attr) %>
+  <% end %>
+
   <div class="actions">
-    <%= f.submit %>
+    <%= f.submit t('sheet_panels.submit'), :class => "submit" %>
   </div>
 <% end %>