pages_core 3.11.3 → 3.12.0

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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/app/assets/builds/pages_core/admin-dist.js +3 -3
  4. data/app/assets/stylesheets/pages/admin/components/header.scss +4 -4
  5. data/app/assets/stylesheets/pages/admin/components/modal.scss +0 -20
  6. data/app/assets/stylesheets/pages/admin.scss +0 -20
  7. data/app/assets/stylesheets/pages/errors.css +1 -1
  8. data/app/controllers/admin/calendars_controller.rb +36 -0
  9. data/app/controllers/admin/categories_controller.rb +2 -2
  10. data/app/controllers/admin/news_controller.rb +58 -0
  11. data/app/controllers/admin/pages_controller.rb +2 -3
  12. data/app/controllers/admin/password_resets_controller.rb +4 -4
  13. data/app/controllers/admin/users_controller.rb +4 -4
  14. data/app/controllers/errors_controller.rb +1 -1
  15. data/app/controllers/sessions_controller.rb +1 -1
  16. data/app/helpers/admin/calendars_helper.rb +29 -0
  17. data/app/helpers/pages_core/admin/content_tabs_helper.rb +1 -0
  18. data/app/helpers/pages_core/admin/labelled_field_helper.rb +1 -1
  19. data/app/helpers/pages_core/application_helper.rb +1 -1
  20. data/app/javascript/components/PageTreeNode.jsx +0 -8
  21. data/app/javascript/components/Toast.jsx +1 -1
  22. data/app/models/category.rb +1 -1
  23. data/app/models/concerns/pages_core/page_model/dated_page.rb +38 -0
  24. data/app/models/page.rb +1 -1
  25. data/app/policies/page_policy.rb +2 -6
  26. data/app/views/admin/calendars/show.html.erb +83 -0
  27. data/app/views/admin/invites/show.html.erb +6 -4
  28. data/app/views/admin/{pages/news.html.erb → news/index.html.erb} +12 -7
  29. data/app/views/admin/pages/_list_item.html.erb +2 -1
  30. data/app/views/admin/password_resets/show.html.erb +4 -2
  31. data/app/views/admin/users/login.html.erb +3 -3
  32. data/app/views/admin/users/new.html.erb +6 -4
  33. data/app/views/admin/users/new_password.html.erb +1 -1
  34. data/app/views/layouts/admin/_header.html.erb +4 -16
  35. data/app/views/layouts/admin/_page_header.html.erb +5 -3
  36. data/app/views/layouts/errors.html.erb +2 -2
  37. data/config/routes.rb +7 -2
  38. data/lib/pages_core/pages_plugin.rb +6 -1
  39. data/lib/rails/generators/pages_core/install/install_generator.rb +2 -2
  40. data/lib/rails/generators/pages_core/install/templates/delayed_job +2 -3
  41. data/lib/rails/generators/pages_core/rspec/templates/rails_helper.rb +2 -2
  42. metadata +9 -6
  43. data/app/controllers/concerns/pages_core/admin/news_page_controller.rb +0 -67
@@ -12,7 +12,7 @@ header {
12
12
  color: $c-text-invert;
13
13
  }
14
14
 
15
- #logo {
15
+ .logo {
16
16
  position: absolute;
17
17
  z-index: 2;
18
18
  top: 11px;
@@ -21,7 +21,7 @@ header {
21
21
  height: 27px;
22
22
  }
23
23
 
24
- #site-name {
24
+ .site-name {
25
25
  color: $c-text-invert;
26
26
  position: absolute;
27
27
  top: 15px;
@@ -100,7 +100,7 @@ header {
100
100
  }
101
101
  }
102
102
 
103
- #content-tabs {
103
+ .content-tabs {
104
104
  list-style-type: none;
105
105
  margin: 24px 0px -11px -18px;
106
106
  padding: 0;
@@ -126,7 +126,7 @@ header {
126
126
  }
127
127
  }
128
128
 
129
- #page-description {
129
+ .page-description {
130
130
  @include vertical-gradient(#dceef6, #e7f3f9);
131
131
  margin: 0;
132
132
  padding: 16px 32px;
@@ -84,23 +84,3 @@ body.modal {
84
84
  opacity: 1.0;
85
85
  }
86
86
  }
87
-
88
-
89
-
90
- /* Old rules */
91
-
92
- #modal-container {
93
- z-index:20;
94
- border: 1px solid #555;
95
- position: absolute;
96
- background: #f8f8f8;
97
- padding:20px;
98
- padding-top: 10px;
99
- }
100
-
101
- #modal-container h2 {
102
- padding: 0 0 8px 0;
103
- color: #27495e;
104
- font-size: 1.45em;
105
- border-bottom: 1px solid #e0e0e0;
106
- }
@@ -49,26 +49,6 @@ td {
49
49
  padding: 2px 16px 2px 0;
50
50
  }
51
51
 
52
- #flash-error,
53
- #flash-notice {
54
- padding: 16px 32px;
55
- font-size: 12px;
56
- }
57
-
58
- #flash-error {
59
- @include vertical-gradient(#970002, $c-red);
60
- border-bottom: 1px solid #9c0002;
61
- color: #fff299;
62
- font-weight: bold;
63
- }
64
-
65
- #flash-notice {
66
- background: #f5f3bc;
67
- border-bottom: 1px solid #dad88a;
68
- color: #3d3b00;
69
- font-weight: normal;
70
- }
71
-
72
52
  .errorExplanation {
73
53
  background-color: #ffd;
74
54
  border-bottom: 1px solid #dda;
@@ -11,7 +11,7 @@ body {
11
11
  line-height: 1.5;
12
12
  }
13
13
 
14
- #content {
14
+ main {
15
15
  width: 600px;
16
16
  margin: 150px auto;
17
17
  }
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Admin
4
+ class CalendarsController < Admin::AdminController
5
+ before_action :find_year_and_month
6
+
7
+ require_authorization object: Page
8
+
9
+ def show
10
+ unless @year
11
+ redirect_to(admin_calendar_path(@locale, Time.zone.now.year))
12
+ return
13
+ end
14
+ @pages = if @month
15
+ calendar_items.in_year_and_month(@year, @month)
16
+ else
17
+ calendar_items.in_year(@year)
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ def calendar_items
24
+ Page.with_dates
25
+ .order("starts_at DESC")
26
+ .in_locale(@locale)
27
+ .visible
28
+ .paginate(per_page: 50, page: params[:page])
29
+ end
30
+
31
+ def find_year_and_month
32
+ @year = params[:year]&.to_i
33
+ @month = params[:month]&.to_i
34
+ end
35
+ end
36
+ end
@@ -16,6 +16,8 @@ module Admin
16
16
  @category = Category.new
17
17
  end
18
18
 
19
+ def edit; end
20
+
19
21
  def create
20
22
  @category = Category.create(category_params)
21
23
  if @category.valid?
@@ -26,8 +28,6 @@ module Admin
26
28
  end
27
29
  end
28
30
 
29
- def edit; end
30
-
31
31
  def update
32
32
  if @category.update(category_params)
33
33
  flash[:notice] = t("pages_core.categories_controller.updated")
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Admin
4
+ class NewsController < Admin::AdminController
5
+ before_action :require_news_pages
6
+ before_action :find_news_pages
7
+ before_action :find_year_and_month
8
+
9
+ require_authorization object: Page
10
+
11
+ def index
12
+ @archive_finder = archive_finder(@news_pages, @locale)
13
+ unless @year
14
+ redirect_to(admin_news_index_path(@locale,
15
+ (@archive_finder.latest_year ||
16
+ Time.zone.now.year)))
17
+ return
18
+ end
19
+ @pages = @archive_finder.by_year_and_maybe_month(@year, @month)
20
+ .paginate(per_page: 50, page: params[:page])
21
+ end
22
+
23
+ private
24
+
25
+ def archive_finder(parents, locale)
26
+ Page.where(parent_page_id: parents)
27
+ .visible
28
+ .order("published_at DESC")
29
+ .in_locale(locale)
30
+ .archive_finder
31
+ end
32
+
33
+ def find_news_pages
34
+ @news_pages = Page.news_pages
35
+ .in_locale(@locale)
36
+ .reorder("parent_page_id ASC, position ASC")
37
+ return if @news_pages.any?
38
+
39
+ redirect_to(admin_pages_url(@locale))
40
+ end
41
+
42
+ def find_year_and_month
43
+ @year = params[:year]&.to_i
44
+ @month = params[:month]&.to_i
45
+ end
46
+
47
+ # Redirect away if no news pages has been configured
48
+ def require_news_pages
49
+ return if Page.news_pages.any?
50
+
51
+ redirect_to(admin_pages_url(@locale))
52
+ end
53
+
54
+ def latest_year
55
+ archive_finder.latest_year_and_month.first || Time.zone.now.year
56
+ end
57
+ end
58
+ end
@@ -3,7 +3,6 @@
3
3
  module Admin
4
4
  class PagesController < Admin::AdminController
5
5
  include PagesCore::Admin::PageJsonHelper
6
- include PagesCore::Admin::NewsPageController
7
6
 
8
7
  before_action :find_categories
9
8
  before_action :find_page, only: %i[show edit update destroy move]
@@ -34,6 +33,8 @@ module Admin
34
33
  end
35
34
  end
36
35
 
36
+ def edit; end
37
+
37
38
  def create
38
39
  @page = build_page(@locale, page_params, param_categories)
39
40
  if @page.valid?
@@ -46,8 +47,6 @@ module Admin
46
47
  end
47
48
  end
48
49
 
49
- def edit; end
50
-
51
50
  def update
52
51
  if @page.update(page_params)
53
52
  @page.categories = param_categories
@@ -8,6 +8,10 @@ module Admin
8
8
 
9
9
  layout "admin"
10
10
 
11
+ def show
12
+ @user = @password_reset_token.user
13
+ end
14
+
11
15
  def create
12
16
  @user = find_user_by_email(params[:email])
13
17
  if @user
@@ -20,10 +24,6 @@ module Admin
20
24
  redirect_to login_admin_users_url
21
25
  end
22
26
 
23
- def show
24
- @user = @password_reset_token.user
25
- end
26
-
27
27
  def update
28
28
  @user = @password_reset_token.user
29
29
  if user_params[:password].present? && @user.update(user_params)
@@ -25,10 +25,14 @@ module Admin
25
25
  redirect_to admin_default_url
26
26
  end
27
27
 
28
+ def show; end
29
+
28
30
  def new
29
31
  @user = User.new
30
32
  end
31
33
 
34
+ def edit; end
35
+
32
36
  def create
33
37
  @user = PagesCore::CreateUserService.call(user_params)
34
38
  if @user.valid?
@@ -39,10 +43,6 @@ module Admin
39
43
  end
40
44
  end
41
45
 
42
- def show; end
43
-
44
- def edit; end
45
-
46
46
  def update
47
47
  if @user.update(user_params_with_roles)
48
48
  flash[:notice] = "Your changed to #{@user.name} were saved."
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ErrorsController < ::ApplicationController
3
+ class ErrorsController < ApplicationController
4
4
  layout "errors"
5
5
 
6
6
  def show
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class SessionsController < ::ApplicationController
3
+ class SessionsController < ApplicationController
4
4
  def create
5
5
  user = find_user(params[:email], params[:password])
6
6
  authenticate!(user) if user
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Admin
4
+ module CalendarsHelper
5
+ def calendar_pages(locale)
6
+ Page.where(
7
+ id: Page.with_dates.visible.pluck(:parent_page_id).uniq.compact
8
+ ).in_locale(locale)
9
+ end
10
+
11
+ def calendar_years_with_count
12
+ calendar_counts.each_with_object({}) do |entry, obj|
13
+ obj[entry[:year]] ||= 0
14
+ obj[entry[:year]] += entry[:count]
15
+ end
16
+ end
17
+
18
+ def calendar_months_count(year)
19
+ calendar_counts.filter { |e| e[:year] == year }
20
+ .map { |e| [e[:month], e[:count]] }
21
+ end
22
+
23
+ private
24
+
25
+ def calendar_counts
26
+ @calendar_counts ||= Page.count_by_month
27
+ end
28
+ end
29
+ end
@@ -23,6 +23,7 @@ module PagesCore
23
23
  tag.div(content,
24
24
  class: "content-tab",
25
25
  id: "content-tab-#{key}",
26
+ role: "tabpanel",
26
27
  data: { tab: key,
27
28
  "main-target" => "tab" })
28
29
  end
@@ -53,7 +53,7 @@ module PagesCore
53
53
 
54
54
  def labelled_field_label(label, options = {})
55
55
  tag.label do
56
- label + labelled_field_errors(options[:errors])
56
+ safe_join([label, labelled_field_errors(options[:errors])])
57
57
  end
58
58
  end
59
59
 
@@ -28,7 +28,7 @@ module PagesCore
28
28
  output = capture(page.localize(locale), &block)
29
29
  concat(output)
30
30
  end
31
- page ? page.localize(locale) : nil
31
+ page&.localize(locale)
32
32
  end
33
33
 
34
34
  private
@@ -328,7 +328,6 @@ export default class PageTreeNode extends React.Component {
328
328
  let index = this.props.index;
329
329
  let node = index.node;
330
330
 
331
- var dateLabel = "";
332
331
  var pageName = <span className="name">{this.pageName()}</span>;
333
332
  var className = "page";
334
333
 
@@ -344,12 +343,6 @@ export default class PageTreeNode extends React.Component {
344
343
  </a>;
345
344
  }
346
345
 
347
- if (node.id && node.starts_at) {
348
- dateLabel = <span className="date">
349
- {node.starts_at}
350
- </span>;
351
- }
352
-
353
346
  if (node.news_page) {
354
347
  iconClass = "fa fa-newspaper-o icon";
355
348
  } else if (node.pinned) {
@@ -360,7 +353,6 @@ export default class PageTreeNode extends React.Component {
360
353
  <div className={className}>
361
354
  <i className={iconClass}></i>
362
355
  {pageName}
363
- {dateLabel}
364
356
  {this.statusLabel()}
365
357
  {this.collapsedLabel()}
366
358
  {this.actions()}
@@ -55,7 +55,7 @@ export default class Toast extends React.Component {
55
55
  }
56
56
 
57
57
  return (
58
- <div className="toast-wrapper">
58
+ <div className="toast-wrapper" aria-live="polite">
59
59
  {toast && (
60
60
  <div className={classNames.join(" ")}>
61
61
  {toast.message}
@@ -15,7 +15,7 @@ class Category < ApplicationRecord
15
15
  def set_slug
16
16
  self.slug = name.downcase
17
17
  .gsub(/[^\w\s]/, "")
18
- .split(/[^\w\d\-]+/)
18
+ .split(/[^\w\d-]+/)
19
19
  .compact
20
20
  .join("-")
21
21
  end
@@ -11,9 +11,47 @@ module PagesCore
11
11
 
12
12
  scope :upcoming, -> { where("ends_at > ?", Time.zone.now) }
13
13
  scope :past, -> { where("ends_at <= ?", Time.zone.now) }
14
+ scope :with_dates, -> { where.not(starts_at: nil) }
14
15
  end
15
16
 
16
17
  module ClassMethods
18
+ def count_by_month
19
+ connection.select_all(count_by_month_query).map(&:symbolize_keys)
20
+ end
21
+
22
+ def in_year(year)
23
+ time = Date.new(year.to_i).to_time
24
+ where("ends_at >= ? AND starts_at <= ?",
25
+ time.beginning_of_year,
26
+ time.end_of_year)
27
+ end
28
+
29
+ def in_year_and_month(year, month)
30
+ time = Date.new(year.to_i, month.to_i).to_time
31
+ where("ends_at >= ? AND starts_at <= ?",
32
+ time.beginning_of_month,
33
+ time.end_of_month)
34
+ end
35
+
36
+ private
37
+
38
+ def count_by_month_query
39
+ <<-SQL.squish
40
+ SELECT extract('year' FROM s.d)::integer AS year,
41
+ extract('month' FROM s.d)::integer AS month,
42
+ count(p.id) AS count
43
+ FROM (SELECT generate_series(
44
+ date_trunc('month', min(starts_at)::date),
45
+ max(ends_at)::date,
46
+ '1 month'::interval)::date AS d FROM pages) s
47
+ RIGHT JOIN pages p
48
+ ON p.ends_at::date >= s.d
49
+ AND p.starts_at::date <= (s.d + interval '1 month - 1 day')::date
50
+ WHERE p.starts_at IS NOT NULL
51
+ GROUP BY s.d
52
+ ORDER BY s.d DESC
53
+ SQL
54
+ end
17
55
  end
18
56
 
19
57
  # Finds the page's next sibling by date. Returns nil if there
data/app/models/page.rb CHANGED
@@ -29,7 +29,7 @@ class Page < ApplicationRecord
29
29
  has_many :categories, through: :page_categories
30
30
 
31
31
  validates(:unique_name,
32
- format: { with: /\A[\w\d_\-]+\z/,
32
+ format: { with: /\A[\w\d_-]+\z/,
33
33
  allow_blank: true },
34
34
  uniqueness: { allow_blank: true })
35
35
 
@@ -5,8 +5,8 @@ class PagePolicy < Policy
5
5
  true
6
6
  end
7
7
 
8
- def news?
9
- true
8
+ def calendar?
9
+ index?
10
10
  end
11
11
 
12
12
  def deleted?
@@ -17,10 +17,6 @@ class PagePolicy < Policy
17
17
  user.role?(:pages)
18
18
  end
19
19
 
20
- def new_news?
21
- create?
22
- end
23
-
24
20
  def show?
25
21
  true
26
22
  end
@@ -0,0 +1,83 @@
1
+ <%
2
+ month_names = %w{January February March April May June July August September October November December}
3
+ page_title "Calendar"
4
+ page_description "Calendar"
5
+
6
+ if PagesCore.config.localizations?
7
+ self.page_description_links = 'In ' + PagesCore.config.locales.map{ |l, n| link_to_unless_current n, calendar_admin_pages_path(l) }.join(link_separator)
8
+ end
9
+ %>
10
+
11
+ <% content_for :sidebar do %>
12
+ <h2>New entry</h2>
13
+ <p>
14
+ <%= form_tag new_admin_page_path, method: :get do %>
15
+ In <%= select_tag('parent',
16
+ options_for_select(calendar_pages(@locale).map{|p| [page_name(p, include_parents: true).gsub("&raquo;", "»"), p.id] })) %>
17
+ <%= submit_tag "Go", name: nil %>
18
+ <% end %>
19
+ </p>
20
+
21
+ <div class="archive-index">
22
+ <% calendar_years_with_count.each do |year, year_count| %>
23
+ <h2>
24
+ <%= link_to_unless_current(year,
25
+ admin_calendar_path(
26
+ @locale,
27
+ year: year)
28
+ ) %>
29
+ <span class="count">
30
+ (<%= year_count %>)
31
+ </span>
32
+ </h2>
33
+ <ul>
34
+ <% calendar_months_count(year).each do |month, month_count| %>
35
+ <li>
36
+ <% if year == @year && month == @month %>
37
+ <strong>
38
+ <%= month_names[month-1] %>
39
+ </strong>
40
+ <% else %>
41
+ <%= link_to_unless_current(
42
+ month_names[month-1],
43
+ admin_calendar_path(@locale,
44
+ month: month,
45
+ year: year)) %>
46
+ <% end %>
47
+ <span class="count">
48
+ (<%= month_count %>)
49
+ </span>
50
+ </li>
51
+ <% end %>
52
+ </ul>
53
+ <% end %>
54
+ </div>
55
+ <% end %>
56
+
57
+ <% if @pages.any? %>
58
+ <table class="list calendar-item-list">
59
+ <tr>
60
+ <th>Name</th>
61
+ <th>Date</th>
62
+ <th>Published</th>
63
+ <th>Section</th>
64
+ </tr>
65
+ <% @pages.each do |page| %>
66
+ <%= render(partial: "admin/pages/list_item",
67
+ locals: {
68
+ page: page,
69
+ date: true,
70
+ section: true,
71
+ sections: @parents
72
+ }) %>
73
+ <% end %>
74
+ </table>
75
+
76
+ <%= will_paginate @pages %>
77
+ <% else %>
78
+ <div class="content">
79
+ <p>
80
+ No calendar items have been posted yet.
81
+ </p>
82
+ </div>
83
+ <% end %>
@@ -12,10 +12,12 @@
12
12
  <%= form_for(@user,
13
13
  url: accept_admin_invite_path(@invite, token: @invite.token),
14
14
  builder: PagesCore::FormBuilder) do |f| %>
15
- <%= f.labelled_text_field :name %>
16
- <%= f.labelled_text_field :email %>
17
- <%= f.labelled_password_field :password %>
18
- <%= f.labelled_password_field :confirm_password %>
15
+ <%= f.labelled_text_field :name, autocomplete: "name" %>
16
+ <%= f.labelled_text_field :email, autocomplete: "email" %>
17
+ <%= f.labelled_password_field(:password,
18
+ autocomplete: "new-password") %>
19
+ <%= f.labelled_password_field(:confirm_password,
20
+ autocomplete: "new-password") %>
19
21
  <p>
20
22
  <button type="submit">
21
23
  Sign up
@@ -4,15 +4,15 @@
4
4
  page_description "<em>News: #{month_names[@month - 1] if @month} #{@year}</em>"
5
5
 
6
6
  if PagesCore.config.localizations?
7
- self.page_description_links = 'In ' + PagesCore.config.locales.map{ |l, n| link_to_unless_current n, news_admin_pages_path(l) }.join(link_separator)
7
+ self.page_description_links = 'In ' + PagesCore.config.locales.map{ |l, n| link_to_unless_current n, admin_news_path(l) }.join(link_separator)
8
8
  end
9
9
  %>
10
10
 
11
11
  <% content_for :sidebar do %>
12
- <% if policy(Page).new_news? %>
12
+ <% if policy(Page).new? %>
13
13
  <h2>New article</h2>
14
14
  <p>
15
- <%= form_tag new_news_admin_pages_path, method: :get do %>
15
+ <%= form_tag new_admin_page_path, method: :get do %>
16
16
  In
17
17
  <%= select_tag('parent',
18
18
  options_for_select(@news_pages.map{|p| [news_section_name(p, @news_pages).gsub("&raquo;", "»"), p.id] })) %>
@@ -24,7 +24,7 @@
24
24
  <% @archive_finder.years_with_count.reverse.each do |year, year_count| %>
25
25
  <h2>
26
26
  <%= link_to_unless_current(year,
27
- news_admin_pages_path(
27
+ admin_news_index_path(
28
28
  @locale,
29
29
  year: year,
30
30
  category: @category&.slug)
@@ -44,7 +44,7 @@
44
44
  (<%= page_count %>)
45
45
  <% else %>
46
46
  <%= link_to(month_names[month-1],
47
- news_admin_pages_path(@locale,
47
+ admin_news_index_path(@locale,
48
48
  month: month,
49
49
  year: year,
50
50
  category: @category&.slug)) %>
@@ -68,8 +68,13 @@
68
68
  <th>Section</th>
69
69
  </tr>
70
70
  <% @pages.each do |page| %>
71
- <%= render(partial: "list_item",
72
- locals: { page: page, author: true, section: true }) %>
71
+ <%= render(partial: "admin/pages/list_item",
72
+ locals: {
73
+ page: page,
74
+ author: true,
75
+ section: true,
76
+ sections: @news_pages
77
+ }) %>
73
78
  <% end %>
74
79
  </table>
75
80
 
@@ -2,6 +2,7 @@
2
2
  author ||= false
3
3
  date ||= false
4
4
  section ||= false
5
+ sections ||= []
5
6
  %>
6
7
  <tr class="<%= [page.status_label.downcase,((page.autopublish?) ? 'autopublish' : nil), ((page.pinned?) ? 'pinned' : nil)].join(' ') %>">
7
8
  <td class="name">
@@ -44,7 +45,7 @@
44
45
  <% end %>
45
46
  <% if section %>
46
47
  <td>
47
- <%= news_section_name(page.parent, @news_pages) %>
48
+ <%= news_section_name(page.parent, sections) %>
48
49
  </td>
49
50
  <% end %>
50
51
  </tr>
@@ -9,8 +9,10 @@
9
9
  url: admin_password_reset_path(@password_reset_token, token: @password_reset_token.token),
10
10
  builder: PagesCore::Admin::FormBuilder,
11
11
  class: 'form') do |f| %>
12
- <%= f.labelled_password_field :password %>
13
- <%= f.labelled_password_field :confirm_password %>
12
+ <%= f.labelled_password_field(:password,
13
+ autocomplete: "new-password") %>
14
+ <%= f.labelled_password_field(:confirm_password,
15
+ autocomplete: "new-password") %>
14
16
  <p>
15
17
  <button type="submit">
16
18
  Change Password