-
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.
Update develop - added access token and versioning with octokit (#19)
* Add devise user views and set up stimulus * Added octokit github version * Add access_token github
- Loading branch information
Showing
29 changed files
with
319 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
module PromptsHelper | ||
end |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Entry point for the build script in your package.json | ||
import "@hotwired/turbo-rails" | ||
import "./controllers" | ||
|
||
import * as bootstrap from "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,21 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
// Connects to data-controller="focus" | ||
export default class extends Controller { | ||
static values = { | ||
first: Number | ||
} | ||
connect() { | ||
if (this.firstValue === 0) { | ||
// Focus the element | ||
this.element.focus(); | ||
// Add the highlight class to the div | ||
this.element.classList.add('focus-action-element') | ||
|
||
// Remove the highlight class after 2 seconds (adjust the time as needed) | ||
setTimeout(() => { | ||
this.element.classList.remove('focus-action-element'); | ||
}, 1000); | ||
} | ||
} | ||
} |
This file was deleted.
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
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
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,14 @@ | ||
<div class="row mx-5 pt-5 pb-2"> | ||
<p class="col-6 text-secondary fs-6 text-sm-start"> | ||
<code class="text-secondary fs-6"> | ||
<%#= remote_ip_address %> | ||
</code> | ||
</p> | ||
<div class="col-6 link-underline-opacity-0 text-sm-end"> | ||
<code> | ||
<%= link_to("https://www.github.com/rossme/formless", class: 'link-underline-opacity-0 text-secondary text-sm-end link-dark', target: '_blank') do %> | ||
<%= "latest release: #{latest_github_release}" %> <i class="bi bi-github" class="text-secondary"></i> | ||
<% end %> | ||
</code> | ||
</div> | ||
</div> |
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
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
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
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,20 @@ | ||
<h2>Resend confirmation instructions</h2> | ||
|
||
<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> | ||
<%= f.error_notification %> | ||
<%= f.full_error :confirmation_token %> | ||
|
||
<div class="form-inputs"> | ||
<%= f.input :email, | ||
required: true, | ||
autofocus: true, | ||
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), | ||
input_html: { autocomplete: "email" } %> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit, "Resend confirmation instructions" %> | ||
</div> | ||
<% end %> | ||
<%= render "users/shared/links" %> |
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,5 @@ | ||
<p>Welcome <%= @email %>!</p> | ||
|
||
<p>You can confirm your account email through the link below:</p> | ||
|
||
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p> |
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,7 @@ | ||
<p>Hello <%= @email %>!</p> | ||
|
||
<% if @resource.try(:unconfirmed_email?) %> | ||
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p> | ||
<% else %> | ||
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p> | ||
<% end %> |
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>Hello <%= @resource.email %>!</p> | ||
|
||
<p>We're contacting you to notify you that your password has been changed.</p> |
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>Hello <%= @resource.email %>!</p> | ||
|
||
<p>Someone has requested a link to change your password. You can do this through the link below.</p> | ||
|
||
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p> | ||
|
||
<p>If you didn't request this, please ignore this email.</p> | ||
<p>Your password won't change until you access the link above and create a new one.</p> |
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,7 @@ | ||
<p>Hello <%= @resource.email %>!</p> | ||
|
||
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p> | ||
|
||
<p>Click the link below to unlock your account:</p> | ||
|
||
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p> |
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,27 @@ | ||
<h2>Change your password</h2> | ||
|
||
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= f.error_notification %> | ||
<%= f.input :reset_password_token, as: :hidden %> | ||
<%= f.full_error :reset_password_token %> | ||
|
||
<div class="form-inputs"> | ||
<%= f.input :password, | ||
label: "New password", | ||
required: true, | ||
autofocus: true, | ||
hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length), | ||
input_html: { autocomplete: "new-password" } %> | ||
<%= f.input :password_confirmation, | ||
label: "Confirm your new password", | ||
required: true, | ||
input_html: { autocomplete: "new-password" } %> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit, "Change my password" %> | ||
</div> | ||
<% end %> | ||
<%= render "users/shared/links" %> |
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,18 @@ | ||
<h2>Forgot your password?</h2> | ||
|
||
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> | ||
<%= f.error_notification %> | ||
|
||
<div class="form-inputs"> | ||
<%= f.input :email, | ||
required: true, | ||
autofocus: true, | ||
input_html: { autocomplete: "email" } %> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit, "Send me reset password instructions" %> | ||
</div> | ||
<% end %> | ||
<%= render "users/shared/links" %> |
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,35 @@ | ||
<h2>Edit <%= resource_name.to_s.humanize %></h2> | ||
|
||
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= f.error_notification %> | ||
|
||
<div class="form-inputs"> | ||
<%= f.input :email, required: true, autofocus: true %> | ||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> | ||
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p> | ||
<% end %> | ||
<%= f.input :password, | ||
hint: "leave it blank if you don't want to change it", | ||
required: false, | ||
input_html: { autocomplete: "new-password" } %> | ||
<%= f.input :password_confirmation, | ||
required: false, | ||
input_html: { autocomplete: "new-password" } %> | ||
<%= f.input :current_password, | ||
hint: "we need your current password to confirm your changes", | ||
required: true, | ||
input_html: { autocomplete: "current-password" } %> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit, "Update" %> | ||
</div> | ||
<% end %> | ||
|
||
<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 %> |
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 @@ | ||
<h2>Sign up</h2> | ||
|
||
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> | ||
<%= f.error_notification %> | ||
|
||
<div class="form-inputs"> | ||
<%= f.input :email, | ||
required: true, | ||
autofocus: true, | ||
input_html: { autocomplete: "email" }%> | ||
<%= f.input :password, | ||
required: true, | ||
hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length), | ||
input_html: { autocomplete: "new-password" } %> | ||
<%= f.input :password_confirmation, | ||
required: true, | ||
input_html: { autocomplete: "new-password" } %> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit, "Sign up" %> | ||
</div> | ||
<% end %> | ||
<%= render "users/shared/links" %> |
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,32 @@ | ||
<div class="mx-2 mt-2 d-flex justify-content-center"> | ||
<div class="row m-4"> | ||
<div class="col-md-12 mb-4"> | ||
<div class="card"> | ||
<div class="card-header"> | ||
<h6 class="lead text-center pt-2">You can find login details on the formless github repo</h6> | ||
</div> | ||
<div class="row card-body m-4"> | ||
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> | ||
<div class="form-inputs"> | ||
<%= f.input :email, | ||
placeholder: 'Username', | ||
label: false, | ||
required: false, | ||
autofocus: true, | ||
input_html: { autocomplete: "email", class: 'form-control form-control-md mb-2' } %> | ||
<%= f.input :password, | ||
placeholder: 'Password', | ||
label: false, | ||
required: false, | ||
input_html: { autocomplete: "current-password", class: 'form-control form-control-md' } %> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit, "Log in", class: 'btn btn-light text-secondary border mt-2' %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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,15 @@ | ||
<% if resource.errors.any? %> | ||
<div id="error_explanation" data-turbo-cache="false"> | ||
<h2> | ||
<%= I18n.t("errors.messages.not_saved", | ||
count: resource.errors.count, | ||
resource: resource.class.model_name.human.downcase) | ||
%> | ||
</h2> | ||
<ul> | ||
<% resource.errors.full_messages.each do |message| %> | ||
<li><%= message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> |
Oops, something went wrong.