initial commit

This commit is contained in:
Stefan Tollkühn
2025-07-21 12:14:42 +02:00
parent a77fc87832
commit 3735122750
156 changed files with 3862 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
<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>

View File

@@ -0,0 +1,2 @@
json.extract! client, :id, :company_name, :firstname, :lastname, :streetname, :zipcode, :city, :country, :email, :phone, :created_at, :updated_at
json.url client_url(client, format: :json)

View File

@@ -0,0 +1,62 @@
<%= 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 %>
<div>
<%= form.label :company_name, style: "display: block" %>
<%= form.text_field :company_name %>
</div>
<div>
<%= form.label :firstname, style: "display: block" %>
<%= form.text_field :firstname %>
</div>
<div>
<%= form.label :lastname, style: "display: block" %>
<%= form.text_field :lastname %>
</div>
<div>
<%= form.label :streetname, style: "display: block" %>
<%= form.text_field :streetname %>
</div>
<div>
<%= form.label :zipcode, style: "display: block" %>
<%= form.text_field :zipcode %>
</div>
<div>
<%= form.label :city, style: "display: block" %>
<%= form.text_field :city %>
</div>
<div>
<%= form.label :country, style: "display: block" %>
<%= form.text_field :country %>
</div>
<div>
<%= form.label :email, style: "display: block" %>
<%= form.text_field :email %>
</div>
<div>
<%= form.label :phone, style: "display: block" %>
<%= form.text_field :phone %>
</div>
<div>
<%= form.submit %>
</div>
<% end %>

View File

@@ -0,0 +1,12 @@
<% content_for :title, "Editing client" %>
<h1>Editing client</h1>
<%= render "form", client: @client %>
<br>
<div>
<%= link_to "Show this client", @client %> |
<%= link_to "Back to clients", clients_path %>
</div>

View File

@@ -0,0 +1,16 @@
<p style="color: green"><%= notice %></p>
<% content_for :title, "Clients" %>
<h1>Clients</h1>
<div id="clients">
<% @clients.each do |client| %>
<%= render client %>
<p>
<%= link_to "Show this client", client %>
</p>
<% end %>
</div>
<%= link_to "New client", new_client_path %>

View File

@@ -0,0 +1 @@
json.array! @clients, partial: "clients/client", as: :client

View File

@@ -0,0 +1,11 @@
<% content_for :title, "New client" %>
<h1>New client</h1>
<%= render "form", client: @client %>
<br>
<div>
<%= link_to "Back to clients", clients_path %>
</div>

View File

@@ -0,0 +1,10 @@
<p style="color: green"><%= notice %></p>
<%= render @client %>
<div>
<%= link_to "Edit this client", edit_client_path(@client) %> |
<%= link_to "Back to clients", clients_path %>
<%= button_to "Destroy this client", @client, method: :delete %>
</div>

View File

@@ -0,0 +1 @@
json.partial! "clients/client", client: @client