fullstack-cms 0.3.15 → 0.3.16

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,45 +1,45 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actionmailer (3.2.8)
5
- actionpack (= 3.2.8)
4
+ actionmailer (3.2.9)
5
+ actionpack (= 3.2.9)
6
6
  mail (~> 2.4.4)
7
- actionpack (3.2.8)
8
- activemodel (= 3.2.8)
9
- activesupport (= 3.2.8)
7
+ actionpack (3.2.9)
8
+ activemodel (= 3.2.9)
9
+ activesupport (= 3.2.9)
10
10
  builder (~> 3.0.0)
11
11
  erubis (~> 2.7.0)
12
12
  journey (~> 1.0.4)
13
13
  rack (~> 1.4.0)
14
14
  rack-cache (~> 1.2)
15
15
  rack-test (~> 0.6.1)
16
- sprockets (~> 2.1.3)
16
+ sprockets (~> 2.2.1)
17
17
  active_record_schema (0.5.13)
18
18
  rails
19
- activemodel (3.2.8)
20
- activesupport (= 3.2.8)
19
+ activemodel (3.2.9)
20
+ activesupport (= 3.2.9)
21
21
  builder (~> 3.0.0)
22
- activerecord (3.2.8)
23
- activemodel (= 3.2.8)
24
- activesupport (= 3.2.8)
22
+ activerecord (3.2.9)
23
+ activemodel (= 3.2.9)
24
+ activesupport (= 3.2.9)
25
25
  arel (~> 3.0.2)
26
26
  tzinfo (~> 0.3.29)
27
- activeresource (3.2.8)
28
- activemodel (= 3.2.8)
29
- activesupport (= 3.2.8)
30
- activesupport (3.2.8)
27
+ activeresource (3.2.9)
28
+ activemodel (= 3.2.9)
29
+ activesupport (= 3.2.9)
30
+ activesupport (3.2.9)
31
31
  i18n (~> 0.6)
32
32
  multi_json (~> 1.0)
33
33
  acts-as-taggable-on (2.3.3)
34
34
  rails (~> 3.0)
35
- acts_as_indexed (0.7.8)
35
+ acts_as_indexed (0.8.1)
36
36
  arel (3.0.2)
37
- ars-permalink (0.1.1)
37
+ ars-permalink (0.1.4)
38
38
  friendly_id
39
39
  rails
40
40
  auto_strip_attributes (2.0.2)
41
41
  activerecord (>= 3.0)
42
- awesome_nested_set (2.1.3)
42
+ awesome_nested_set (2.1.5)
43
43
  activerecord (>= 3.0.0)
44
44
  aws-sdk (1.8.0)
45
45
  httparty (~> 0.7)
@@ -48,17 +48,17 @@ GEM
48
48
  uuidtools (~> 2.1)
49
49
  bcrypt-ruby (3.0.1)
50
50
  bluecloth (2.2.0)
51
- bootstrap-datepicker-rails (0.6.33)
51
+ bootstrap-datepicker-rails (0.6.34)
52
52
  railties (>= 3.0)
53
53
  bootstrap-helpers (0.1.8)
54
54
  rails
55
- builder (3.0.0)
55
+ builder (3.0.4)
56
56
  checkin (0.5.1)
57
57
  chosen-rails (0.9.11)
58
58
  coffee-rails (~> 3.2)
59
59
  railties (~> 3.0)
60
60
  sass-rails (~> 3.2)
61
- chronic (0.6.7)
61
+ chronic (0.9.0)
62
62
  ckeditor (3.7.3)
63
63
  mime-types
64
64
  orm_adapter
@@ -93,7 +93,7 @@ GEM
93
93
  formtastic-bootstrap (2.0.0)
94
94
  formtastic (~> 2.2)
95
95
  formtastic-bootstrap
96
- friendly_id (4.0.8)
96
+ friendly_id (4.0.9)
97
97
  fullstack (0.1.26)
98
98
  active_record_schema
99
99
  auto_strip_attributes
@@ -146,7 +146,7 @@ GEM
146
146
  httparty (0.9.0)
147
147
  multi_json (~> 1.0)
148
148
  multi_xml
149
- i18n (0.6.0)
149
+ i18n (0.6.1)
150
150
  jeweler (1.8.4)
151
151
  bundler (~> 1.0)
152
152
  git (>= 1.2.5)
@@ -156,7 +156,7 @@ GEM
156
156
  jquery-rails (2.1.4)
157
157
  railties (>= 3.0, < 5.0)
158
158
  thor (>= 0.14, < 2.0)
159
- json (1.7.4)
159
+ json (1.7.5)
160
160
  kaminari (0.13.0)
161
161
  actionpack (>= 3.0.0)
162
162
  activesupport (>= 3.0.0)
@@ -178,7 +178,7 @@ GEM
178
178
  mobile-fu (1.1.1)
179
179
  rack-mobile-detect
180
180
  rails
181
- multi_json (1.3.6)
181
+ multi_json (1.5.0)
182
182
  multi_xml (0.5.1)
183
183
  net-ssh (2.6.2)
184
184
  nokogiri (1.5.6)
@@ -201,17 +201,17 @@ GEM
201
201
  rack
202
202
  rack-ssl (1.3.2)
203
203
  rack
204
- rack-test (0.6.1)
204
+ rack-test (0.6.2)
205
205
  rack (>= 1.0)
206
- rails (3.2.8)
207
- actionmailer (= 3.2.8)
208
- actionpack (= 3.2.8)
209
- activerecord (= 3.2.8)
210
- activeresource (= 3.2.8)
211
- activesupport (= 3.2.8)
206
+ rails (3.2.9)
207
+ actionmailer (= 3.2.9)
208
+ actionpack (= 3.2.9)
209
+ activerecord (= 3.2.9)
210
+ activeresource (= 3.2.9)
211
+ activesupport (= 3.2.9)
212
212
  bundler (~> 1.0)
213
- railties (= 3.2.8)
214
- rails-i18n (0.7.1)
213
+ railties (= 3.2.9)
214
+ rails-i18n (0.7.2)
215
215
  i18n (~> 0.5)
216
216
  rails-slow-assets-workaround (0.1.1)
217
217
  rails
@@ -221,14 +221,14 @@ GEM
221
221
  rails (~> 3.0)
222
222
  rails_nested_layouts (0.1.1)
223
223
  rails
224
- railties (3.2.8)
225
- actionpack (= 3.2.8)
226
- activesupport (= 3.2.8)
224
+ railties (3.2.9)
225
+ actionpack (= 3.2.9)
226
+ activesupport (= 3.2.9)
227
227
  rack-ssl (~> 1.3.2)
228
228
  rake (>= 0.8.7)
229
229
  rdoc (~> 3.4)
230
230
  thor (>= 0.14.6, < 2.0)
231
- rake (0.9.2.2)
231
+ rake (10.0.3)
232
232
  rambler (0.1.3)
233
233
  rails (~> 3.2)
234
234
  rdoc (3.12)
@@ -245,26 +245,27 @@ GEM
245
245
  railties (~> 3.2.0)
246
246
  sass (>= 3.1.10)
247
247
  tilt (~> 1.3)
248
- sprockets (2.1.3)
248
+ sprockets (2.2.2)
249
249
  hike (~> 1.2)
250
+ multi_json (~> 1.0)
250
251
  rack (~> 1.0)
251
252
  tilt (~> 1.1, != 1.3.0)
252
253
  squeel (1.0.14)
253
254
  activerecord (~> 3.0)
254
255
  activesupport (~> 3.0)
255
256
  polyamorous (~> 0.5.0)
256
- thor (0.15.4)
257
+ thor (0.16.0)
257
258
  tilt (1.3.3)
258
- treetop (1.4.10)
259
+ treetop (1.4.12)
259
260
  polyglot
260
261
  polyglot (>= 0.3.1)
261
- tzinfo (0.3.33)
262
+ tzinfo (0.3.35)
262
263
  uuidtools (2.1.3)
263
264
  warden (1.2.1)
264
265
  rack (>= 1.0)
265
- whenever (0.7.3)
266
+ whenever (0.8.1)
266
267
  activesupport (>= 2.3.4)
267
- chronic (~> 0.6.3)
268
+ chronic (>= 0.6.3)
268
269
 
269
270
  PLATFORMS
270
271
  ruby
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.15
1
+ 0.3.16
data/app/models/page.rb CHANGED
@@ -23,10 +23,6 @@ class Page < ActiveRecord::Base
23
23
  resource_type.present?
24
24
  end
25
25
 
26
- def to_label
27
- name
28
- end
29
-
30
26
  def resource_class
31
27
  if self.resourceful?
32
28
  @resource_class ||= resource_type.to_s.camelize.constantize
@@ -61,7 +57,7 @@ class Page < ActiveRecord::Base
61
57
  end
62
58
 
63
59
  def to_label
64
- "#{name} - #{locale}"
60
+ self.respond_to?(:locale) && locale.present? ? "#{name.titleize} (#{locale})" : "#{name.titleize}"
65
61
  end
66
62
 
67
63
  has_many :page_parts
@@ -1,7 +1,54 @@
1
1
  module Sitemap
2
- extend ActiveSupport::Concern
2
+ extend ActiveSupport::Concern
3
3
 
4
- def render_sitemap(allowed_locales = nil)
4
+ def render_sitemap(options = {})
5
+ if Fullstack::Cms.localized?
6
+ render_sitemap_localized(options[:allowed_locales])
7
+ else
8
+ render_sitemap_not_localized
9
+ end
10
+ end
11
+
12
+ def render_sitemap_not_localized
13
+ @pages = Page.all.sort do |p1, p2|
14
+ (p1.path || "").split("/").size <=> (p2.path || "").split("/").size
15
+ end
16
+
17
+ erb = <<-eos
18
+ <?xml version="1.0" encoding="UTF-8"?>
19
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
20
+ <% @pages.each do |page| -%>
21
+ <% if !page.resourceful? -%>
22
+ <% begin -%>
23
+ <% loc = polymorphic_url([:site, page.uid.split("#").last].compact) -%>
24
+ <url>
25
+ <loc><%= loc %></loc>
26
+ </url>
27
+ <% rescue Exception => e -%>
28
+ <% end -%>
29
+ <% else -%>
30
+ <% page.resource_class.all.each do |resource| -%>
31
+ <% unless (resource.respond_to?(:published) && !resource.published?) ||
32
+ (resource.respond_to?(:sitemap) && !resource.sitemap?) -%>
33
+ <url>
34
+ <loc><%= page_url_for(resource) -%></loc>
35
+ <% if resource.respond_to?(:updated_at) -%>
36
+ <lastmod><%= resource.updated_at.strftime("%F") -%></lastmod>
37
+ <% end -%>
38
+ </url>
39
+ <% end -%>
40
+ <% end -%>
41
+ <% end -%>
42
+ <% end -%>
43
+ </urlset>
44
+
45
+ eos
46
+
47
+ render :inline => erb, :layout => false
48
+
49
+ end
50
+
51
+ def render_sitemap_localized(allowed_locales = nil)
5
52
  allowed_locales ||= I18n.available_locales.map(&:to_s)
6
53
  @pages = Page.where("locale IN (?)", allowed_locales).sort do |p1, p2|
7
54
  (p1.path || "").split("/").size <=> (p2.path || "").split("/").size
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fullstack-cms"
8
- s.version = "0.3.15"
8
+ s.version = "0.3.16"
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 = "2012-12-27"
12
+ s.date = "2012-12-29"
13
13
  s.description = "CMS system built on fullstack"
14
14
  s.email = "maurizio.cas@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -42,8 +42,6 @@
42
42
  <% end %>
43
43
  <% end %>
44
44
 
45
- <meta name="keywords" content="bed and breakfast bologna, bed and breakfast bologna ospedale maggiore, bed and breakfast bologna aereoporto, bed and breakfast bologna fiera" />
46
-
47
45
  <link rel="shortcut icon" href="/favicon.ico?v=2" />
48
46
  <%= stylesheet_link_tag 'site/site' %>
49
47
  <%= yield :stylesheets %>
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.15
4
+ version: 0.3.16
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: 2012-12-27 00:00:00.000000000 Z
12
+ date: 2012-12-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fullstack-admin
@@ -329,7 +329,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
329
329
  version: '0'
330
330
  segments:
331
331
  - 0
332
- hash: 2985390891517279258
332
+ hash: -410963911146515683
333
333
  required_rubygems_version: !ruby/object:Gem::Requirement
334
334
  none: false
335
335
  requirements: