fullstack-cms 0.3.23 → 0.3.24

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.23
1
+ 0.3.24
@@ -47,8 +47,37 @@ class Setting < ActiveRecord::Base
47
47
  self.send("#{setting_kind}_value")
48
48
  end
49
49
 
50
- # eg. Setting.global("site-name")
50
+ # examples
51
+ #
52
+ # Setting.get("contacts/registrant", :default => "[ none ]")
53
+ # Setting.get( :registrant, :group => :contacts )
54
+ # Setting.get( "address", :of => @user )
55
+
56
+ def self.get(key, opts = {})
57
+ key = key.to_s
58
+ gk = key.split("/")
51
59
 
60
+ group = nil
61
+ if gk.size == 1
62
+ group = opts.delete(:group)
63
+ key = gk.first
64
+ else
65
+ group, key = gk
66
+ end
67
+
68
+ default = opts.delete(:default)
69
+ settable = opts.delete(:of)
70
+ settable_id = settable.try(:id)
71
+
72
+ query = opts.dup
73
+ query.merge!({:key => key})
74
+ query.merge!({:group => group}) if group
75
+ query.merge!({:settable_id => settable_id})
76
+
77
+ self.where(query).first.try(:value) || default
78
+ end
79
+
80
+ # using Setting.get is simpler, expecially if you don't want 'autocreate' feature
52
81
  def self.global(key, opts = {})
53
82
  key = key.to_s
54
83
  autocreate = opts.delete(:autocreate)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fullstack-cms"
8
- s.version = "0.3.23"
8
+ s.version = "0.3.24"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mcasimir"]
12
- s.date = "2013-01-06"
12
+ s.date = "2013-01-09"
13
13
  s.description = "CMS system built on fullstack"
14
14
  s.email = "maurizio.cas@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -4,4 +4,29 @@
4
4
 
5
5
  .footer {
6
6
  text-align: center;
7
- }
7
+ padding: 40px;
8
+ }
9
+
10
+ .header {
11
+ position: relative;
12
+ }
13
+
14
+ .main-menu {
15
+ position: absolute;
16
+ right: 0;
17
+ bottom: 0;
18
+ }
19
+
20
+ .main-menu .nav-pills {
21
+ margin-bottom: 0;
22
+ }
23
+
24
+ h2.tagline {
25
+ margin: 0;
26
+ padding: 0;
27
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
28
+ font-size: 14px;
29
+ line-height: 20px;
30
+ color: #333;
31
+ font-weight: normal;
32
+ }
@@ -16,7 +16,7 @@
16
16
 
17
17
  <div class="page-wrapper">
18
18
  <div class="container page">
19
- <%= yield(:breadcrumbs) unless home_page? %>
19
+ <%= yield(:breadcrumb) unless home_page? %>
20
20
  <div role="main">
21
21
  <%= yield %>
22
22
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fullstack-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.23
4
+ version: 0.3.24
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-06 00:00:00.000000000 Z
12
+ date: 2013-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fullstack-admin
@@ -345,7 +345,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
345
345
  version: '0'
346
346
  segments:
347
347
  - 0
348
- hash: 1028969823530157224
348
+ hash: 4219949771033988603
349
349
  required_rubygems_version: !ruby/object:Gem::Requirement
350
350
  none: false
351
351
  requirements: