OSDN Git Service

仕入先マスタ管理機能追加
[elecoma/elecoma.git] / app / views / admin / product_styles / new.html.erb
1 <% content_for :head do %>
2   <%= javascript_include_tag "admin/product_style" %>
3 <% end %>
4 <%= render :partial => "submenu" %>
5
6 <div id="main"><!-- メイン -->
7
8 <%= @error_messages %>
9
10 <% if @product.valid? %>
11   <h2>規格登録</h2>
12   <% if @new_flg = ( @product.product_styles.empty? || @product.product_styles.first.code.blank? ) %>
13     <% form_tag( {:action => "setting"}, {:id => "setting"}) do %>
14       <table class="data" cellspacing="1">
15         <tr>
16           <th>商品名</th>
17           <td><%= h @product.name %></td>
18         </tr>
19         <tr>
20           <th>規格1</th>
21           <td><%= select_tag :style_id1, Style.select_options(@style1 && @style1.id)%></td>
22         </tr>
23         <tr>
24           <th>規格2</th>
25           <td><%= select_tag :style_id2, Style.select_options(@style2 && @style2.id) %></td>
26         </tr>
27       </table>
28
29       <div class="btn_box">
30         <%if request.referer =~ /(admin\/products\/complete)/%>
31           <%= button_to_function "検索に戻る ", "form.action = '#{url_for admin_products_index_path}'; form.submit()", :onclick => true, :class=>"btn" %>
32           <img class="btn_side" width="6" height="34" src="/images/btn_side.gif">
33         <%else %>
34           <%= button_to_function '戻る', 'history.back()', :class=>"btn" %>
35           <img class="btn_side" width="6" height="34" src="/images/btn_side.gif">
36         <%end %>
37         <%= submit_to_remote '', "表示する", :update => "style_create", :url => {:action => "create_form", :id => params[:id] || params[:product_id] }, :submit => "setting", :html => {:class=>"btn"} %>
38         <img class="btn_side" width="6" height="34" src="/images/btn_side.gif">
39       </div>
40     <% end %>
41   <% end %>
42
43   <div id="style_create">
44     <% unless @product_styles.empty? %>
45       <%= render :partial => 'create_form' %>
46     <% end %>
47   </div>
48
49 <% else %>
50   商品情報が不正です。商品を正しく登録して下さい。<br>
51   <%= link_to "編集画面へ", edit_admin_product_path(@product.id) %>
52 <% end %>
53
54 </div><!-- /メイン -->