Finished phase006
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<main>
|
||||
<p><%= notice %></p>
|
||||
|
||||
<p><%= link_to "Back to vehicle", vehicle_path(@vehicle) %></p>
|
||||
|
||||
<h1>Maintenance Schedules</h1>
|
||||
<p><%= @vehicle.year %> <%= @vehicle.make %> <%= @vehicle.model %></p>
|
||||
|
||||
<p><%= link_to "New maintenance schedule", new_vehicle_maintenance_schedule_path(@vehicle) %></p>
|
||||
|
||||
<% if @maintenance_schedules.any? %>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Mileage interval</th>
|
||||
<th>Time interval</th>
|
||||
<th>Baseline odometer</th>
|
||||
<th>Baseline date</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @maintenance_schedules.each do |schedule| %>
|
||||
<tr>
|
||||
<td><%= link_to schedule.maintenance_type, vehicle_maintenance_schedule_path(@vehicle, schedule) %></td>
|
||||
<td><%= number_with_delimiter(schedule.mileage_interval) %> miles</td>
|
||||
<td><%= schedule.time_interval %> days</td>
|
||||
<td><%= number_with_delimiter(schedule.baseline_odometer) %></td>
|
||||
<td><%= schedule.baseline_date %></td>
|
||||
<td><%= schedule.active? ? "Active" : "Inactive" %></td>
|
||||
<td>
|
||||
<%= link_to "Edit", edit_vehicle_maintenance_schedule_path(@vehicle, schedule) %>
|
||||
<% if schedule.active? %>
|
||||
<%= button_to "Deactivate", deactivate_vehicle_maintenance_schedule_path(@vehicle, schedule), method: :patch %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>No maintenance schedules recorded.</p>
|
||||
<% end %>
|
||||
</main>
|
||||
Reference in New Issue
Block a user