trusty-cms 7.0.20 → 7.0.22

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37a5978bda243d56eb15cd2fddca3156c0e45ed5a61e328fb39c7eaa8c84853f
4
- data.tar.gz: b6fc1b14ea84740df2ce0436854232d38a530269215b6501bbdac37fa27d9eb1
3
+ metadata.gz: 6d89a9b9e2dcf23e551b41e9e59acebc8f1d7326bb856bc5273be76749eae4c1
4
+ data.tar.gz: af9ab2fcfab265ffa26c21508744d1216116b0d66b40c96128d702d6cff8ecc2
5
5
  SHA512:
6
- metadata.gz: bd523345862bf8e7f266688ac143567ff251d4addc1160302523232a126584080ebff5069ccd94961fe6b06940270cddc150789ce9d27a088ae1528a9cecceef
7
- data.tar.gz: a4814549c19beb1313eebfdfdb82f1e978d47e3e38a55b5abf9c3dbf49cc9649847b9dc1189c1e74d67641b5a5b7adb18b1239e25f12bc987bd86ea2de1a320f
6
+ metadata.gz: 7875257d4fee723579c5a3505ef55cdf321ef58bc2223ce6d55c207704d93d88a10af8598abf94520a83167dfdb5443d0fd5e999c4222698e8aefbc996c6ea39
7
+ data.tar.gz: 3a9184e0283f7dec02b4a5dc54cb63423ca5d41d38384cc0e89b630c77a75e86bec33a3358d568905c77baad4120d4252f27c2dc9c0644a24e7bbc450a9c01a8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (7.0.20)
4
+ trusty-cms (7.0.22)
5
5
  RedCloth (= 4.3.3)
6
6
  activestorage-validator
7
7
  acts_as_list (>= 0.9.5, < 1.3.0)
@@ -27,6 +27,7 @@
27
27
  @import "partials/preferences";
28
28
  @import "partials/treetable";
29
29
  @import "partials/login_form";
30
+ @import "partials/previous_versions";
30
31
  @import "multi_site_main";
31
32
  @import "site_chooser";
32
33
 
@@ -0,0 +1,18 @@
1
+ #previous-versions .drawer_handle {
2
+ padding-top: 0;
3
+ }
4
+
5
+ #previous-versions h4 {
6
+ margin-bottom: 0.5em;
7
+ margin-top: 0;
8
+ padding-bottom: 0.25em;
9
+ padding-top: 0;
10
+ }
11
+
12
+ #previous-versions th {
13
+ text-align: center;
14
+ }
15
+
16
+ #previous-versions #no-previous-versions {
17
+ padding-bottom: 0.5em;
18
+ }
@@ -87,8 +87,9 @@ class Admin::PagesController < Admin::ResourceController
87
87
  end
88
88
 
89
89
  def verify_site_id
90
- @site_id = params[:site_id]&.to_i
91
- unless @site_id && @page&.site_id == @site_id
90
+ page_site_id = @page.site_id
91
+ user_site_ids = current_user.admins_sites.each.pluck(:site_id)
92
+ unless user_site_ids.include?(page_site_id)
92
93
  redirect_to admin_pages_url
93
94
  end
94
95
  end
@@ -33,7 +33,9 @@ class PageStatusController < ApplicationController
33
33
  pages.each do |page|
34
34
  page_id = page.id
35
35
  published_at = page.published_at
36
- if published_at && published_at <= Time.now
36
+
37
+ # Publish the page if its scheduled publish date is today or earlier
38
+ if published_at && published_at.beginning_of_day <= Time.now
37
39
  page.update(status_id: Status[:published].id)
38
40
  updated_pages << page_id
39
41
  else
@@ -33,9 +33,6 @@
33
33
  = render :partial => 'admin/page_parts/page_part', :collection => @page.parts
34
34
  = render_region :parts_bottom, :locals => {:f => fields}
35
35
 
36
- #previous-versions
37
- = render :partial => 'admin/pages/previous_versions'
38
-
39
36
  .set
40
37
  - render_region :layout, :locals => {:f => fields} do |layout|
41
38
  - layout.edit_layout do
@@ -7,7 +7,7 @@
7
7
  = node_title
8
8
  - else
9
9
  %i.far.fa-file
10
- = (link_to("#{node_title}".html_safe, edit_admin_page_path(page, site_id: page.site_id), :title => page.path)).html_safe
10
+ = (link_to("#{node_title}".html_safe, edit_admin_page_path(page), :title => page.path)).html_safe
11
11
  = page_type
12
12
  = spinner
13
13
  - node.status_column do
@@ -1,28 +1,33 @@
1
- %fieldset
2
- %h4
3
- %i.fas.fa-clock-rotate-left
4
- Previous Versions
5
-
6
- - if @versions.present?
7
- %section
8
- %table
9
- %thead
10
- %tr
11
- %th Date Updated
12
- %th Time Updated
13
- %th Updated By
14
- %th Action
15
- %tbody{ :id => 'versions-table' }
16
- - @versions.each do |version|
17
- %tr
18
- %td= version[:update_date]
19
- %td= version[:update_time]
20
- %td= version[:updated_by]
21
- %td
22
- = link_to 'Restore',
23
- restore_version_admin_page_path(@page.id, version_index: version[:index]),
24
- method: :put,
25
- data: { confirm: 'Are you sure you want to restore this version?' }
26
- - else
27
- %section
28
- %p No previous versions are available.
1
+ #previous-versions
2
+ %fieldset
3
+ %h4
4
+ %i.fas.fa-clock-rotate-left
5
+ Previous Versions
6
+ .drawer_contents#versions
7
+ - if @versions.present?
8
+ %section
9
+ %table
10
+ %thead
11
+ %tr
12
+ %th Date Updated
13
+ %th Time Updated
14
+ %th Updated By
15
+ %th Action
16
+ %tbody{ :id => 'versions-table' }
17
+ - @versions.each do |version|
18
+ %tr
19
+ %td= version[:update_date]
20
+ %td= version[:update_time]
21
+ %td= version[:updated_by]
22
+ %td
23
+ = button_to 'Restore',
24
+ restore_version_admin_page_path(@page, version_index: version[:index]),
25
+ method: :put,
26
+ data: { confirm: 'Are you sure you want to restore this version?' }
27
+ - else
28
+ %section#no-previous-versions
29
+ %p No previous versions are available.
30
+ .drawer_handle
31
+ %a.toggle{:href=>'#versions', :rel=>'toggle[versions]', :class=>"#{(meta_errors? ? 'less' : 'more')}"}
32
+ = meta_label
33
+ %i.fas.fa-angle-down
@@ -7,7 +7,7 @@
7
7
  = node_title
8
8
  - else
9
9
  %i.far.fa-file
10
- = (link_to("#{node_title}".html_safe, edit_admin_page_path(page, site_id: page.site_id), :title => page.path)).html_safe
10
+ = (link_to("#{node_title}".html_safe, edit_admin_page_path(page), :title => page.path)).html_safe
11
11
  = page_type
12
12
  = spinner
13
13
  - node.path_column do
@@ -6,5 +6,6 @@
6
6
  - main.edit_form do
7
7
  = form_for @page, :as => :page, :url => admin_page_path(@page), :html => {:method => :put, :multipart => true, :id => 'edit_page', 'data-onsubmit_status'=>t('saving_changes')} do |fields|
8
8
  = render :partial => 'fields', :object => fields
9
+ = render :partial => 'previous_versions'
9
10
  - main.edit_popups do
10
11
  = render :partial => 'popups'
@@ -1,3 +1,3 @@
1
1
  module TrustyCms
2
- VERSION = '7.0.20'.freeze
2
+ VERSION = '7.0.22'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trusty-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.20
4
+ version: 7.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - TrustyCms CMS dev team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-03 00:00:00.000000000 Z
11
+ date: 2025-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage-validator
@@ -742,6 +742,7 @@ files:
742
742
  - app/assets/stylesheets/admin/partials/_messages.scss
743
743
  - app/assets/stylesheets/admin/partials/_popup.scss
744
744
  - app/assets/stylesheets/admin/partials/_preferences.scss
745
+ - app/assets/stylesheets/admin/partials/_previous_versions.scss
745
746
  - app/assets/stylesheets/admin/partials/_sidebar.scss
746
747
  - app/assets/stylesheets/admin/partials/_tabcontrol.scss
747
748
  - app/assets/stylesheets/admin/partials/_table.scss