mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-10-03 20:40:43 -04:00
Added style to show and form
This commit is contained in:
1 parent
51010758c6
commit
bc7c4e26c6
2 files changed
+140
-109
No files matched your search
@@ -1,79 +1,42 @@
|
||||
<%= 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"} %>
|
||||
<%= f.hidden_field :customer_id, id: "customer_id", onchange: "this.form.requestSubmit()" %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :user_id, l(:field_user) %>
|
||||
<%= 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.collection_select( :estimate_id, @appointment.customer&.estimates || [], :id, :name, include_blank: true ) %>
|
||||
|
||||
</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>
|
||||
<p>
|
||||
<%= f.text_area :description, rows: 8, class: 'wiki-edit', style: 'width: 95%;' %>
|
||||
<%= wikitoolbar_for 'appointment_description' %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
@@ -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>
|
||||
<th><%= t(:customer) %></th>
|
||||
<td><%= link_to @appointment&.customer %></td>
|
||||
</tr>
|
||||
<span class="appointment-title"><%= @appointment.subject %></span>
|
||||
|
||||
<tr>
|
||||
<th><%= t(:vehicle) %></th>
|
||||
<td><%= link_to @appointment&.vehicle unless @appointment&.vehicle.nil? %></td>
|
||||
</tr>
|
||||
<span class="appointment-dates">
|
||||
(<%= format_date(@appointment.start_date) %>
|
||||
<% if @appointment.end_date && @appointment.start_date != @appointment.end_date %>
|
||||
- <%= format_date(@appointment.end_date) %>
|
||||
<% end %>)
|
||||
</span>
|
||||
</h2>
|
||||
|
||||
<tr>
|
||||
<th><%= t(:primary_phone) %></th>
|
||||
<td><%= @appointment&.customer&.primary_phone %></td>
|
||||
</tr>
|
||||
<style>
|
||||
.calendar-badge {
|
||||
display: inline-block;
|
||||
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>
|
||||
<th><%= t(:technician) %></th>
|
||||
<td><%= link_to @appointment.user %></td>
|
||||
</tr>
|
||||
.calendar-badge .month {
|
||||
background-color: #c22b2b; /* Redmine primary red tone */
|
||||
color: #ffffff;
|
||||
font-size: 9px;
|
||||
font-weight: bold;
|
||||
padding: 3px 0 2px 0;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
<tr>
|
||||
<th><%= t(:status) %></th>
|
||||
<td><%= @appointment.status %></td>
|
||||
</tr>
|
||||
.calendar-badge .day {
|
||||
color: #333333;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
padding: 4px 0 3px 0;
|
||||
}
|
||||
|
||||
<tr>
|
||||
<th><%= t(:estimate) %></th>
|
||||
<td><%= link_to @appointment.estimate unless @appointment.estimate.nil? %></td>
|
||||
</tr>
|
||||
.appointment-title {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
<tr>
|
||||
<th><%= t(:duration) %></th>
|
||||
<td><%= @appointment.duration %> <%= t(:days) %></td>
|
||||
</tr>
|
||||
.appointment-dates {
|
||||
font-size: 70%;
|
||||
color: #666;
|
||||
margin-left: 8px;
|
||||
font-weight: normal;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
|
||||
<tr>
|
||||
<th><%= t(:estimated_hours) %></th>
|
||||
<td><%= @appointment.estimated_hours %></td>
|
||||
</tr>
|
||||
<div class="issue details">
|
||||
<div class="attributes">
|
||||
<div class="splitcontent">
|
||||
<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>
|
||||
<th><%= t(:description) %></th>
|
||||
<td><%= simple_format(@appointment.description) %></td>
|
||||
</tr>
|
||||
<div class="splitcontentright">
|
||||
<div class="attribute">
|
||||
<div class="label"><%= l(:field_status) %>:</div>
|
||||
<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>
|
||||
|
||||
<%= link_to t(:edit), edit_customer_appointment_path(@appointment), class: "icon icon-edit" %>
|
||||
<%= link_to t(:delete), customer_appointment_path(@appointment), method: :delete, data: { confirm: t(:are_you_sure) }, class: "icon icon-del" %>
|
||||
<% if @appointment.description.present? %>
|
||||
<hr />
|
||||
<div class="description">
|
||||
<p><strong><%= l(:field_description) %></strong></p>
|
||||
<div class="wiki">
|
||||
<%= textilizable(@appointment, :description) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
Reference in new issue
Block a user