parent
b97a590b5c
commit
2a2121a7c8
Binary file not shown.
After Width: | Height: | Size: 182 B |
|
@ -12,6 +12,17 @@ class Admin::PropertyHiresController < OrbitAdminController
|
|||
|
||||
@properties = search_data(@properties,[:title]).page(params[:page]).per(10)
|
||||
end
|
||||
def fields_display_order
|
||||
uid = params[:id].split("-").last
|
||||
@property = Property.find_by(:uid=>uid)
|
||||
end
|
||||
def update_fields_display_order
|
||||
uid = params[:id].split("-").last
|
||||
@property = Property.find_by(:uid=>uid)
|
||||
prop = params.require(:property).permit!
|
||||
@property.update_attributes(prop)
|
||||
redirect_to params[:referer_url]
|
||||
end
|
||||
def order
|
||||
@properties = Property.all.sort_order
|
||||
end
|
||||
|
@ -84,18 +95,13 @@ class Admin::PropertyHiresController < OrbitAdminController
|
|||
end
|
||||
flash.now[:notice] = "Updated Fields"
|
||||
property.p_hire_fields.each{|t| t.destroy if t["to_delete"] == true}
|
||||
redirect_to admin_property_hires_path(:locale => params[:locale]) and return
|
||||
else
|
||||
property.update_attributes(@property_params)
|
||||
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue []
|
||||
email = User.all.select{|v| v.is_admin? && v.user_name != 'rulingcom'}.collect{|v| v.member_profile.email} if email.length == 0
|
||||
Admin::PropertyHiresHelper::HireMethod.send_mail('edit',email,property.id,nil,nil,current_user.id)
|
||||
if params[:page]
|
||||
redirect_to admin_property_hires_path(:page => params[:page],:locale => params[:locale])
|
||||
else
|
||||
redirect_to admin_property_hires_path(:locale => params[:locale])
|
||||
end
|
||||
end
|
||||
redirect_to params[:referer_url]
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
@ -221,7 +221,8 @@ class PropertyHiresController < ApplicationController
|
|||
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue []
|
||||
email = User.all.select{|v| v.is_admin? && v.user_name != 'rulingcom'}.collect{|v| v.member_profile.email} if email.length == 0
|
||||
email << hire.hiring_person_email
|
||||
Admin::PropertyHiresHelper::HireMethod.send_mail('p_hire',email,property.id,nil,hire.id)
|
||||
email = email.select{|e| e.present?}
|
||||
Admin::PropertyHiresHelper::HireMethod.send_mail('p_hire',email,property.id,nil,hire.id,(current_user.id rescue nil))
|
||||
end
|
||||
redirect_to index_page
|
||||
else
|
||||
|
|
|
@ -27,7 +27,24 @@ class PHireField
|
|||
has_many :p_hire_field_values, autosave: true, dependent: :destroy
|
||||
accepts_nested_attributes_for :p_hire_field_values, :allow_destroy => true
|
||||
before_save :check_option_list
|
||||
|
||||
before_destroy do
|
||||
@property = self.property
|
||||
if @property && @property.custom_field_names
|
||||
@property.custom_field_names.delete("p_hire_fields.#{self.id}")
|
||||
@property.save
|
||||
end
|
||||
end
|
||||
after_save do
|
||||
unless self.disabled
|
||||
@property = self.property
|
||||
if @property && @property.custom_field_names
|
||||
if self.new_record? || !(@property.custom_field_names.include?("p_hire_fields.#{self.id}"))
|
||||
@property.custom_field_names << "p_hire_fields.#{self.id}"
|
||||
@property.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
def markup_value
|
||||
get_data["option_list"]
|
||||
end
|
||||
|
|
|
@ -4,6 +4,8 @@ class Property
|
|||
include OrbitTag::Taggable
|
||||
include OrbitCategory::Categorizable
|
||||
include Slug
|
||||
|
||||
FIELDSNAME=["hiring_person_email","hiring_person_number","hiring_person_name","reason_for_hire","note_for_hire","organization" ,"person_in_charge" ,"tel_of_person_in_charge" ,"department" ,"contact_person" ,"tel_of_contact_person" , "mobile_phone_of_contact_person" ,"contact_person_Email" ,"contact_person_department"]
|
||||
field :custom_calendar_type, type: Integer, default: 0 #0=>預設, 1=> 顯示, 2=> 不顯示
|
||||
field :custom_carousel_image_width, type: String, default: ""
|
||||
field :display_img, :type => Boolean, :default => false
|
||||
|
@ -34,7 +36,12 @@ class Property
|
|||
field :start_date, type: DateTime
|
||||
field :end_date, type: DateTime
|
||||
field :description, :localize => true
|
||||
field :unavailibility_note, :localize => true
|
||||
field :unavailibility_note, :localize => true
|
||||
field :hiring_person_email, type: Hash, default: {"enable"=>"1","required"=>"true"}
|
||||
field :hiring_person_number, type: Hash, default: {"enable"=>"1","required"=>"true"}
|
||||
field :hiring_person_name, type: Hash, default: {"enable"=>"1","required"=>"true"}
|
||||
field :reason_for_hire, type: Hash, default: {"enable"=>"1","required"=>"true"}
|
||||
field :note_for_hire
|
||||
field :organization
|
||||
field :person_in_charge
|
||||
field :tel_of_person_in_charge
|
||||
|
@ -46,6 +53,9 @@ class Property
|
|||
field :contact_person_department
|
||||
field :enable_notes_selector , type: Boolean, default: false
|
||||
field :notes_selector ,type: Hash, default: {}
|
||||
field :enable_fields_sort , type: Boolean, default: false
|
||||
field :custom_field_names, type: Array
|
||||
field :default_field_names, type: Array
|
||||
belongs_to :property_location
|
||||
has_many :p_hires
|
||||
has_many :hire_email_sets, :autosave => true, :dependent => :destroy, :inverse_of => :property
|
||||
|
@ -73,10 +83,40 @@ class Property
|
|||
"Saturday"
|
||||
]
|
||||
CAlENDARTYPE = ["default","display","not_display"]
|
||||
after_initialize do
|
||||
unless self.new_record?
|
||||
save_flag = false
|
||||
@no_validate = true
|
||||
if self.default_field_names.nil?
|
||||
self.default_field_names = self.get_all_fields(true)
|
||||
save_flag = true
|
||||
end
|
||||
if self.custom_field_names.nil?
|
||||
self.custom_field_names = self.get_all_fields(true)
|
||||
save_flag = true
|
||||
end
|
||||
if save_flag
|
||||
self.save
|
||||
end
|
||||
end
|
||||
end
|
||||
before_create do
|
||||
max_position = self.class.max(:order_position)
|
||||
max_position = -1 if max_position.nil?
|
||||
self.order_position = max_position + 1
|
||||
@no_validate = true
|
||||
self.default_field_names = self.get_all_fields(true)
|
||||
self.custom_field_names = self.get_all_fields(true)
|
||||
end
|
||||
before_save do
|
||||
unless @no_validate
|
||||
self.default_field_names = self.get_all_fields(true)
|
||||
self.class::FIELDSNAME.each do |f|
|
||||
if((self.send(f)["enable"] == "1" rescue true) && !(self.custom_field_names.include?(f)))
|
||||
self.custom_field_names << f
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
after_save do
|
||||
self.change_day_setting_status
|
||||
|
@ -123,7 +163,7 @@ class Property
|
|||
def disable_view_calendar_page
|
||||
@@disable_view_calendar_page
|
||||
end
|
||||
def custom_text(field_name,type,locale=nil)
|
||||
def custom_text(field_name,type="name",locale=nil)
|
||||
locale = locale || I18n.locale
|
||||
default_text = I18n.with_locale(locale){I18n.t("property_hire.#{field_name}")}
|
||||
if (self.send(field_name)[type][locale.to_s].present? rescue false)
|
||||
|
@ -432,11 +472,33 @@ class Property
|
|||
end
|
||||
|
||||
def get_attribute_values(attribute_type=nil)
|
||||
@attribute_values = attribute_type.seminar_signup_values rescue nil
|
||||
@attribute_values = attribute_type.p_hire_field_values rescue nil
|
||||
end
|
||||
def get_value_from_field_id(field_id,attribute_type=nil)
|
||||
values = get_attribute_values(attribute_type)
|
||||
value = values.detect {|value| value.seminar_signup_field_id == field_id} rescue nil
|
||||
value = values.detect {|value| value.p_hire_field_id == field_id} rescue nil
|
||||
value ? value : nil
|
||||
end
|
||||
def get_basic_fields
|
||||
basic_fields = self.class::FIELDSNAME
|
||||
basic_fields = basic_fields.select{|f| (self.send(f)["enable"] == "1" rescue true)}
|
||||
end
|
||||
def get_all_fields(get_default=false)
|
||||
@default_field_names = nil if @default_field_names.nil?
|
||||
if get_default
|
||||
if @default_field_names.nil?
|
||||
basic_fields = self.get_basic_fields
|
||||
custom_fields = []
|
||||
self.p_hire_fields.each do |p_hire_field|
|
||||
unless p_hire_field.disabled
|
||||
custom_fields << "p_hire_fields.#{p_hire_field.id}"
|
||||
end
|
||||
end
|
||||
@default_field_names = basic_fields + custom_fields
|
||||
end
|
||||
return @default_field_names
|
||||
else
|
||||
self.enable_fields_sort ? self.custom_field_names : self.default_field_names
|
||||
end
|
||||
end
|
||||
end
|
|
@ -201,7 +201,7 @@
|
|||
<% if @property.image.file %>
|
||||
<%= image_tag @property.image %>
|
||||
<% else %>
|
||||
<img src="http://www.placehold.it/50x50/EFEFEF/AAAAAA" />
|
||||
<img src="/assets/property_hire/AAAAAA.png" />
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
|
||||
|
@ -449,7 +449,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="settings">
|
||||
<% fields_name = ["organization" ,"person_in_charge" , "tel_of_person_in_charge" , "department" , "contact_person" , "tel_of_contact_person" , "mobile_phone_of_contact_person" , "contact_person_Email" , "contact_person_department"] %>
|
||||
<% fields_name = f.object.class::FIELDSNAME %>
|
||||
<div style="padding: 1.2em;">
|
||||
<table style="margin: 0;">
|
||||
<thead>
|
||||
|
@ -604,12 +604,12 @@
|
|||
</div>
|
||||
<!-- Form Actions -->
|
||||
<div class="form-actions">
|
||||
<% if params[:page] %>
|
||||
<input type="hidden" name="page" value="<%= params[:page] %>" />
|
||||
<% end %>
|
||||
<% referer = request.referer rescue nil %>
|
||||
<% referer = get_referer_url if referer.blank? || request.host != URI.parse(URI.encode(referer)).host %>
|
||||
<input type="hidden" name="referer_url" value="<%= referer %>">
|
||||
<%= 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" %>
|
||||
<%= link_to t('cancel'), referer, :class=>"btn" %>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$("#bulletin_display_img").click(function(){$("#image_display_setting").toggleClass("hide")})
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<% if form_image.file.file %>
|
||||
<%= image_tag form_image.file %>
|
||||
<% else %>
|
||||
<img src="http://www.placehold.it/50x50/EFEFEF/AAAAAA" />
|
||||
<img src="/assets/property_hire/AAAAAA.png" />
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
|
||||
<div class="form-actions">
|
||||
<button type="button" class="btn btn-success add-attributes"><%= t(:add_attribute_field) %></button>
|
||||
<% referer = request.referer rescue nil %>
|
||||
<% referer = get_referer_url if referer.blank? || request.host != URI.parse(URI.encode(referer)).host %>
|
||||
<input type="hidden" name="referer_url" value="<%= referer %>">
|
||||
<%= hidden_field_tag 'id', params[:id] if !params[:id].blank? %>
|
||||
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
|
|
|
@ -76,6 +76,10 @@
|
|||
max-height: 400px;
|
||||
overflow: initial;
|
||||
}
|
||||
.input-append{
|
||||
font-size: 1em;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<%= content_for :page_specific_css do %>
|
||||
<% ["basic/bootstrap-datetimepicker.css","property_hire_fullcalendar.css","property_hire_calendar"].each do |css| %>
|
||||
|
@ -668,7 +672,7 @@ ul.list-unstyled li {
|
|||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-<%=label_col%> col-sm-<%=input_col%>">
|
||||
<div id="property-avaialable-alert" style="margin-bottom: 5px; padding: 10px;<%= 'display: none;' unless recover %>" class="alert alert-success" role="alert"><b>Hooray! </b>This property is available.</div>
|
||||
<div id="property-avaialable-alert" style="margin-bottom: 5px; padding: 10px;<%= 'display: none;' unless recover %>" class="alert alert-success" role="alert"><%=t("property_hire.this_property_is_available",:default=>"<b>Hooray! </b>This property is available.").html_safe%></div>
|
||||
<div id="property-unavaialable-alert" style="margin-bottom: 5px; padding: 10px; display: none;" class="alert alert-danger" role="alert"><b>Sorry! </b><span> This property is available.</span></div>
|
||||
<div id="values-alert" style="margin-bottom: 5px; padding: 10px; display: none;" class="alert alert-warning" role="alert">
|
||||
<% hint1 = t("property_hire.please_select_recurring_interval_and_recurring_end_time",:default=>"") %>
|
||||
|
@ -696,86 +700,53 @@ ul.list-unstyled li {
|
|||
<img style="display: none;" width="40" src="/assets/spin.gif" id="spinner" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :hiring_person_email, "*"+t("property_hire.hiring_person_email"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_field :hiring_person_email, :class => "form-control", :value => (recover ? hire.hiring_person_email : ( current_user.member_profile.email rescue "")), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :hiring_person_number, "*"+t("property_hire.hiring_person_number"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_field :hiring_person_number, :class => "form-control", :value => (recover ? hire.hiring_person_number : ( current_user.member_profile.mobile_no rescue "")), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :hiring_person_name, "*"+t("property_hire.hiring_person_name"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_field :hiring_person_name, :class => "form-control", :value => (recover ? hire.hiring_person_name : ( current_user.name rescue "")), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
<%= f.hidden_field :hiring_person_id, :value => (current_user.member_profile.id.to_s rescue "") %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :reason_for_hire, "*"+t("property_hire.reason_for_hire"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_field :reason_for_hire, :class => "form-control", :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
</div>
|
||||
</div>
|
||||
<% default_values = {"hiring_person_email" => ( current_user.member_profile.email rescue ""),
|
||||
"hiring_person_number" => ( current_user.member_profile.mobile_no rescue ""),
|
||||
"hiring_person_name" => ( current_user.name rescue "")
|
||||
} %>
|
||||
<% if recover
|
||||
default_values = default_values.merge(Property::FIELDSNAME.map{|f| [f,hire.send(f)]}.to_h)
|
||||
end %>
|
||||
<%= f.hidden_field :hiring_person_id, :value => (current_user.member_profile.id.to_s rescue "") %>
|
||||
<% custom_field_inputs = {} %>
|
||||
<% custom_field_type = {"note_for_hire"=>"text_area"} %>
|
||||
<% if(property.enable_notes_selector rescue false) %>
|
||||
<% property.notes_selector.each do |index,sub_hash| %>
|
||||
<% name = sub_hash["name"][I18n.locale.to_s] %>
|
||||
<% name = sub_hash["name"].values.select{|v| v.present?}.first.to_s if name.blank? %>
|
||||
<% values = sub_hash["value"][I18n.locale.to_s] %>
|
||||
<% values = sub_hash["value"].values.select{|v| v.present?}.first.to_s if values.blank? %>
|
||||
<% type = sub_hash["type"] %>
|
||||
<div class="form-group">
|
||||
<%= f.label "notes_selector[#{index}]", name, :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<% values.each_with_index do |v,i| %>
|
||||
<label class="checkbox-inline">
|
||||
<input type="<%=type%>" name="p_hire[notes_selector][<%=index.to_s%>][]" value="<%=i%>" <%= (type=="radio" && i == 0) ? "checked=\"checked\"" : "" %>>
|
||||
<%=v%>
|
||||
</label>
|
||||
<% end %>
|
||||
<% if type == "checkbox" && (values.count > 1) %>
|
||||
<small class="help-block"><%= t("property_hire.checkbox_hint") %></small>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="form-group">
|
||||
<%= f.label :note_for_hire, t("property_hire.note_for_hire"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_area :note_for_hire, :class => "form-control" %>
|
||||
</div>
|
||||
</div>
|
||||
<% custom_field_inputs["note_for_hire"] = render(:partial=>"note_for_hire",:locals=>{:f=>f,:property=>property}) %>
|
||||
<% end %>
|
||||
<% fields_name = ["organization" ,"person_in_charge" , "tel_of_person_in_charge" , "department" , "contact_person" , "tel_of_contact_person" , "mobile_phone_of_contact_person" , "contact_person_Email" , "contact_person_department"] %>
|
||||
<% fields_name = property.get_all_fields %>
|
||||
<% has_p_hire_fields = property.p_hire_fields.count != 0
|
||||
p_hire_fields = {}
|
||||
if has_p_hire_fields
|
||||
p_hire_fields = property.p_hire_fields.map{|rf| [rf.id.to_s,rf]}.to_h
|
||||
end
|
||||
%>
|
||||
<% @form_index = 0 %>
|
||||
<% fields_name.each do |field_name| %>
|
||||
<% if(property[field_name]["enable"] == "1" rescue false) %>
|
||||
<% required = (property[field_name]["required"] == "true" rescue false) %>
|
||||
<div class="form-group">
|
||||
<%= f.label field_name, (required ? "*" : "") + property.custom_text(field_name,"name"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<% placeholder = property.custom_text(field_name,"placeholder") %>
|
||||
<% if required %>
|
||||
<%= f.text_field field_name, :class => "form-control", :placeholder => placeholder, :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
<% else %>
|
||||
<%= f.text_field field_name, :class => "form-control", :placeholder => placeholder %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if property.p_hire_fields.count != 0 %>
|
||||
<% p_hire = PHire.new(:id=>nil) %>
|
||||
<% @form_index = 0 %>
|
||||
<% property.p_hire_fields.asc(:_id).each do |rf| %>
|
||||
<% if has_p_hire_fields && field_name.include?("p_hire_fields") %>
|
||||
<div class="form-group">
|
||||
<%= rf.block_helper(property,@form_index,false,"p_hire",p_hire, rf.to_require,label_col) %>
|
||||
<% rf = p_hire_fields[field_name.sub("p_hire_fields.",'')] %>
|
||||
<%= rf.block_helper(property,@form_index,false,"p_hire",hire, rf.to_require,label_col) %>
|
||||
</div>
|
||||
<% @form_index = @form_index +1 %>
|
||||
<% else %>
|
||||
<% if(property[field_name]["enable"] == "1" rescue true) %>
|
||||
<% required = (property[field_name]["required"] == "true" rescue false) %>
|
||||
<% if custom_field_inputs[field_name] %>
|
||||
<%= custom_field_inputs[field_name] %>
|
||||
<% else %>
|
||||
<div class="form-group">
|
||||
<%= f.label field_name, (required ? "*" : "") + property.custom_text(field_name,"name"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<% placeholder = property.custom_text(field_name,"placeholder") %>
|
||||
<% if custom_field_type[field_name] %>
|
||||
<%= f.send(custom_field_type[field_name], field_name , {:class => "form-control", :placeholder => placeholder, :value => default_values[field_name], :data => (required ? {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} : nil)}) %>
|
||||
<% else %>
|
||||
<%= f.text_field field_name, :class => "form-control", :placeholder => placeholder, :value => default_values[field_name], :data => (required ? {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} : nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if allow_no_logins_user && current_user.nil? %>
|
||||
|
@ -790,7 +761,9 @@ ul.list-unstyled li {
|
|||
<% end %>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-<%=label_col%> col-sm-<%=input_col%>">
|
||||
<%= f.hidden_field :id %>
|
||||
<% if f.object.id.present? %>
|
||||
<%= f.hidden_field :id %>
|
||||
<% end %>
|
||||
<%= f.submit t("property_hire.save"), :class => "btn btn-primary" %>
|
||||
<%= f.hidden_field :property_id, :value => property.id %>
|
||||
<input type="hidden" name="url" value="<%= url %>" />
|
||||
|
|
|
@ -0,0 +1,198 @@
|
|||
<style>
|
||||
.icons-list-2 {
|
||||
cursor: all-scroll;
|
||||
}
|
||||
legend{
|
||||
width: auto;
|
||||
text-align: center;
|
||||
padding: 0 1em;
|
||||
}
|
||||
.position-text-div {
|
||||
cursor: text;
|
||||
margin: -8px;
|
||||
padding: 8px;
|
||||
}
|
||||
.position-text-div:hover {
|
||||
background: aqua;
|
||||
}
|
||||
</style>
|
||||
<%= form_for @property , :url => {:action => "update_fields_display_order"}, html: {class: "form-horizontal main-forms"} do |f| %>
|
||||
<% p_hire_fields = @property.p_hire_fields.map{|rf| [rf.id.to_s,rf]}.to_h %>
|
||||
<fieldset>
|
||||
<legend><%= @property.title %></legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="enable_fields_sort"><%=t("property_hire.enable_fields_sort")%></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :enable_fields_sort, :id=>"enable_fields_sort" %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fields_sort_block" class="<%= 'hide' unless f.object.enable_fields_sort %>">
|
||||
<table width="100%" id="property_order_table" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><%= t("property_hire.sort_number") %></th>
|
||||
<th><%= t("property_hire.field_name") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @property.custom_field_names.each_with_index do |field_name,i| %>
|
||||
<tr data-index="<%=i%>">
|
||||
<td><span class="brand"><i class="icons-list-2"></i></span></td>
|
||||
<td class="position-text">
|
||||
<div class="position-text-div" data-value="<%= (i + 1).to_s %>"><%= (i + 1).to_s %></div>
|
||||
</td>
|
||||
<td>
|
||||
<%= field_name.include?("p_hire_fields") ? p_hire_fields[field_name.sub("p_hire_fields.",'')].title : @property.custom_text(field_name) %>
|
||||
<%= hidden_field_tag "#{f.object_name}[custom_field_names][]", field_name %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<% referer = request.referer rescue nil %>
|
||||
<% referer = get_referer_url if referer.blank? || request.host != URI.parse(URI.encode(referer)).host %>
|
||||
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
||||
<input type="hidden" name="referer_url" value="<%= referer %>">
|
||||
<%= link_to t('cancel'), referer, :class=>"btn" %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<script>
|
||||
$("#enable_fields_sort").click(function(){
|
||||
$("#fields_sort_block").toggleClass("hide");
|
||||
update_table_cache_width();
|
||||
})
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var makeEditable = function(){
|
||||
var input_box = $("<input type='text'/>"),
|
||||
el = $(this);
|
||||
input_box.addClass("editable-input");
|
||||
input_box.val(el.data("value"));
|
||||
input_box.attr("data-old-id",el.data("value"));
|
||||
input_box.on("blur",function(){
|
||||
putBackdiv($(this));
|
||||
});
|
||||
input_box.on("keypress",function(e){
|
||||
if(e.keyCode == 13 || e.keyCode == 27){
|
||||
putBackdiv($(this),e.keyCode);
|
||||
}
|
||||
})
|
||||
el.parent().html(input_box);
|
||||
input_box.focus();
|
||||
}
|
||||
|
||||
var putBackdiv = function(el,keyCode){
|
||||
current_value = parseInt((el.val() == "" ? el.data("old-id") : el.val())),
|
||||
old_value = parseInt(el.data("old-id"));
|
||||
if(isNaN(current_value) || keyCode == 27){
|
||||
current_value = old_value;
|
||||
}
|
||||
if(old_value != current_value){
|
||||
var new_index_value = (current_value > old_value ? current_value + 1 : current_value - 1),
|
||||
div = $("<div class='position-text-div' data-value='" + current_value + "'>" + new_index_value + "</div>");
|
||||
div.on("click",makeEditable);
|
||||
el.parent().html(div);
|
||||
sortTable(el.data("old-id"),current_value);
|
||||
}else{
|
||||
var div = $("<div class='position-text-div' data-value='" + current_value + "'>" + current_value + "</div>");
|
||||
div.on("click",makeEditable);
|
||||
el.parent().html(div);
|
||||
}
|
||||
}
|
||||
var sortTable = function(changed_index,changed_to){
|
||||
var table_element = document.getElementById("property_order_table"),
|
||||
data = [],
|
||||
allRows = table_element.rows;
|
||||
for(i = 1; i < allRows.length; i++){
|
||||
var thisRow = allRows[i],
|
||||
text = thisRow.cells[1].textContent.trim(),
|
||||
hash = {};
|
||||
hash.index = parseInt(text);
|
||||
text = thisRow.cells[2].innerHTML.trim();
|
||||
if(text != " "){
|
||||
hash.property = text;
|
||||
}
|
||||
data.push(hash);
|
||||
}
|
||||
data = data.sort(function(a,b){return a.index - b.index});
|
||||
renderSortedTable(data,table_element);
|
||||
}
|
||||
var renderSortedTable = function(data,table_element){
|
||||
var allRows = table_element.rows;
|
||||
for(i = 0;i < data.length; i++){
|
||||
var thisRow = allRows[i + 1],
|
||||
current_value = i + 1;
|
||||
thisRow.cells[1].innerHTML = "<div class='position-text-div' data-value='" + current_value + "'>" + current_value + "</div>";
|
||||
thisRow.cells[2].innerHTML = data[i].property;
|
||||
}
|
||||
$("#property_order_table div.position-text-div").on("click",makeEditable);
|
||||
}
|
||||
$("#property_order_table div.position-text-div").on("click",makeEditable);
|
||||
</script>
|
||||
<script>
|
||||
window.update_table_cache_width = function(){
|
||||
$( ".table tbody" ).each(function(i,tbody){
|
||||
var table = $(tbody).parents("table").eq(0);
|
||||
table.data("index",i);
|
||||
th_width[i] = [];
|
||||
table.find("thead th").each(function(j,th){
|
||||
th_width[i].push($(th).outerWidth(true));
|
||||
})
|
||||
})
|
||||
}
|
||||
var th_width = {};
|
||||
$(document).ready(function(){
|
||||
update_table_cache_width();
|
||||
$( ".table tbody" ).sortable({
|
||||
revert: true,
|
||||
axis: "y",
|
||||
handle: ".brand",
|
||||
start: function(event, ui){
|
||||
var item = ui.item;
|
||||
var target = $(event.target);
|
||||
var index = target.parents(".table").eq(0).data("index");
|
||||
item.css("width",target.width());
|
||||
item.find("td").each(function(i,td){
|
||||
$(td).width(th_width[index][i]);
|
||||
})
|
||||
},
|
||||
stop: function(event, ui) {
|
||||
var item = ui.item;
|
||||
item.css("width","");
|
||||
item.find("td").css("width","");
|
||||
},
|
||||
update: function(event, ui) {
|
||||
var item = ui.item;
|
||||
var org_index = item.data("index");
|
||||
console.log(org_index);
|
||||
var new_index = item.index();
|
||||
var indices = [org_index,new_index].sort();
|
||||
var table = item.parents(".table").eq(0);
|
||||
table.find("tbody tr").each(function(i,tr){
|
||||
if(i >= indices[0] && i <= indices[1]){
|
||||
var position_text_div = $(tr).find(".position-text-div");
|
||||
position_text_div.text(i+1).data("value",i+1);
|
||||
$(tr).data("index",i);
|
||||
}
|
||||
if(i > indices[1]){
|
||||
return;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
$(window).resize(function(){
|
||||
th_width = {};
|
||||
$( ".table tbody" ).each(function(i,tbody){
|
||||
var table = $(tbody).parents("table").eq(0);
|
||||
th_width[i] = [];
|
||||
table.find("thead th").each(function(j,th){
|
||||
th_width[i].push($(th).outerWidth(true));
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
|
@ -16,6 +16,7 @@
|
|||
<ul class="nav nav-pills">
|
||||
<li><a href="<%= edit_admin_property_hire_path(property, :page => params[:page]) %>"><%= t(:edit) %></a></li>
|
||||
<li><a href="<%= custom_fields_admin_property_hire_path(property) %>"><%= t("property_hire.custom_fields") %></a></li>
|
||||
<li><a href="<%= fields_display_order_admin_property_hire_path(property) %>"><%= t("property_hire.fields_display_order") %></a></li>
|
||||
<li><a href="<%= admin_property_hire_path(property.id, :page => params[:page]) %>" data-method="delete" data-confirm="Are you sure?"><%= t(:delete_) %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -5,6 +5,14 @@
|
|||
.icons-list-2 {
|
||||
cursor: all-scroll;
|
||||
}
|
||||
.position-text-div {
|
||||
cursor: text;
|
||||
margin: -8px;
|
||||
padding: 8px;
|
||||
}
|
||||
.position-text-div:hover {
|
||||
background: aqua;
|
||||
}
|
||||
</style>
|
||||
<div class="order-edit-notification"><%= t("property_hire.please_save") %></div>
|
||||
<table width="100%" id="property_order_table" class="table table-striped" class="web_soursce_table">
|
||||
|
@ -81,10 +89,10 @@
|
|||
allRows = table_element.rows;
|
||||
for(i = 1; i < allRows.length; i++){
|
||||
var thisRow = allRows[i],
|
||||
text = thisRow.cells[0].textContent.trim(),
|
||||
text = thisRow.cells[1].textContent.trim(),
|
||||
hash = {};
|
||||
hash.index = parseInt(text);
|
||||
text = thisRow.cells[1].innerHTML.trim();
|
||||
text = thisRow.cells[2].innerHTML.trim();
|
||||
if(text != " "){
|
||||
hash.property = text;
|
||||
}
|
||||
|
@ -99,8 +107,8 @@
|
|||
for(i = 0;i < data.length; i++){
|
||||
var thisRow = allRows[i + 1],
|
||||
current_value = i + 1;
|
||||
thisRow.cells[0].innerHTML = "<div class='position-text-div' data-value='" + current_value + "'>" + current_value + "</div>";
|
||||
thisRow.cells[1].innerHTML = data[i].property;
|
||||
thisRow.cells[1].innerHTML = "<div class='position-text-div' data-value='" + current_value + "'>" + current_value + "</div>";
|
||||
thisRow.cells[2].innerHTML = data[i].property;
|
||||
}
|
||||
$("#property_order_table div.position-text-div").on("click",makeEditable);
|
||||
}
|
||||
|
|
|
@ -25,14 +25,40 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% extra_fields_name = ["organization" ,"person_in_charge" , "tel_of_person_in_charge" , "department" , "contact_person" , "tel_of_contact_person" , "mobile_phone_of_contact_person" , "contact_person_Email" , "contact_person_department"] %>
|
||||
<% keys = ['hiring_person_name','hiring_person_email','start_time','end_time','recurring','recurring_interval','recurring_end_date','passed','reason_for_hire','note_for_hire'] %>
|
||||
<% used_extra_fields_name = extra_fields_name.select{|field_name| (property[field_name]["enable"] == "1" rescue false) } %>
|
||||
<% all_trans = keys.map{|k| t("property_hire.#{k}")} %>
|
||||
<% all_trans += used_extra_fields_name.map{|k| property.custom_text(k,"name")} %>
|
||||
<% keys.concat( used_extra_fields_name ) %>
|
||||
<%
|
||||
p_hire_fields = property.p_hire_fields.map{|rf| [rf.id.to_s,rf]}.to_h
|
||||
fields_name = property.get_all_fields
|
||||
basic_keys = ['hiring_person_name','hiring_person_email','start_time','end_time','recurring','recurring_interval','recurring_end_date','passed']
|
||||
fields_name = fields_name - basic_keys
|
||||
keys = basic_keys + fields_name
|
||||
keys = keys.select{|field_name| (property[field_name]["enable"] == "1" rescue true) }
|
||||
p_hire_fields = property.p_hire_fields.map{|rf| [rf.id.to_s,rf]}.to_h
|
||||
has_p_hire_fields = p_hire_fields.count != 0
|
||||
tmp_keys = []
|
||||
all_trans = keys.map do |k|
|
||||
if has_p_hire_fields && k.include?("p_hire_fields")
|
||||
tmp_keys << k.sub("p_hire_fields.",'')
|
||||
nil
|
||||
else
|
||||
tmp_keys << k
|
||||
property.custom_text(k,"name")
|
||||
end
|
||||
end
|
||||
%>
|
||||
<% p_hire_field_values = hire.p_hire_field_values.to_a %>
|
||||
<% keys.each_with_index do |k,i| %>
|
||||
<% v = hire.send(k) %>
|
||||
<% if has_p_hire_fields && k.include?("p_hire_fields")
|
||||
p_hire_field_id = tmp_keys[i]
|
||||
v = p_hire_field_values.select{|v| v.p_hire_field_id.to_s == p_hire_field_id}.first
|
||||
field_info = v.get_field_value rescue {}
|
||||
if field_info["title"].present? && !field_info["value"].nil?
|
||||
all_trans[i] = field_info["title"]
|
||||
v = field_info["value"]
|
||||
end
|
||||
else
|
||||
v = hire.send(k)
|
||||
end
|
||||
%>
|
||||
<% if !v.nil? && !(k.include?('recurring') && hire.recurring != true)%>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -54,15 +80,6 @@
|
|||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% hire.p_hire_field_values.each do |v| %>
|
||||
<% field_info = v.get_field_value rescue {} %>
|
||||
<% if field_info["title"].present? && !field_info["value"].nil? %>
|
||||
<tr>
|
||||
<td><%=field_info["title"]%>: </td>
|
||||
<td><%=field_info["value"]%></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
<% end%>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<% property.notes_selector.each do |index,sub_hash| %>
|
||||
<% name = sub_hash["name"][I18n.locale.to_s] %>
|
||||
<% name = sub_hash["name"].values.select{|v| v.present?}.first.to_s if name.blank? %>
|
||||
<% values = sub_hash["value"][I18n.locale.to_s] %>
|
||||
<% values = sub_hash["value"].values.select{|v| v.present?}.first.to_s if values.blank? %>
|
||||
<% type = sub_hash["type"] %>
|
||||
<div class="form-group">
|
||||
<%= f.label "notes_selector[#{index}]", name, :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<% values.each_with_index do |v,i| %>
|
||||
<label class="checkbox-inline">
|
||||
<input type="<%=type%>" name="p_hire[notes_selector][<%=index.to_s%>][]" value="<%=i%>" <%= (type=="radio" && i == 0) ? "checked=\"checked\"" : "" %>>
|
||||
<%=v%>
|
||||
</label>
|
||||
<% end %>
|
||||
<% if type == "checkbox" && (values.count > 1) %>
|
||||
<small class="help-block"><%= t("property_hire.checkbox_hint") %></small>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -543,86 +543,53 @@
|
|||
<img style="display: none;" width="40" src="/assets/spin.gif" id="spinner" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :hiring_person_email, "*"+t("property_hire.hiring_person_email"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_field :hiring_person_email, :class => "form-control", :value => (recover ? hire.hiring_person_email : ( current_user.member_profile.email rescue "")), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :hiring_person_number, "*"+t("property_hire.hiring_person_number"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_field :hiring_person_number, :class => "form-control", :value => (recover ? hire.hiring_person_number : ( current_user.member_profile.mobile_no rescue "")), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :hiring_person_name, "*"+t("property_hire.hiring_person_name"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_field :hiring_person_name, :class => "form-control", :value => (recover ? hire.hiring_person_name : ( current_user.name rescue "")), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
<%= f.hidden_field :hiring_person_id, :value => (current_user.member_profile.id.to_s rescue "") %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label :reason_for_hire, "*"+t("property_hire.reason_for_hire"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_field :reason_for_hire, :class => "form-control", :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
</div>
|
||||
</div>
|
||||
<% default_values = {"hiring_person_email" => ( current_user.member_profile.email rescue ""),
|
||||
"hiring_person_number" => ( current_user.member_profile.mobile_no rescue ""),
|
||||
"hiring_person_name" => ( current_user.name rescue "")
|
||||
} %>
|
||||
<% if recover
|
||||
default_values = default_values.merge(Property::FIELDSNAME.map{|f| [f,hire.send(f)]}.to_h)
|
||||
end %>
|
||||
<%= f.hidden_field :hiring_person_id, :value => (current_user.member_profile.id.to_s rescue "") %>
|
||||
<% custom_field_inputs = {} %>
|
||||
<% custom_field_type = {"note_for_hire"=>"text_area"} %>
|
||||
<% if(property.enable_notes_selector rescue false) %>
|
||||
<% property.notes_selector.each do |index,sub_hash| %>
|
||||
<% name = sub_hash["name"][I18n.locale.to_s] %>
|
||||
<% name = sub_hash["name"].values.select{|v| v.present?}.first.to_s if name.blank? %>
|
||||
<% values = sub_hash["value"][I18n.locale.to_s] %>
|
||||
<% values = sub_hash["value"].values.select{|v| v.present?}.first.to_s if values.blank? %>
|
||||
<% type = sub_hash["type"] %>
|
||||
<div class="form-group">
|
||||
<%= f.label "notes_selector[#{index}]", name, :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<% values.each_with_index do |v,i| %>
|
||||
<label class="checkbox-inline">
|
||||
<input type="<%=type%>" name="p_hire[notes_selector][<%=index.to_s%>][]" value="<%=i%>" <%= (type=="radio" && i == 0) ? "checked=\"checked\"" : "" %>>
|
||||
<%=v%>
|
||||
</label>
|
||||
<% end %>
|
||||
<% if type == "checkbox" && (values.count > 1) %>
|
||||
<small class="help-block"><%= t("property_hire.checkbox_hint") %></small>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="form-group">
|
||||
<%= f.label :note_for_hire, t("property_hire.note_for_hire"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<%= f.text_area :note_for_hire, :class => "form-control" %>
|
||||
</div>
|
||||
</div>
|
||||
<% custom_field_inputs["note_for_hire"] = render(:partial=>"note_for_hire",:locals=>{:f=>f,:property=>property}) %>
|
||||
<% end %>
|
||||
<% fields_name = ["organization" ,"person_in_charge" , "tel_of_person_in_charge" , "department" , "contact_person" , "tel_of_contact_person" , "mobile_phone_of_contact_person" , "contact_person_Email" , "contact_person_department"] %>
|
||||
<% fields_name = property.get_all_fields %>
|
||||
<% has_p_hire_fields = property.p_hire_fields.count != 0
|
||||
p_hire_fields = {}
|
||||
if has_p_hire_fields
|
||||
p_hire_fields = property.p_hire_fields.map{|rf| [rf.id.to_s,rf]}.to_h
|
||||
end
|
||||
%>
|
||||
<% @form_index = 0 %>
|
||||
<% fields_name.each do |field_name| %>
|
||||
<% if(property[field_name]["enable"] == "1" rescue false) %>
|
||||
<% required = (property[field_name]["required"] == "true" rescue false) %>
|
||||
<div class="form-group">
|
||||
<%= f.label field_name, (required ? "*" : "") + property.custom_text(field_name,"name"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<% placeholder = property.custom_text(field_name,"placeholder") %>
|
||||
<% if required %>
|
||||
<%= f.text_field field_name, :class => "form-control", :placeholder => placeholder, :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} %>
|
||||
<% else %>
|
||||
<%= f.text_field field_name, :class => "form-control", :placeholder => placeholder %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if property.p_hire_fields.count != 0 %>
|
||||
<% p_hire = PHire.new(:id=>nil) %>
|
||||
<% @form_index = 0 %>
|
||||
<% property.p_hire_fields.asc(:_id).each do |rf| %>
|
||||
<% if has_p_hire_fields && field_name.include?("p_hire_fields") %>
|
||||
<div class="form-group">
|
||||
<%= rf.block_helper(property,@form_index,false,"p_hire",p_hire, rf.to_require,label_col) %>
|
||||
<% rf = p_hire_fields[field_name.sub("p_hire_fields.",'')] %>
|
||||
<%= rf.block_helper(property,@form_index,false,"p_hire",hire, rf.to_require,label_col) %>
|
||||
</div>
|
||||
<% @form_index = @form_index +1 %>
|
||||
<% else %>
|
||||
<% if(property[field_name]["enable"] == "1" rescue true) %>
|
||||
<% required = (property[field_name]["required"] == "true" rescue false) %>
|
||||
<% if custom_field_inputs[field_name] %>
|
||||
<%= custom_field_inputs[field_name] %>
|
||||
<% else %>
|
||||
<div class="form-group">
|
||||
<%= f.label field_name, (required ? "*" : "") + property.custom_text(field_name,"name"), :class => "col-sm-#{label_col} control-label" %>
|
||||
<div class="col-sm-<%=input_col%>">
|
||||
<% placeholder = property.custom_text(field_name,"placeholder") %>
|
||||
<% if custom_field_type[field_name] %>
|
||||
<%= f.send(custom_field_type[field_name], field_name , {:class => "form-control", :placeholder => placeholder, :value => default_values[field_name], :data => (required ? {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} : nil)}) %>
|
||||
<% else %>
|
||||
<%= f.text_field field_name, :class => "form-control", :placeholder => placeholder, :value => default_values[field_name], :data => (required ? {"fv-validation" => "required;", "fv-messages" => "Cannot be empty;"} : nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if allow_no_logins_user && current_user.nil? %>
|
||||
|
@ -637,7 +604,9 @@
|
|||
<% end %>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-<%=label_col%> col-sm-<%=input_col%>">
|
||||
<%= f.hidden_field :id %>
|
||||
<% if f.object.id.present? %>
|
||||
<%= f.hidden_field :id %>
|
||||
<% end %>
|
||||
<%= f.submit t("property_hire.save"), :class => "btn btn-primary" %>
|
||||
<%= f.hidden_field :property_id, :value => property.id %>
|
||||
<input type="hidden" name="url" value="<%= url %>" />
|
||||
|
|
|
@ -2,7 +2,12 @@ en:
|
|||
lists:
|
||||
markups:
|
||||
hint_text: Hint Text
|
||||
restful_actions:
|
||||
fields_display_order: "Fields display order"
|
||||
property_hire:
|
||||
sort_number: Sort Number
|
||||
enable_fields_sort: Enable fields sort
|
||||
fields_display_order: "Fields display order"
|
||||
this_property_is_available: "<b>Hooray! </b>This property is available."
|
||||
recaptcha:
|
||||
recaptcha: Recaptcha
|
||||
|
|
|
@ -2,7 +2,12 @@ zh_tw:
|
|||
lists:
|
||||
markups:
|
||||
hint_text: 提示文字
|
||||
restful_actions:
|
||||
fields_display_order: "欄位顯示順序"
|
||||
property_hire:
|
||||
sort_number: 排序數
|
||||
enable_fields_sort: 啟用欄位排序
|
||||
fields_display_order: "欄位顯示順序"
|
||||
this_property_is_available: "<b>可借用</b>"
|
||||
recaptcha:
|
||||
recaptcha: 驗證碼
|
||||
|
@ -139,8 +144,6 @@ zh_tw:
|
|||
owner_phone: 管理人聯絡電話
|
||||
price: Price
|
||||
set_unavailibility: 設定不開放時段
|
||||
start_time: 可被借用開始時間
|
||||
end_time: 可被借用結束時間
|
||||
weekdays: 每週不開放預約日
|
||||
start_date: 套用限制開始日期
|
||||
end_date: 套用限制結束日期
|
||||
|
|
|
@ -18,6 +18,9 @@ Rails.application.routes.draw do
|
|||
get "edit_hire"
|
||||
patch "update_hire"
|
||||
get "custom_fields"
|
||||
get "fields_display_order"
|
||||
post "update_fields_display_order"
|
||||
patch "update_fields_display_order"
|
||||
end
|
||||
collection do
|
||||
get "my_bookings"
|
||||
|
|
Loading…
Reference in New Issue