property_hire/app/views/admin/property_hires/_attribute_field.html.erb

146 lines
9.5 KiB
Plaintext
Raw Normal View History

2021-09-06 16:45:14 +00:00
<div class="attributes default <%= attribute_field.disabled ? 'disabled' : ''%>">
<%
attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter
%>
<div class="attributes-header clearfix">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= attribute_field.disabled ? 'disabled' : ''%>">
<%= hidden_field "#{@field_name}[p_hire_fields][#{@af_counter}]","disabled",:value=>attribute_field.disabled,:class=>"toggle-check", :data=>{:deploy=>"right"} %>
<label><b></b></label>
</div>
</div>
<a class="btn btn-mini pull-right btn-danger delete" href="#"><i class="icon-trash"></i> <%= t(:delete_)%></a>
<%= hidden_field "#{@field_name}[p_hire_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<a class="btn btn-mini pull-right btn-inverse reply hide" href="#"><i class="icons-reply"></i> Reset</a>
<h4>Field <span><%= @af_counter + 1 %></span></h4>
</div>
<div class="attributes-body">
<div class="control-group">
<label class="control-label muted" for="key_<%= @af_counter %>"><%= t(:key) %></label>
<div class="controls">
<%= text_field "#{@field_name}[p_hire_fields][#{@af_counter}]","key",:value=>attribute_field.key, :data=>{:type=>"key"} %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"#{@field_name}[p_hire_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group">
<label class="control-label muted" for=""><%= t('property_hire.to_require') %></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[p_hire_fields][#{@af_counter}]", "to_require", "true",:checked => (attribute_field.to_require == true ? true : false), :data=>{:type=>"search_true"}) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[p_hire_fields][#{@af_counter}]", "to_require", "false",:checked => (attribute_field.to_require == false ? true : false), :data=>{:type=>"search_false"}) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label muted" for=""><%= t('property_hire.display_in_reason_for_hire') %></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[p_hire_fields][#{@af_counter}]", "display_in_reason_for_hire", "true",:checked => (attribute_field.display_in_reason_for_hire == true ? true : false), :data=>{:type=>"search_true"}) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[p_hire_fields][#{@af_counter}]", "display_in_reason_for_hire", "false",:checked => (attribute_field.display_in_reason_for_hire == false ? true : false), :data=>{:type=>"search_false"}) %><%= t(:no_)%>
</label>
</div>
</div>
2021-09-06 16:45:14 +00:00
<div class="control-group">
<label class="control-label muted" for=""><%= t(:type)%></label>
<div class="controls">
<select class="dataType" data-type="select" name=<%= "#{@field_name}[p_hire_fields][#{@af_counter}][markup]"%>>
<%$property_list[:markups].each do |key,val|%>
<% next if val["display_only"] && val["display_only"] != "p_hire_field" %>
<% if key != 'address' %>
<option value="<%= key %>" <%= attribute_field.markup == key ? 'selected="selected"' : '' %> ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
<% end %>
<% end %>
</select>
</div>
</div>
</div>
<div class="field-type fade"></div>
<%= content_tag :div,:class=>"field-type default fade in #{show_property_type_panel(attribute_field,"typeA")}" do%>
<div class="control-group">
<label class="control-label muted"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[p_hire_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"],:data=>{:type=>"cross_lang"}) %>
<%= t(:cross_lang) %>
</label>
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[p_hire_fields][#{@af_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"],:data=>{:type=>"add_more"}) %>
<%= t(:add_more)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"#{@field_name}[p_hire_fields][#{@af_counter}][typeA][placeholder]"}%>
<% end if show_property_type_panel(attribute_field,"typeA") != 'typeA hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_property_type_panel(attribute_field,"typeB")}" do %>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"#{@field_name}[p_hire_fields][#{@af_counter}][typeB][initial]"}%>
<% if attribute_field.self_defined_markup_options?%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[p_hire_fields][#{@af_counter}][attribute][property][statuses]"} %>
<%else #normal list%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[p_hire_fields][#{@af_counter}][typeB][option_list]"} %>
<% end #of self_defined_markup_options?%>
<% end if show_property_type_panel(attribute_field,"typeB") != 'typeB hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_property_type_panel(attribute_field,"typeC")}" do %>
<div class="control-group">
<label class="control-label"><%= t("date.format")%></label>
<div class="controls">
<%= select "#{@field_name}[p_hire_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.range")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[p_hire_fields][#{@af_counter}][typeC]", "is_range", "false",:checked => (!attribute_field.date_is_range? ? true : false)) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[p_hire_fields][#{@af_counter}][typeC]", "is_range", "true",:checked => (attribute_field.date_is_range? ? true : false)) %><%= t(:no_)%>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.calendar")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("#{@field_name}[p_hire_fields][#{@af_counter}][typeC]", "calendar", "west_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "west_calendar" ? true : false)) %><%= t("date.west_calendar")%>
</label>
<label class="radio inline">
<%= radio_button("#{@field_name}[p_hire_fields][#{@af_counter}][typeC]", "calendar", "tw_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "tw_calendar" ? true : false)) %><%= t("date.tw_calendar")%>
</label>
</div>
</div>
<% end if show_property_type_panel(attribute_field,"typeC") != 'typeC hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_property_type_panel(attribute_field,"typeD")}" do%>
<div class="control-group">
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[p_hire_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
<%= t(:cross_lang)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"#{@field_name}[p_hire_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
<% end if show_property_type_panel(attribute_field,"typeD") != 'typeD hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_property_type_panel(attribute_field,"typeE")}" do%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[p_hire_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["typeE"]["option_list"]}%>
<% end if show_property_type_panel(attribute_field,"typeE") != 'typeE hide' %>
<%= content_tag :div,:class=>"field-type default fade in #{show_property_type_panel(attribute_field,"typeF")}" do%>
<%= render :partial=>"shared/attribute_field/hint_block",:locals=>{:values=>attribute_field["typeF"]["placeholder"],:field_name=>"#{@field_name}[p_hire_fields][#{@af_counter}][typeF][placeholder]"}%>
<% end if show_property_type_panel(attribute_field,"typeF") != 'typeF hide' %>
<%= hidden_field "#{@field_name}[p_hire_fields][#{@af_counter}]","id",:value=>attribute_field.id%>
</div>