cartoonist 0.0.20.2 → 0.0.20.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/setting.rb +8 -0
- data/app/views/admin/settings/show.html.erb +27 -17
- data/cartoonist.gemspec +1 -1
- data/lib/cartoonist/engine.rb +1 -1
- data/lib/cartoonist/version.rb +1 -1
- metadata +21 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b1d27d0658246d396c6dcbe6b60b4d3b26f2369
|
4
|
+
data.tar.gz: 6e84396f9a3d7c21b793ad6c9b328e4a15b024ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c056d8527aad3f5b4bddbfae6ba959137f7e3d9dc937ab38a814f91cf77e289bb537e5d704c799b0f4651082f6fafdf555511a3cb8c19c2879e0b15f0f68ed49
|
7
|
+
data.tar.gz: ae0342a687c6526f19d6a3a487321ea0f9f7b3eb700d76fb7efa20ee1e8e4bc36f4978150323cf0dccd5744de8ad9b37519ee44918c815f8817a9f714db9620e
|
data/app/models/setting.rb
CHANGED
@@ -140,6 +140,14 @@ class Setting < ActiveRecord::Base
|
|
140
140
|
|
141
141
|
if type == :boolean
|
142
142
|
(!!value).to_s
|
143
|
+
elsif type == :array && select_from && select_from_options.all? { |x| x.kind_of? Symbol }
|
144
|
+
value.each do |x|
|
145
|
+
unless select_from_options.map(&:to_s).include? x.to_s
|
146
|
+
raise "Invalid value: #{x}"
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
value.map(&:to_sym).to_yaml
|
143
151
|
elsif type == :array || type == :hash
|
144
152
|
value.to_yaml
|
145
153
|
else
|
@@ -22,25 +22,35 @@
|
|
22
22
|
<% next unless Setting::Meta[setting].select_from || [:text, :string, :boolean, :int].include?(Setting::Meta[setting].type) %>
|
23
23
|
<p class="setting">
|
24
24
|
<input type="hidden" name="included_settings[]" value="<%= setting %>" />
|
25
|
-
|
25
|
+
<% if Setting::Meta[setting].select_from && Setting::Meta[setting].type == :array %>
|
26
26
|
<%= Setting::Meta[setting].localized %>
|
27
|
-
<%
|
28
|
-
<
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
<select name="<%= setting %>" value="<%= Setting[setting] %>">
|
33
|
-
<% elsif Setting::Meta[setting].type == :text %>
|
34
|
-
<br />
|
35
|
-
<textarea name="<%= setting %>" cols="75" rows="15"><%= Setting[setting] %></textarea>
|
36
|
-
<% elsif Setting::Meta[setting].type == :string %>
|
37
|
-
<input type="text" name="<%= setting %>" value="<%= Setting[setting] %>" size="60" />
|
38
|
-
<% elsif [:int, :float].include?(Setting::Meta[setting].type) %>
|
39
|
-
<input type="text" name="<%= setting %>" value="<%= Setting[setting] %>" size="10" />
|
40
|
-
<% elsif Setting::Meta[setting].type == :boolean %>
|
41
|
-
<input type="checkbox" name="<%= setting %>" value="true" <%= checked Setting[setting] %> />
|
27
|
+
<% Setting::Meta[setting].select_from_options.each do |option| %>
|
28
|
+
<label>
|
29
|
+
<input type="checkbox" name="<%= setting %>[]" value="<%= setting_select_value option %>" <%= checked Setting[setting].include?(setting_select_value(option)) %> />
|
30
|
+
<%= setting_select_label option %>
|
31
|
+
</label>
|
42
32
|
<% end %>
|
43
|
-
|
33
|
+
<% else %>
|
34
|
+
<label>
|
35
|
+
<%= Setting::Meta[setting].localized %>
|
36
|
+
<% if Setting::Meta[setting].select_from %>
|
37
|
+
<select name="<%= setting %>">
|
38
|
+
<% Setting::Meta[setting].select_from_options.each do |option| %>
|
39
|
+
<option value="<%= setting_select_value option %>" <%= selected setting_select_value(option), Setting[setting] %>><%= setting_select_label option %></option>
|
40
|
+
<% end %>
|
41
|
+
<select name="<%= setting %>" value="<%= Setting[setting] %>">
|
42
|
+
<% elsif Setting::Meta[setting].type == :text %>
|
43
|
+
<br />
|
44
|
+
<textarea name="<%= setting %>" cols="75" rows="15"><%= Setting[setting] %></textarea>
|
45
|
+
<% elsif Setting::Meta[setting].type == :string %>
|
46
|
+
<input type="text" name="<%= setting %>" value="<%= Setting[setting] %>" size="60" />
|
47
|
+
<% elsif [:int, :float].include?(Setting::Meta[setting].type) %>
|
48
|
+
<input type="text" name="<%= setting %>" value="<%= Setting[setting] %>" size="10" />
|
49
|
+
<% elsif Setting::Meta[setting].type == :boolean %>
|
50
|
+
<input type="checkbox" name="<%= setting %>" value="true" <%= checked Setting[setting] %> />
|
51
|
+
<% end %>
|
52
|
+
</label>
|
53
|
+
<% end %>
|
44
54
|
|
45
55
|
<% if Setting::Meta[setting].info_label %>
|
46
56
|
<em class="info"><%= t Setting::Meta[setting].info_label %></em>
|
data/cartoonist.gemspec
CHANGED
data/lib/cartoonist/engine.rb
CHANGED
@@ -284,7 +284,7 @@ module Cartoonist
|
|
284
284
|
Setting.define :site_update_description, :order => 4
|
285
285
|
Setting.define :root_path, :type => :symbol, :default => Cartoonist::RootPath.all.first, :order => 5, :select_from => lambda { Cartoonist::RootPath.all }, :onchange => lambda { Rails.application.reload_routes! }
|
286
286
|
Setting.define :theme, :type => :symbol, :default => :cartoonist_default_theme, :order => 6, :select_from => lambda { Cartoonist::Theme.all }
|
287
|
-
Setting.define :schedule, :type => :array, :default => [:monday, :wednesday, :friday], :order => 7
|
287
|
+
Setting.define :schedule, :type => :array, :default => [:monday, :wednesday, :friday], :order => 7, :select_from => [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday]
|
288
288
|
Setting.define :copyright_starting_year, :type => :int, :order => 8
|
289
289
|
Setting.define :copyright_owners, :order => 9
|
290
290
|
|
data/lib/cartoonist/version.rb
CHANGED
metadata
CHANGED
@@ -1,125 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cartoonist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.20.
|
4
|
+
version: 0.0.20.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Virata-Stone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack-page_caching
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: devise
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jquery-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: omniauth-openid
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: railties
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '4.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '4.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: redcarpet
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '3.0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubyzip
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '1.0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '1.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: minitar
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - ~>
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0.5'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - ~>
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0.5'
|
125
125
|
description: This provides the main functionality and plugin api for Cartoonist.
|
@@ -209,17 +209,17 @@ require_paths:
|
|
209
209
|
- lib
|
210
210
|
required_ruby_version: !ruby/object:Gem::Requirement
|
211
211
|
requirements:
|
212
|
-
- -
|
212
|
+
- - ">="
|
213
213
|
- !ruby/object:Gem::Version
|
214
214
|
version: '0'
|
215
215
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
216
216
|
requirements:
|
217
|
-
- -
|
217
|
+
- - ">="
|
218
218
|
- !ruby/object:Gem::Version
|
219
219
|
version: '0'
|
220
220
|
requirements: []
|
221
221
|
rubyforge_project:
|
222
|
-
rubygems_version: 2.
|
222
|
+
rubygems_version: 2.2.2
|
223
223
|
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: Cartoonist Core
|