Added style to show and form

This commit is contained in:
ricky committed 2026-08-06 16:32:13 -04:00
1 parent 51010758c6
commit bc7c4e26c6
2 files changed
+140 -109

No files matched your search

+30 -67
View File
@@ -1,79 +1,42 @@
<%= labelled_form_for @appointment do |f| %> <%= labelled_form_for @appointment do |f| %>
<%= error_messages_for @appointment %>
<p> <div class="box tabular">
<p><%= f.text_field :subject, required: true, style: "width: 95%;" %></p>
<%= f.text_field :subject %> <p>
<%= f.text_field :customer, label: :label_customer, class: "customer-name", autocomplete: "off", data: { autocomplete_url: "/customers/autocomplete" } %>
<%= f.hidden_field :customer_id, id: "customer_id", onchange: "this.form.requestSubmit()" %>
</p>
</p> <p>
<%= f.label :vehicle_id, l(:label_vehicle) %>
<%= f.collection_select :vehicle_id, @appointment.customer&.vehicles || [], :id, :name, { include_blank: true }, { label: false } %>
</p>
<p> <p>
<%= f.label :estimate_id, l(:label_estimate) %>
<%= f.collection_select :estimate_id, @appointment.customer&.estimates || [], :id, :name, { include_blank: true }, { label: false } %>
</p>
<%= f.text_field :customer, class: "customer-name", autocomplete: "off", data: { autocomplete_url: "/customers/autocomplete"} %> <p>
<%= f.hidden_field :customer_id, id: "customer_id", onchange: "this.form.requestSubmit()" %> <%= f.label :user_id, l(:field_user) %>
</p> <%= f.collection_select :user_id, User.active.sorted, :id, :name, { include_blank: true }, { label: false } %>
</p>
<p> <p><%= f.date_field :start_date, size: 10 %></p>
<p><%= f.date_field :end_date, size: 10 %></p>
<p> <p><%= f.number_field :estimated_hours, step: 0.1, size: 6 %></p>
<p><%= f.number_field :duration, step: 1, size: 6, label: :label_duration %></p>
<%= f.collection_select( :vehicle_id, @appointment.customer&.vehicles || [], :id, :name, include_blank: true ) %> <p><%= f.select :status, CustomerAppointment::STATUSES, label: :field_status %></p>
</p> <p>
<%= f.text_area :description, rows: 8, class: 'wiki-edit', style: 'width: 95%;' %>
<p> <%= wikitoolbar_for 'appointment_description' %>
</p>
<%= f.collection_select( :estimate_id, @appointment.customer&.estimates || [], :id, :name, include_blank: true ) %> </div>
</p>
<p>
<%= f.collection_select( :user_id, User.active.sorted,:id,:name,include_blank: true ) %>
</p>
<p>
<%= f.date_field :start_date %>
</p>
<p>
<%= f.date_field :end_date %>
</p>
<p>
<%= f.number_field :estimated_hours, step: 0.1 %>
</p>
<p>
<%= f.number_field :duration, step: 1 %>
</p>
<p>
<%= f.select(:status, CustomerAppointment::STATUSES) %>
</p>
<p>
<%= f.text_area :description,
rows: 8 %>
</p>
<p>
<%= submit_tag l(:button_save) %>
</p>
<%= submit_tag l(:button_save) %>
<% end %> <% end %>
+110 -42
View File
@@ -1,53 +1,121 @@
<h2><%= @appointment.subject %></h2> <div class="contextual">
<%= link_to l(:button_edit), edit_customer_appointment_path(@appointment), class: 'icon icon-edit' %>
<%= link_to l(:button_delete), customer_appointment_path(@appointment), method: :delete, data: { confirm: l(:text_are_you_sure) }, class: 'icon icon-del' %>
</div>
<table class="attributes"> <h2>
<% if @appointment.start_date %>
<div class="calendar-badge">
<div class="month"><%= @appointment.start_date.strftime('%b').upcase %></div>
<div class="day"><%= @appointment.start_date.day %></div>
</div>
<% end %>
<tr> <span class="appointment-title"><%= @appointment.subject %></span>
<th><%= t(:customer) %></th>
<td><%= link_to @appointment&.customer %></td>
</tr>
<tr> <span class="appointment-dates">
<th><%= t(:vehicle) %></th> (<%= format_date(@appointment.start_date) %>
<td><%= link_to @appointment&.vehicle unless @appointment&.vehicle.nil? %></td> <% if @appointment.end_date && @appointment.start_date != @appointment.end_date %>
</tr> - <%= format_date(@appointment.end_date) %>
<% end %>)
</span>
</h2>
<tr> <style>
<th><%= t(:primary_phone) %></th> .calendar-badge {
<td><%= @appointment&.customer&.primary_phone %></td> display: inline-block;
</tr> width: 38px;
border: 1px solid #b8c0c8;
border-radius: 4px;
overflow: hidden;
text-align: center;
vertical-align: middle;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
margin-right: 8px;
line-height: 1;
background: #fff;
}
<tr> .calendar-badge .month {
<th><%= t(:technician) %></th> background-color: #c22b2b; /* Redmine primary red tone */
<td><%= link_to @appointment.user %></td> color: #ffffff;
</tr> font-size: 9px;
font-weight: bold;
padding: 3px 0 2px 0;
text-transform: uppercase;
letter-spacing: 0.5px;
}
<tr> .calendar-badge .day {
<th><%= t(:status) %></th> color: #333333;
<td><%= @appointment.status %></td> font-size: 16px;
</tr> font-weight: bold;
padding: 4px 0 3px 0;
}
<tr> .appointment-title {
<th><%= t(:estimate) %></th> vertical-align: middle;
<td><%= link_to @appointment.estimate unless @appointment.estimate.nil? %></td> }
</tr>
<tr> .appointment-dates {
<th><%= t(:duration) %></th> font-size: 70%;
<td><%= @appointment.duration %> <%= t(:days) %></td> color: #666;
</tr> margin-left: 8px;
font-weight: normal;
vertical-align: middle;
}
</style>
<tr> <div class="issue details">
<th><%= t(:estimated_hours) %></th> <div class="attributes">
<td><%= @appointment.estimated_hours %></td> <div class="splitcontent">
</tr> <div class="splitcontentleft">
<div class="attribute">
<div class="label"><%= l(:label_customer, default: 'Customer') %>:</div>
<div class="value"><%= link_to_if @appointment.customer, @appointment.customer&.name, @appointment.customer %></div>
</div>
<div class="attribute">
<div class="label"><%= l(:label_vehicle, default: 'Vehicle') %>:</div>
<div class="value"><%= link_to_if @appointment.vehicle, @appointment.vehicle&.name, @appointment.vehicle %></div>
</div>
<div class="attribute">
<div class="label"><%= l(:label_primary_phone, default: 'Primary phone') %>:</div>
<div class="value"><%= @appointment.customer&.primary_phone %></div>
</div>
<div class="attribute">
<div class="label"><%= l(:label_estimate, default: 'Estimate') %>:</div>
<div class="value"><%= link_to_if @appointment.estimate, @appointment.estimate&.name, @appointment.estimate %></div>
</div>
</div>
<tr> <div class="splitcontentright">
<th><%= t(:description) %></th> <div class="attribute">
<td><%= simple_format(@appointment.description) %></td> <div class="label"><%= l(:field_status) %>:</div>
</tr> <div class="value"><%= @appointment.status %></div>
</div>
<div class="attribute">
<div class="label"><%= l(:field_user) %>:</div>
<div class="value"><%= link_to_user(@appointment.user) %></div>
</div>
<div class="attribute">
<div class="label"><%= l(:label_duration, default: 'Duration') %>:</div>
<div class="value"><%= @appointment.duration %> <%= l(:label_day_plural, default: 'days') %></div>
</div>
<div class="attribute">
<div class="label"><%= l(:field_estimated_hours) %>:</div>
<div class="value"><%= @appointment.estimated_hours %></div>
</div>
</div>
</div>
</div>
</table> <% if @appointment.description.present? %>
<hr />
<%= link_to t(:edit), edit_customer_appointment_path(@appointment), class: "icon icon-edit" %> <div class="description">
<%= link_to t(:delete), customer_appointment_path(@appointment), method: :delete, data: { confirm: t(:are_you_sure) }, class: "icon icon-del" %> <p><strong><%= l(:field_description) %></strong></p>
<div class="wiki">
<%= textilizable(@appointment, :description) %>
</div>
</div>
<% end %>
</div>