-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9174e57
commit 1024851
Showing
21 changed files
with
420 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Custom bootstrap variables must be set or imported *before* bootstrap. | ||
@import "bootstrap"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
!!! | ||
%html | ||
%head | ||
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ | ||
%title= content_for(:title) || "Pudding" | ||
%meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/ | ||
%meta{:content => "yes", :name => "apple-mobile-web-app-capable"}/ | ||
%meta{:content => "yes", :name => "mobile-web-app-capable"}/ | ||
= csrf_meta_tags | ||
= csp_meta_tag | ||
= yield :head | ||
%link{:href => "/icon.png", :rel => "icon", :type => "image/png"}/ | ||
%link{:href => "/icon.svg", :rel => "icon", :type => "image/svg+xml"}/ | ||
%link{:href => "/icon.png", :rel => "apple-touch-icon"}/ | ||
= stylesheet_link_tag :app, "data-turbo-track": "reload" | ||
= javascript_importmap_tags | ||
= stylesheet_link_tag "application", "data-turbo-track": "reload" | ||
%body | ||
= yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
!!! | ||
%html | ||
%head | ||
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/ | ||
:css | ||
/* Email styles need to be inline */ | ||
%body | ||
= yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
= yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%h1 Update your password | ||
= 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
%h1 Forgot your password? | ||
= 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
%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)}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
= form_with(model: pdf) do |form| | ||
- if pdf.errors.any? | ||
%div{:style => "color: red"} | ||
%h2 | ||
= pluralize(pdf.errors.count, "error") | ||
prohibited this pdf from being saved: | ||
%ul | ||
- pdf.errors.each do |error| | ||
%li= error.full_message | ||
%div | ||
= form.label :name, style: "display: block" | ||
= form.text_field :name | ||
%div | ||
= form.label :version, style: "display: block" | ||
= form.text_field :version | ||
%div | ||
= form.label :description, style: "display: block" | ||
= form.text_field :description | ||
%div | ||
= form.label :pdf_file, style: "display: block" | ||
= form.file_field :pdf_file | ||
%div | ||
= form.label :first_page_number, style: "display: block" | ||
= form.text_field :first_page_number | ||
%div | ||
= form.submit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
%div{:id => "#{dom_id pdf}"} | ||
%p | ||
%strong Name: | ||
= pdf.name | ||
%p | ||
%strong Owner: | ||
= pdf.owner_id | ||
%p | ||
%strong Version: | ||
= pdf.version | ||
%p | ||
%strong Description: | ||
= pdf.description | ||
%p | ||
%strong Page count: | ||
= pdf.page_count | ||
%p | ||
%strong First page numberuploaded filename: | ||
= pdf.first_page_numberuploaded_filename | ||
%p | ||
%strong Uploaded at: | ||
= pdf.uploaded_at | ||
%p | ||
%strong Uploaded by: | ||
= pdf.uploaded_by_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- content_for :title, "Editing pdf" | ||
%h1 Editing pdf | ||
= render "form", pdf: @pdf | ||
%br/ | ||
%div | ||
= link_to "Show this pdf", @pdf | ||
| | ||
\#{link_to "Back to pdfs", pdfs_path} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
%p{:style => "color: green"}= notice | ||
- content_for :title, "Pdfs" | ||
%h1 Pdfs | ||
#pdfs | ||
- @pdfs.each do |pdf| | ||
= render pdf | ||
%p | ||
= link_to "Show this pdf", pdf | ||
= link_to "New pdf", new_pdf_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- content_for :title, "New pdf" | ||
%h1 New pdf | ||
= render "form", pdf: @pdf | ||
%br/ | ||
%div | ||
= link_to "Back to pdfs", pdfs_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%p{:style => "color: green"}= notice | ||
= render @pdf | ||
%div | ||
= link_to "Edit this pdf", edit_pdf_path(@pdf) | ||
| | ||
\#{link_to "Back to pdfs", pdfs_path} | ||
|
||
\#{button_to "Destroy this pdf", @pdf, method: :delete} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "Pudding", | ||
"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": "Pudding.", | ||
"theme_color": "red", | ||
"background_color": "red" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
= 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" | ||
%br/ | ||
= link_to "Forgot password?", new_password_path |
57 changes: 57 additions & 0 deletions
57
db/migrate/20241227164929_create_active_storage_tables.active_storage.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This migration comes from active_storage (originally 20170806125915) | ||
class CreateActiveStorageTables < ActiveRecord::Migration[7.0] | ||
def change | ||
# Use Active Record's configured type for primary and foreign keys | ||
primary_key_type, foreign_key_type = primary_and_foreign_key_types | ||
|
||
create_table :active_storage_blobs, id: primary_key_type do |t| | ||
t.string :key, null: false | ||
t.string :filename, null: false | ||
t.string :content_type | ||
t.text :metadata | ||
t.string :service_name, null: false | ||
t.bigint :byte_size, null: false | ||
t.string :checksum | ||
|
||
if connection.supports_datetime_with_precision? | ||
t.datetime :created_at, precision: 6, null: false | ||
else | ||
t.datetime :created_at, null: false | ||
end | ||
|
||
t.index [ :key ], unique: true | ||
end | ||
|
||
create_table :active_storage_attachments, id: primary_key_type do |t| | ||
t.string :name, null: false | ||
t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type | ||
t.references :blob, null: false, type: foreign_key_type | ||
|
||
if connection.supports_datetime_with_precision? | ||
t.datetime :created_at, precision: 6, null: false | ||
else | ||
t.datetime :created_at, null: false | ||
end | ||
|
||
t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true | ||
t.foreign_key :active_storage_blobs, column: :blob_id | ||
end | ||
|
||
create_table :active_storage_variant_records, id: primary_key_type do |t| | ||
t.belongs_to :blob, null: false, index: false, type: foreign_key_type | ||
t.string :variation_digest, null: false | ||
|
||
t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true | ||
t.foreign_key :active_storage_blobs, column: :blob_id | ||
end | ||
end | ||
|
||
private | ||
def primary_and_foreign_key_types | ||
config = Rails.configuration.generators | ||
setting = config.options[config.orm][:primary_key_type] | ||
primary_key_type = setting || :primary_key | ||
foreign_key_type = setting || :bigint | ||
[ primary_key_type, foreign_key_type ] | ||
end | ||
end |
Oops, something went wrong.