trusty-cms 7.0.7 → 7.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +5 -3
- data/INSTALL.md +4 -2
- data/app/views/admin/pages/_fields.html.haml +3 -0
- data/app/views/admin/pages/_previous_versions.haml +28 -0
- data/config/initializers/paper_trail.rb +1 -1
- data/lib/trusty_cms/engine.rb +6 -5
- data/lib/trusty_cms/version.rb +1 -1
- data/spec/dummy/db/schema.rb +39 -18
- data/trusty_cms.gemspec +2 -0
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 170bd1825c9f7ff25e1bcf51d8ac424e32612d8415a7d640fc441195e9bddb4c
|
4
|
+
data.tar.gz: 2c367de40351f12fd2d71e2f4fb9ff842a0379fe07f313c8e040a43979bc5e8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1247c66e283d00de5c30181d53d356271c165401a40de6c8ffbf6d4cbc9dcb31d96e980daea0ac150b64abccd4101dc027b7484f8dfa965db74c36628e0089a6
|
7
|
+
data.tar.gz: eb1e804f9a828378cc4cf4553c0761753c08b133011409cbc514f79dae86ef377a69c74ef20125f3d472f997d68dc772f291126cd8413b803f775b76e249d5f6
|
data/Gemfile
CHANGED
@@ -7,8 +7,8 @@ source 'https://rubygems.org'
|
|
7
7
|
# requires trusty and therefore pulls in every
|
8
8
|
# dependency mentioned in trusty.gemspec.
|
9
9
|
|
10
|
-
gem 'paper_trail'
|
11
|
-
gem 'paper_trail-association_tracking'
|
10
|
+
gem 'paper_trail', '~> 16.0.0'
|
11
|
+
gem 'paper_trail-association_tracking', '~> 2.2.1'
|
12
12
|
gem 'psych', '5.2.2'
|
13
13
|
gem 'trustygems', '~> 0.2.0'
|
14
14
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
trusty-cms (7.0.
|
4
|
+
trusty-cms (7.0.8)
|
5
5
|
RedCloth (= 4.3.3)
|
6
6
|
activestorage-validator
|
7
7
|
acts_as_list (>= 0.9.5, < 1.3.0)
|
@@ -21,6 +21,8 @@ PATH
|
|
21
21
|
mini_racer
|
22
22
|
mutex_m
|
23
23
|
mysql2
|
24
|
+
paper_trail (~> 16.0.0)
|
25
|
+
paper_trail-association_tracking (~> 2.2.1)
|
24
26
|
rack (>= 2.0.1, < 3.2.0)
|
25
27
|
rack-cache (~> 1.7)
|
26
28
|
radius (~> 0.7)
|
@@ -429,8 +431,8 @@ DEPENDENCIES
|
|
429
431
|
file_validators
|
430
432
|
launchy (~> 3.0.1)
|
431
433
|
mysql2
|
432
|
-
paper_trail
|
433
|
-
paper_trail-association_tracking
|
434
|
+
paper_trail (~> 16.0.0)
|
435
|
+
paper_trail-association_tracking (~> 2.2.1)
|
434
436
|
poltergeist (~> 1.18.1)
|
435
437
|
pry-byebug
|
436
438
|
psych (= 5.2.2)
|
data/INSTALL.md
CHANGED
@@ -14,9 +14,11 @@ From within the directory containing your TrustyCMS instance:
|
|
14
14
|
4. Run the Trusty CMS generator to get the project into shape: `rails g trusty_cms [project_name]`.
|
15
15
|
- This will ask you if you want to replace a number of existing files (like application.rb); reply Y to all.
|
16
16
|
|
17
|
-
5.
|
17
|
+
5. Add `config.extensions = [ :snippets, :clipped, :layouts, :multi_site ]` to enable them in application.rb
|
18
|
+
|
19
|
+
6. Add `config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time, ActiveSupport::TimeWithZone, ActiveSupport::TimeZone]` to application.rb. This is required for pages to save previous versions.
|
18
20
|
|
19
21
|
7. Add utf8 encoding to your db.yml
|
20
22
|
|
21
|
-
|
23
|
+
8. Run `bundle exec rake db:setup`, `bundle exec rake trusty_cms:install:migrations`, then
|
22
24
|
`bundle exec rake db:bootstrap`.
|
@@ -30,6 +30,9 @@
|
|
30
30
|
= render :partial => 'admin/page_parts/page_part', :collection => @page.parts
|
31
31
|
= render_region :parts_bottom, :locals => {:f => fields}
|
32
32
|
|
33
|
+
#previous-versions
|
34
|
+
= render :partial => 'admin/pages/previous_versions'
|
35
|
+
|
33
36
|
.set
|
34
37
|
- render_region :layout, :locals => {:f => fields} do |layout|
|
35
38
|
- layout.edit_layout do
|
@@ -0,0 +1,28 @@
|
|
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.
|
data/lib/trusty_cms/engine.rb
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
require 'ckeditor'
|
2
|
+
require 'devise'
|
3
|
+
require 'ransack'
|
4
|
+
require 'paper_trail'
|
5
|
+
require 'paper_trail-association_tracking'
|
6
|
+
|
1
7
|
module TrustyCms
|
2
8
|
class Engine < Rails::Engine
|
3
9
|
isolate_namespace TrustyCms
|
@@ -19,8 +25,3 @@ module TrustyCms
|
|
19
25
|
end
|
20
26
|
end
|
21
27
|
end
|
22
|
-
|
23
|
-
require 'ckeditor'
|
24
|
-
require 'devise'
|
25
|
-
require 'ransack'
|
26
|
-
|
data/lib/trusty_cms/version.rb
CHANGED
data/spec/dummy/db/schema.rb
CHANGED
@@ -10,8 +10,8 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema[7.0].define(version:
|
14
|
-
create_table "active_storage_attachments", charset: "
|
13
|
+
ActiveRecord::Schema[7.0].define(version: 2025_01_03_191134) do
|
14
|
+
create_table "active_storage_attachments", charset: "utf8", force: :cascade do |t|
|
15
15
|
t.string "name", null: false
|
16
16
|
t.string "record_type", null: false
|
17
17
|
t.bigint "record_id", null: false
|
@@ -21,7 +21,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
21
21
|
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
22
22
|
end
|
23
23
|
|
24
|
-
create_table "active_storage_blobs", charset: "
|
24
|
+
create_table "active_storage_blobs", charset: "utf8", force: :cascade do |t|
|
25
25
|
t.string "key", null: false
|
26
26
|
t.string "filename", null: false
|
27
27
|
t.string "content_type"
|
@@ -33,13 +33,13 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
33
33
|
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
34
34
|
end
|
35
35
|
|
36
|
-
create_table "active_storage_variant_records", charset: "
|
36
|
+
create_table "active_storage_variant_records", charset: "utf8", force: :cascade do |t|
|
37
37
|
t.bigint "blob_id", null: false
|
38
38
|
t.string "variation_digest", null: false
|
39
39
|
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
40
40
|
end
|
41
41
|
|
42
|
-
create_table "admins", charset: "
|
42
|
+
create_table "admins", charset: "utf8", force: :cascade do |t|
|
43
43
|
t.string "email", default: "", null: false
|
44
44
|
t.string "encrypted_password", default: "", null: false
|
45
45
|
t.string "reset_password_token"
|
@@ -69,14 +69,14 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
69
69
|
t.datetime "updated_at", precision: nil, null: false
|
70
70
|
end
|
71
71
|
|
72
|
-
create_table "admins_sites", charset: "
|
72
|
+
create_table "admins_sites", charset: "utf8", force: :cascade do |t|
|
73
73
|
t.integer "admin_id", null: false
|
74
74
|
t.integer "site_id", null: false
|
75
75
|
t.index ["admin_id"], name: "index_admins_sites_on_admin_id"
|
76
76
|
t.index ["site_id"], name: "index_admins_sites_on_site_id"
|
77
77
|
end
|
78
78
|
|
79
|
-
create_table "assets", charset: "
|
79
|
+
create_table "assets", charset: "utf8", force: :cascade do |t|
|
80
80
|
t.string "caption"
|
81
81
|
t.string "title"
|
82
82
|
t.string "asset_file_name"
|
@@ -92,19 +92,19 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
92
92
|
t.string "original_extension"
|
93
93
|
end
|
94
94
|
|
95
|
-
create_table "config", charset: "
|
95
|
+
create_table "config", charset: "utf8", force: :cascade do |t|
|
96
96
|
t.string "key", limit: 40, default: "", null: false
|
97
97
|
t.string "value", default: ""
|
98
98
|
t.index ["key"], name: "key", unique: true
|
99
99
|
end
|
100
100
|
|
101
|
-
create_table "extension_meta", charset: "
|
101
|
+
create_table "extension_meta", charset: "utf8", force: :cascade do |t|
|
102
102
|
t.string "name"
|
103
103
|
t.integer "schema_version", default: 0
|
104
104
|
t.boolean "enabled", default: true
|
105
105
|
end
|
106
106
|
|
107
|
-
create_table "layouts", charset: "
|
107
|
+
create_table "layouts", charset: "utf8", force: :cascade do |t|
|
108
108
|
t.string "name", limit: 100
|
109
109
|
t.text "content"
|
110
110
|
t.datetime "created_at", precision: nil
|
@@ -116,20 +116,20 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
116
116
|
t.integer "site_id"
|
117
117
|
end
|
118
118
|
|
119
|
-
create_table "page_attachments", charset: "
|
119
|
+
create_table "page_attachments", charset: "utf8", force: :cascade do |t|
|
120
120
|
t.integer "asset_id"
|
121
121
|
t.integer "page_id"
|
122
122
|
t.integer "position"
|
123
123
|
end
|
124
124
|
|
125
|
-
create_table "page_fields", charset: "
|
125
|
+
create_table "page_fields", charset: "utf8", force: :cascade do |t|
|
126
126
|
t.integer "page_id"
|
127
127
|
t.string "name"
|
128
128
|
t.string "content"
|
129
129
|
t.index ["page_id", "name", "content"], name: "index_page_fields_on_page_id_and_name_and_content"
|
130
130
|
end
|
131
131
|
|
132
|
-
create_table "page_parts", charset: "
|
132
|
+
create_table "page_parts", charset: "utf8", force: :cascade do |t|
|
133
133
|
t.string "name", limit: 100
|
134
134
|
t.string "filter_id", limit: 25
|
135
135
|
t.text "content", size: :medium
|
@@ -137,7 +137,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
137
137
|
t.index ["page_id", "name"], name: "parts_by_page"
|
138
138
|
end
|
139
139
|
|
140
|
-
create_table "pages", charset: "
|
140
|
+
create_table "pages", charset: "utf8", force: :cascade do |t|
|
141
141
|
t.string "title"
|
142
142
|
t.string "slug", limit: 100
|
143
143
|
t.string "breadcrumb", limit: 160
|
@@ -162,7 +162,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
162
162
|
t.index ["virtual", "status_id"], name: "pages_published"
|
163
163
|
end
|
164
164
|
|
165
|
-
create_table "sessions", charset: "
|
165
|
+
create_table "sessions", charset: "utf8", force: :cascade do |t|
|
166
166
|
t.string "session_id"
|
167
167
|
t.text "data"
|
168
168
|
t.datetime "updated_at", precision: nil
|
@@ -170,7 +170,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
170
170
|
t.index ["updated_at"], name: "index_sessions_on_updated_at"
|
171
171
|
end
|
172
172
|
|
173
|
-
create_table "sites", charset: "
|
173
|
+
create_table "sites", charset: "utf8", force: :cascade do |t|
|
174
174
|
t.string "name"
|
175
175
|
t.string "domain"
|
176
176
|
t.integer "homepage_id"
|
@@ -184,7 +184,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
184
184
|
t.string "base_domain"
|
185
185
|
end
|
186
186
|
|
187
|
-
create_table "snippets", charset: "
|
187
|
+
create_table "snippets", charset: "utf8", force: :cascade do |t|
|
188
188
|
t.string "name", limit: 100, default: "", null: false
|
189
189
|
t.string "filter_id", limit: 25
|
190
190
|
t.text "content"
|
@@ -197,7 +197,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
197
197
|
t.index ["name", "site_id"], name: "name_site_id", unique: true
|
198
198
|
end
|
199
199
|
|
200
|
-
create_table "users", charset: "
|
200
|
+
create_table "users", charset: "utf8", force: :cascade do |t|
|
201
201
|
t.string "name", limit: 100
|
202
202
|
t.string "email"
|
203
203
|
t.string "login", limit: 40, default: "", null: false
|
@@ -218,6 +218,27 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_08_172942) do
|
|
218
218
|
t.datetime "password_reset_sent_at", precision: nil
|
219
219
|
end
|
220
220
|
|
221
|
+
create_table "version_associations", charset: "utf8", force: :cascade do |t|
|
222
|
+
t.integer "version_id"
|
223
|
+
t.string "foreign_key_name", null: false
|
224
|
+
t.integer "foreign_key_id"
|
225
|
+
t.string "foreign_type"
|
226
|
+
t.index ["foreign_key_name", "foreign_key_id", "foreign_type"], name: "index_version_associations_on_foreign_key"
|
227
|
+
t.index ["version_id"], name: "index_version_associations_on_version_id"
|
228
|
+
end
|
229
|
+
|
230
|
+
create_table "versions", charset: "utf8mb4", force: :cascade do |t|
|
231
|
+
t.string "whodunnit"
|
232
|
+
t.datetime "created_at"
|
233
|
+
t.bigint "item_id", null: false
|
234
|
+
t.string "item_type", limit: 191, null: false
|
235
|
+
t.string "event", null: false
|
236
|
+
t.text "object", size: :long
|
237
|
+
t.integer "transaction_id"
|
238
|
+
t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
|
239
|
+
t.index ["transaction_id"], name: "index_versions_on_transaction_id"
|
240
|
+
end
|
241
|
+
|
221
242
|
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
222
243
|
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
223
244
|
end
|
data/trusty_cms.gemspec
CHANGED
@@ -43,6 +43,8 @@ a general purpose content management system--not merely a blogging engine.'
|
|
43
43
|
s.add_dependency 'mini_racer'
|
44
44
|
s.add_dependency 'mutex_m'
|
45
45
|
s.add_dependency 'mysql2'
|
46
|
+
s.add_dependency 'paper_trail', '~> 16.0.0'
|
47
|
+
s.add_dependency 'paper_trail-association_tracking', '~> 2.2.1'
|
46
48
|
s.add_dependency 'rack', '>= 2.0.1', '< 3.2.0'
|
47
49
|
s.add_dependency 'rack-cache', '~> 1.7'
|
48
50
|
s.add_dependency 'radius', '~> 0.7'
|
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.
|
4
|
+
version: 7.0.8
|
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-01-
|
11
|
+
date: 2025-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage-validator
|
@@ -292,6 +292,34 @@ dependencies:
|
|
292
292
|
- - ">="
|
293
293
|
- !ruby/object:Gem::Version
|
294
294
|
version: '0'
|
295
|
+
- !ruby/object:Gem::Dependency
|
296
|
+
name: paper_trail
|
297
|
+
requirement: !ruby/object:Gem::Requirement
|
298
|
+
requirements:
|
299
|
+
- - "~>"
|
300
|
+
- !ruby/object:Gem::Version
|
301
|
+
version: 16.0.0
|
302
|
+
type: :runtime
|
303
|
+
prerelease: false
|
304
|
+
version_requirements: !ruby/object:Gem::Requirement
|
305
|
+
requirements:
|
306
|
+
- - "~>"
|
307
|
+
- !ruby/object:Gem::Version
|
308
|
+
version: 16.0.0
|
309
|
+
- !ruby/object:Gem::Dependency
|
310
|
+
name: paper_trail-association_tracking
|
311
|
+
requirement: !ruby/object:Gem::Requirement
|
312
|
+
requirements:
|
313
|
+
- - "~>"
|
314
|
+
- !ruby/object:Gem::Version
|
315
|
+
version: 2.2.1
|
316
|
+
type: :runtime
|
317
|
+
prerelease: false
|
318
|
+
version_requirements: !ruby/object:Gem::Requirement
|
319
|
+
requirements:
|
320
|
+
- - "~>"
|
321
|
+
- !ruby/object:Gem::Version
|
322
|
+
version: 2.2.1
|
295
323
|
- !ruby/object:Gem::Dependency
|
296
324
|
name: rack
|
297
325
|
requirement: !ruby/object:Gem::Requirement
|
@@ -790,6 +818,7 @@ files:
|
|
790
818
|
- app/views/admin/pages/_meta_row.html.haml
|
791
819
|
- app/views/admin/pages/_node.html.haml
|
792
820
|
- app/views/admin/pages/_popups.html.haml
|
821
|
+
- app/views/admin/pages/_previous_versions.haml
|
793
822
|
- app/views/admin/pages/children.html.haml
|
794
823
|
- app/views/admin/pages/edit.html.haml
|
795
824
|
- app/views/admin/pages/index.html.haml
|