fixed polyfill issue and added some for label radio
This commit is contained in:
parent
833e156206
commit
e0c96b2f54
|
@ -61,7 +61,8 @@ class PHire
|
||||||
viewButton = true
|
viewButton = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
title = startt.strftime("%H:%M") + " ~ " + endt.strftime("%H:%M") + " " + self.reason_for_hire
|
label = self.send(self.property.calendar_label_field_name) rescue ""
|
||||||
|
title = startt.strftime("%H:%M") + " ~ " + endt.strftime("%H:%M") + " " + label
|
||||||
{
|
{
|
||||||
:id => self.id.to_s,
|
:id => self.id.to_s,
|
||||||
# :title => (self.reason_for_hire.to_s + " "+ self.tmp_reason_for_hire.to_s).html_safe,
|
# :title => (self.reason_for_hire.to_s + " "+ self.tmp_reason_for_hire.to_s).html_safe,
|
||||||
|
|
|
@ -72,6 +72,7 @@ class Property
|
||||||
field :custom_field_names, type: Array
|
field :custom_field_names, type: Array
|
||||||
field :default_field_names, type: Array
|
field :default_field_names, type: Array
|
||||||
field :copy_id
|
field :copy_id
|
||||||
|
field :calendar_label_field_name
|
||||||
field :except_clone_relations, :type=>Array, :default => []
|
field :except_clone_relations, :type=>Array, :default => []
|
||||||
belongs_to :property_location
|
belongs_to :property_location
|
||||||
has_many :p_hires
|
has_many :p_hires
|
||||||
|
|
|
@ -64,6 +64,9 @@
|
||||||
.apply_default_time_settings{
|
.apply_default_time_settings{
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<% content_for :page_specific_css do %>
|
<% content_for :page_specific_css do %>
|
||||||
<%= stylesheet_link_tag "lib/main-forms" %>
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||||
|
@ -596,6 +599,7 @@
|
||||||
<th><%= t('property_hire.placeholder') %></th>
|
<th><%= t('property_hire.placeholder') %></th>
|
||||||
<th><%= t('property_hire.disable') %></th>
|
<th><%= t('property_hire.disable') %></th>
|
||||||
<th><%= t('property_hire.required') %></th>
|
<th><%= t('property_hire.required') %></th>
|
||||||
|
<th><%= t('property_hire.for_label') %></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% fields_name.each do |field_name| %>
|
<% fields_name.each do |field_name| %>
|
||||||
|
@ -615,7 +619,11 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name='<%= "#{f.object_name}[#{field_name}][required]" %>' value="false">
|
<input type="hidden" name='<%= "#{f.object_name}[#{field_name}][required]" %>' value="false">
|
||||||
<%= check_box_tag("#{f.object_name}[#{field_name}][required]", "true" , (f.object.send(field_name)["required"] == "true" rescue false)) %>
|
<%= check_box_tag("#{f.object_name}[#{field_name}][required]", "true" , (f.object.send(field_name)["required"] == "true" rescue false), class: "for_required") %>
|
||||||
|
<% for_label = f.object.send(field_name)["required"] == "true" ? true : false %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= f.radio_button :calendar_label_field_name, field_name, {:class => "for_label_selection #{(for_label == true ? '' : 'hide')}" } %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -759,7 +767,19 @@
|
||||||
}else{
|
}else{
|
||||||
$("#selector_block").css("display","");
|
$("#selector_block").css("display","");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// adding for label selector
|
||||||
|
$("input.for_required").on("click", function() {
|
||||||
|
var dom = $(this).parent().parent().find(".for_label_selection")
|
||||||
|
if($(this).is(":checked")){
|
||||||
|
dom.removeClass("hide");
|
||||||
|
}else{
|
||||||
|
dom.addClass("hide");
|
||||||
|
dom.removeAttr("checked");
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
$("#property_set_unavailibility").on("click",function(){
|
$("#property_set_unavailibility").on("click",function(){
|
||||||
if($(this).is(":checked")){
|
if($(this).is(":checked")){
|
||||||
$("#set_unavailibility_div").show();
|
$("#set_unavailibility_div").show();
|
||||||
|
@ -896,6 +916,8 @@
|
||||||
$("#selector_block").css("display","");
|
$("#selector_block").css("display","");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
var setting_count = <%=setting_count%>;
|
var setting_count = <%=setting_count%>;
|
||||||
var default_time_settings = <%= PropertyHireSetting.first.default_time_settings.map{|s| s.attributes.except("_id","created_at","updated_at")}.to_s.gsub("=>",": ").html_safe rescue "[]" %>
|
var default_time_settings = <%= PropertyHireSetting.first.default_time_settings.map{|s| s.attributes.except("_id","created_at","updated_at")}.to_s.gsub("=>",": ").html_safe rescue "[]" %>
|
||||||
<% property_day_setting = f.object.property_day_settings.new(:id=>nil) %>
|
<% property_day_setting = f.object.property_day_settings.new(:id=>nil) %>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<% OrbitHelper.render_css_in_head(["basic/bootstrap-datetimepicker.css","property_hire_fullcalendar.css","property_hire_calendar"]) %>
|
<% OrbitHelper.render_css_in_head(["basic/bootstrap-datetimepicker.css","property_hire_fullcalendar.css","property_hire_calendar"]) %>
|
||||||
<%= javascript_include_tag "validator.js" %>
|
<%= javascript_include_tag "validator.js" %>
|
||||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.DateTimeFormat,Intl.DateTimeFormat.~locale.en,Intl.NumberFormat.~locale.en"></script>
|
<!--<script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.DateTimeFormat,Intl.DateTimeFormat.~locale.en,Intl.NumberFormat.~locale.en"></script>-->
|
||||||
<script type="text/javascript" src="/assets/property_hire_fullcalendar.min.js"></script>
|
<script type="text/javascript" src="/assets/property_hire_fullcalendar.min.js"></script>
|
||||||
<script type="text/javascript" src="/assets/property_hire_calendar_frontend.js"></script>
|
<script type="text/javascript" src="/assets/property_hire_calendar_frontend.js"></script>
|
||||||
<script type="text/javascript" src="/assets/locale-all.min.js"></script>
|
<script type="text/javascript" src="/assets/locale-all.min.js"></script>
|
||||||
|
|
|
@ -211,3 +211,4 @@ en:
|
||||||
month: Month
|
month: Month
|
||||||
all_properties: All Properties
|
all_properties: All Properties
|
||||||
export_reservation_data: Export data
|
export_reservation_data: Export data
|
||||||
|
for_label: For Label
|
||||||
|
|
|
@ -232,4 +232,5 @@ zh_tw:
|
||||||
week: 週模式
|
week: 週模式
|
||||||
month: 月模式
|
month: 月模式
|
||||||
all_properties: All Properties
|
all_properties: All Properties
|
||||||
export_reservation_data: Export data
|
export_reservation_data: Export data
|
||||||
|
for_label: For Label
|
Loading…
Reference in New Issue