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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTZiMDg1M2U0NWNhODljNTdkYjhhMjdjOTk0ODc1ODY5NWZmNjdiZQ==
4
+ NDI0ODY2M2M0OWQwZTBhYmIzZmEyMmZiNTQzNjU4NzYzOTU3ZTQyZg==
5
5
  data.tar.gz: !binary |-
6
- ZDNmOTBjMjc1ZDZlMWU2ZmEzMDFiZmJlMzFjNWM2Zjk0ODNkNTk1Zg==
6
+ NWY3MmM0N2EzOGM4MDBkNDRlMDY1MzBkZDJhNjJhZWE4YWQ0ODI1OA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDMyYTQ0MjQ2OWUxNjdmZjBjN2U5MjAzMGY5NjUwYTVlMWY2MjVlMGI0OTI3
10
- MTM3YzFmNzg2MWYyMWE2ZWU4YzAxMjVjZDU2MjhkMmQ5MjRmNDM4MWM5NmNi
11
- NTEzM2NlZjc4MzIwYWI4MDRkZDY1ZWY5MzBkYTA5OGNkMmY0YTU=
9
+ MjI3NzVjOTNmNjk2M2Y4MTBlN2JmNGFhZWIyMjA2MzA2YmM4OWNhNWM5MmU1
10
+ ZDY0N2ZlN2YwMzNmZmExOWVkM2UxZjMyNTBjYTE1NWZkNzdjYWUxODljMjY1
11
+ ZjMzOTYyMmNhMjJhZjYzYzQxMjE0NzA5OGE3Y2MzOGRmMTUwZDU=
12
12
  data.tar.gz: !binary |-
13
- ZTc5ODA2ZDllZTc2ZGZkNmZhY2M3MWE2ZTY1YWNiZGQyYWY4ZDAzNzZmOWQw
14
- MTQzYWNlOTE3ODAxMGUyZDI0OGFmZTFlMTZiZWM2MWQ5NzJmMTU5NTQ3Mjhh
15
- NDIxZDIzMzk1ZTllNTE1MThmMzE2M2VlOGJiMzk0ZTIzMzk5ODc=
13
+ MzlmY2VmMjliNjVkOWY2ZGNlMjc5N2NlMDUxODM1YWEwYmYyN2FiY2Q1MjY4
14
+ YzdkZWY3YjBmN2M2NmE0ZWEyMzU5MjM2M2Q3YTA5ZTM5MzJiMjc0MWZjMjlj
15
+ ZjU5OGM4NGJlN2FlODI1OGMyNmUyZDdlYTg5Mzg1ZjNkYWY5YTM=
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.0.4 - 0.0.5
2
+ * Small fixes
3
+
1
4
  == 0.0.3
2
5
  * Published & Draft pages
3
6
  * Make compatible only with rails 4
@@ -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.has_changed_content? || !page.published?
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.has_changed_content?
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(:title) do |page|
30
- if page.has_changed_content?
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: 'Content'
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/twilight");
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())
@@ -5,5 +5,4 @@
5
5
  width: 100%;
6
6
  height: 500px;
7
7
  position: relative;
8
- top: 8px;
9
8
  }
@@ -3,7 +3,7 @@ module ActiveadminCms
3
3
  validates :slug, presence: true, uniqueness: true
4
4
  validates :title, presence: true
5
5
 
6
- def has_changed_content?
6
+ def has_unpublished_changes?
7
7
  content != draft_content
8
8
  end
9
9
 
@@ -1,3 +1,3 @@
1
1
  module ActiveadminCms
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
Binary file
@@ -693,3 +693,58 @@ ActiveadminCmsTest: test_truth
693
693
   (0.0ms) SAVEPOINT active_record_1
694
694
   (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
695
695
   (0.0ms) rollback transaction
696
+  (3.2ms) DELETE FROM "activeadmin_cms_posts";
697
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
698
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'activeadmin_cms_posts';
699
+  (7.0ms) DELETE FROM "activeadmin_cms_pages";
700
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
701
+  (0.2ms) DELETE FROM sqlite_sequence where name = 'activeadmin_cms_pages';
702
+  (0.1ms) begin transaction
703
+ -----------------------------------------------------
704
+ #publish: test_0001_should change status to published
705
+ -----------------------------------------------------
706
+  (0.0ms) SAVEPOINT active_record_1
707
+  (0.0ms) RELEASE SAVEPOINT active_record_1
708
+  (0.0ms) SAVEPOINT active_record_1
709
+ SQL (5.7ms) INSERT INTO "activeadmin_cms_posts" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["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
+ SQL (0.2ms) 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
+ ActiveadminCms::Post Load (0.1ms) SELECT "activeadmin_cms_posts".* FROM "activeadmin_cms_posts" WHERE "activeadmin_cms_posts"."id" = ? LIMIT 1 [["id", 1]]
712
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
713
+  (0.6ms) rollback transaction
714
+  (0.1ms) begin transaction
715
+ -----------------------------------------------------
716
+ #publish: test_0001_should change status to published
717
+ -----------------------------------------------------
718
+  (0.1ms) SAVEPOINT active_record_1
719
+  (0.1ms) RELEASE SAVEPOINT active_record_1
720
+  (0.1ms) SAVEPOINT active_record_1
721
+ ActiveadminCms::Page Exists (0.1ms) SELECT 1 AS one FROM "activeadmin_cms_pages" WHERE "activeadmin_cms_pages"."slug" = 'slug-1' LIMIT 1
722
+ SQL (0.5ms) 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-1"], ["title", "Foo page"], ["updated_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00]]
723
+ ActiveadminCms::Page Exists (0.1ms) SELECT 1 AS one FROM "activeadmin_cms_pages" WHERE ("activeadmin_cms_pages"."slug" = 'slug-1' AND "activeadmin_cms_pages"."id" != 1) LIMIT 1
724
+ SQL (0.2ms) UPDATE "activeadmin_cms_pages" SET "content" = ?, "published" = ?, "updated_at" = ? WHERE "activeadmin_cms_pages"."id" = 1 [["content", nil], ["published", true], ["updated_at", Sun, 20 Oct 2013 19:55:16 UTC +00:00]]
725
+ ActiveadminCms::Page Load (0.1ms) SELECT "activeadmin_cms_pages".* FROM "activeadmin_cms_pages" WHERE "activeadmin_cms_pages"."id" = ? LIMIT 1 [["id", 1]]
726
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
727
+  (0.5ms) rollback transaction
728
+  (0.1ms) begin transaction
729
+ --------------------------------------------------
730
+ #publish: test_0002_should move content from draft
731
+ --------------------------------------------------
732
+  (0.1ms) SAVEPOINT active_record_1
733
+  (0.1ms) RELEASE SAVEPOINT active_record_1
734
+  (0.1ms) SAVEPOINT active_record_1
735
+ ActiveadminCms::Page Exists (0.2ms) SELECT 1 AS one FROM "activeadmin_cms_pages" WHERE "activeadmin_cms_pages"."slug" = 'slug-2' LIMIT 1
736
+ SQL (0.4ms) 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
+ ActiveadminCms::Page Exists (0.1ms) SELECT 1 AS one FROM "activeadmin_cms_pages" WHERE ("activeadmin_cms_pages"."slug" = 'slug-2' AND "activeadmin_cms_pages"."id" != 1) LIMIT 1
738
+ SQL (0.2ms) 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
+ ActiveadminCms::Page Load (0.1ms) SELECT "activeadmin_cms_pages".* FROM "activeadmin_cms_pages" WHERE "activeadmin_cms_pages"."id" = ? LIMIT 1 [["id", 1]]
740
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
741
+  (0.4ms) rollback transaction
742
+  (0.1ms) begin transaction
743
+ ------------------------------
744
+ ActiveadminCmsTest: test_truth
745
+ ------------------------------
746
+  (0.1ms) SAVEPOINT active_record_1
747
+  (0.0ms) RELEASE SAVEPOINT active_record_1
748
+  (0.0ms) SAVEPOINT active_record_1
749
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
750
+  (0.1ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Haziev