Dump
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
This commit is contained in:
commit
ef378a1f59
147 changed files with 3891 additions and 0 deletions
14
app/views/active_storage/blobs/_blob.html.erb
Normal file
14
app/views/active_storage/blobs/_blob.html.erb
Normal file
|
@ -0,0 +1,14 @@
|
|||
<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>">
|
||||
<% if blob.representable? %>
|
||||
<%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
|
||||
<% end %>
|
||||
|
||||
<figcaption class="attachment__caption">
|
||||
<% if caption = blob.try(:caption) %>
|
||||
<%= caption %>
|
||||
<% else %>
|
||||
<span class="attachment__name"><%= blob.filename %></span>
|
||||
<span class="attachment__size"><%= number_to_human_size blob.byte_size %></span>
|
||||
<% end %>
|
||||
</figcaption>
|
||||
</figure>
|
3
app/views/layouts/action_text/contents/_content.html.erb
Normal file
3
app/views/layouts/action_text/contents/_content.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<div class="trix-content">
|
||||
<%= yield -%>
|
||||
</div>
|
36
app/views/layouts/application.html.erb
Normal file
36
app/views/layouts/application.html.erb
Normal file
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= content_for(:title) || "Guide Store" %></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>
|
||||
<nav>
|
||||
<%= link_to "Home", root_path %>
|
||||
<%= link_to "Log In", new_session_path unless authenticated? %>
|
||||
<%= button_to "Log Out", session_path, method: :delete if authenticated? %>
|
||||
</nav>
|
||||
<div class="notice"><%= notice %></div>
|
||||
<main>
|
||||
<%= yield %>
|
||||
</main>
|
||||
</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 %>
|
9
app/views/passwords/edit.html.erb
Normal file
9
app/views/passwords/edit.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<h1>Update your password</h1>
|
||||
|
||||
<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
|
||||
|
||||
<%= form_with url: password_path(params[:token]), method: :put do |form| %>
|
||||
<%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72 %><br>
|
||||
<%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72 %><br>
|
||||
<%= form.submit "Save" %>
|
||||
<% end %>
|
8
app/views/passwords/new.html.erb
Normal file
8
app/views/passwords/new.html.erb
Normal file
|
@ -0,0 +1,8 @@
|
|||
<h1>Forgot your password?</h1>
|
||||
|
||||
<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
|
||||
|
||||
<%= form_with url: passwords_path do |form| %>
|
||||
<%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address] %><br>
|
||||
<%= form.submit "Email reset instructions" %>
|
||||
<% end %>
|
4
app/views/passwords_mailer/reset.html.erb
Normal file
4
app/views/passwords_mailer/reset.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<p>
|
||||
You can reset your password within the next 15 minutes on
|
||||
<%= link_to "this password reset page", edit_password_url(@user.password_reset_token) %>.
|
||||
</p>
|
2
app/views/passwords_mailer/reset.text.erb
Normal file
2
app/views/passwords_mailer/reset.text.erb
Normal file
|
@ -0,0 +1,2 @@
|
|||
You can reset your password within the next 15 minutes on this password reset page:
|
||||
<%= edit_password_url(@user.password_reset_token) %>
|
24
app/views/products/_form.html.erb
Normal file
24
app/views/products/_form.html.erb
Normal file
|
@ -0,0 +1,24 @@
|
|||
<%= form_with model: product do |form| %>
|
||||
<div>
|
||||
<%= form.label :name %>
|
||||
<%= form.text_field :name %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :inventory_count, style: "display: block" %>
|
||||
<%= form.number_field :inventory_count %>
|
||||
|
||||
<div>
|
||||
<%= form.label :description, style: "display: block" %>
|
||||
<%= form.rich_text_area :description %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :featured_image, style: "display:block" %>
|
||||
<%= form.file_field :featured_image, accept: "image/*" %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
6
app/views/products/edit.html.erb
Normal file
6
app/views/products/edit.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<h1>Edit Product: <%= @product.name %></h1>
|
||||
|
||||
<%= render "form", product: @product %>
|
||||
|
||||
<%= link_to "Cancel", @product %>
|
||||
|
11
app/views/products/index.html.erb
Normal file
11
app/views/products/index.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
<h1><%= t ".title" %></h1>
|
||||
|
||||
<%= link_to "New Product", new_product_path if authenticated? %>
|
||||
|
||||
<div id="products">
|
||||
<% @products.each do |product| %>
|
||||
<div>
|
||||
<%= link_to product.name, product %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
5
app/views/products/new.html.erb
Normal file
5
app/views/products/new.html.erb
Normal file
|
@ -0,0 +1,5 @@
|
|||
<h1>New Product</h1>
|
||||
|
||||
<%= render "form", product: @product %>
|
||||
|
||||
<%= link_to "Cancel", products_path %>
|
13
app/views/products/show.html.erb
Normal file
13
app/views/products/show.html.erb
Normal file
|
@ -0,0 +1,13 @@
|
|||
<%= image_tag @product.featured_image if @product.featured_image.attached? %>
|
||||
|
||||
<% cache @product do %>
|
||||
<h1><%= @product.name %></h1>
|
||||
<%= @product.description %>
|
||||
<% end %>
|
||||
|
||||
<% if authenticated? %>
|
||||
<%= link_to "Edit", edit_product_path(@product) %>
|
||||
<%= button_to "Delete", @product, method: :delete,
|
||||
data: { turbo_confirm: "Are you certain?" } %>
|
||||
<% end %>
|
||||
<%= link_to "Back", products_path %>
|
22
app/views/pwa/manifest.json.erb
Normal file
22
app/views/pwa/manifest.json.erb
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "GuideStore",
|
||||
"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": "GuideStore.",
|
||||
"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)
|
||||
// }
|
||||
// })
|
||||
// )
|
||||
// })
|
11
app/views/sessions/new.html.erb
Normal file
11
app/views/sessions/new.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
|
||||
<%= tag.div(flash[:notice], style: "color:green") if flash[:notice] %>
|
||||
|
||||
<%= form_with url: session_path do |form| %>
|
||||
<%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address] %><br>
|
||||
<%= form.password_field :password, required: true, autocomplete: "current-password", placeholder: "Enter your password", maxlength: 72 %><br>
|
||||
<%= form.submit "Sign in" %>
|
||||
<% end %>
|
||||
<br>
|
||||
|
||||
<%= link_to "Forgot password?", new_password_path %>
|
Loading…
Add table
Add a link
Reference in a new issue