now this is what i call an app
This commit is contained in:
commit
8063246b68
97 changed files with 1989 additions and 0 deletions
8
app/views/home/index.html.erb
Normal file
8
app/views/home/index.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h2>Recently Updated</h2>
|
||||
<ul id="tapes">
|
||||
<% @tapes.each do |tape| %>
|
||||
<li>
|
||||
<%= link_to tape.title, tape %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
35
app/views/layouts/application.html.erb
Normal file
35
app/views/layouts/application.html.erb
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= content_for(:title) || "Misadventure" %></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 %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav>
|
||||
<%= link_to "Home", root_path %>
|
||||
<%= button_to "Log out", session_path, method: :delete if authenticated? %>
|
||||
<%= link_to "Login", new_session_path unless authenticated? %>
|
||||
<%= link_to "Tapes", tapes_path %>
|
||||
</nav>
|
||||
<main>
|
||||
<%= yield %>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
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) %>
|
||||
22
app/views/pwa/manifest.json.erb
Normal file
22
app/views/pwa/manifest.json.erb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "Misadventure",
|
||||
"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": "Misadventure.",
|
||||
"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 %>
|
||||
11
app/views/tapes/_form.html.erb
Normal file
11
app/views/tapes/_form.html.erb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<%= form_with model: tape do |form| %>
|
||||
<div>
|
||||
<%= form.label :title %>
|
||||
<%= form.text_field :title %>
|
||||
<%= form.file_field :video, :accept => 'video/quicktime,video/mp4' %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
4
app/views/tapes/edit.html.erb
Normal file
4
app/views/tapes/edit.html.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<h1>Edit tape</h1>
|
||||
|
||||
<%= render "form", tape: @tape %>
|
||||
<%= link_to "Cancel", @tape %>
|
||||
11
app/views/tapes/index.html.erb
Normal file
11
app/views/tapes/index.html.erb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<h1>Tapes</h1>
|
||||
|
||||
<%= link_to "New tape", new_tape_path if authenticated? %>
|
||||
|
||||
<div id="tapes">
|
||||
<% @tapes.each do |tape| %>
|
||||
<div>
|
||||
<%= link_to tape.title, tape %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
4
app/views/tapes/new.html.erb
Normal file
4
app/views/tapes/new.html.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<h1>New tape</h1>
|
||||
|
||||
<%= render "form", tape: @tape %>
|
||||
<%= link_to "Cancel", tapes_path %>
|
||||
11
app/views/tapes/show.html.erb
Normal file
11
app/views/tapes/show.html.erb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<% cache @tape do %>
|
||||
<h1><%= @tape.title %></h1>
|
||||
<% end %>
|
||||
<% if @tape.video.attached? %>
|
||||
<%= video_tag @tape.video, :controls => true%>
|
||||
<% end %>
|
||||
<%= link_to "Back", tapes_path%>
|
||||
<% if authenticated? %>
|
||||
<%= link_to "Edit", edit_tape_path(@tape) %>
|
||||
<%= button_to "Delete", @tape, method: :delete, data: { turbo_confirm: "Are you sure?" } %>
|
||||
<% end %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue