blog_app 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +67 -0
  3. data/README.md +24 -0
  4. data/Rakefile +6 -0
  5. data/config/application.rb +22 -0
  6. data/config/boot.rb +4 -0
  7. data/config/cable.yml +10 -0
  8. data/config/credentials.yml.enc +1 -0
  9. data/config/database.yml +29 -0
  10. data/config/environment.rb +5 -0
  11. data/config/environments/development.rb +66 -0
  12. data/config/environments/production.rb +112 -0
  13. data/config/environments/test.rb +49 -0
  14. data/config/initializers/application_controller_renderer.rb +8 -0
  15. data/config/initializers/assets.rb +14 -0
  16. data/config/initializers/backtrace_silencers.rb +7 -0
  17. data/config/initializers/content_security_policy.rb +30 -0
  18. data/config/initializers/cookies_serializer.rb +5 -0
  19. data/config/initializers/devise.rb +311 -0
  20. data/config/initializers/filter_parameter_logging.rb +4 -0
  21. data/config/initializers/inflections.rb +16 -0
  22. data/config/initializers/mime_types.rb +4 -0
  23. data/config/initializers/wrap_parameters.rb +14 -0
  24. data/config/locales/devise.en.yml +65 -0
  25. data/config/locales/en.yml +33 -0
  26. data/config/puma.rb +38 -0
  27. data/config/routes.rb +12 -0
  28. data/config/spring.rb +6 -0
  29. data/config/storage.yml +34 -0
  30. data/config/webpack/development.js +5 -0
  31. data/config/webpack/environment.js +11 -0
  32. data/config/webpack/production.js +5 -0
  33. data/config/webpack/test.js +5 -0
  34. data/config/webpacker.yml +96 -0
  35. data/db/migrate/20220803091536_create_articles.rb +10 -0
  36. data/db/migrate/20220803160125_create_comments.rb +11 -0
  37. data/db/migrate/20220810064022_devise_create_users.rb +44 -0
  38. data/db/migrate/20220819063129_add_user_ref_to_comments.rb +5 -0
  39. data/db/migrate/20220819064210_changes_in_table.rb +6 -0
  40. data/db/migrate/20220907114823_create_active_storage_tables.active_storage.rb +27 -0
  41. data/db/migrate/20220908072238_add_omniauth_to_users.rb +5 -0
  42. data/db/schema.rb +80 -0
  43. data/db/seeds.rb +1018 -0
  44. data/lib/app/assets/config/manifest.js +2 -0
  45. data/lib/app/assets/stylesheets/application.css +15 -0
  46. data/lib/app/assets/stylesheets/articles.scss +3 -0
  47. data/lib/app/assets/stylesheets/comments.scss +3 -0
  48. data/lib/app/assets/stylesheets/custom.css +30 -0
  49. data/lib/app/channels/application_cable/channel.rb +4 -0
  50. data/lib/app/channels/application_cable/connection.rb +4 -0
  51. data/lib/app/controllers/application_controller.rb +11 -0
  52. data/lib/app/controllers/articles_controller.rb +50 -0
  53. data/lib/app/controllers/comments_controller.rb +25 -0
  54. data/lib/app/controllers/users/omniauth_callbacks_controller.rb +14 -0
  55. data/lib/app/helpers/application_helper.rb +2 -0
  56. data/lib/app/helpers/articles_helper.rb +2 -0
  57. data/lib/app/helpers/comments_helper.rb +2 -0
  58. data/lib/app/javascript/channels/consumer.js +6 -0
  59. data/lib/app/javascript/channels/index.js +5 -0
  60. data/lib/app/javascript/css/application.scss +2 -0
  61. data/lib/app/javascript/packs/application.js +18 -0
  62. data/lib/app/jobs/application_job.rb +7 -0
  63. data/lib/app/mailers/application_mailer.rb +4 -0
  64. data/lib/app/mailers/user_mailer.rb +11 -0
  65. data/lib/app/models/application_record.rb +3 -0
  66. data/lib/app/models/article.rb +5 -0
  67. data/lib/app/models/comment.rb +4 -0
  68. data/lib/app/models/user.rb +42 -0
  69. data/lib/app/views/articles/_form.html.erb +31 -0
  70. data/lib/app/views/articles/edit.html.erb +8 -0
  71. data/lib/app/views/articles/index.html.erb +26 -0
  72. data/lib/app/views/articles/new.html.erb +8 -0
  73. data/lib/app/views/articles/show.html.erb +26 -0
  74. data/lib/app/views/comments/_comment.html.erb +16 -0
  75. data/lib/app/views/comments/_form.html.erb +15 -0
  76. data/lib/app/views/header_and_footer/_header.html.erb +34 -0
  77. data/lib/app/views/layouts/application.html.erb +23 -0
  78. data/lib/app/views/layouts/authentication.html.erb +0 -0
  79. data/lib/app/views/layouts/mailer.html.erb +13 -0
  80. data/lib/app/views/layouts/mailer.text.erb +1 -0
  81. data/lib/app/views/user_mailer/welcome_email.html.erb +10 -0
  82. data/lib/app/views/user_mailer/welcome_email.text.erb +13 -0
  83. data/lib/app/views/users/confirmations/new.html.erb +16 -0
  84. data/lib/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
  85. data/lib/app/views/users/mailer/email_changed.html.erb +7 -0
  86. data/lib/app/views/users/mailer/password_change.html.erb +3 -0
  87. data/lib/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
  88. data/lib/app/views/users/mailer/unlock_instructions.html.erb +7 -0
  89. data/lib/app/views/users/passwords/edit.html.erb +27 -0
  90. data/lib/app/views/users/passwords/new.html.erb +18 -0
  91. data/lib/app/views/users/registrations/edit.html.erb +77 -0
  92. data/lib/app/views/users/registrations/new.html.erb +40 -0
  93. data/lib/app/views/users/sessions/new.html.erb +28 -0
  94. data/lib/app/views/users/shared/_error_messages.html.erb +15 -0
  95. data/lib/app/views/users/shared/_links.html.erb +26 -0
  96. data/lib/app/views/users/unlocks/new.html.erb +16 -0
  97. metadata +151 -0
@@ -0,0 +1,2 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../stylesheets .css
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6
+ * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the Articles controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: https://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the Comments controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: https://sass-lang.com/
@@ -0,0 +1,30 @@
1
+ .align-class {
2
+ text-align: center;
3
+ }
4
+
5
+ .shadow-class {
6
+ text-shadow: 2px 2px 7px #000000;
7
+ }
8
+
9
+ .table-class {
10
+ padding: 1.5rem !important;
11
+ text-align: center;
12
+ }
13
+
14
+ .link-class {
15
+ text-decoration: none;
16
+ }
17
+
18
+ .font-class {
19
+ font-size: 30px;
20
+ }
21
+
22
+ .notice-class {
23
+ color: green;
24
+ padding: 0rem;
25
+ }
26
+
27
+ .alert-class {
28
+ color: red;
29
+ padding: 0rem !important;
30
+ }
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,11 @@
1
+ class ApplicationController < ActionController::Base
2
+ before_action :authenticate_user!
3
+ before_action :configure_permitted_parameters, if: :devise_controller?
4
+
5
+ protected
6
+
7
+ def configure_permitted_parameters
8
+ devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name])
9
+ devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name, :avatar])
10
+ end
11
+ end
@@ -0,0 +1,50 @@
1
+ class ArticlesController < ApplicationController
2
+ before_action :find_article, only: [:show, :edit, :update, :destroy]
3
+ def index
4
+ @articles = Article.all.page params[:page]
5
+ end
6
+
7
+ def show
8
+ end
9
+
10
+ def new
11
+ @article = Article.new
12
+ end
13
+
14
+ def edit
15
+ end
16
+
17
+ def create
18
+ @article = Article.new(article_params)
19
+
20
+ if @article.save
21
+ redirect_to @article
22
+ else
23
+ render 'new'
24
+ end
25
+ end
26
+
27
+ def update
28
+ if @article.update(article_params)
29
+ redirect_to @article
30
+ else
31
+ render 'edit'
32
+ end
33
+ end
34
+
35
+ def destroy
36
+ @article.destroy
37
+
38
+ redirect_to articles_path, notice: "Article was successfully destroyed."
39
+ end
40
+
41
+ private
42
+
43
+ def find_article
44
+ @article = Article.find(params[:id])
45
+ end
46
+
47
+ def article_params
48
+ params.require(:article).permit(:title, :text)
49
+ end
50
+ end
@@ -0,0 +1,25 @@
1
+ class CommentsController < ApplicationController
2
+ before_action :find_article, only: [:create, :destroy]
3
+
4
+ def create
5
+ @comment = @article.comments.create(comment_params.merge(user_id: current_user.id))
6
+ redirect_to article_path(@article)
7
+ end
8
+
9
+ def destroy
10
+ @comment = @article.comments.find(params[:id])
11
+
12
+ @comment.destroy
13
+ redirect_to article_path(@article), notice: "Comment Destroyed Successfully"
14
+ end
15
+
16
+ private
17
+
18
+ def comment_params
19
+ params.require(:comment).permit(:commenter, :body)
20
+ end
21
+
22
+ def find_article
23
+ @article = Article.find(params[:article_id])
24
+ end
25
+ end
@@ -0,0 +1,14 @@
1
+ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
2
+ def google_oauth2
3
+ # You need to implement the method below in your model (e.g. app/models/user.rb)
4
+ @user = User.from_omniauth(request.env['omniauth.auth'])
5
+
6
+ if @user.persisted?
7
+ flash[:notice] = I18n.t 'devise.omniauth_callbacks.success', kind: 'Google'
8
+ sign_in_and_redirect @user, event: :authentication
9
+ else
10
+ session['devise.google_data'] = request.env['omniauth.auth'].except('extra') # Removing extra as it can overflow some session stores
11
+ redirect_to new_user_registration_url, alert: @user.errors.full_messages.join("\n")
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module ArticlesHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module CommentsHelper
2
+ end
@@ -0,0 +1,6 @@
1
+ // Action Cable provides the framework to deal with WebSockets in Rails.
2
+ // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3
+
4
+ import { createConsumer } from "@rails/actioncable"
5
+
6
+ export default createConsumer()
@@ -0,0 +1,5 @@
1
+ // Load all the channels within this directory and all subdirectories.
2
+ // Channel files must be named *_channel.js.
3
+
4
+ const channels = require.context('.', true, /_channel\.js$/)
5
+ channels.keys().forEach(channels)
@@ -0,0 +1,2 @@
1
+
2
+ @import "~bootstrap/scss/bootstrap.scss";
@@ -0,0 +1,18 @@
1
+ // This file is automatically compiled by Webpack, along with any other files
2
+ // present in this directory. You're encouraged to place your actual application logic in
3
+ // a relevant structure within app/javascript and only use these pack files to reference
4
+ // that code so it'll be compiled.
5
+
6
+ require("@rails/ujs").start()
7
+ require("turbolinks").start()
8
+ require("@rails/activestorage").start()
9
+ require("channels")
10
+
11
+ import "css/application";
12
+
13
+ // Uncomment to copy all static images under ../images to the output folder and reference
14
+ // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
15
+ // or the `imagePath` JavaScript helper below.
16
+ //
17
+ // const images = require.context('../images', true)
18
+ // const imagePath = (name) => images(name, true)
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,11 @@
1
+ class UserMailer < ApplicationMailer
2
+ default from: 'support@ckblogs.com'
3
+
4
+ def welcome_email
5
+ @user = params[:user]
6
+ mail(
7
+ to: @user.email,
8
+ subject: 'Welcome to CK Blogs'
9
+ )
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -0,0 +1,5 @@
1
+ class Article < ApplicationRecord
2
+ paginates_per 10
3
+ validates :title, presence: true, length: { minimum: 5 }
4
+ has_many :comments, dependent: :destroy
5
+ end
@@ -0,0 +1,4 @@
1
+ class Comment < ApplicationRecord
2
+ belongs_to :article
3
+ belongs_to :user
4
+ end
@@ -0,0 +1,42 @@
1
+ class User < ApplicationRecord
2
+ after_create :send_welcome_mail
3
+
4
+ has_many :comments, dependent: :destroy
5
+
6
+ has_one_attached :avatar
7
+
8
+ def full_name
9
+ "#{first_name} #{last_name}"
10
+ end
11
+
12
+
13
+
14
+ # Include default devise modules. Others available are:
15
+ # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
16
+ devise :database_authenticatable, :registerable,
17
+ :recoverable, :rememberable, :validatable, :trackable, :omniauthable, omniauth_providers: [:google_oauth2]
18
+
19
+ def self.from_omniauth(access_token)
20
+ user = User.find_by(email: access_token.info.email)
21
+ unless user
22
+ user = User.create(
23
+ email: access_token.info.email,
24
+ password: Devise.friendly_token[0,20]
25
+ )
26
+ end
27
+ user.first_name = access_token.info.first_name
28
+ user.last_name = access_token.info.last_name
29
+ user.image = access_token.info.image
30
+ # user.uid = access_token.uid
31
+ # user.provider = access_token.provider
32
+ user.save
33
+
34
+ user
35
+ end
36
+
37
+ private
38
+
39
+ def send_welcome_mail
40
+ UserMailer.with(user: self).welcome_email.deliver_now
41
+ end
42
+ end
@@ -0,0 +1,31 @@
1
+ <%= form_with model: @article, local: true do |form| %>
2
+
3
+ <% if @article.errors.any? %>
4
+ <div id="error_explanation">
5
+ <h2>
6
+ <%= pluralize(@article.errors.count, "error") %> prohibited
7
+ this article from being saved:
8
+ </h2>
9
+ <ul>
10
+ <% @article.errors.full_messages.each do |msg| %>
11
+ <li><%= msg %></li>
12
+ <% end %>
13
+ </ul>
14
+ </div>
15
+ <% end %>
16
+
17
+ <p class="mb-3">
18
+ <%= form.label :title, class: "form-label" %><br>
19
+ <%= form.text_field :title, class: "form-control" %>
20
+ </p>
21
+
22
+ <p class="mb-3">
23
+ <%= form.label :text, class: "form-label" %><br>
24
+ <%= form.text_area :text, class: "form-control" %>
25
+ </p>
26
+ <br>
27
+ <p>
28
+ <%= form.submit class: "btn btn-success btn-lg shadow" %>
29
+ </p>
30
+
31
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <div class="col-8 mx-auto">
2
+ <h1 class="align-class shadow-class">Edit your Article</h1>
3
+ <br>
4
+ <br>
5
+ <%= render 'form' %>
6
+
7
+ <%= link_to 'Back', articles_path, class: "btn btn-secondary shadow" %>
8
+ </div>
@@ -0,0 +1,26 @@
1
+ <div class="col">
2
+ <div class="row justify-content-between">
3
+ <h1 class="col-2 shadow-class">ARTICLES</h1>
4
+ <%= link_to 'New article', new_article_path, class: "col-2 btn btn-success btn-lg shadow" %>
5
+ </div>
6
+ <br>
7
+ <table class="table table-striped table-hover shadow">
8
+ <tr class="shadow table-dark">
9
+ <th class="table-class">Title</th>
10
+ <th class="table-class">Text</th>
11
+ <th class="table-class" colspan="3">Actions</th>
12
+ </tr>
13
+
14
+ <% @articles.each do |article| %>
15
+ <tr>
16
+ <td class="table-class"><%= article.title %></td>
17
+ <td class="table-class"><%= article.text %></td>
18
+ <td class="table-class"><%= link_to 'Show', article_path(article), class: "link-class" %></td>
19
+ <td class="table-class"><%= link_to 'Edit', edit_article_path(article), class: "link-class" %></td>
20
+ <td class="table-class"><%= link_to 'Destroy', article_path(article), method: :delete, data: { confirm: 'Are you sure?' }, class: "link-danger link-class" %></td>
21
+ </tr>
22
+ <% end %>
23
+ </table>
24
+ <%= paginate @articles %>
25
+ <br>
26
+ </div>
@@ -0,0 +1,8 @@
1
+ <div class="col-8 mx-auto">
2
+ <h1 class="align-class shadow-class">New Article</h1>
3
+ <br>
4
+ <br>
5
+ <%= render 'form' %>
6
+ <br>
7
+ <%= link_to 'Back', articles_path, class: "btn btn-secondary shadow" %>
8
+ </div>
@@ -0,0 +1,26 @@
1
+ <div class="col">
2
+ <p class="font-class">
3
+ <strong>Title : </strong>
4
+ <%= @article.title %>
5
+ </p>
6
+
7
+ <p class="font-class">
8
+ <strong>Text : </strong>
9
+ <%= @article.text %>
10
+ </p>
11
+ <div class="d-grid gap-2 d-md-flex justify-content-end">
12
+ <%= link_to 'Edit', edit_article_path, class: "btn btn-primary shadow" %>
13
+ <%= link_to 'Back', articles_path, class: "btn btn-secondary shadow" %>
14
+ </div>
15
+ <br>
16
+ <hr>
17
+ <h4>Comments</h4>
18
+ <br>
19
+ <%= render @article.comments %>
20
+ <br>
21
+ <hr>
22
+ <br>
23
+ <h4>Add a comment:</h3>
24
+ <br>
25
+ <%= render 'comments/form' %>
26
+ </div>
@@ -0,0 +1,16 @@
1
+ <p>
2
+ <strong>Commenter:</strong>
3
+ <%= comment.user.full_name %>
4
+ </p>
5
+ <p>
6
+ <strong>Comment:</strong>
7
+ <%= comment.body %>
8
+ </p>
9
+ <br>
10
+
11
+ <% if current_user && current_user == comment.user %>
12
+ <%= link_to 'Destroy Comment', [comment.article, comment], method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %>
13
+ <hr>
14
+ <% end %>
15
+ <br>
16
+ <br>
@@ -0,0 +1,15 @@
1
+ <div class="col-3">
2
+ <%= form_with(model: [ @article, @article.comments.build ], local: true) do |form| %>
3
+ <!-- <p class="mb-3">
4
+ <%= form.label :commenter, class: "form-label" %><br>
5
+ <%= form.text_field :commenter, class: "form-control" %>
6
+ </p> -->
7
+ <p>
8
+ <%= form.label :body, class: "form-label" %><br>
9
+ <%= form.text_area :body, class: "form-control" %>
10
+ </p>
11
+ <p>
12
+ <%= form.submit class: "btn btn-primary shadow" %>
13
+ </p>
14
+ <% end %>
15
+ </div>
@@ -0,0 +1,34 @@
1
+ <% if current_user %>
2
+ <nav class="navbar navbar-expand-lg navbar-dark bg-success">
3
+ <div class="container-fluid">
4
+ <a class="navbar-brand" href="/">Blog Application</a>
5
+ <div class="nav-link row justify-content-end">
6
+ </div>
7
+ <div class="nav-link row justify-content-end">
8
+ <% if current_user.avatar.attached?%>
9
+ <span><%= image_tag current_user.avatar, width: "40px", style: "border-radius: 50%;border: 1px solid white", class: "shadow" %></span>
10
+ <% elsif user_signed_in? %>
11
+ <span><%= image_tag current_user.image, width: "40px", style: "border-radius: 50%;border: 1px solid white", class: "shadow" if current_user.image?%></span>
12
+ <% end %>
13
+ <span class="link-light"><%= current_user.full_name %></span>
14
+ <span>
15
+ <%= link_to 'Edit User', edit_user_registration_path, class: "btn btn-outline-light"%>
16
+ </span>
17
+ <span>
18
+ <%= link_to 'Sign out', destroy_user_session_path, method: :delete, class: "btn btn-outline-light" %>
19
+ </span>
20
+ </div>
21
+ </div>
22
+ </nav>
23
+ <% else %>
24
+ <nav class="navbar navbar-expand-lg navbar-dark bg-success">
25
+ <div class="container-fluid">
26
+ <a class="navbar-brand" href="/">Blog Application</a>
27
+ <div class="nav-link row justify-content-end">
28
+ <div class="nav-item">
29
+ <%= link_to 'Sign up', new_user_registration_path, class: "link-class link-light" %>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </nav>
34
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>DemoApp</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
9
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
10
+ <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
11
+ </head>
12
+
13
+ <body>
14
+ <%= render "header_and_footer/header" %>
15
+ <div class="container">
16
+ <div class="row">
17
+ <p class="notice notice-class"><%= notice %></p>
18
+ <p class="alert alert-class"><%= alert %></p>
19
+ <%= yield %>
20
+ </div>
21
+ </div>
22
+ </body>
23
+ </html>
File without changes
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,10 @@
1
+ <h1>Welcome to CK blogs!!</h1>
2
+ <p>
3
+ You have successfully signed up to CK blogs <br>
4
+ </p>
5
+ <p><strong>Email:-</strong> <%= @user.email %></p>
6
+ <p><strong>Password:-</strong> <%= @user.password %></p>
7
+ <p>
8
+ To login to the site, just follow this link: <%= @url %>
9
+ </p>
10
+ <p>Thanks for joining and have a great day!</p>
@@ -0,0 +1,13 @@
1
+ Welcome to CK blogs, <%= @user.full_name %>
2
+ =============================================================================
3
+
4
+ You have successfully signed up to CK blogs, your username is: <%= @user.full_name %>
5
+
6
+ Email:- <%= @user.email %>
7
+ Password:- <%= @user.password %>
8
+
9
+ =============================================================================
10
+
11
+ To login to the site, just follow this link: <%= @url %>
12
+
13
+ Thanks for joining and have a great day!
@@ -0,0 +1,16 @@
1
+ <h2>Resend confirmation instructions</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= render "users/shared/error_messages", resource: resource %>
5
+
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
9
+ </div>
10
+
11
+ <div class="actions">
12
+ <%= f.submit "Resend confirmation instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "users/shared/links" %>
@@ -0,0 +1,5 @@
1
+ <p>Welcome <%= @email %>!</p>
2
+
3
+ <p>You can confirm your account email through the link below:</p>
4
+
5
+ <p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @email %>!</p>
2
+
3
+ <% if @resource.try(:unconfirmed_email?) %>
4
+ <p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
5
+ <% else %>
6
+ <p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
7
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>We're contacting you to notify you that your password has been changed.</p>
@@ -0,0 +1,8 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Someone has requested a link to change your password. You can do this through the link below.</p>
4
+
5
+ <p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
6
+
7
+ <p>If you didn't request this, please ignore this email.</p>
8
+ <p>Your password won't change until you access the link above and create a new one.</p>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
4
+
5
+ <p>Click the link below to unlock your account:</p>
6
+
7
+ <p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
@@ -0,0 +1,27 @@
1
+ <div class="col">
2
+ <h2 class="align-class">Change your password</h2>
3
+ <br>
4
+ <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
5
+ <%= render "users/shared/error_messages", resource: resource %>
6
+ <%= f.hidden_field :reset_password_token %>
7
+
8
+ <div class="field col-6 mx-auto">
9
+ <%= f.label :password, "New password", class: "form-label" %><br />
10
+ <% if @minimum_password_length %>
11
+ <em>(<%= @minimum_password_length %> characters minimum)</em><br />
12
+ <% end %>
13
+ <%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: "form-control" %>
14
+ </div>
15
+ <br>
16
+ <div class="field col-6 mx-auto">
17
+ <%= f.label :password_confirmation, "Confirm new password", class: "form-label" %><br />
18
+ <%= f.password_field :password_confirmation, autocomplete: "new-password", class: "form-control" %>
19
+ </div>
20
+ <br>
21
+ <div class="actions d-grid gap-2 col-6 mx-auto shadow">
22
+ <%= f.submit "Change my password", class: "btn btn-success btn-lg" %>
23
+ </div>
24
+ <% end %>
25
+ <br>
26
+ <%= render "users/shared/links" %>
27
+ </div>