initial commit
This commit is contained in:
47
app/views/clients/_client.html.erb
Normal file
47
app/views/clients/_client.html.erb
Normal 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>
|
||||
2
app/views/clients/_client.json.jbuilder
Normal file
2
app/views/clients/_client.json.jbuilder
Normal 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)
|
||||
62
app/views/clients/_form.html.erb
Normal file
62
app/views/clients/_form.html.erb
Normal 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 %>
|
||||
12
app/views/clients/edit.html.erb
Normal file
12
app/views/clients/edit.html.erb
Normal 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>
|
||||
16
app/views/clients/index.html.erb
Normal file
16
app/views/clients/index.html.erb
Normal 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 %>
|
||||
1
app/views/clients/index.json.jbuilder
Normal file
1
app/views/clients/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @clients, partial: "clients/client", as: :client
|
||||
11
app/views/clients/new.html.erb
Normal file
11
app/views/clients/new.html.erb
Normal 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>
|
||||
10
app/views/clients/show.html.erb
Normal file
10
app/views/clients/show.html.erb
Normal 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>
|
||||
1
app/views/clients/show.json.jbuilder
Normal file
1
app/views/clients/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "clients/client", client: @client
|
||||
28
app/views/layouts/application.html.erb
Normal file
28
app/views/layouts/application.html.erb
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= content_for(:title) || "Parse" %></title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
|
||||
<%= yield :head %>
|
||||
|
||||
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
|
||||
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
|
||||
|
||||
<link rel="icon" href="/icon.png" type="image/png">
|
||||
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
||||
<link rel="apple-touch-icon" href="/icon.png">
|
||||
|
||||
<%# Includes all stylesheet files in app/assets/stylesheets %>
|
||||
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
|
||||
<%= javascript_importmap_tags %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
13
app/views/layouts/mailer.html.erb
Normal file
13
app/views/layouts/mailer.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<style>
|
||||
/* Email styles need to be inline */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
1
app/views/layouts/mailer.text.erb
Normal file
1
app/views/layouts/mailer.text.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= yield %>
|
||||
52
app/views/projects/_form.html.erb
Normal file
52
app/views/projects/_form.html.erb
Normal file
@@ -0,0 +1,52 @@
|
||||
<%= form_with(model: project) do |form| %>
|
||||
<% if project.errors.any? %>
|
||||
<div style="color: red">
|
||||
<h2><%= pluralize(project.errors.count, "error") %> prohibited this project from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% project.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div>
|
||||
<%= form.label :name, style: "display: block" %>
|
||||
<%= form.text_field :name %>
|
||||
</div>
|
||||
|
||||
<h3>Subprojects</h3>
|
||||
<%= form.fields_for :subprojects do |sp_form| %>
|
||||
<div class="subproject-fields">
|
||||
<%= sp_form.label :subproject_name %>
|
||||
<%= sp_form.text_field :subproject_name %>
|
||||
|
||||
<% [:client, :owner, :builder].each do |role| %>
|
||||
<div>
|
||||
<%= sp_form.label "#{role}_id", "Select Existing #{role.capitalize}" %>
|
||||
<%= sp_form.collection_select "#{role}_id", Client.all, :id, :company_name, prompt: "Select #{role.capitalize}" %>
|
||||
|
||||
<fieldset>
|
||||
<legend>Or Create New <%= role.capitalize %></legend>
|
||||
<%= sp_form.fields_for role do |c_form| %>
|
||||
<%= c_form.label :company_name %>
|
||||
<%= c_form.text_field :company_name %><br>
|
||||
<%= c_form.label :firstname %>
|
||||
<%= c_form.text_field :firstname %><br>
|
||||
<%= c_form.label :lastname %>
|
||||
<%= c_form.text_field :lastname %><br>
|
||||
<%= c_form.label :email %>
|
||||
<%= c_form.text_field :email %><br>
|
||||
<!-- Add more client fields here as needed -->
|
||||
<% end %>
|
||||
</fieldset>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div>
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
7
app/views/projects/_project.html.erb
Normal file
7
app/views/projects/_project.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<div id="<%= dom_id project %>">
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= project.name %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/projects/_project.json.jbuilder
Normal file
2
app/views/projects/_project.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! project, :id, :name, :created_at, :updated_at
|
||||
json.url project_url(project, format: :json)
|
||||
12
app/views/projects/edit.html.erb
Normal file
12
app/views/projects/edit.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<% content_for :title, "Editing project" %>
|
||||
|
||||
<h1>Editing project</h1>
|
||||
|
||||
<%= render "form", project: @project %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Show this project", @project %> |
|
||||
<%= link_to "Back to projects", projects_path %>
|
||||
</div>
|
||||
16
app/views/projects/index.html.erb
Normal file
16
app/views/projects/index.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<% content_for :title, "Projects" %>
|
||||
|
||||
<h1>Projects</h1>
|
||||
|
||||
<div id="projects">
|
||||
<% @projects.each do |project| %>
|
||||
<%= render project %>
|
||||
<p>
|
||||
<%= link_to "Show this project", project %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= link_to "New project", new_project_path %>
|
||||
1
app/views/projects/index.json.jbuilder
Normal file
1
app/views/projects/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @projects, partial: "projects/project", as: :project
|
||||
11
app/views/projects/new.html.erb
Normal file
11
app/views/projects/new.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<% content_for :title, "New project" %>
|
||||
|
||||
<h1>New project</h1>
|
||||
|
||||
<%= render "form", project: @project %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Back to projects", projects_path %>
|
||||
</div>
|
||||
10
app/views/projects/show.html.erb
Normal file
10
app/views/projects/show.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<%= render @project %>
|
||||
|
||||
<div>
|
||||
<%= link_to "Edit this project", edit_project_path(@project) %> |
|
||||
<%= link_to "Back to projects", projects_path %>
|
||||
|
||||
<%= button_to "Destroy this project", @project, method: :delete %>
|
||||
</div>
|
||||
1
app/views/projects/show.json.jbuilder
Normal file
1
app/views/projects/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "projects/project", project: @project
|
||||
22
app/views/pwa/manifest.json.erb
Normal file
22
app/views/pwa/manifest.json.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "Parse",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icon.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
},
|
||||
{
|
||||
"src": "/icon.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
],
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"scope": "/",
|
||||
"description": "Parse.",
|
||||
"theme_color": "red",
|
||||
"background_color": "red"
|
||||
}
|
||||
26
app/views/pwa/service-worker.js
Normal file
26
app/views/pwa/service-worker.js
Normal file
@@ -0,0 +1,26 @@
|
||||
// Add a service worker for processing Web Push notifications:
|
||||
//
|
||||
// self.addEventListener("push", async (event) => {
|
||||
// const { title, options } = await event.data.json()
|
||||
// event.waitUntil(self.registration.showNotification(title, options))
|
||||
// })
|
||||
//
|
||||
// self.addEventListener("notificationclick", function(event) {
|
||||
// event.notification.close()
|
||||
// event.waitUntil(
|
||||
// clients.matchAll({ type: "window" }).then((clientList) => {
|
||||
// for (let i = 0; i < clientList.length; i++) {
|
||||
// let client = clientList[i]
|
||||
// let clientPath = (new URL(client.url)).pathname
|
||||
//
|
||||
// if (clientPath == event.notification.data.path && "focus" in client) {
|
||||
// return client.focus()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (clients.openWindow) {
|
||||
// return clients.openWindow(event.notification.data.path)
|
||||
// }
|
||||
// })
|
||||
// )
|
||||
// })
|
||||
42
app/views/subprojects/_form.html.erb
Normal file
42
app/views/subprojects/_form.html.erb
Normal file
@@ -0,0 +1,42 @@
|
||||
<%= form_with(model: subproject) do |form| %>
|
||||
<% if subproject.errors.any? %>
|
||||
<div style="color: red">
|
||||
<h2><%= pluralize(subproject.errors.count, "error") %> prohibited this subproject from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% subproject.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div>
|
||||
<%= form.label :subproject_name, style: "display: block" %>
|
||||
<%= form.text_field :subproject_name %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :project_id, style: "display: block" %>
|
||||
<%= form.text_field :project_id %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :client_id, style: "display: block" %>
|
||||
<%= form.text_field :client_id %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :owner_id, style: "display: block" %>
|
||||
<%= form.text_field :owner_id %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :builder_id, style: "display: block" %>
|
||||
<%= form.text_field :builder_id %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
27
app/views/subprojects/_subproject.html.erb
Normal file
27
app/views/subprojects/_subproject.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<div id="<%= dom_id subproject %>">
|
||||
<p>
|
||||
<strong>Subproject name:</strong>
|
||||
<%= subproject.subproject_name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Project:</strong>
|
||||
<%= subproject.project_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Client:</strong>
|
||||
<%= subproject.client_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Owner:</strong>
|
||||
<%= subproject.owner_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Builder:</strong>
|
||||
<%= subproject.builder_id %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/subprojects/_subproject.json.jbuilder
Normal file
2
app/views/subprojects/_subproject.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! subproject, :id, :subproject_name, :project_id, :client_id, :owner_id, :builder_id, :created_at, :updated_at
|
||||
json.url subproject_url(subproject, format: :json)
|
||||
12
app/views/subprojects/edit.html.erb
Normal file
12
app/views/subprojects/edit.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<% content_for :title, "Editing subproject" %>
|
||||
|
||||
<h1>Editing subproject</h1>
|
||||
|
||||
<%= render "form", subproject: @subproject %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Show this subproject", @subproject %> |
|
||||
<%= link_to "Back to subprojects", subprojects_path %>
|
||||
</div>
|
||||
16
app/views/subprojects/index.html.erb
Normal file
16
app/views/subprojects/index.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<% content_for :title, "Subprojects" %>
|
||||
|
||||
<h1>Subprojects</h1>
|
||||
|
||||
<div id="subprojects">
|
||||
<% @subprojects.each do |subproject| %>
|
||||
<%= render subproject %>
|
||||
<p>
|
||||
<%= link_to "Show this subproject", subproject %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= link_to "New subproject", new_subproject_path %>
|
||||
1
app/views/subprojects/index.json.jbuilder
Normal file
1
app/views/subprojects/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @subprojects, partial: "subprojects/subproject", as: :subproject
|
||||
11
app/views/subprojects/new.html.erb
Normal file
11
app/views/subprojects/new.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<% content_for :title, "New subproject" %>
|
||||
|
||||
<h1>New subproject</h1>
|
||||
|
||||
<%= render "form", subproject: @subproject %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Back to subprojects", subprojects_path %>
|
||||
</div>
|
||||
10
app/views/subprojects/show.html.erb
Normal file
10
app/views/subprojects/show.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<%= render @subproject %>
|
||||
|
||||
<div>
|
||||
<%= link_to "Edit this subproject", edit_subproject_path(@subproject) %> |
|
||||
<%= link_to "Back to subprojects", subprojects_path %>
|
||||
|
||||
<%= button_to "Destroy this subproject", @subproject, method: :delete %>
|
||||
</div>
|
||||
1
app/views/subprojects/show.json.jbuilder
Normal file
1
app/views/subprojects/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "subprojects/subproject", subproject: @subproject
|
||||
Reference in New Issue
Block a user