prevent update if template is in use

This commit is contained in:
Bilal
2020-07-13 20:01:06 +02:00
parent cefa30b331
commit f44eca5328
7 changed files with 39 additions and 6 deletions

View File

@@ -19,7 +19,7 @@
<div class="btn-group">
<%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
<div class="dropdown-menu dropdown-menu-right">
<% if policy(ContractTemplate).edit? %>
<% if policy(ContractTemplate).edit? && contract_template.editable? %>
<%= link_to fa_icon("pencil fw", text: t(".actions.edit")), [:edit, contract_template], class: "dropdown-item" %>
<% end %>
<% if policy(QrCode).show? %>

View File

@@ -1,4 +1,4 @@
<%= bootstrap_form_with model: [project, contract_template], local: true do |form| %>
<%= bootstrap_form_with model: contract_template, local: true do |form| %>
<%= field_set_tag content_tag(:span, t(".release_info.heading"), class: "h6 text-muted text-uppercase") do %>
<div class="form-row">
<%= form.text_field :name, wrapper_class: "col-sm-6" %>