<% hire_method = Admin::PropertyHiresHelper::HireMethod hire_method.set_input_name('property') %> <% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/fileupload" %> <%= stylesheet_link_tag "lib/main-list" %> <% 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 %>
<%= f.label :property_number, t("property_hire.property_number"), :class => "control-label muted" %>
<%= f.text_field :property_number %>
<%= f.label :can_be_hired, t("property_hire.can_be_hired"), :class => "control-label muted" %>
<%= f.check_box :can_be_hired %>
<%= 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_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 %>
<%= 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) %>
<% (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',action_name != 'new') %>
<%= 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',action_name != 'new') %>
<%= hidden_field_tag("property[hire_email_sets][#{index1}][field_name]",@email_set[index1]['field_name']) %> <%= hidden_field_tag("property[hire_email_sets][#{index1}][property_id]",@property.id) %>
<% end %>
<%= f.label :set_unavailibility, t("property_hire.set_unavailibility"), :class => "control-label muted" %>
<%= f.check_box :set_unavailibility %>
<% if @property.new_record? %>
<% @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: "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: "input-block-level", placeholder: t("property_hire.note"), value: (@property.note_translations[locale] rescue nil) %> <% end %>
<% end %>
<% if params[:page] %> <% end %> <%= hidden_field_tag("property[id]",@property.id) %> <%= f.submit t('submit'), class: 'btn btn-primary' %> <%= link_to t('cancel'), admin_property_hires_path, :class=>"btn" %>