added new field to show in the modal
This commit is contained in:
parent
6e6765e09d
commit
fd09fa43f2
|
@ -354,7 +354,7 @@ var EventDialog = function(calendar,event){
|
|||
'<h3>' + _event.title + '</h3>' +
|
||||
'</div>' +
|
||||
'<div class="modal-body">' +
|
||||
'<div class="event_summary">' + time_string + '</br>' + _event.reason_for_hire + '</div>' + _event.note +
|
||||
'<div class="event_summary">' + time_string + '</br>' + _event.stringToShow + '</div>' +
|
||||
(_event.error_message ? ("<br><span style=\"color: #FC4040;\">" + _event.error_message + "</span>") : "") +
|
||||
'</div>' +
|
||||
'<div class="modal-footer">' +
|
||||
|
|
|
@ -63,6 +63,8 @@ class PHire
|
|||
end
|
||||
label = self.send(self.property.calendar_label_field_name) rescue ""
|
||||
title = startt.strftime("%H:%M") + " ~ " + endt.strftime("%H:%M") + " " + label
|
||||
fields_to_show = Property::FIELDSNAME.select{|k,v| self.property.send(k)["for_display"] == "true"}
|
||||
string_to_show = fields_to_show.map{|k| "<b>" + self.property.send(k)["name"][I18n.locale] + "</b> : " + self.send(k)}.join(" <br /> ")
|
||||
{
|
||||
:id => self.id.to_s,
|
||||
# :title => (self.reason_for_hire.to_s + " "+ self.tmp_reason_for_hire.to_s).html_safe,
|
||||
|
@ -84,6 +86,7 @@ class PHire
|
|||
:classNames => classNames,
|
||||
:view_button => viewButton,
|
||||
:color => self.property.property_color,
|
||||
:stringToShow => string_to_show,
|
||||
:view_path => "/#{OrbitHelper.get_site_locale}/admin/property_hires/#{self.id.to_s}/show_booking_details",
|
||||
:view_path_name => I18n.t("property_hire.view")
|
||||
}
|
||||
|
|
|
@ -602,37 +602,43 @@
|
|||
<div style="padding: 1.2em;">
|
||||
<table style="margin: 0;">
|
||||
<thead>
|
||||
<th><%= t('property_hire.field_name') %></th>
|
||||
<th><%= t('property_hire.name') %></th>
|
||||
<th><%= t('property_hire.placeholder') %></th>
|
||||
<th><%= t('property_hire.disable') %></th>
|
||||
<th><%= t('property_hire.required') %></th>
|
||||
<th><%= t('property_hire.for_label') %></th>
|
||||
<th style="padding:0 5px;"><%= t('property_hire.field_name') %></th>
|
||||
<th style="padding:0 5px;"><%= t('property_hire.name') %></th>
|
||||
<th style="padding:0 5px;"><%= t('property_hire.placeholder') %></th>
|
||||
<th style="padding:0 5px;"><%= t('property_hire.disable') %></th>
|
||||
<th style="padding:0 5px;"><%= t('property_hire.required') %></th>
|
||||
<th style="padding:0 5px;"><%= t('property_hire.for_label') %></th>
|
||||
<th style="padding:0 5px;"><%= t('property_hire.for_display') %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% fields_name.each do |field_name| %>
|
||||
<tr>
|
||||
<td>
|
||||
<td style="padding:0 5px;">
|
||||
<%= t("property_hire.#{field_name}") %>
|
||||
</td>
|
||||
<td>
|
||||
<td style="padding:0 5px;">
|
||||
<%= render_custom_text_field(f,field_name,"name") %>
|
||||
</td>
|
||||
<td>
|
||||
<td style="padding:0 5px;">
|
||||
<%= render_custom_text_field(f,field_name,"placeholder") %>
|
||||
</td>
|
||||
<td>
|
||||
<td style="padding:0 5px;">
|
||||
<input type="hidden" name='<%= "#{f.object_name}[#{field_name}][enable]" %>' value="1">
|
||||
<%= check_box_tag("#{f.object_name}[#{field_name}][enable]", "0" , (f.object.send(field_name)["enable"] == "0" rescue false)) %>
|
||||
</td>
|
||||
<td>
|
||||
<td style="padding:0 5px;">
|
||||
<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), class: "for_required") %>
|
||||
<% for_label = f.object.send(field_name)["required"] == "true" ? true : false %>
|
||||
</td>
|
||||
<td>
|
||||
<td style="padding:0 5px;">
|
||||
<%= f.radio_button :calendar_label_field_name, field_name, {:class => "for_label_selection #{(for_label == true ? '' : 'hide')}" } %>
|
||||
</td>
|
||||
<td style="padding:0 5px;">
|
||||
<input type="hidden" name='<%= "#{f.object_name}[#{field_name}][for_display]" %>' value="false">
|
||||
<%= check_box_tag("#{f.object_name}[#{field_name}][for_display]", "true" , (f.object.send(field_name)["for_display"] == "true" rescue false), class: "for_display") %>
|
||||
<% for_label = f.object.send(field_name)["for_display"] == "true" ? true : false %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
|
|
@ -213,3 +213,4 @@ en:
|
|||
for_label: For Label
|
||||
property_color: Property color
|
||||
admin_reserve: Reserve
|
||||
for_display: Display
|
||||
|
|
|
@ -234,4 +234,5 @@ zh_tw:
|
|||
all_properties: All Properties
|
||||
export_reservation_data: Export data
|
||||
for_label: For Label
|
||||
property_color: Property color
|
||||
property_color: Property color
|
||||
for_display: Display
|
Loading…
Reference in New Issue