<% hire_method = Admin::PropertyHiresHelper::HireMethod hire_method.set_input_name('property') with_id = !(@property.new_record?) %> <% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/fileupload" %> <%= stylesheet_link_tag "lib/main-list" %> <%= stylesheet_link_tag "admin/card" %> <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/bootstrap-fileupload" %> <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> <%= javascript_include_tag "lib/file-type" %> <%= javascript_include_tag "lib/module-area" %> <% end %>
<%= select_category(f, @module_app) %>
<%= f.label :property_location, t("property_hire.property_location"), :class => "control-label muted" %>
<% if @property.new_record? %> <%= f.select :property_location, @locations %> <% elsif @property.property_location.nil? %> <%= f.select :property_location, @locations, {:selected => "other_location"} %> <% else %> <%= f.select :property_location, @locations %> <% end %>
"> <%= f.label :other_location, t("property_hire.other_location"), :class => "control-label muted" %>
<%= f.text_field :other_location %>
<% =begin%>
<%= f.label :property_number, t("property_hire.property_number"), :class => "control-label muted" %>
<%= f.text_field :property_number %>
<% =end%>
<%= f.label :p_display_start_time, t("property_hire.p_display_start_time"), :class => "control-label muted" %>
<%= f.datetime_picker :p_display_start_time, :picker_type => "date", :no_label => true, :new_record => @property.new_record?, :data=>{"picker-type" => "range", "range" => "start"}, :format => "yyyy/MM/dd hh:mm" %>
<%= f.label :p_display_end_time, t("property_hire.p_display_end_time"), :class => "control-label muted" %>
<%= f.datetime_picker :p_display_end_time, :picker_type => "date", :no_label => true, :new_record => @property.new_record?, :data=>{"picker-type" => "range", "range" => "end"}, :format => "yyyy/MM/dd hh:mm" %>
<%= f.label :p_hire_start_time, t("property_hire.p_hire_start_time"), :class => "control-label muted" %>
<%= t("property_hire.time_period_note") %>
<%= f.datetime_picker :p_hire_start_time, :picker_type => "date", :no_label => true, :new_record => @property.new_record?, :data=>{"picker-type" => "range", "range" => "start"}, :format => "yyyy/MM/dd hh:mm" %>
<%= f.label :p_hire_end_time, t("property_hire.p_hire_end_time"), :class => "control-label muted" %>
<%= f.datetime_picker :p_hire_end_time, :picker_type => "date", :no_label => true, :new_record => @property.new_record?, :data=>{"picker-type" => "range", "range" => "end"}, :format => "yyyy/MM/dd hh:mm" %>
<%= f.label :recurring_enable, t("property_hire.recurring_enable"), :class => "control-label muted" %>
<%= f.check_box :recurring_enable %>
<%= f.label :p_open_start_time, t("property_hire.p_open_start_time"), :class => "control-label muted" %>
<%= t("property_hire.available_time_note") %>
<%= f.datetime_picker :p_open_start_time, :picker_type => "date", :no_label => true, :new_record => @property.new_record?, :data=>{"picker-type" => "range", "range" => "start"}, :format => "yyyy/MM/dd" %>
<%= f.label :p_open_end_time, t("property_hire.p_open_end_time"), :class => "control-label muted" %>
<%= f.datetime_picker :p_open_end_time, :picker_type => "date", :no_label => true, :new_record => @property.new_record?, :data=>{"picker-type" => "range", "range" => "end"}, :format => "yyyy/MM/dd" %>
<% =begin%>
<%= f.label :purchase_date, t("property_hire.purchase_date"), :class => "control-label muted" %>
<%= f.datetime_picker :purchase_date, :no_label => true, :new_record => @property.new_record?, :picker_type => "date", :format => "yyyy/MM/dd" %>
<% =end%>
<%= f.label :owners, t("property_hire.owners"), :class => "control-label muted" %>
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'property[owners][]', email_members: @property.owner_profiles} %>
<%= f.label :other_owner, t("property_hire.other_owner"), :class => "control-label muted" %>
<%= f.text_field :other_owner %>
<%= f.label :owner_email, t("property_hire.owner_email"), :class => "control-label muted" %>
<%= f.text_field :owner_email %>
<%= f.label :owner_email_rule, t("property_hire.owner_email_rule"), :class => "control-label muted" %>
<%= f.select :owner_email_rule, options_for_select([0,1,2].map{|i| [t("property_hire.owner_email_rules.#{i}"), i]}, f.object.owner_email_rule) %>
<%= f.label :owner_phone, t("property_hire.owner_phone"), :class => "control-label muted" %>
<%= f.text_field :owner_phone %>
<% =begin%>
<%= f.label :price, t("property_hire.price"), :class => "control-label muted" %>
<%= f.text_field :price %>
<% =end%>
<%= f.label :custom_calendar_type, t("property_hire.display_calendar"), :class => "control-label muted" %>
<%= f.select :custom_calendar_type, options_for_select(Property::CAlENDARTYPE.map.with_index{|type,i| [t("property_hire.custom_calendar_type.#{type}"), i]}, f.object.custom_calendar_type) %>
<%= select_tags(f, @module_app) %>
<% if @property.image.file %> <%= image_tag @property.image %> <% else %> <% end %>
<%= t(:select_image) %> <%= t(:change) %> <%= f.file_field :image %> <%= t(:cancel) %>
<%= f.label :display_img, t("property_hire.display_img"), :class => "control-label muted" %>
<%= f.check_box :display_img %>
<% image_display_class_relation = {"full_width"=>"full-size-img","up_left_corner"=>"pull-left","up_right_corner"=>"pull-right"} %>
<%= f.label :image_display_class, t("property_hire.cover_image_display_setting"), :class => "control-label muted" %>
<% image_display_class_relation.each.with_index do |(key,value),i| %> <% end %>
<% (0..2).each do |index1| %> <% active_email_set = index1==0 ? ' active' : '' %>
<%= t('disable') %> <%= check_box_tag("property[hire_email_sets][#{index1}][disabled]", true ,@email_set[index1].disabled) %>
<%= t('property_hire.email_title') %> <%= hire_method.show_set_field(@email_set[index1].id,@email_set[index1]['title'],'hire_email_sets',index1,'title','text_field',with_id) %>
<%= t('property_hire.email_content') %>
<%= hire_method.show_set_field(@email_set[index1].id,@email_set[index1]['content'],'hire_email_sets',index1,'content','text_area',with_id) %>
<%= hidden_field_tag("property[hire_email_sets][#{index1}][field_name]",@email_set[index1]['field_name']) %> <% unless @property.new_record? %> <%= hidden_field_tag("property[hire_email_sets][#{index1}][property_id]",@property.id) %> <% end %>
<% end %>
<%= f.label :set_unavailibility, t("property_hire.set_unavailibility"), :class => "control-label muted" %>
<%= f.check_box :set_unavailibility %>
<% if @property.set_unavailibility %>
<% else %>
<%= f.label :set_availability, t("property_hire.set_availability"), :class => "control-label muted" %>
<%= f.check_box :set_availability %>
<% if @property.set_availability %>
<% else %>
<% fields_name = f.object.class::FIELDSNAME %>
<% fields_name.each do |field_name| %> <% end %>
<%= t('property_hire.field_name') %> <%= t('property_hire.name') %> <%= t('property_hire.placeholder') %> <%= t('property_hire.disable') %> <%= t('property_hire.required') %>
<%= t("property_hire.#{field_name}") %> <%= render_custom_text_field(f,field_name,"name") %> <%= render_custom_text_field(f,field_name,"placeholder") %> <%= check_box_tag("#{f.object_name}[#{field_name}][enable]", "0" , (f.object.send(field_name)["enable"] == "0" rescue false)) %> <%= check_box_tag("#{f.object_name}[#{field_name}][required]", "true" , (f.object.send(field_name)["required"] == "true" rescue false)) %>

<% field_name = "enable_notes_selector" %>
<% field_name = "notes_selector" %>
<% @property[field_name].each do |index,sub_hash| %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
" id="select_choice_name_index<%=index%>_<%=locale.to_s%>"> ">
<% end %>
<% @site_in_use_locales.each_with_index do |locale, i| %> " href="#select_choice_name_index<%=index%>_<%=locale.to_s%>" data-toggle="tab"><%= t(locale.to_s) %> <% end %>
<% @property["#{field_name}"]["#{index}"]["value"].values.first.each_with_index do |v,val_index|%>
<% @site_in_use_locales.each_with_index do |locale, i| %>
" id="select_choice_value_index<%=index.to_s%>_<%=locale.to_s%>_<%=val_index%>"> ">
<% end %>
<% end %>
<%=t("property_hire.add_choice")%>
<% end %>
<%=t(:add)%>
<% @site_in_use_locales.each_with_index do |locale, i| %>
">
<%= f.fields_for :title_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t("property_hire.title"), value: (@property.title_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :property_usage_translations do |f| %> <%= f.text_area locale, class: "ckeditor input-block-level", placeholder: t("property_hire.property_usage"), value: (@property.property_usage_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :note_translations do |f| %> <%= f.text_area locale, class: "ckeditor input-block-level", placeholder: t("property_hire.note"), value: (@property.note_translations[locale] rescue nil) %> <% end %>
<% end %>
<% referer = request.referer rescue nil %> <% referer = get_referer_url if referer.blank? || request.host != URI.parse(URI.encode(referer)).host %> <% unless @property.new_record? %> <%= hidden_field_tag("property[id]", @property.id) %> <% end %> <%= f.submit t('submit'), class: 'btn btn-primary' %> <%= link_to t('cancel'), referer, :class=>"btn" %>