Orbit/app/views/admin/infos/_attribute_field.html.erb

101 lines
7.2 KiB
Plaintext
Raw Normal View History

<div class="form-horizontal">
<legend>
<button class="onoff pull-right <%= attribute_field.disabled ? 'disabled' : ''%>">ON</button>
<%= hidden_field "info[attribute_fields][#{attribute_field_counter}]","disabled",:value=>attribute_field.disabled,:class=>"attribute_field_disabled"%>
<%= hidden_field "info[attribute_fields][#{attribute_field_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<a class="btn btn-small pull-right btn-danger remove_attribute" href="#"><i class="icon-trash icon-large"></i> <%= t("delete")%></a>
<div class="clear">
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t("admin.key") %></label>
<div class="multipleInput">
<div class="controls">
<%= text_field "info[attribute_fields][#{attribute_field_counter}]","key",:value=>attribute_field.key%>
</div>
</div>
</div>
<%= render :partial=>"placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t("admin.infos.name"),:field_name=>"info[attribute_fields][#{attribute_field_counter}][title_translations]"}%>
<div class="control-group pull-left">
<label class="control-label" for=""><%= t("admin.infos.type")%></label>
<div class="controls">
<%#= select_tag "info[attribute_fields][#{attribute_field_counter}][markup]" do %>
<select class="dataType" name=<%= "info[attribute_fields][#{attribute_field_counter}][markup]"%>>
<%LIST[:markups].each do |key,val|%>
<option value="<%= key %>" <%= attribute_field.markup == key ? 'selected="selected"' : '' %> ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
<% end %>
</select>
</div>
</div>
</div>
</legend>
<div class="<%= attribute_field.disabled ? 'hide' : ''%>">
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeA") do%>
<div class="control-group">
<label class="control-label"><%= t("admin.infos.options")%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeA][multilingual]","true",attribute_field["typeA"]["multilingual"]) %>
<%= t("admin.infos.multilingual")%>
</label>
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"]) %>
<%= t("admin.infos.add_more")%>
</label>
</div>
</div>
<%= render :partial=> "placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"info[attribute_fields][#{attribute_field_counter}][typeA][placeholder]"}%>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeB") do %>
<%= render :partial=> "placeholder_block",:locals=>{:label_ext=>t("admin.infos.initial"),:values=>attribute_field["typeB"]["initial"],:field_name=>"info[attribute_fields][#{attribute_field_counter}][typeB][initial]"}%>
<%= render :partial=>"list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{attribute_field_counter}][typeB][option_list]"} %>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeC") do %>
<div class="control-group">
<label class="control-label"><%= t("admin.infos.date.format")%></label>
<div class="controls">
<%= select "info[attribute_fields][#{attribute_field_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("admin.infos.date.range")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{attribute_field_counter}][typeC]", "is_range", "false",:checked => (attribute_field["typeC"]["is_range"]== "false" ? true : false)) %><%= t("admin.infos.not_range")%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{attribute_field_counter}][typeC]", "is_range", "true",:checked => (attribute_field["typeC"]["is_range"]== "true" ? true : false)) %><%= t("admin.infos.is_range")%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("admin.infos.date.claendar")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{attribute_field_counter}][typeC]", "claendar", "west_claendar",:checked =>(attribute_field["typeC"]["claendar"]== "west_claendar" ? true : false)) %><%= t("admin.infos.date.west_claendar")%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{attribute_field_counter}][typeC]", "claendar", "tw_claendar",:checked =>(attribute_field["typeC"]["claendar"]== "tw_claendar" ? true : false)) %><%= t("admin.infos.date.tw_claendar")%>
</label>
</div>
</div>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeD") do%>
<div class="control-group">
<label class="control-label"><%= t("admin.infos.options")%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeD][multilingual]","true",attribute_field["typeD"]["multilingual"]) %>
<%= t("admin.infos.multilingual")%>
</label>
</div>
</div>
<%= render :partial=> "placeholder_block",:locals=>{:field_name=>"info[attribute_fields][#{attribute_field_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeE") do%>
<%= render :partial=>"list_block",:locals=>{:field_name=>"info[attribute_fields][#{attribute_field_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
<% end %>
</div>
<%= hidden_field "info[attribute_fields][#{attribute_field_counter}]","id",:value=>attribute_field.id%>
</div>