mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-11-18 02:40:37 -05:00
Vehicle page: Edit and Delete in the contextual area instead of buttons
Moves Edit and Delete from buttons under the vehicle details to Redmine's standard top-right contextual area (pencil and trash icons, "e" access key, Redmine's delete confirmation). Same permissions; Delete still only shows for vehicles without issues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
2 files changed
+11
-10
No files matched your search
@@ -52,13 +52,3 @@
|
|||||||
at <%= mileage %> <%= t(:label_miles) %>
|
at <%= mileage %> <%= t(:label_miles) %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div style="float: right;">
|
|
||||||
<% if User.current.allowed_to?(:edit_vehicles, nil, global: true) %>
|
|
||||||
<%= button_to t(:label_edit), edit_vehicle_path(vehicle), method: :get %>
|
|
||||||
<% end %>
|
|
||||||
<%# Vehicles with issues can't be deleted, to keep their service history %>
|
|
||||||
<% if User.current.allowed_to?(:delete_vehicles, nil, global: true) && !vehicle.issues.exists? %>
|
|
||||||
<%= button_to t(:label_delete), vehicle, method: :delete, data: { confirm: t(:warn_ru_sure) } %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
@@ -1,3 +1,14 @@
|
|||||||
|
<div class="contextual">
|
||||||
|
<% if User.current.allowed_to?(:edit_vehicles, nil, global: true) %>
|
||||||
|
<%= link_to sprite_icon('edit', l(:button_edit)), edit_vehicle_path(@vehicle),
|
||||||
|
class: 'icon icon-edit', accesskey: accesskey(:edit) %>
|
||||||
|
<% end %>
|
||||||
|
<%# Vehicles with issues can't be deleted, to keep their service history %>
|
||||||
|
<% if User.current.allowed_to?(:delete_vehicles, nil, global: true) && !@vehicle.issues.exists? %>
|
||||||
|
<%= delete_link vehicle_path(@vehicle) %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2><%=t(:field_vehicle)%> #<%=@vehicle.id%></h2>
|
<h2><%=t(:field_vehicle)%> #<%=@vehicle.id%></h2>
|
||||||
|
|
||||||
<% unless @vehicle.vin_decoded? %>
|
<% unless @vehicle.vin_decoded? %>
|
||||||
|
|||||||
Reference in new issue
Block a user