liquid_cms 0.3.0.6 → 0.3.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- liquid_cms (0.3.0.1)
11
+ liquid_cms (0.3.0.6)
12
12
  bundler (>= 1.0.0)
13
13
  formatize
14
14
  paperclip (~> 2.3.1)
@@ -2,19 +2,17 @@
2
2
 
3
3
  <p>No liquid support currently for editing components.</p>
4
4
 
5
- <%= form_tag({:controller => 'cms/components', :action => 'update', :url => CGI::escape(@component.path)}, :class => 'formtastic') do %>
6
- <fieldset class="inputs">
7
- <ol>
8
- <li class="string"><%= label_tag :name %> <%= text_field_tag :name, @component.path, :readonly => true %></li>
9
- <li class="text"><%= label_tag :contents %> <%= text_area_tag :contents, @component.read, :rows => 40 %></li>
10
- </ol>
11
- </fieldset>
5
+ <% form_tag({:controller => 'cms/components', :action => 'update', :url => CGI::escape(@component.path)}, :class => 'simple_form') do %>
6
+ <div class="string required">
7
+ <%= label_tag :name, nil, :class => 'string required' %> <%= text_field_tag :name, @component.path, :readonly => true, :class => 'string required' %>
8
+ </div>
9
+ <div class="text required">
10
+ <%= label_tag :contents, nil, :class => 'text required' %> <%= text_area_tag :contents, @component.read, :rows => 40, :class => 'text required' %>
11
+ </div>
12
12
 
13
- <fieldset class="buttons">
14
- <ol>
15
- <li><%= submit_tag 'Update' %></li>
16
- </ol>
17
- </fieldset>
13
+ <div class="buttons">
14
+ <%= submit_tag 'Update', :class => 'update' %> or <%= link_to 'Cancel', :back, :class => 'cancel' %>
15
+ </div>
18
16
  <% end %>
19
17
 
20
18
  <%= codemirror_edit Cms::Editable::content_type(@component.path), 'form.simple_form', 'contents' %>
@@ -9,10 +9,40 @@ form.simple_form, .shadow {
9
9
  -webkit-box-shadow: 0.3em 0.3em 9px rgba(0, 0, 0, 0.1);
10
10
  box-shadow: 0.3em 0.3em 9px rgba(0, 0, 0, 0.1);
11
11
  }
12
+
13
+ form.simple_form .buttons input,
12
14
  form.simple_form a.cancel {
13
- color: red;
15
+ font-family: Arial;
16
+ font-weight: bold;
14
17
  line-height: 2em;
18
+ padding: 0.5em 1em;
15
19
  }
20
+ form.simple_form .buttons input {
21
+ color: #444;
22
+ margin-right: 0.3em;
23
+ text-shadow: 0 1px #FFF;
24
+ }
25
+ form.simple_form .buttons input:hover {
26
+ cursor: pointer;
27
+ }
28
+ form.simple_form a.cancel {
29
+ -moz-border-radius: 0.5em;
30
+ -webkit-border-radius: 0.5em;
31
+ border-radius: 0.5em;
32
+ background: #D00;
33
+ background: -moz-linear-gradient(90deg, #BB0000 0%, #EE4444 100%) repeat scroll 0 0 transparent;
34
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0,#E44), color-stop(1.0,#B00));
35
+ color: white;
36
+ margin-left: 0.3em;
37
+ text-decoration: none;
38
+ text-shadow: 0 1px #555;
39
+ }
40
+ form.simple_form a.cancel:hover {
41
+ background: #E00;
42
+ background: -moz-linear-gradient(90deg, #C11 0%, #F55 100%) repeat scroll 0 0 transparent;
43
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0,#F55), color-stop(1.0,#C11));
44
+ }
45
+
16
46
  form.simple_form div.string, form.simple_form div.text, form.simple_form div.boolean, div.select {
17
47
  margin-bottom: 1.3em;
18
48
  }
@@ -20,25 +50,30 @@ form.simple_form label {
20
50
  color: #333;
21
51
  float: left;
22
52
  font-size: 10pt;
53
+ font-family: Verdana;
23
54
  font-weight: bold;
24
- width: 10%;
55
+ line-height: 1.8em;
56
+ width: 9%;
25
57
  }
26
58
  form.simple_form input.string {
59
+ display: block;
60
+ padding: 0.3em;
61
+ margin-left: 9%;
27
62
  width: 89%;
28
63
  }
29
64
 
30
- form.simple_form .buttons { margin-left: 10%; margin-top: 1em; }
31
- form.simple_form span.hint { color: #666; display: block; font-size: 8pt; font-style: italic; margin: 0.5em 0 0 10%;}
65
+ form.simple_form .buttons { margin-left: 9%; margin-top: 1.5em; }
66
+ form.simple_form span.hint { color: #666; display: block; font-size: 8pt; font-style: italic; margin: 0.5em 0 0 9%;}
32
67
  form.simple_form span.hint em { color: #333; font-weight: bold; }
33
68
 
34
69
  form.simple_form div.fieldWithErrors { background-color: #FBE3E4; padding: 0.5em 0; }
35
70
  form.simple_form span.error {
36
71
  background: white;
37
- border:1px solid red;
38
- color:red;
39
- display:block;
40
- font-weight:bold;
41
- margin-left:10%;
42
- margin-top:0.5em;
43
- padding:0.5em;
72
+ border: 1px solid red;
73
+ color: red;
74
+ display: block;
75
+ font-weight: bold;
76
+ margin-left: 9%;
77
+ margin-top: 0.5em;
78
+ padding: 0.5em;
44
79
  }
@@ -79,6 +79,9 @@ a img {
79
79
  text-align: center;
80
80
  text-shadow: 1px 1px 4px #FFFFFF;
81
81
  }
82
+ .cms_components #content p {
83
+ font-style: italic;
84
+ }
82
85
 
83
86
  #sidebar {
84
87
  background-color: #CFCFCF;
@@ -178,3 +181,10 @@ h2 p.message {
178
181
  background-color: white;
179
182
  border: 1px solid #BBBBBB !important;
180
183
  }
184
+
185
+ .cms_pages #content h2 {
186
+ background: url("/cms/images/icons/page.png") no-repeat scroll right 50% transparent;
187
+ }
188
+ .cms_assets #content h2 {
189
+ background: url("/cms/images/icons/photo.png") no-repeat scroll right 50% transparent;
190
+ }
@@ -15,9 +15,18 @@ body {
15
15
  .cms_documentation #content a {
16
16
  color: #FFE900;
17
17
  }
18
+ .cms_components #content p {
19
+ color: white;
20
+ }
18
21
  .cms_documentation span.function {
19
22
  color: #49FF3F;
20
23
  }
21
24
  .cms_documentation .cms_info {
22
25
  color: #333;
23
26
  }
27
+
28
+ form.simple_form, .shadow {
29
+ -moz-box-shadow: 0.3em 0.3em 9px 1px rgba(0, 0, 0, 0.5);
30
+ -webkit-box-shadow: 0.3em 0.3em 9px rgba(0, 0, 0, 0.5);
31
+ box-shadow: 0.3em 0.3em 9px rgba(0, 0, 0, 0.5);
32
+ }
@@ -6,6 +6,8 @@ module Cms
6
6
  mattr_reader :context_class
7
7
  def self.context_class=(klass)
8
8
  @@context_class = klass
9
+ return if klass.nil?
10
+
9
11
  eval(klass.to_s).extend Cms::ContextAssociation
10
12
 
11
13
  Cms::Page.belongs_to :context, :class_name => klass.to_s
@@ -14,6 +16,7 @@ module Cms
14
16
  @@context_class = nil
15
17
 
16
18
  def self.set_context(context, bind_to)
19
+ return if @@context_class.nil?
17
20
  bind_to.instance_variable_set :@cms_context, context
18
21
  end
19
22
 
@@ -5,7 +5,7 @@ module Cms
5
5
  attr_reader :object
6
6
 
7
7
  def initialize(context = nil)
8
- @object = context
8
+ @object = Cms.context_class ? context : nil
9
9
  end
10
10
 
11
11
  def pages
@@ -1,3 +1,3 @@
1
1
  module Cms
2
- VERSION = "0.3.0.6"
2
+ VERSION = "0.3.0.7"
3
3
  end
@@ -9,7 +9,10 @@ Gem::Specification.new do |s|
9
9
  s.email = ['andrew@redlinesoftware.com']
10
10
  s.homepage = "http://rubygems.org/gems/liquid_cms"
11
11
  s.summary = "A context aware Rails CMS engine using the Liquid template library."
12
- s.description = "A context aware Rails CMS engine using the Liquid template library."
12
+ s.description = <<-TXT
13
+ A context aware Rails CMS engine using the Liquid template library.
14
+ Use the 0.3.x series for Rails 3 compatibility and the 0.2.x version for Rails 2 compatibility.
15
+ TXT
13
16
 
14
17
  s.required_rubygems_version = ">= 1.3.6"
15
18
  s.rubyforge_project = "liquid_cms"
@@ -3,7 +3,7 @@ Factory.define :company do |c|
3
3
  c.domain_name 'acme.com'
4
4
  c.subdomain 'test'
5
5
  c.after_create do |c|
6
- Factory(:home_page, :context => c)
6
+ Factory(:home_page, Cms.context_class ? {:context => c} : {})
7
7
  end
8
8
  c.after_create do |c|
9
9
  Factory(:user, :company => c)
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 3
8
8
  - 0
9
- - 6
10
- version: 0.3.0.6
9
+ - 7
10
+ version: 0.3.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Kaspick
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-17 00:00:00 -06:00
19
+ date: 2011-02-20 00:00:00 -06:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -165,7 +165,7 @@ dependencies:
165
165
  version: 2.10.3
166
166
  type: :development
167
167
  version_requirements: *id010
168
- description: A context aware Rails CMS engine using the Liquid template library.
168
+ description: " A context aware Rails CMS engine using the Liquid template library.\n Use the 0.3.x series for Rails 3 compatibility and the 0.2.x version for Rails 2 compatibility.\n"
169
169
  email:
170
170
  - andrew@redlinesoftware.com
171
171
  executables: []