<%= 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 %>
<%= f.label :property_number, t("property_hire.property_number"), :class => "control-label muted" %>
<%= f.text_field :property_number %>
<%= f.label :p_hire_start_time, t("property_hire.p_hire_start_time"), :class => "control-label muted" %>
<%= 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" %>
<%= 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" %>
<%= 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" %>
<%= 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 %>
<%= f.label :price, t("property_hire.price"), :class => "control-label muted" %>
<%= f.text_field :price %>
<%= 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) %>
<% 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 %>
<%= f.text_field :custom_carousel_image_width, :placeholder => t("property_hire.custom_carousel_image_width_hint") %>
<% if f.object && !f.object.property_carousel_images.blank? %>
<% f.object.property_carousel_images.each_with_index do |property_carousel_image, i| %>
<%= f.fields_for :property_carousel_images, property_carousel_image do |f| %>
<%= render :partial => 'form_image', :object => property_carousel_image, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag 'property_carousel_image_count', f.object.property_carousel_images.count %>
<%= t(:add) %>
<%= f.label :set_unavailibility, t("property_hire.set_unavailibility"), :class => "control-label muted" %>
<%= f.check_box :set_unavailibility %>
<% if @property.set_unavailibility %>
<% else %>
<% end %>
<%= f.label :can_hire_before_months, t("property_hire.how_many_months_ago_can_be_hired"), :class => "control-label muted" %>
<%= f.select :can_hire_before_months, options_for_select([[t("property_hire.no_limit"),0]] + (1..12).to_a.map{|month| [t("property_hire.month", month: month), month]},f.object.can_hire_before_months) %>
<%= f.label :need_hire_before, t("property_hire.need_hire_before"), :class => "control-label muted" %>
<% units = ['month', 'day', 'hour', 'minute'] %>
<%= f.number_field :need_hire_before, :min=>0 %>
<%= f.select :need_hire_before_unit, options_for_select(units.map{|unit| [t("property_hire._#{unit}"), unit]},f.object.need_hire_before_unit) %>
<% @property.special_unavailable_dates.each_with_index do |dt, idx| %>
<% end %>
<%= f.label :start_date, t("property_hire.start_date"), :class => "control-label muted" %>
<%= f.datetime_picker :start_date, :picker_type => "date", :no_label => true, :new_record => @property.new_record?, :data=>{"picker-type" => "range", "range" => "start"}, :format => "yyyy/MM/dd" %>
<%= f.label :end_date, t("property_hire.end_date"), :class => "control-label muted" %>
<%= f.datetime_picker :end_date, :picker_type => "date", :no_label => true, :new_record => @property.new_record?, :data=>{"picker-type" => "range", "range" => "end"}, :format => "yyyy/MM/dd" %>
<%= f.label :start_time, t("property_hire.limit_start_time"), :class => "control-label muted" %>
<%= f.datetime_picker :start_time, :picker_type => "time", :no_label => true, :new_record => @property.new_record?, :value => (Time.parse(@property.start_time) rescue "") %>
<%= f.label :end_time, t("property_hire.limit_end_time"), :class => "control-label muted" %>
<%= f.datetime_picker :end_time, :picker_type => "time", :no_label => true, :new_record => @property.new_record?, :value => (Time.parse(@property.end_time) rescue "") %>
<% @site_in_use_locales.each do |locale| %>
<%= f.fields_for :description_translations do |f| %>
<%= f.text_field locale, value: (@property.description_translations[locale.to_s] rescue nil) %>
<% end %>
<% end %>
<% @site_in_use_locales.each do |locale| %>
<%= f.fields_for :unavailibility_note_translations do |f| %>
<%= f.text_area locale, value: (@property.unavailibility_note_translations[locale.to_s] rescue nil) %>
<% end %>
<% end %>
<%= f.label :set_availability, t("property_hire.set_availability"), :class => "control-label muted" %>
<%= f.check_box :set_availability %>
<% if @property.set_availability %>
<% else %>
<% end %>
<% all_day_settings = f.object.all_day_settings %>
<% setting_count = 0 %>
<% Property::WEEKDAYS.each_with_index do |weekday,i| %>
-
<% if all_day_settings[i.to_s] %>
<% all_day_settings[i.to_s].each_with_index do |setting,j| %>
<%= f.fields_for :property_day_settings, setting,:child_index => setting_count do |f| %>
<%= render :partial => "time_form", :locals=>{:key=>j,:day=>i,:f=>f} %>
<% setting_count += 1 %>
<% end %>
<% end %>
<% end %>
<%=t(:add)%>
<% end %>
<% fields_name = f.object.class::FIELDSNAME %>
<%= t('property_hire.field_name') %> |
<%= t('property_hire.name') %> |
<%= t('property_hire.placeholder') %> |
<%= t('property_hire.disable') %> |
<%= t('property_hire.required') %> |
<% fields_name.each do |field_name| %>
<%= 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)) %>
|
<% end %>
<% field_name = "enable_notes_selector" %>
<% field_name = "notes_selector" %>
<% @property[field_name].each do |index,sub_hash| %>
❌
<% @property["#{field_name}"]["#{index}"]["value"].values.first.each_with_index do |v,val_index|%>
<% end %>
<%=t("property_hire.add_choice")%>
<% end %>
<%=t(:add)%>
<%= t(:language) %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
-
<%= t(locale) %>
<% end %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
<% 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" %>