activeadmin_cms 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +3 -0
- data/app/admin/manage_pages.rb +6 -13
- data/app/assets/javascripts/activeadmin_cms/editor/ace.js +2 -1
- data/app/assets/stylesheets/activeadmin_cms/editor/ace.css +0 -1
- data/app/models/activeadmin_cms/page.rb +1 -1
- data/lib/activeadmin_cms/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +55 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDI0ODY2M2M0OWQwZTBhYmIzZmEyMmZiNTQzNjU4NzYzOTU3ZTQyZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWY3MmM0N2EzOGM4MDBkNDRlMDY1MzBkZDJhNjJhZWE4YWQ0ODI1OA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjI3NzVjOTNmNjk2M2Y4MTBlN2JmNGFhZWIyMjA2MzA2YmM4OWNhNWM5MmU1
|
10
|
+
ZDY0N2ZlN2YwMzNmZmExOWVkM2UxZjMyNTBjYTE1NWZkNzdjYWUxODljMjY1
|
11
|
+
ZjMzOTYyMmNhMjJhZjYzYzQxMjE0NzA5OGE3Y2MzOGRmMTUwZDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzlmY2VmMjliNjVkOWY2ZGNlMjc5N2NlMDUxODM1YWEwYmYyN2FiY2Q1MjY4
|
14
|
+
YzdkZWY3YjBmN2M2NmE0ZWEyMzU5MjM2M2Q3YTA5ZTM5MzJiMjc0MWZjMjlj
|
15
|
+
ZjU5OGM4NGJlN2FlODI1OGMyNmUyZDdlYTg5Mzg1ZjNkYWY5YTM=
|
data/CHANGELOG
CHANGED
data/app/admin/manage_pages.rb
CHANGED
@@ -3,7 +3,7 @@ ActiveAdmin.register ActiveadminCms::Page, as: 'Page' do
|
|
3
3
|
filter :title
|
4
4
|
|
5
5
|
action_item only: :show do
|
6
|
-
if page.
|
6
|
+
if page.has_unpublished_changes? || !page.published?
|
7
7
|
link_to "Publish", publish_admin_page_path, method: :put
|
8
8
|
elsif page.published?
|
9
9
|
link_to "Move draft", draft_admin_page_path, method: :put
|
@@ -13,7 +13,7 @@ ActiveAdmin.register ActiveadminCms::Page, as: 'Page' do
|
|
13
13
|
index do
|
14
14
|
column :id
|
15
15
|
column :title do |page|
|
16
|
-
if page.
|
16
|
+
if page.has_unpublished_changes?
|
17
17
|
"* #{page.title}"
|
18
18
|
else
|
19
19
|
page.title
|
@@ -26,18 +26,11 @@ ActiveAdmin.register ActiveadminCms::Page, as: 'Page' do
|
|
26
26
|
show do
|
27
27
|
panel "Post Details" do
|
28
28
|
attributes_table_for page do
|
29
|
-
row(:
|
30
|
-
|
31
|
-
"* #{page.title}"
|
32
|
-
else
|
33
|
-
page.title
|
34
|
-
end
|
29
|
+
row(:url) do |page|
|
30
|
+
link_to "/#{page.slug}", "/#{page.slug}", target: '_blank'
|
35
31
|
end
|
36
|
-
if page.has_changed_content?
|
37
|
-
row(:draft_content) { page.draft_content.html_safe }
|
38
|
-
end
|
39
|
-
row(:content) { page.content.html_safe }
|
40
32
|
row(:published?)
|
33
|
+
row(:has_unpublished_changes?)
|
41
34
|
row(:created_at)
|
42
35
|
end
|
43
36
|
end
|
@@ -66,7 +59,7 @@ ActiveAdmin.register ActiveadminCms::Page, as: 'Page' do
|
|
66
59
|
if config.page_categories.any?
|
67
60
|
f.input :category, collection: config.page_categories, include_blank: false
|
68
61
|
end
|
69
|
-
f.input :draft_content, label:
|
62
|
+
f.input :draft_content, label: false
|
70
63
|
if config.page_editor_backend = 'ace_editor'
|
71
64
|
f.form_buffers.last << content_tag(:div, page.draft_content, id: 'editor')
|
72
65
|
end
|
@@ -7,8 +7,9 @@ $(function (){
|
|
7
7
|
$content = $('#page_draft_content')
|
8
8
|
$content.hide()
|
9
9
|
var editor = ace.edit("editor")
|
10
|
-
editor.setTheme("ace/theme/
|
10
|
+
editor.setTheme("ace/theme/tomorrow");
|
11
11
|
editor.getSession().setMode("ace/mode/html");
|
12
|
+
editor.getSession().setUseWrapMode(true);
|
12
13
|
editor.setFontSize("16px");
|
13
14
|
editor.on('change', function (e) {
|
14
15
|
$content.val(editor.getValue())
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/dummy/log/test.log
CHANGED
@@ -693,3 +693,58 @@ ActiveadminCmsTest: test_truth
|
|
693
693
|
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
694
694
|
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
695
695
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
696
|
+
[1m[36m (3.2ms)[0m [1mDELETE FROM "activeadmin_cms_posts";[0m
|
697
|
+
[1m[35m (0.2ms)[0m SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
|
698
|
+
[1m[36m (0.3ms)[0m [1mDELETE FROM sqlite_sequence where name = 'activeadmin_cms_posts';[0m
|
699
|
+
[1m[35m (7.0ms)[0m DELETE FROM "activeadmin_cms_pages";
|
700
|
+
[1m[36m (0.2ms)[0m [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
|
701
|
+
[1m[35m (0.2ms)[0m DELETE FROM sqlite_sequence where name = 'activeadmin_cms_pages';
|
702
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
703
|
+
-----------------------------------------------------
|
704
|
+
#publish: test_0001_should change status to published
|
705
|
+
-----------------------------------------------------
|
706
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
707
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
708
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
709
|
+
[1m[36mSQL (5.7ms)[0m [1mINSERT INTO "activeadmin_cms_posts" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "Foo content"], ["created_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00], ["title", "Foo post"], ["updated_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00]]
|
710
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "activeadmin_cms_posts" SET "published" = ?, "updated_at" = ? WHERE "activeadmin_cms_posts"."id" = 1 [["published", true], ["updated_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00]]
|
711
|
+
[1m[36mActiveadminCms::Post Load (0.1ms)[0m [1mSELECT "activeadmin_cms_posts".* FROM "activeadmin_cms_posts" WHERE "activeadmin_cms_posts"."id" = ? LIMIT 1[0m [["id", 1]]
|
712
|
+
[1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
713
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
714
|
+
[1m[35m (0.1ms)[0m begin transaction
|
715
|
+
-----------------------------------------------------
|
716
|
+
#publish: test_0001_should change status to published
|
717
|
+
-----------------------------------------------------
|
718
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
719
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
720
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
721
|
+
[1m[35mActiveadminCms::Page Exists (0.1ms)[0m SELECT 1 AS one FROM "activeadmin_cms_pages" WHERE "activeadmin_cms_pages"."slug" = 'slug-1' LIMIT 1
|
722
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "activeadmin_cms_pages" ("content", "created_at", "slug", "title", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["content", "Foo content"], ["created_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00], ["slug", "slug-1"], ["title", "Foo page"], ["updated_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00]]
|
723
|
+
[1m[35mActiveadminCms::Page Exists (0.1ms)[0m SELECT 1 AS one FROM "activeadmin_cms_pages" WHERE ("activeadmin_cms_pages"."slug" = 'slug-1' AND "activeadmin_cms_pages"."id" != 1) LIMIT 1
|
724
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "activeadmin_cms_pages" SET "content" = ?, "published" = ?, "updated_at" = ? WHERE "activeadmin_cms_pages"."id" = 1[0m [["content", nil], ["published", true], ["updated_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00]]
|
725
|
+
[1m[35mActiveadminCms::Page Load (0.1ms)[0m SELECT "activeadmin_cms_pages".* FROM "activeadmin_cms_pages" WHERE "activeadmin_cms_pages"."id" = ? LIMIT 1 [["id", 1]]
|
726
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
727
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
728
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
729
|
+
--------------------------------------------------
|
730
|
+
#publish: test_0002_should move content from draft
|
731
|
+
--------------------------------------------------
|
732
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
733
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
734
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
735
|
+
[1m[36mActiveadminCms::Page Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "activeadmin_cms_pages" WHERE "activeadmin_cms_pages"."slug" = 'slug-2' LIMIT 1[0m
|
736
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "activeadmin_cms_pages" ("content", "created_at", "slug", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["content", "Foo content"], ["created_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00], ["slug", "slug-2"], ["title", "Foo page"], ["updated_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00]]
|
737
|
+
[1m[36mActiveadminCms::Page Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "activeadmin_cms_pages" WHERE ("activeadmin_cms_pages"."slug" = 'slug-2' AND "activeadmin_cms_pages"."id" != 1) LIMIT 1[0m
|
738
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "activeadmin_cms_pages" SET "draft_content" = ?, "content" = ?, "published" = ?, "updated_at" = ? WHERE "activeadmin_cms_pages"."id" = 1 [["draft_content", "new content"], ["content", "new content"], ["published", true], ["updated_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00]]
|
739
|
+
[1m[36mActiveadminCms::Page Load (0.1ms)[0m [1mSELECT "activeadmin_cms_pages".* FROM "activeadmin_cms_pages" WHERE "activeadmin_cms_pages"."id" = ? LIMIT 1[0m [["id", 1]]
|
740
|
+
[1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
741
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
742
|
+
[1m[35m (0.1ms)[0m begin transaction
|
743
|
+
------------------------------
|
744
|
+
ActiveadminCmsTest: test_truth
|
745
|
+
------------------------------
|
746
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
747
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
748
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
749
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
750
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|