activeadmin-settings 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,6 +45,7 @@
45
45
  data-id="#setting_<%= setting.id %>">
46
46
  Update
47
47
  </a>
48
+ <span class="saved-state">Saved</span>
48
49
  </td>
49
50
  </tr>
50
51
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module ActiveadminSettings
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
@@ -18,7 +18,7 @@ namespace :activeadmin do
18
18
 
19
19
  # Save default text values to db,
20
20
  # as this way it's more easy to edit them
21
- if s.type == "text"
21
+ if s.type == "text" or s.type == "html"
22
22
  s.string = s.default_value
23
23
  s.save
24
24
  end
@@ -15,6 +15,14 @@ $ ->
15
15
  $('#settings .form form').submit ->
16
16
  false
17
17
 
18
+ show_saved_state = (el) ->
19
+ saved_label = el.closest('tr').find('.saved-state')
20
+ el.hide()
21
+ saved_label.show()
22
+ hide_label = (label, btn) -> label.fadeOut => btn.show()
23
+
24
+ setTimeout ( -> hide_label(saved_label, el) ), 1000
25
+
18
26
  $('#settings .update_link').click (e) ->
19
27
  e.preventDefault()
20
28
  btn = $(this)
@@ -26,5 +34,8 @@ $ ->
26
34
  if form.parent().hasClass("file")
27
35
  form.find(".inline-hints").html(value)
28
36
  form.clearForm()
29
- btn.hide()
37
+ if form.parent().hasClass("html")
38
+ show_saved_state(btn)
39
+ else
40
+ btn.hide()
30
41
 
@@ -5,14 +5,38 @@
5
5
  tr th:last-child { width:15%; }
6
6
 
7
7
  .update_link { display: none; }
8
- .option-type-html .update_link { display: inline; }
8
+ .saved-state { display:none; }
9
+
10
+ .option-type-html {
11
+ .update_link { display: inline; }
12
+ }
13
+
9
14
  tr td .form {
10
- //display:none;
11
15
  .label { display:none; }
16
+
12
17
  .file .label { display:inline; }
18
+
13
19
  .inputs { margin-bottom:0; }
20
+
14
21
  input[type="text"], textarea { width:90%; }
15
22
  textarea { height:100px; }
23
+
24
+ &.html {
25
+ fieldset {
26
+ padding: 0;
27
+ background: transparent;
28
+ border: none;
29
+ -webkit-box-shadow: none;
30
+ -moz-box-shadow: none;
31
+ box-shadow: none;
32
+
33
+ li.input.text {
34
+ padding: 0px;
35
+ }
36
+
37
+ textarea { height: 280px; }
38
+ }
39
+ }
16
40
  }
17
41
  }
18
42
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  segments:
105
105
  - 0
106
- hash: 2295382336544002382
106
+ hash: -140399498841524941
107
107
  required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements: