skylinecms 3.0.7 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. data/.yardopts +4 -2
  2. data/CHANGELOG +12 -0
  3. data/Rakefile +88 -8
  4. data/app/helpers/skyline/content_helper.rb +1 -0
  5. data/app/helpers/skyline/media_files_helper.rb +1 -0
  6. data/app/helpers/skyline/message_generator.rb +1 -0
  7. data/app/helpers/skyline/tree_helper.rb +1 -1
  8. data/app/models/skyline/article.rb +57 -15
  9. data/app/models/skyline/article_version.rb +1 -0
  10. data/app/models/skyline/associated_tag.rb +1 -0
  11. data/app/models/skyline/grant.rb +1 -0
  12. data/app/models/skyline/image_ref.rb +1 -0
  13. data/app/models/skyline/inline_ref.rb +2 -1
  14. data/app/models/skyline/link_ref.rb +1 -0
  15. data/app/models/skyline/link_section_link.rb +1 -0
  16. data/app/models/skyline/media_cache.rb +1 -0
  17. data/app/models/skyline/media_dir.rb +1 -0
  18. data/app/models/skyline/media_file.rb +1 -0
  19. data/app/models/skyline/media_node.rb +1 -0
  20. data/app/models/skyline/object_ref.rb +1 -0
  21. data/app/models/skyline/page.rb +9 -2
  22. data/app/models/skyline/publication.rb +1 -0
  23. data/app/models/skyline/ref_object.rb +1 -0
  24. data/app/models/skyline/referable_uri.rb +1 -0
  25. data/app/models/skyline/right.rb +1 -0
  26. data/app/models/skyline/role.rb +1 -0
  27. data/app/models/skyline/section.rb +1 -0
  28. data/app/models/skyline/sections/content_collection_section.rb +13 -0
  29. data/app/models/skyline/sections/content_item_section.rb +1 -0
  30. data/app/models/skyline/sections/heading_section.rb +1 -0
  31. data/app/models/skyline/sections/iframe_section.rb +1 -0
  32. data/app/models/skyline/sections/link_section.rb +1 -0
  33. data/app/models/skyline/sections/media_section.rb +1 -0
  34. data/app/models/skyline/sections/page_fragment_section.rb +1 -0
  35. data/app/models/skyline/sections/raw_section.rb +1 -0
  36. data/app/models/skyline/sections/redirect_section.rb +1 -0
  37. data/app/models/skyline/sections/rss_section.rb +2 -0
  38. data/app/models/skyline/sections/splitter_section.rb +1 -0
  39. data/app/models/skyline/sections/wysiwyg_section.rb +1 -0
  40. data/app/models/skyline/variant.rb +1 -6
  41. data/app/templates/skyline/page/default/index.html.erb +2 -0
  42. data/app/templates/skyline/sections/content_collection_section/default/index.html.erb +1 -2
  43. data/app/templates/skyline/sections/link_section/default/index.html.erb +3 -1
  44. data/config/initializers/rails_defaults.rb +5 -1
  45. data/config/locales/en-US.yml +4 -4
  46. data/db/migrate/20090526090049_add_pages_url_part.rb +1 -3
  47. data/db/migrate/20090610142139_add_skyline_tags_taggable_type.rb +1 -1
  48. data/db/migrate/20090610143446_move_skyline_media_files_skyline_tags_to_skyline_associated_tags.rb +1 -1
  49. data/db/migrate/20090616091122_add_skyline_pages_persistent.rb +0 -1
  50. data/db/migrate/20091008134448_article_position_no_default.rb +2 -1
  51. data/doc/Bundler.md +71 -0
  52. data/doc/INSTALL.md +72 -42
  53. data/doc/MIGRATION.md +24 -0
  54. data/lib/skyline/cli/base.rb +2 -0
  55. data/lib/skyline/cli/init.rb +2 -1
  56. data/lib/skyline/configuration.rb +1 -1
  57. data/lib/skyline/content/exportable.rb +1 -1
  58. data/lib/skyline/content/orderable.rb +3 -3
  59. data/lib/skyline/content/versioning/version.rb +1 -0
  60. data/lib/skyline/content/versioning/versionable.rb +2 -0
  61. data/lib/skyline/referable.rb +4 -2
  62. data/lib/skyline/rendering/helpers/bread_crumb_helper.rb +5 -3
  63. data/lib/skyline/rendering/helpers/column_helper.rb +5 -2
  64. data/lib/skyline/rendering/helpers/renderer_helper.rb +20 -3
  65. data/lib/skyline/rendering/helpers/settings_helper.rb +9 -14
  66. data/lib/skyline/version.rb +26 -3
  67. data/lib/skyline/wildcard_renderable_scope.rb +1 -0
  68. data/lib/skyline.rb +6 -3
  69. data/rails/init.rb +3 -1
  70. metadata +3 -4
  71. data/app/helpers/skyline/browser/tabs/media_library/media_files_helper.rb +0 -6
  72. data/app/helpers/skyline/users_helper.rb +0 -2
data/.yardopts CHANGED
@@ -1,8 +1,10 @@
1
1
  lib/**/*.rb
2
2
  app/models/**/*.rb
3
- app/helpers/**/*.rb
3
+ app/helpers/skyline/*.rb
4
4
  --no-private
5
+ --title "Skyline API documentation"
5
6
  -o ydoc
6
7
  -
7
8
  doc/INSTALL.md
8
- doc/MIGRATION.md
9
+ doc/MIGRATION.md
10
+ doc/Bundler.md
data/CHANGELOG CHANGED
@@ -1,3 +1,15 @@
1
+ *3.0.8 (December 18, 2009)*
2
+
3
+ * Added support for SQLite3
4
+ * Always make the last saved variant the default variant
5
+ * Fix longstanding bug which can be caused by copy-paste from one wysiwyg section to another
6
+ * Make the default templates more bullet-proof
7
+ * Implemented capture functionality on RendererHelper#assign
8
+ * Add some helper methods to the ContentCollectionSection. Simplified the templates accordingly
9
+ * Added loads and loads of API documentation
10
+ * Deprecate the settings helper in favour of Settings#get and Settings#get_page
11
+ * Deprecate page_sections_per_column in favour of sections_per_column
12
+
1
13
  *3.0.7 (December 8, 2009)*
2
14
 
3
15
  * Minor optimalisation to make (auto)loading work better
data/Rakefile CHANGED
@@ -3,6 +3,63 @@ require File.dirname(__FILE__) + "/lib/skyline/version"
3
3
 
4
4
  begin
5
5
  require 'jeweler'
6
+ rescue LoadError
7
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
8
+ end
9
+
10
+ begin
11
+ require 'yard'
12
+ rescue LoadError
13
+ puts "Yardoc not available. Install it with: sudo gem install yard"
14
+ end
15
+
16
+ require 'yaml'
17
+
18
+ DEFAULT_OPTIONS = {
19
+ "doc" => {
20
+ "output_path" => "ydoc",
21
+ "deploy_to" => nil
22
+ }
23
+ }
24
+
25
+ class Options < Hash
26
+ def [](v)
27
+ get_options!
28
+ super(v)
29
+ end
30
+
31
+
32
+
33
+ def inspect
34
+ get_options!
35
+ super
36
+ end
37
+
38
+ private
39
+
40
+ def get_options!
41
+ return if @_loaded
42
+ @_loaded = true
43
+
44
+ self.update(DEFAULT_OPTIONS)
45
+
46
+ f = File.expand_path("~/.skyline_options")
47
+ if File.exist?(f)
48
+ opts = YAML.load(File.read(f))
49
+ opts.each do |k,v|
50
+ if self.has_key?(k)
51
+ self[k].update(v)
52
+ else
53
+ self[k] = v
54
+ end
55
+ end
56
+ end
57
+
58
+ end
59
+ end
60
+ OPTIONS = Options.new
61
+
62
+ namespace :gem do
6
63
  Jeweler::Tasks.new do |gemspec|
7
64
  gemspec.version = Skyline.version
8
65
  gemspec.name = "skylinecms"
@@ -11,22 +68,22 @@ begin
11
68
  gemspec.email = "info@digitpaint.nl"
12
69
  gemspec.homepage = "http://www.skylinecms.nl"
13
70
  gemspec.authors = ["DigitPaint"]
14
-
71
+
15
72
  gemspec.files.exclude "tasks/testing.rake"
16
73
  gemspec.files.exclude "Gemfile"
17
74
  gemspec.files.exclude ".gitignore"
18
75
  gemspec.files.exclude "test/"
19
-
76
+
20
77
  gemspec.test_files = []
21
-
78
+
22
79
  gemspec.has_rdoc = false
23
80
  gemspec.extra_rdoc_files = %w{README.md doc/MIGRATION.md}
24
-
81
+
25
82
  gemspec.add_dependency "thor", "0.12.0"
26
-
83
+
27
84
  gemspec.add_dependency "rails", "2.3.5"
28
85
  gemspec.add_dependency "rack", "1.0.1"
29
-
86
+
30
87
  gemspec.add_dependency "polyglot", "0.2.6"
31
88
  gemspec.add_dependency "sprockets", "1.0.2"
32
89
  gemspec.add_dependency "mime-types", "1.16"
@@ -35,8 +92,31 @@ begin
35
92
  gemspec.add_dependency "guid", "0.1.1"
36
93
  gemspec.add_dependency "will_paginate", "~>2.3.11"
37
94
  gemspec.add_dependency "seed-fu", "~>1.2.0"
95
+
96
+ end
97
+ end
98
+
99
+ namespace :doc do
100
+ desc "Generate the Skyline CMS documentation (uses Yard)"
101
+ YARD::Rake::YardocTask.new(:generate) do |t|
102
+ t.options = ["-o#{OPTIONS["doc"]["output_path"]}", "--title=\"Skyline #{Skyline.version} API documentation\""]
103
+ end
104
+
105
+ task :deploy do
106
+ raise "No Options['doc']['deploy_to'] variable set, create a ~/.skyline_options YAML file and set it there" if OPTIONS["doc"]["deploy_to"].nil?
38
107
 
108
+ puts "=> Generating YarDoc first."
109
+ Rake::Task['doc:generate'].execute
110
+
111
+ puts "=> Uploading documentation"
112
+ Rake::Task['doc:upload'].execute
39
113
  end
40
- rescue LoadError
41
- puts "Jeweler not available. Install it with: sudo gem install jeweler"
114
+
115
+ task :upload do
116
+ system("rsync -az --delete #{OPTIONS["doc"]["output_path"]}/* #{OPTIONS["doc"]["deploy_to"]}")
117
+ end
118
+ end
119
+
120
+ task :options do
121
+ puts OPTIONS.inspect
42
122
  end
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  module Skyline::ContentHelper
2
3
 
3
4
  # We need some preconditions to make automatic breadcrumbs work
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  module Skyline::MediaFilesHelper
2
3
  def skyline_media_file_path_with_session_information(media_dir)
3
4
  session_key = ActionController::Base.session_options[:session_key] || ActionController::Base.session_options[:key]
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::MessageGenerator
2
3
  include ActionView::Helpers::JavaScriptHelper
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  module Skyline::TreeHelper
2
3
 
3
4
  def page_tree(pages, roots, options = {})
@@ -58,5 +59,4 @@ module Skyline::TreeHelper
58
59
  content_tag("ul",tags.join("\n"));
59
60
  end
60
61
 
61
- # content_tag("span", node.name)
62
62
  end
@@ -1,4 +1,12 @@
1
+ # Articles are container objects that contain Sections, have history and can (optional) be previewed
2
+ # and published.
3
+ #
4
+ # @abstract Subclass and implement the Article interface
1
5
  class Skyline::Article < ActiveRecord::Base
6
+
7
+ # The data object contains required structured data needed for an article.
8
+ #
9
+ # @abstract Subclass and implement the Article::Data interface
2
10
  class Data < ActiveRecord::Base
3
11
  self.abstract_class = true
4
12
 
@@ -57,29 +65,35 @@ class Skyline::Article < ActiveRecord::Base
57
65
 
58
66
  # The prefix to use when determining rights. User#allow? uses
59
67
  # this method when called with 2 parameters.
60
- # --
68
+ #
69
+ # @return [String] The string to prefix to the right (_create, _update, _delete)
70
+ # @abstract Implement the value correct value in your subclass, defaults to 'article'
61
71
  def right_prefix
62
72
  "article"
63
73
  end
64
74
 
65
- # used by SearchableItem
75
+ # Is this type of article publishable?
76
+ #
77
+ # @return [true,false] Wether or not this article type can be published
78
+ # @abstract Implement in subclass if needed, true is a sensible default.
66
79
  def publishable?
67
80
  true
68
81
  end
69
82
  end
70
83
 
84
+ # Has this article been puslished?
85
+ #
86
+ # @return [true,false] True if it has a published_publication, meaning it's currently published
71
87
  def published?
72
88
  # Don't use only "self.published_publication" here, it causes way too many lookups
73
89
  # If the next test is wrong, than maybe you should wonder why it is wrong? Foreign key left behind?
74
90
  self.published_publication_id.present?
75
91
  end
76
92
 
77
- # Depublish a page, removes the published_publication if keep_history? is false
78
- #
79
- # ==== Raises
80
- # StandardError:: if page is persistent
93
+ # Depublish an article, removes the published_publication if keep_history? is false
81
94
  #
82
- # --
95
+ # @raise [StandardError] If page is persistent and cannot be depulished
96
+ # @return [void]
83
97
  def depublish
84
98
  raise StandardError, "can't be depublished because this page is persistent" if self.persistent?
85
99
 
@@ -94,31 +108,47 @@ class Skyline::Article < ActiveRecord::Base
94
108
  self.save
95
109
  end
96
110
 
111
+ # Depublish this article and destroy it.
112
+ #
113
+ # @see Skylien::Article#depublish
114
+ # @return [false,true] True sucessfully destroyed, otherwise false
97
115
  def destroy
98
116
  depublish
99
117
  super
100
118
  end
101
119
 
120
+ # Can this article be depublished?
121
+ #
122
+ # @return [true,false]
102
123
  def depublishable?
103
124
  !self.persistent?
104
125
  end
105
126
 
127
+ # Can this article be destroyed? Only works if the article isn't persisntent and does not have
128
+ # a publication (isn't published).
129
+ #
130
+ # @return [true,false]
106
131
  def destroyable?
107
132
  !self.persistent? && self.published_publication == nil
108
133
  end
109
134
 
135
+ # Can this article be rendered. This basically means wether or not there are any templates for
136
+ # this article.
137
+ #
138
+ # @return [true,false]
110
139
  def renderable?
111
140
  self.renderable_scope.renderer.templates_for(self).any?
112
141
  end
113
142
 
114
- def renderable_scope
115
- Skyline::WildcardRenderableScope.new
116
- end
117
-
143
+ # Can this article be previewed? Delegates to Skyline::Article#renderable?
144
+ #
145
+ # @return [true,false]
146
+ # @see Skyline::Article#renderable?
118
147
  def previewable?
119
148
  self.renderable?
120
149
  end
121
150
 
151
+
122
152
  def rollbackable?
123
153
  true
124
154
  end
@@ -142,12 +172,15 @@ class Skyline::Article < ActiveRecord::Base
142
172
 
143
173
  # Checks if the page can be edited by a certain user
144
174
  # Currently only checks on page locks.
145
- # --
175
+ #
176
+ # @param user [Skyline::User,Integer] The user or user id to check the access for.
177
+ # @return [true,false] True if the user can edit this page, false otherwise
146
178
  def editable_by?(user)
147
179
  user = user.kind_of?(Skyline::User) ? user : Skyline::User.find_by_id(user)
148
180
  self.locked? && user.allow?(:page_lock) || !self.locked?
149
181
  end
150
182
 
183
+
151
184
  def set_default_variant!(variant)
152
185
  return if variant.id == self.default_variant_id && variant.data_id == self.default_variant_data_id
153
186
  self.update_attributes(:default_variant_id => variant.id, :default_variant_data_id => variant.data_id)
@@ -159,15 +192,17 @@ class Skyline::Article < ActiveRecord::Base
159
192
  end
160
193
 
161
194
  # The class that provides our custom data fields.
162
- # --
163
- # Note: We can't use memoize here, because it freezes the class
195
+ #
196
+ # @return [Class,false] False if we don't have an inner Data class, the inner Data class if there is one.
164
197
  def data_class
198
+ # Note: We can't use memoize here, because it freezes the class
165
199
  return @_data_class unless @_data_class.nil?
166
200
  @_data_class = (self.class.name + "::" + "Data").constantize
167
201
  rescue NameError
168
202
  @_data_class = false
169
203
  end
170
204
 
205
+
171
206
  def right_prefix
172
207
  self.class.right_prefix
173
208
  end
@@ -176,7 +211,10 @@ class Skyline::Article < ActiveRecord::Base
176
211
  self.id
177
212
  end
178
213
 
179
- # a subclass might return a Page in which the article (ie: NewsItem) will be rendered for previewing
214
+ # A subclass can return a Page in which the article (ie: NewsItem) will be rendered for previewing
215
+ #
216
+ # @return [Skyline::Page,nil] The page to wrap this article in when previewing. Nil if no wrapping is needed.
217
+ # @abstract Implement this in a subclass to get the Page from Settings or from somewhere else.
180
218
  def preview_wrapper_page
181
219
  nil
182
220
  end
@@ -189,6 +227,10 @@ class Skyline::Article < ActiveRecord::Base
189
227
  Skyline::Site.new
190
228
  end
191
229
 
230
+ def renderable_scope
231
+ Skyline::WildcardRenderableScope.new
232
+ end
233
+
192
234
  protected
193
235
 
194
236
  def after_initialize
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::ArticleVersion < ActiveRecord::Base
2
3
  set_table_name :skyline_article_versions
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::AssociatedTag < ActiveRecord::Base
2
3
  set_table_name :skyline_associated_tags
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Grant < ActiveRecord::Base
2
3
  set_table_name :skyline_grants
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::ImageRef < Skyline::InlineRef
2
3
 
3
4
  # Render html for specified RefObject
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::InlineRef < Skyline::RefObject
2
3
 
3
4
  attr_accessor :previous_referable
@@ -124,7 +125,7 @@ class Skyline::InlineRef < Skyline::RefObject
124
125
  result
125
126
  end
126
127
 
127
- new_ref = skyline_class.find_by_id(id) if id
128
+ new_ref = skyline_class.find_by_id_and_refering_type_and_refering_id(id,refering_object.class.name,refering_object.id) if id
128
129
  new_ref ||= skyline_class.new
129
130
 
130
131
  new_ref.previous_referable = new_ref.referable.dup if new_ref.referable
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::LinkRef < Skyline::InlineRef
2
3
 
3
4
  # Render html start tag for specified RefObject
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::LinkSectionLink < ActiveRecord::Base
2
3
  include Skyline::ContentItem
3
4
  include Skyline::Positionable
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::MediaCache < ActiveRecord::Base
2
3
  set_table_name :skyline_media_cache
3
4
  cattr_accessor :cache_path
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::MediaDir < Skyline::MediaNode
2
3
  extend ActiveSupport::Memoizable
3
4
  include UniqueIdentifiers
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::MediaFile < Skyline::MediaNode
2
3
  has_and_belongs_to_many :tags, :class_name => "Skyline::Tag", :join_table => "skyline_media_files_skyline_tags"
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::MediaNode < ActiveRecord::Base
2
3
  set_table_name :skyline_media_nodes
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::ObjectRef < Skyline::RefObject
2
3
  after_destroy :destroy_referable
3
4
 
@@ -75,7 +75,8 @@ class Skyline::Page < Skyline::Article
75
75
  pages = self.connection.select_all("
76
76
  SELECT page.id,
77
77
  page.parent_id,
78
- IF(ISNULL(data.navigation_title) || data.navigation_title='', data.title, data.navigation_title) AS title,
78
+ data.navigation_title as navigation_title,
79
+ data.title as title,
79
80
  page.locked,
80
81
  page.published_publication_id,
81
82
  page.default_variant_id,
@@ -93,7 +94,13 @@ class Skyline::Page < Skyline::Article
93
94
  class << o
94
95
  def id; self["id"].to_i; end
95
96
  def parent_id; self["parent_id"].blank? ? nil : self["parent_id"].to_i; end
96
- def title; self["title"].blank? ? "n/a" : self["title"]; end
97
+ def title
98
+ if self["navigation_title"].blank?
99
+ self["title"].blank? ? "n/a" : self["title"]
100
+ else
101
+ self["navigation_title"]
102
+ end
103
+ end
97
104
  def published?; self["published_publication_id"].present?; end
98
105
  def identical_to_publication?
99
106
  self["published_publication_variant_id"] == self["default_variant_id"] && self["published_publication_version"] == self["default_variant_version"]
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Publication < Skyline::ArticleVersion
2
3
  belongs_to :variant, :class_name => "Skyline::Variant"
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::RefObject < ActiveRecord::Base
2
3
  belongs_to :referable, :polymorphic => true, :autosave => true
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::ReferableUri < ActiveRecord::Base
2
3
  set_table_name :skyline_referable_uris
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Right < ActiveRecord::Base
2
3
  set_table_name :skyline_rights
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Role < ActiveRecord::Base
2
3
  set_table_name :skyline_roles
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Section < ActiveRecord::Base
2
3
  set_table_name :skyline_sections
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::ContentCollectionSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
  include Skyline::Taggable
@@ -18,6 +19,18 @@ class Skyline::Sections::ContentCollectionSection < ActiveRecord::Base
18
19
  end
19
20
  end
20
21
 
22
+ def collection_name
23
+ self.content_name.pluralize.to_sym
24
+ end
25
+
26
+ def collection
27
+ self.full_collection.scoped(:limit => self.number)
28
+ end
29
+
30
+ def full_collection
31
+ self.content_class.published.with_tags(self.tags).scoped(:limit => self.number)
32
+ end
33
+
21
34
  def clone
22
35
  returning super do |clone|
23
36
  clone.associated_tags = self.associated_tags.collect{|associated_tag| associated_tag.clone}
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::ContentItemSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::HeadingSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::IframeSection < ActiveRecord::Base
2
3
  extend Skyline::UrlValidation
3
4
  include Skyline::SectionItem
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::LinkSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
  include NestedAttributesPositioning
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::MediaSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
  include Skyline::ContentItem
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::PageFragmentSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::RawSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::RedirectSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
  include Skyline::ContentItem
@@ -1,4 +1,6 @@
1
1
  require 'fileutils'
2
+
3
+ # @private
2
4
  class Skyline::Sections::RssSection < ActiveRecord::Base
3
5
  extend ActiveSupport::Memoizable
4
6
  extend Skyline::UrlValidation
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::SplitterSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
 
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class Skyline::Sections::WysiwygSection < ActiveRecord::Base
2
3
  include Skyline::SectionItem
3
4
  include Skyline::Referable
@@ -158,12 +158,7 @@ class Skyline::Variant < Skyline::ArticleVersion
158
158
  end
159
159
 
160
160
  def update_article_default_variant
161
- if !self.article.default_variant.present? || # no default_variant has been set yet
162
- !self.article.default_variant_data.present? || # no default_variant has been set yet
163
- !self.article.published? # article isn't published, so now I'm the default variant
164
-
165
- self.article.set_default_variant!(self)
166
- end
161
+ self.article.set_default_variant!(self)
167
162
  end
168
163
 
169
164
  def update_article_default_variant_on_destroy
@@ -13,6 +13,8 @@
13
13
 
14
14
  <body>
15
15
  <h1><%= article_version.data.title%></h1>
16
+ <% assign(:heading_level,1) %>
17
+
16
18
  <%= render_collection(article_version.sections) %>
17
19
  <%= @body %>
18
20
  </body>
@@ -1,2 +1 @@
1
- <% proxy = content_collection_section.content_class.published.with_site(site).with_tags(content_collection_section.tags).scoped(:limit => content_collection_section.number) %>
2
- <%= render :partial => "#{content_collection_section.content_name.pluralize}", :locals => {content_collection_section.content_name.pluralize.to_sym => proxy} %>
1
+ <%= render :partial => "#{content_collection_section.collection_name}", :locals => {content_collection_section.collection_name => content_collection_section.collection} %>
@@ -5,7 +5,9 @@
5
5
  <% if link_section.links.any? %>
6
6
  <ul class="links">
7
7
  <% link_section.links.each do |link| %>
8
- <li><%=link_to link.title, link.url%></li>
8
+ <% if link.present? %>
9
+ <li><%=link_to link.title, link.url%></li>
10
+ <% end %>
9
11
  <% end %>
10
12
  </ul>
11
13
  <% end %>
@@ -1,2 +1,6 @@
1
1
  ActionView::Base.field_error_proc = Proc.new {|html_tag, instance| %(#{html_tag})}
2
- ActionView::Base.default_form_builder = Skyline::FormBuilderWithErrors
2
+
3
+ # This has to happen on every request as the Constant may not be the same anymore (because of reloading)
4
+ ActionController::Dispatcher.to_prepare(:form_builder) do
5
+ ActionView::Base.default_form_builder = Skyline::FormBuilderWithErrors
6
+ end