pages_core 3.11.2 → 3.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) 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/news_controller.rb +58 -0
  10. data/app/controllers/admin/pages_controller.rb +0 -1
  11. data/app/controllers/errors_controller.rb +1 -1
  12. data/app/controllers/sessions_controller.rb +1 -1
  13. data/app/helpers/admin/calendars_helper.rb +29 -0
  14. data/app/helpers/pages_core/admin/content_tabs_helper.rb +1 -0
  15. data/app/helpers/pages_core/admin/labelled_field_helper.rb +1 -1
  16. data/app/helpers/pages_core/application_helper.rb +1 -1
  17. data/app/javascript/components/Attachments.jsx +2 -1
  18. data/app/javascript/components/PageTreeNode.jsx +0 -8
  19. data/app/javascript/components/Toast.jsx +1 -1
  20. data/app/models/category.rb +1 -1
  21. data/app/models/concerns/pages_core/page_model/dated_page.rb +38 -0
  22. data/app/models/page.rb +1 -1
  23. data/app/policies/page_policy.rb +2 -6
  24. data/app/views/admin/calendars/show.html.erb +83 -0
  25. data/app/views/admin/invites/show.html.erb +6 -4
  26. data/app/views/admin/{pages/news.html.erb → news/index.html.erb} +12 -7
  27. data/app/views/admin/pages/_list_item.html.erb +2 -1
  28. data/app/views/admin/password_resets/show.html.erb +4 -2
  29. data/app/views/admin/users/login.html.erb +3 -3
  30. data/app/views/admin/users/new.html.erb +6 -4
  31. data/app/views/admin/users/new_password.html.erb +1 -1
  32. data/app/views/layouts/admin/_header.html.erb +4 -16
  33. data/app/views/layouts/admin/_page_header.html.erb +5 -3
  34. data/app/views/layouts/errors.html.erb +2 -2
  35. data/config/routes.rb +7 -2
  36. data/lib/pages_core/pages_plugin.rb +6 -1
  37. data/lib/rails/generators/pages_core/install/install_generator.rb +2 -2
  38. data/lib/rails/generators/pages_core/install/templates/delayed_job +2 -3
  39. data/lib/rails/generators/pages_core/rspec/templates/rails_helper.rb +2 -2
  40. metadata +9 -6
  41. 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
@@ -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]
@@ -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
@@ -16,7 +16,8 @@ function filenameToName(str) {
16
16
 
17
17
  export default function Attachments(props) {
18
18
  const collection = useDragCollection(props.records);
19
- const locales = props.locales ? Object.keys(props.locales) : [props.locale];
19
+ const locales = props.locales && props.locales.length > 0 ?
20
+ Object.keys(props.locales) : [props.locale];
20
21
  const [deleted, setDeleted] = useState([]);
21
22
 
22
23
  const uploadAttachment = (file) => {
@@ -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
@@ -19,11 +19,11 @@
19
19
  <%= form_tag session_path do %>
20
20
  <p>
21
21
  <label>Email address</label>
22
- <%= text_field_tag :email, '' %>
22
+ <%= text_field_tag(:email, "", autocomplete: "email") %>
23
23
  </p>
24
24
  <p>
25
25
  <label>Password</label>
26
- <%= password_field_tag :password, '' %>
26
+ <%= password_field_tag(:password, "", autocomplete: "current-password") %>
27
27
  </p>
28
28
  <p>
29
29
  <button type="submit">Sign in</button>
@@ -54,7 +54,7 @@
54
54
  and we'll send you a link where you can reset your password.
55
55
  </p>
56
56
  <p>
57
- <%= text_field_tag :email, '' %>
57
+ <%= text_field_tag(:email, "", autocomplete: "email") %>
58
58
  </p>
59
59
  <p>
60
60
  <button type="submit">
@@ -9,10 +9,12 @@
9
9
 
10
10
  <%= form_for [:admin, @user], builder: PagesCore::FormBuilder do |f| %>
11
11
 
12
- <%= f.labelled_text_field :name %>
13
- <%= f.labelled_text_field :email %>
14
- <%= f.labelled_password_field :password %>
15
- <%= f.labelled_password_field :confirm_password %>
12
+ <%= f.labelled_text_field(:name, autocomplete: "name") %>
13
+ <%= f.labelled_text_field(:email, autocomplete: "email") %>
14
+ <%= f.labelled_password_field(:password,
15
+ autocomplete: "new-password") %>
16
+ <%= f.labelled_password_field(:confirm_password,
17
+ autocomplete: "new-password") %>
16
18
 
17
19
  <p>
18
20
  <button type="submit">
@@ -13,7 +13,7 @@
13
13
  </div>
14
14
  <%= form_tag(reset_password_admin_users_path, method: :post) do %>
15
15
  <p>
16
- <%= text_field_tag :email, '', size: 32 %>
16
+ <%= text_field_tag(:email, "", size: 32, autocomplete: "email") %>
17
17
  <%= submit_tag "Find" %>
18
18
  </p>
19
19
  </form>