29 lines
823 B
Plaintext
29 lines
823 B
Plaintext
<% if @client.editable? %>
|
|
<%= form_with(model: client) do |form| %>
|
|
<% if client.errors.any? %>
|
|
<div style="color: red">
|
|
<h2><%= pluralize(client.errors.count, "error") %> prohibited this client from being saved:</h2>
|
|
|
|
<ul>
|
|
<% client.errors.each do |error| %>
|
|
<li><%= error.full_message %></li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% [:company_name, :firstname, :lastname, :streetname, :zipcode, :city, :country, :email, :phone].each do |attrib|%>
|
|
<div>
|
|
<%= form.label attrib, style: "display: block" %>
|
|
<%= form.text_field attrib %><br>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div>
|
|
<%= form.submit %>
|
|
</div>
|
|
<% end %>
|
|
<% else %>
|
|
<p>This client is used in multiple subprojects and cannot be edited.</p>
|
|
<% end %>
|