group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"
+ gem "letter_opener"
end
group :test do
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
+ childprocess (5.1.0)
+ logger (~> 1.5)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
+ launchy (3.0.1)
+ addressable (~> 2.8)
+ childprocess (~> 5.0)
+ letter_opener (1.10.0)
+ launchy (>= 2.2, < 4)
logger (1.6.1)
loofah (2.22.0)
crass (~> 1.0.2)
httparty
jsonapi-serializer
kaminari
+ letter_opener
mysql2 (~> 0.5)
puma (>= 5.0)
rails (~> 7.2.1)
border-left: none;
}
+.devise-links {
+ padding-top: 1rem;
+ border-top: 1px solid var(--accent-a);
+}
+
footer {
margin-top: 3rem;
border-top: 1px solid var(--accent-a);
color: var(--link-color);
border-radius: 0.25rem;
margin-right: 0.5rem;
+ cursor: pointer;
}
.button.small {
color: var(--body-text);
}
-.button:hover {
+button:hover, input[type="submit"]:hover, .button:hover {
opacity: 0.8;
text-decoration: none;
}
color: var(--accent-c);
}
+.marquee {
+ position: relative;
+ width: 100vw;
+ max-width: 100%;
+ height: 18px;
+ overflow-x: hidden;
+}
+
+.track {
+ position: absolute;
+ white-space: nowrap;
+ will-change: transform;
+ animation: marquee 32s linear infinite;
+}
+
+@keyframes marquee {
+ from { transform: translateX(0); }
+ to { transform: translateX(-50%); }
+}
+
@media (max-width: 480px) {
.container,
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
- :recoverable, :rememberable, :validatable
+ :recoverable, :rememberable, :validatable,
+ :confirmable
validates :first_name, presence: true
validates :last_name, presence: true
<%= yield(:form_content) %>
- <div class="links">
- <%= render "devise/shared/links" %> <%= link_to "Home", root_url %>
+ <div class="devise-links links">
+ <%= render "devise/shared/links" %>
+ <%= link_to "Home", root_url, class: "button" %>
</div>
</div>
}
.actions {
margin-top: 20px;
- text-align: center;
- }
- .actions input[type="submit"] {
- background-color: #007bff;
- color: white;
- padding: 10px 20px;
- border: none;
- border-radius: 4px;
- cursor: pointer;
- }
- .actions input[type="submit"]:hover {
- background-color: #0056b3;
}
.links {
margin-top: 20px;
- text-align: center;
}
.links a {
- color: #007bff;
text-decoration: none;
- }
- .links a:hover {
- text-decoration: underline;
+ margin-bottom: 4px;
}
</style>
\ No newline at end of file
-<h2>Resend confirmation instructions</h2>
+<% content_for :title do %>Resend email confirmation<% end %>
-<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
- <%= render "devise/shared/error_messages", resource: resource %>
+<% content_for :form_content do %>
- <div class="field">
- <%= f.label :email %><br />
- <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
- </div>
-
- <div class="actions">
- <%= f.submit "Resend confirmation instructions" %>
- </div>
+ <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
+ <%= render "devise/shared/error_messages", resource: resource %>
+
+ <div class="field">
+ <%= f.label :email %><br />
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
+ </div>
+
+ <div class="actions">
+ <%= f.submit "Resend confirmation instructions" %>
+ </div>
+ <% end %>
<% end %>
-<%= render "devise/shared/links" %>
+<%= render template: 'devise/base_template' %>
\ No newline at end of file
-<p>Welcome <%= @email %>!</p>
+<p>Welcome to <em>mind reader</em>.</p>
-<p>You can confirm your account email through the link below:</p>
+<p>You are receiving this email at <code><%= @email %></code> to confirm you really own this address. This is for spam prevention purposes.</p>
+
+<p>If you made an account on <em>mind reader</em> you can confirm your account email through the link below:</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
+
+<p>If you did not make an account you can safely disregard this message and you will not receive further emails.</p>
+
+<p>Best wishes,<br>Aidan.</p>
-<% content_for :title do %>Edit <%= resource_name.to_s.humanize %><% end %>
+<% content_for :title do %>Edit your registration<% end %>
<% content_for :form_content do %>
+ <p>Welcome back, <%= resource.first_name %>. Your email address is <%= resource.confirmed? ? "confirmed":"not yet confirmed, please check your email soon" %>.</p>
+
+ <p>Are you looking to get emails with new dispatches? You still need to register and confirm your email by following <a href="/about">instructions here</a>.</p>
+
+ <p>On this page below you can modify your registration.</p>
+
+ <hr>
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="field">
<%= f.label :first_name %>
- <%= f.text_field :first_name, autofocus: true %>
+ <%= f.text_field :first_name %>
</div>
<div class="field">
<%= f.submit "Update" %>
</div>
<% end %>
-
+ <%= button_to "Log out", destroy_user_session_path, method: :delete %>
<% if current_user&.admin? %>
-
+ <h3>Keys to the kingdom</h3>
+ <p>As an author and administrator of mind reader you cannot delete your account here. You need to remove administrative privileges first, then you may modify your account.</p>
+ <p>Privilege destruction can only be done from the rails console.</p>
<% else %>
<h3>Cancel my account</h3>
-
- <div>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete %></div>
-
- <%= link_to "Back", :back %>
+ <p>If you wish, you may delete your registration with this website. Please be aware, by doing this you will lose access to any content you have purchased or been granted. You will <em>not</em> be unsubscribed from dispatches at the same email address as this is a separate system.</p>
+ <p>Please see this page to learn how to <a href="/about">unsubscribe from emails</a>.</p>
+ <p><%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete %></p>
<% end %>
<% end %>
-<%- if controller_name != 'sessions' %>
- <%= link_to "Log in", new_session_path(resource_name) %><br />
-<% end %>
+<% if current_user %>
-<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
-<% end %>
-
-<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
-<% end %>
-
-<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
-<% end %>
-
-<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
-<% end %>
-
-<%- if devise_mapping.omniauthable? %>
- <%- resource_class.omniauth_providers.each do |provider| %>
- <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br />
+<% else %>
+ <%- if controller_name != 'sessions' %>
+ <%= link_to "Log in", new_session_path(resource_name), class: "button" %><br />
+ <% end %>
+
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
+ <%= link_to "Sign up", new_registration_path(resource_name), class: "button" %><br />
+ <% end %>
+
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
+ <%= link_to "Forgot your password?", new_password_path(resource_name), class: "button" %><br />
+ <% end %>
+
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: "button" %><br />
+ <% end %>
+
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: "button" %><br />
+ <% end %>
+
+ <%- if devise_mapping.omniauthable? %>
+ <%- resource_class.omniauth_providers.each do |provider| %>
+ <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br />
+ <% end %>
<% end %>
-<% end %>
+<% end %>
\ No newline at end of file
<script src="/simplemde.min.js"></script>
<% end %>
</head>
+ <% if !Rails.env.production? %>
+ <div class="marquee"><div class="track">NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD NOT PROD</div></div>
+ <% end %>
<% if notice or alert %>
<div class="notice">
<h3>Notice:</h3>
<%= yield %>
<footer>
- <p>© <%= Time.current.year %> <%= link_to "Aidan Cornelius-Bell", "https://aidan.cornelius-bell.com" %>, CC-NC-SA. <% if current_user&.first_name? %>Welcome back, <%= link_to current_user.first_name, edit_user_registration_path %>. <% if current_user&.admin? %>You hold the keys to the kingdom.<% end %><% end %></p>
+ <p class="account"><% if current_user&.first_name? %>Welcome back, <%= link_to current_user.first_name, edit_user_registration_path %>. <% if current_user&.admin? %>You hold the keys to the kingdom.<% end %><% else %> You are not logged in. <%= link_to "Change that?", new_user_session_path %><% end %></span></p>
+ <p>© <%= Time.current.year %> <%= link_to "Aidan Cornelius-Bell", "https://aidan.cornelius-bell.com" %>, CC-NC-SA.</p>
<p>This site is managed from the sovereign Yarta of the Kaurna Miyurna, with respect and gratitude for the custodianship of Elders past and present of the many Countries it may appear upon.</p>
<p>For legal purposes: any views expressed directly on this website are my own and not reflective of those of any employers, colleagues or affiliates. Links provided remain the views and intellectual property of their respective owners.</p>
</footer>
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
+
+ config.action_mailer.delivery_method = :letter_opener
+ config.action_mailer.perform_deliveries = true
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
port: ENV['SMTP_PORT'],
user_name: ENV['SMTP_USERNAME'],
password: ENV['SMTP_PASSWORD'],
+ host: 'acb.boo',
authentication: 'plain',
enable_starttls: true
}
# without confirming their account.
# Default is 0.days, meaning the user cannot access the website without
# confirming their account.
- # config.allow_unconfirmed_access_for = 2.days
+ config.allow_unconfirmed_access_for = 2.days
# A period that the user is allowed to confirm their account before their
# token becomes invalid. For example, if set to 3.days, the user can confirm
--- /dev/null
+class AddConfirmableToDevise < ActiveRecord::Migration[7.2]
+ def up
+ add_column :users, :confirmation_token, :string
+ add_column :users, :confirmed_at, :datetime
+ add_column :users, :confirmation_sent_at, :datetime
+ add_column :users, :unconfirmed_email, :string
+ add_index :users, :confirmation_token, unique: true
+
+ # Update existing users to confirmed
+ User.update_all(confirmed_at: DateTime.now)
+ end
+
+ def down
+ remove_columns :users, :confirmation_token, :confirmed_at, :confirmation_sent_at, :unconfirmed_email
+ end
+end
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.2].define(version: 2024_09_14_223207) do
+ActiveRecord::Schema[7.2].define(version: 2024_09_23_002439) do
create_table "api_keys", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "key"
t.datetime "created_at", null: false
t.boolean "admin", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
+ t.string "confirmation_token"
+ t.datetime "confirmed_at"
+ t.datetime "confirmation_sent_at"
+ t.string "unconfirmed_email"
+ t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end