use tables to display clients

This commit is contained in:
Stefan Tollkühn
2025-07-23 17:33:01 +02:00
parent 8393202661
commit b366e5d0a1
4 changed files with 54 additions and 54 deletions

View File

@@ -1,47 +1,14 @@
<div id="<%= dom_id client %>">
<p>
<strong>Company name:</strong>
<%= client.company_name %>
</p>
<p>
<strong>Firstname:</strong>
<%= client.firstname %>
</p>
<p>
<strong>Lastname:</strong>
<%= client.lastname %>
</p>
<p>
<strong>Streetname:</strong>
<%= client.streetname %>
</p>
<p>
<strong>Zipcode:</strong>
<%= client.zipcode %>
</p>
<p>
<strong>City:</strong>
<%= client.city %>
</p>
<p>
<strong>Country:</strong>
<%= client.country %>
</p>
<p>
<strong>Email:</strong>
<%= client.email %>
</p>
<p>
<strong>Phone:</strong>
<%= client.phone %>
</p>
</div>
<% client_view_fields.each do |attrib| %>
<td>
<% value = client.send(attrib) %>
<% if attrib == :company_name %>
<%= link_to value, client_path(client) %>
<% elsif attrib == :email %>
<%= mail_to value %>
<% elsif attrib == :phone %>
<%= link_to value, "tel:#{value.strip.gsub(/\s+/, '')}" %>
<% else %>
<%= value.is_a?(Date) ? l(value) : value %>
<% end %>
</td>
<% end %>