WIP: print settings

This commit is contained in:
rulingcom 2025-10-27 23:32:08 +08:00
parent cd7da404bc
commit 8b3049b1c7
7 changed files with 101 additions and 97 deletions

View File

@ -176,6 +176,10 @@ class Admin::PropertyHiresController < OrbitAdminController
end
end
def print_setting
@property = Property.where(:uid => params[:id].split("-").last).first rescue nil
end
def delete_booking_details
booking = PHire.find(params[:id])
property = booking.property

View File

@ -27,6 +27,7 @@ class PHire
field :mobile_phone_of_contact_person
field :contact_person_Email
field :contact_person_department
field :recommendation
belongs_to :property
has_many :p_hire_field_values, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :p_hire_field_values, allow_destroy: true

View File

@ -35,6 +35,7 @@ class Property
field :p_display_end_time, type: DateTime
field :recurring_enable, type: Boolean, :default => false
field :property_color, :default => "#000000"
field :print_format
mount_uploader :image, ImageUploader

View File

@ -816,6 +816,12 @@ ul.list-unstyled li {
</div>
</div>
<% end %>
<div class="form-group">
<%= f.label :recommendation, t("property_hire.recommendation"), :class => "col-sm-#{label_col} control-label" %>
<div class="col-sm-1">
<%= f.text_area :recommendation %>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-<%=label_col%> col-sm-<%=input_col%>">
<% if f.object.id.present? %>

View File

@ -100,6 +100,7 @@
<li><a href="#available_time" data-toggle="tab"><%= t('property_hire.available_time')%></a></li>
<li><a href="#auto_send_email_set" data-toggle="tab"><%= t('property_hire.auto_send_email_set') %></a></li>
<li><a href="#settings" data-toggle="tab"><%= t('property_hire.reservation_fields') %></a></li>
<li><a href="#printsettings" data-toggle="tab"><%= t('property_hire.print_settings') %></a></li>
</ul>
<!-- Module -->
<div class="tab-content module-area">
@ -136,16 +137,6 @@
<%= f.text_field :other_location %>
</div>
</div>
<%
=begin%>
<div class="control-group">
<%= f.label :property_number, t("property_hire.property_number"), :class => "control-label muted" %>
<div class="controls">
<%= f.text_field :property_number %>
</div>
</div>
<%
=end%>
<div class="control-group">
<%= f.label :p_display_start_time, t("property_hire.p_display_start_time"), :class => "control-label muted" %>
<div class="controls">
@ -193,16 +184,6 @@
</div>
</div>
</div>
<%
=begin%>
<div class="control-group">
<%= f.label :purchase_date, t("property_hire.purchase_date"), :class => "control-label muted" %>
<div class="controls">
<%= f.datetime_picker :purchase_date, :no_label => true, :new_record => @property.new_record?, :picker_type => "date", :format => "yyyy/MM/dd" %>
</div>
</div>
<%
=end%>
<div class="control-group">
<%= f.label :owners, t("property_hire.owners"), :class => "control-label muted" %>
<div class="controls">
@ -233,16 +214,6 @@
<%= f.text_field :owner_phone %>
</div>
</div>
<%
=begin%>
<div class="control-group">
<%= f.label :price, t("property_hire.price"), :class => "control-label muted" %>
<div class="controls">
<%= f.text_field :price %>
</div>
</div>
<%
=end%>
</div>
<!-- page_setting -->
<div class="tab-pane fade" id="page_setting">
@ -597,6 +568,7 @@
</ul>
</div>
</div>
<!-- reservation fields -->
<div class="tab-pane fade" id="settings">
<% fields_name = f.object.class::FIELDSNAME %>
<div style="padding: 1.2em;">
@ -655,7 +627,6 @@
Enable
</label>
</div>
</div>
<div class="control-group" id="selector_block">
<% field_name = "notes_selector" %>
<label class="control-label muted"><%= t("property_hire.#{field_name}") %></label>
@ -720,6 +691,21 @@
</div>
</div>
</div>
<!-- print settings -->
<div class="tab-pane fade" id="printsettings">
<table>
<tbody>
<tr>
<td>
<%= label_tag t('property_hire.print_format') %>
</td>
<td>
<%= f.text_area :print_format,class: 'ckeditor' %>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>

View File

@ -214,3 +214,6 @@ en:
property_color: Property color
admin_reserve: Reserve
for_display: Display
recommendation: Recommendation
print_format: Print Format
print_settings: Print Settings

View File

@ -236,3 +236,6 @@ zh_tw:
for_label: For Label
property_color: Property color
for_display: Display
recommendation: 擬辦/註解
print_format: 列印格式
print_settings: 列印格式設定