ants 0.3.11 → 0.3.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 224cc971f10759d5ed3ed8d23149ca9dcad5674b
4
- data.tar.gz: bee3669b730b5e7dbebbaf7de20b6b86259ba162
3
+ metadata.gz: 3d119d13250cea27ca134c0226d59094f0b31e2d
4
+ data.tar.gz: e6b90d59da7837f1607228133898fedf5e33668f
5
5
  SHA512:
6
- metadata.gz: 96464804ce7c1b5166f79df0ec0ea4ce1705816d2db6316bfe090ef23f67364977d1b088f5da86f0695764ca2e098506e7763e3ba2cccd7a546e2becd3d00d24
7
- data.tar.gz: 6eabeea92fae37aeea1764dc349fff1ca6866a84e33cc4d10c7f46734e3c54400f0ac82e6bdfedbfb79ec25a06e7e628709c516ddcc3b813ba8938a6963213d8
6
+ metadata.gz: b094b378ababb1012422babaa12155459466cb189f3c417bcd6c817e9fc15f1df24b350013e6d936372ac3d1e26f81c9b92e542b20efd17dbd72f26670dfa831
7
+ data.tar.gz: df7d45acb4d7bfbe2beaf599193f0bb809c5c1b39396c73e01871cc2022a293d3630dbf74facf4d78d49ecdd2c0105ac28f0aab7884a8f87a61e801a6422e0bc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ants (0.3.11)
4
+ ants (0.3.12)
5
5
  devise
6
6
  meta-tags
7
7
  mongoid (>= 4.0)
@@ -129,8 +129,8 @@ GEM
129
129
  rake (>= 0.8.7)
130
130
  thor (>= 0.18.1, < 2.0)
131
131
  rake (10.4.2)
132
- responders (2.1.0)
133
- railties (>= 4.2.0, < 5)
132
+ responders (2.1.1)
133
+ railties (>= 4.2.0, < 5.1)
134
134
  rest-client (1.8.0)
135
135
  http-cookie (>= 1.0.2, < 2.0)
136
136
  mime-types (>= 1.16, < 3.0)
@@ -50,6 +50,10 @@ class @AntsContent
50
50
  @_update_slug_label(view)
51
51
  @_update_preview_href(view.form)
52
52
 
53
+ @onViewShow = (view) =>
54
+ @_toggle_draft_fields(view)
55
+ @_add_editor_panel(view)
56
+
53
57
  # PRIVATE ===================================================================
54
58
 
55
59
  _update_slug_label: (view) ->
@@ -106,3 +110,43 @@ class @AntsContent
106
110
  type: "text"
107
111
  label: false
108
112
  placeholder: "Content summary"
113
+
114
+ _add_editor_panel: (view) ->
115
+ $editorGroup = view.form.groups[0].$el
116
+ view.$editorPanel =$ "<div class='group-content-editor-panel'>"
117
+ $editorGroup.append view.$editorPanel
118
+ @_add_publish_button(view)
119
+ @_add_unpublish_button(view)
120
+
121
+ _add_publish_button: (view) ->
122
+ view.$publishBtn =$ "<button class='publish'>Publish</button>"
123
+ view.$publishBtn.on "click", (e) => @_publish(view)
124
+ view.$editorPanel.append view.$publishBtn
125
+
126
+ _add_unpublish_button: (view) ->
127
+ view.$unpublishBtn =$ "<button class='unpublish'>Revert to Draft</button>"
128
+ view.$unpublishBtn.on "click", (e) => @_unpublish(view)
129
+ view.$editorPanel.append view.$unpublishBtn
130
+
131
+ _publish: (view) ->
132
+ view.form.inputs.hidden.updateValue(false)
133
+ view.$saveBtn.trigger("click")
134
+
135
+ _unpublish: (view) ->
136
+ view.form.inputs.hidden.updateValue(true)
137
+ view.$saveBtn.trigger("click")
138
+
139
+ _toggle_draft_fields: (view) ->
140
+ if view.object
141
+ hide = view.object.hidden
142
+ else
143
+ hide = true
144
+
145
+ $viewEl = view.$el
146
+ $hiddenInput = view.form.inputs.hidden.$input
147
+
148
+ $hiddenInput.on "change", (e) ->
149
+ hide = $(e.currentTarget).prop("checked")
150
+ $viewEl.toggleClass("view-content-draft", hide)
151
+
152
+ $viewEl.toggleClass("view-content-draft", hide)
@@ -19,7 +19,6 @@
19
19
 
20
20
  .group-content-editor {
21
21
  @include position(relative);
22
- min-height: 16em;
23
22
  background-color: $white-color;
24
23
 
25
24
  .input-_slug {
@@ -68,6 +67,33 @@
68
67
  padding: 0;
69
68
  }
70
69
  }
70
+
71
+ .publish { display: none; }
72
+ .unpublish { display: block; }
73
+ }
74
+
75
+ .view-content-draft .group-content-editor {
76
+ .publish { display: block; }
77
+ .unpublish { display: none; }
78
+ }
79
+
80
+ .group-content-editor-panel {
81
+ @include position(relative, -1px null null null);
82
+ background-color: $white-color;
83
+ height: 2.5em;
84
+ border-top: 2px solid $bg-color;
85
+
86
+ button {
87
+ float: right;
88
+ font-size: 0.8em;
89
+ margin: 0.5em 0.6em 0;
90
+ }
91
+
92
+ .unpublish {
93
+ border-color: $border-color;
94
+ color: $secondary-font-color;
95
+ float: left;
96
+ }
71
97
  }
72
98
 
73
99
  .view-new .group-content-editor-actions {
@@ -1,3 +1,3 @@
1
1
  module Ants
2
- VERSION = "0.3.11"
2
+ VERSION = "0.3.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ants
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kravets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-20 00:00:00.000000000 Z
11
+ date: 2015-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid