skylinecms 3.0.7 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +4 -2
- data/CHANGELOG +12 -0
- data/Rakefile +88 -8
- data/app/helpers/skyline/content_helper.rb +1 -0
- data/app/helpers/skyline/media_files_helper.rb +1 -0
- data/app/helpers/skyline/message_generator.rb +1 -0
- data/app/helpers/skyline/tree_helper.rb +1 -1
- data/app/models/skyline/article.rb +57 -15
- data/app/models/skyline/article_version.rb +1 -0
- data/app/models/skyline/associated_tag.rb +1 -0
- data/app/models/skyline/grant.rb +1 -0
- data/app/models/skyline/image_ref.rb +1 -0
- data/app/models/skyline/inline_ref.rb +2 -1
- data/app/models/skyline/link_ref.rb +1 -0
- data/app/models/skyline/link_section_link.rb +1 -0
- data/app/models/skyline/media_cache.rb +1 -0
- data/app/models/skyline/media_dir.rb +1 -0
- data/app/models/skyline/media_file.rb +1 -0
- data/app/models/skyline/media_node.rb +1 -0
- data/app/models/skyline/object_ref.rb +1 -0
- data/app/models/skyline/page.rb +9 -2
- data/app/models/skyline/publication.rb +1 -0
- data/app/models/skyline/ref_object.rb +1 -0
- data/app/models/skyline/referable_uri.rb +1 -0
- data/app/models/skyline/right.rb +1 -0
- data/app/models/skyline/role.rb +1 -0
- data/app/models/skyline/section.rb +1 -0
- data/app/models/skyline/sections/content_collection_section.rb +13 -0
- data/app/models/skyline/sections/content_item_section.rb +1 -0
- data/app/models/skyline/sections/heading_section.rb +1 -0
- data/app/models/skyline/sections/iframe_section.rb +1 -0
- data/app/models/skyline/sections/link_section.rb +1 -0
- data/app/models/skyline/sections/media_section.rb +1 -0
- data/app/models/skyline/sections/page_fragment_section.rb +1 -0
- data/app/models/skyline/sections/raw_section.rb +1 -0
- data/app/models/skyline/sections/redirect_section.rb +1 -0
- data/app/models/skyline/sections/rss_section.rb +2 -0
- data/app/models/skyline/sections/splitter_section.rb +1 -0
- data/app/models/skyline/sections/wysiwyg_section.rb +1 -0
- data/app/models/skyline/variant.rb +1 -6
- data/app/templates/skyline/page/default/index.html.erb +2 -0
- data/app/templates/skyline/sections/content_collection_section/default/index.html.erb +1 -2
- data/app/templates/skyline/sections/link_section/default/index.html.erb +3 -1
- data/config/initializers/rails_defaults.rb +5 -1
- data/config/locales/en-US.yml +4 -4
- data/db/migrate/20090526090049_add_pages_url_part.rb +1 -3
- data/db/migrate/20090610142139_add_skyline_tags_taggable_type.rb +1 -1
- data/db/migrate/20090610143446_move_skyline_media_files_skyline_tags_to_skyline_associated_tags.rb +1 -1
- data/db/migrate/20090616091122_add_skyline_pages_persistent.rb +0 -1
- data/db/migrate/20091008134448_article_position_no_default.rb +2 -1
- data/doc/Bundler.md +71 -0
- data/doc/INSTALL.md +72 -42
- data/doc/MIGRATION.md +24 -0
- data/lib/skyline/cli/base.rb +2 -0
- data/lib/skyline/cli/init.rb +2 -1
- data/lib/skyline/configuration.rb +1 -1
- data/lib/skyline/content/exportable.rb +1 -1
- data/lib/skyline/content/orderable.rb +3 -3
- data/lib/skyline/content/versioning/version.rb +1 -0
- data/lib/skyline/content/versioning/versionable.rb +2 -0
- data/lib/skyline/referable.rb +4 -2
- data/lib/skyline/rendering/helpers/bread_crumb_helper.rb +5 -3
- data/lib/skyline/rendering/helpers/column_helper.rb +5 -2
- data/lib/skyline/rendering/helpers/renderer_helper.rb +20 -3
- data/lib/skyline/rendering/helpers/settings_helper.rb +9 -14
- data/lib/skyline/version.rb +26 -3
- data/lib/skyline/wildcard_renderable_scope.rb +1 -0
- data/lib/skyline.rb +6 -3
- data/rails/init.rb +3 -1
- metadata +3 -4
- data/app/helpers/skyline/browser/tabs/media_library/media_files_helper.rb +0 -6
- data/app/helpers/skyline/users_helper.rb +0 -2
data/config/locales/en-US.yml
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"en-US":
|
2
2
|
date:
|
3
3
|
formats:
|
4
|
-
default: "%
|
5
|
-
|
6
|
-
|
4
|
+
default: "%Y-%m-%d"
|
5
|
+
short: "%b %d"
|
6
|
+
long: "%B %d, %Y"
|
7
7
|
short_with_day_of_week: "%a %e %b"
|
8
8
|
|
9
9
|
day_names: [sunday, monday, tuesday, wednesday, thursday, friday, saturday]
|
@@ -307,7 +307,7 @@
|
|
307
307
|
delete_variant: "Delete variant"
|
308
308
|
new_variant: "New variant"
|
309
309
|
copy_variant: "Copy variant"
|
310
|
-
lock: "
|
310
|
+
lock: "Lock"
|
311
311
|
unlock: "Unlock"
|
312
312
|
rollback: "Rollback"
|
313
313
|
login: "Log in"
|
@@ -1,8 +1,6 @@
|
|
1
1
|
class AddPagesUrlPart < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
-
add_column :skyline_pages, :url_part, :string, :null => false
|
4
|
-
execute "UPDATE skyline_pages SET url_part = CONCAT('page-', position)"
|
5
|
-
execute "UPDATE skyline_pages SET url_part = NULL where page_id is NULL"
|
3
|
+
add_column :skyline_pages, :url_part, :string, :null => false, :default => ""
|
6
4
|
end
|
7
5
|
|
8
6
|
def self.down
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class AddSkylineTagsTaggableType < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
-
add_column :skyline_tags, :taggable_type, :string, :null => false
|
3
|
+
add_column :skyline_tags, :taggable_type, :string, :null => false, :default => ""
|
4
4
|
add_index :skyline_tags, [:taggable_type, :tag]
|
5
5
|
execute("UPDATE skyline_tags SET taggable_type='Skyline::MediaFile'")
|
6
6
|
end
|
data/db/migrate/20090610143446_move_skyline_media_files_skyline_tags_to_skyline_associated_tags.rb
CHANGED
@@ -2,7 +2,7 @@ class MoveSkylineMediaFilesSkylineTagsToSkylineAssociatedTags < ActiveRecord::Mi
|
|
2
2
|
def self.up
|
3
3
|
rename_table :skyline_media_files_skyline_tags, :skyline_associated_tags
|
4
4
|
rename_column :skyline_associated_tags, :media_file_id, :taggable_id
|
5
|
-
add_column :skyline_associated_tags, :taggable_type, :string, :null => false
|
5
|
+
add_column :skyline_associated_tags, :taggable_type, :string, :null => false, :default => ""
|
6
6
|
execute "UPDATE skyline_associated_tags SET taggable_type='Skyline::MediaNode'"
|
7
7
|
end
|
8
8
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class ArticlePositionNoDefault < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
-
execute "ALTER TABLE `skyline_articles` CHANGE `position` `position` INT( 11 ) NOT NULL"
|
3
|
+
# execute "ALTER TABLE `skyline_articles` CHANGE `position` `position` INT( 11 ) NOT NULL"
|
4
|
+
change_column_default(:skyline_articles, :position, nil)
|
4
5
|
end
|
5
6
|
|
6
7
|
def self.down
|
data/doc/Bundler.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
Setting up Bundler for a Rails 2.3 application
|
2
|
+
==============================================
|
3
|
+
|
4
|
+
Requirements
|
5
|
+
------------
|
6
|
+
|
7
|
+
* Ruby >= 1.8.6
|
8
|
+
* Rubygems >= 1.3.5
|
9
|
+
* Rails >= 2.3.4
|
10
|
+
* Bundler 0.7.0
|
11
|
+
|
12
|
+
Setup bundler to provide all necessary gems
|
13
|
+
-------------------------------------------
|
14
|
+
|
15
|
+
Create the file `Gemfile` in your RAILS\_ROOT and add the following lines:
|
16
|
+
|
17
|
+
bundle_path "vendor/bundler_gems"
|
18
|
+
gem "rails"
|
19
|
+
disable_system_gems
|
20
|
+
|
21
|
+
### Including extra Gemfiles?
|
22
|
+
|
23
|
+
To make sure bundler handles all the required gems including the ones from plugins use
|
24
|
+
the following code:
|
25
|
+
|
26
|
+
my_gemfile = File.join(File.dirname(__FILE__), 'vendor', 'plugins', 'my_plugin', 'Gemfile')
|
27
|
+
instance_eval(File.read(my_gemfile), my_gemfile)
|
28
|
+
|
29
|
+
Create initializer for Bundler
|
30
|
+
------------------------------
|
31
|
+
|
32
|
+
Create file called `config/preinitializer.rb` and add the follwoing line:
|
33
|
+
|
34
|
+
require "#{File.dirname(__FILE__)}/../vendor/bundler_gems/environment"
|
35
|
+
|
36
|
+
Initialize Bundler before Rails boots
|
37
|
+
-------------------------------------
|
38
|
+
|
39
|
+
Add the following to `config/boot.rb`, just before the `Rails.boot!` statement.
|
40
|
+
|
41
|
+
# for bundler
|
42
|
+
class Rails::Boot
|
43
|
+
def run
|
44
|
+
load_initializer
|
45
|
+
extend_environment
|
46
|
+
Rails::Initializer.run(:set_load_path)
|
47
|
+
end
|
48
|
+
def extend_environment
|
49
|
+
Rails::Initializer.class_eval do
|
50
|
+
old_load = instance_method(:load_environment)
|
51
|
+
define_method(:load_environment) do
|
52
|
+
Bundler.require_env RAILS_ENV
|
53
|
+
old_load.bind(self).call
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
Bundle your gems
|
60
|
+
----------------
|
61
|
+
|
62
|
+
gem bundle
|
63
|
+
|
64
|
+
Using git?
|
65
|
+
----------
|
66
|
+
If you're using git we advise you to put the following lines in your .gitignore
|
67
|
+
|
68
|
+
vendor/bundler_gems/doc
|
69
|
+
vendor/bundler_gems/environment.rb
|
70
|
+
vendor/bundler_gems/gems
|
71
|
+
vendor/bundler_gems/specifications
|
data/doc/INSTALL.md
CHANGED
@@ -1,64 +1,94 @@
|
|
1
1
|
Skyline installation instructions
|
2
2
|
=================================
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
Choose your flavour
|
5
|
+
-------------------
|
6
|
+
|
7
|
+
**Install as a gem** The skylinecms gem is perfect if you want to have stable environment
|
8
|
+
and don't care too much about cutting-edge new features. We release new versions fairly
|
9
|
+
often.
|
10
|
+
|
11
|
+
**Install the plugin** Use the plugin if you want to be on the latest development version
|
12
|
+
with all the 'cool' new features. Especially if you use git, because we're hosting the
|
13
|
+
source on github. It's of course entirely possible to use a stable tagged version as a
|
14
|
+
plugin too.
|
15
|
+
|
16
|
+
Create your rails app
|
17
|
+
---------------------
|
18
|
+
|
19
|
+
Create an empty rails app. Make sure you're usin MySQL for now,
|
20
|
+
we didn't test with other databases yet.
|
21
|
+
|
22
|
+
rails my_app --database=mysql
|
23
|
+
cd my_app
|
24
|
+
|
25
|
+
Installation as a gem
|
26
|
+
---------------------
|
27
|
+
|
28
|
+
Install the gems, and initialize Skyline.
|
29
|
+
|
30
|
+
gem install skylinecms
|
31
|
+
skylincms init
|
32
|
+
|
33
|
+
Continue below.
|
34
|
+
|
35
|
+
Installation as plugin
|
36
|
+
-----------------------
|
37
|
+
|
38
|
+
Download the Skyline source from [http://github.com/DigitPaint/skyline](http://github.com/DigitPaint/skyline).
|
39
|
+
You can use it as a Git submodule or yust download the zip version and unpack it to
|
40
|
+
`vendor/plugins/skyline`
|
41
|
+
|
42
|
+
If you're using bundler, add the following to your `Gemfile`
|
7
43
|
|
8
|
-
# To bundle all gems run: gem bundle --build-options build_options.yml
|
9
44
|
skyline_gemfile = File.join(File.dirname(__FILE__), 'vendor', 'plugins', 'skyline', 'Gemfile')
|
10
45
|
instance_eval(File.read(skyline_gemfile), skyline_gemfile)
|
11
|
-
bundle_path "vendor/bundler_gems"
|
12
|
-
disable_system_gems
|
13
46
|
|
47
|
+
Setup your database
|
48
|
+
-------------------
|
14
49
|
|
15
|
-
|
16
|
-
-------------------------------------------------------------------
|
17
|
-
You only need this if your system needs specific build options
|
50
|
+
Modify `config/database.yml` to match your database configuration and then run:
|
18
51
|
|
19
|
-
|
20
|
-
|
52
|
+
rake db:create
|
53
|
+
rake skyline:db:migrate
|
54
|
+
rake skyline:db:seed
|
55
|
+
|
56
|
+
Create your first user and grant him/her access
|
57
|
+
-----------------------------------------------
|
21
58
|
|
59
|
+
Open a Rails console by running `./script/console`
|
22
60
|
|
23
|
-
|
24
|
-
|
61
|
+
u = Skyline::User.new(:email => 'admin@admin.com', :password => 'secret')
|
62
|
+
u.roles << Skyline::Role.first
|
63
|
+
u.save!
|
25
64
|
|
26
|
-
|
27
|
-
|
65
|
+
Make sure the user exists in the database.
|
28
66
|
|
29
|
-
|
30
|
-
|
67
|
+
If you went the "gem route" you're done now just start the server with `./script/server`
|
68
|
+
and browse to `http://localhost:3000/skyline` and log in with the just created user.
|
31
69
|
|
32
|
-
|
33
|
-
|
34
|
-
alias load_environment_without_bundler load_environment
|
70
|
+
Extra work when using the plugin
|
71
|
+
--------------------------------
|
35
72
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
73
|
+
### Create configuration file
|
74
|
+
|
75
|
+
Create a Rails initializer in `config/initializers` (we call it `skyline_configuration.rb`) and
|
76
|
+
add the following:
|
77
|
+
|
78
|
+
Skyline::Configuration.configure do |config|
|
79
|
+
config.assets_path = File.join(Rails.root,"tmp/upload")
|
80
|
+
config.media_file_cache_path = File.join(Rails.root,"tmp/cache/media_files/cache")
|
81
|
+
config.rss_section_cache_path = File.join(Rails.root,"tmp/cache/rss_sections/cache")
|
40
82
|
end
|
41
83
|
|
84
|
+
### Create template folder
|
42
85
|
|
43
|
-
|
44
|
-
------------------
|
45
|
-
If you're using git.
|
86
|
+
Create the template folder in your `app` directory.
|
46
87
|
|
47
|
-
|
48
|
-
vendor/bundler_gems/doc
|
49
|
-
vendor/bundler_gems/environment.rb
|
50
|
-
vendor/bundler_gems/gems
|
51
|
-
vendor/bundler_gems/specifications
|
88
|
+
mkdir app/templates
|
52
89
|
|
90
|
+
### Add default route for pages
|
53
91
|
|
54
|
-
|
55
|
-
------------------------
|
92
|
+
Open `config/routes.rb` and add the default Skyline route below all other routes:
|
56
93
|
|
57
|
-
|
58
|
-
run "mkdir -p #{deploy_to}/shared/bundler_gems/gems #{deploy_to}/shared/bundler_gems/specifications"
|
59
|
-
run "cd #{current_path}/vendor/bundler_gems; ln -fs #{deploy_to}/shared/bundler_gems/gems"
|
60
|
-
run "cd #{current_path}/vendor/bundler_gems; ln -fs #{deploy_to}/shared/bundler_gems/specifications"
|
61
|
-
run "cd #{current_path}; gem bundle --build-options build_options.yml"
|
62
|
-
end
|
63
|
-
|
64
|
-
after "deploy", ....., "deploy:bundle"
|
94
|
+
map.connect '*url', :controller => "skyline/site/pages", :action => "show"
|
data/doc/MIGRATION.md
CHANGED
@@ -1,6 +1,30 @@
|
|
1
1
|
Skyline Version Migration
|
2
2
|
=========================
|
3
3
|
|
4
|
+
General update recipe
|
5
|
+
---------------------
|
6
|
+
|
7
|
+
After every Skyline update make sure that:
|
8
|
+
|
9
|
+
* You have updated your `Gemfile`, or the `config.gem` specifications in your `environment.rb`.
|
10
|
+
* Run `rake skyline:db:migrate` to update your Skyline tables.
|
11
|
+
* Run `rake skyline:db:seed` to update roles/rights and other important data updates.
|
12
|
+
* **Plugin users only!** The assets (`RAILS_ROOT/public/skyline`) are from the new version. If they are symlinked, Skyline will
|
13
|
+
take care of them for you.
|
14
|
+
|
15
|
+
Version 3.0.7 -> Version 3.0.8
|
16
|
+
------------------------------
|
17
|
+
|
18
|
+
There are no pressing changes you need to make to your implementation. Keep in mind however
|
19
|
+
that we deprecated some methods. The deprecated methods will be removed in version 3.1.0
|
20
|
+
|
21
|
+
**page\_sections\_per_column** in templates. Use `sections_per_column` instead. The old method
|
22
|
+
is still available as an alias.
|
23
|
+
|
24
|
+
**setting and page\_from\_settings** in templates. These two helpers are deprecated
|
25
|
+
in favour of `Settings.get` for `setting` and `Settings.get_page` for `page_from_setting`. The
|
26
|
+
method signatures are identical was merly a restructuring.
|
27
|
+
|
4
28
|
First OS release -> Version 3.0.7
|
5
29
|
---------------------------------
|
6
30
|
|
data/lib/skyline/cli/base.rb
CHANGED
data/lib/skyline/cli/init.rb
CHANGED
@@ -43,7 +43,7 @@ class Skyline::Configuration < Configure
|
|
43
43
|
config.media_file_cache_path = nil
|
44
44
|
config.rss_section_cache_path = nil
|
45
45
|
else
|
46
|
-
config.assets_path = File.join(Rails.root,"tmp/upload")
|
46
|
+
config.assets_path = File.join(Rails.root,"/tmp/upload")
|
47
47
|
config.media_file_cache_path = File.join(Rails.root,"/tmp/media_files/cache")
|
48
48
|
config.rss_section_cache_path = File.join(Rails.root,"/tmp/rss_sections/cache")
|
49
49
|
end
|
@@ -1,6 +1,5 @@
|
|
1
|
-
#
|
2
|
-
# @private
|
3
1
|
module Skyline::Content
|
2
|
+
# @private
|
4
3
|
module Orderable
|
5
4
|
|
6
5
|
def acts_as_orderable(options)
|
@@ -57,7 +56,8 @@ module Skyline::Content
|
|
57
56
|
end
|
58
57
|
end
|
59
58
|
end
|
60
|
-
|
59
|
+
|
60
|
+
# @private
|
61
61
|
module InstanceMethods
|
62
62
|
def set_initial_position
|
63
63
|
unless self[self.class.position_column]
|
data/lib/skyline/referable.rb
CHANGED
@@ -25,6 +25,8 @@ module Skyline::Referable
|
|
25
25
|
base.send(:cattr_accessor, :referable_fields)
|
26
26
|
base.send(:has_many, :image_refs, :class_name => "Skyline::ImageRef", :foreign_key => :refering_id, :source_type => base.name, :dependent => :destroy)
|
27
27
|
base.send(:has_many, :link_refs, :class_name => "Skyline::LinkRef", :foreign_key => :refering_id, :source_type => base.name, :dependent => :destroy)
|
28
|
+
|
29
|
+
base.send :alias_method_chain, :clone, :referables
|
28
30
|
end
|
29
31
|
|
30
32
|
module ClassMethods
|
@@ -61,8 +63,8 @@ module Skyline::Referable
|
|
61
63
|
|
62
64
|
# Implementation of the clone interface
|
63
65
|
# @private
|
64
|
-
def
|
65
|
-
returning
|
66
|
+
def clone_with_referables
|
67
|
+
returning clone_without_referables do |clone|
|
66
68
|
if !self.referable_fields.nil?
|
67
69
|
self.referable_fields.each do |field|
|
68
70
|
clone.send("#{field}=".to_sym, self.send(field,true,{:nullify => true}))
|
@@ -2,15 +2,17 @@ module Skyline::Rendering::Helpers::BreadCrumbHelper
|
|
2
2
|
|
3
3
|
# Helper to easily create breadcrumbs that are cut off in the middle.
|
4
4
|
#
|
5
|
-
# @param bc [Array<Array>]
|
6
|
-
# @param options [Hash]
|
5
|
+
# @param bc [Array<Array>] An array of arrays with two elements: [[title,url],[title,url]...]
|
6
|
+
# @param options [Hash] Options
|
7
7
|
#
|
8
8
|
# @option options :max_length [Integer] () Limit the max length in chars. Returns an array with nil element where
|
9
9
|
# something has been cut away.
|
10
|
+
#
|
11
|
+
# @return [Array<Array>] Array of arrays with the first element the title and as second element the url.
|
10
12
|
def bread_crumb(bc,options={})
|
11
13
|
if bc.kind_of? Skyline::ArticleVersion
|
12
14
|
page = bc
|
13
|
-
bc = bc.page.nesting.map{|p| [p.published_publication_data.navigation_title,p.url]}
|
15
|
+
bc = bc.page.nesting.map{|p| [p.published_publication_data.andand.navigation_title,p.url]}
|
14
16
|
bc[-1][0] = page.data.navigation_title
|
15
17
|
end
|
16
18
|
|
@@ -4,8 +4,8 @@ module Skyline::Rendering::Helpers::ColumnHelper
|
|
4
4
|
#
|
5
5
|
# @param page_version [ArticleVersion] The ArticleVersion to get section from to split
|
6
6
|
#
|
7
|
-
# @return [Array<Array<Section>>]
|
8
|
-
def
|
7
|
+
# @return [Array<Array<Section>>] An array of columns each containing and array of sections.
|
8
|
+
def sections_per_column(page_version)
|
9
9
|
sections_per_col ||= []
|
10
10
|
col = 0
|
11
11
|
page_version.sections.each do |section|
|
@@ -18,5 +18,8 @@ module Skyline::Rendering::Helpers::ColumnHelper
|
|
18
18
|
end
|
19
19
|
sections_per_col
|
20
20
|
end
|
21
|
+
|
22
|
+
# @deprecated Will be removed in 3.1 for the more general sections_per_column
|
23
|
+
alias :page_sections_per_column :sections_per_column
|
21
24
|
|
22
25
|
end
|
@@ -2,9 +2,26 @@
|
|
2
2
|
module Skyline::Rendering
|
3
3
|
module Helpers
|
4
4
|
module RendererHelper
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
|
6
|
+
# Set global renderer assigns. These are accessible throughout all render/render_collection calls. They
|
7
|
+
# are especially usefull in scenarios where you want a sub-item render a piece of the page. You can assign it
|
8
|
+
# to `:content_for_sidebar` and in your page template you can read `assigns(:content_for_sidebar)` and place the content
|
9
|
+
# the content item rendered to the variable `:content_for_sidebar`
|
10
|
+
#
|
11
|
+
# @param key [Symbol] The key to store or read
|
12
|
+
# @param value [Object] Anything you want to store, if empty and no block given this method just returns the stored value
|
13
|
+
#
|
14
|
+
# @yield A block to capture, see also the `capture` documentation in Rails
|
15
|
+
# @yieldreturn [String] The result of doing a regular `capture`
|
16
|
+
#
|
17
|
+
# @return The value stored with the key.
|
18
|
+
def assign(key, value = nil, &block)
|
19
|
+
return @_template_assigns[key] if value.nil? && !block_given?
|
20
|
+
if block_given?
|
21
|
+
@_template_assigns[key] = capture(&block)
|
22
|
+
else
|
23
|
+
@_template_assigns[key] = value
|
24
|
+
end
|
8
25
|
end
|
9
26
|
|
10
27
|
# Get's the current Renderer instance that is rendering the template we're in.
|
@@ -5,15 +5,11 @@ module Skyline::Rendering::Helpers::SettingsHelper
|
|
5
5
|
# @param setting_identifier [Symbol] the symbol of the settings page
|
6
6
|
# @param field [Symbol] the name of the setting
|
7
7
|
#
|
8
|
-
# @return Object the value of the setting or nil if not found
|
8
|
+
# @return [Object] the value of the setting or nil if not found
|
9
|
+
#
|
10
|
+
# @deprecated Will be removed 3.1 in favour of {Skyline::Settings::KlassMethods#get}
|
9
11
|
def setting(setting_identifier, field)
|
10
|
-
|
11
|
-
if s.respond_to?(field)
|
12
|
-
return s.send(field)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
Rails.logger.warn "Couldn't find Setting[:#{setting_identifier}].#{field}"
|
16
|
-
nil
|
12
|
+
::Settings.get(setting_identifier,field)
|
17
13
|
end
|
18
14
|
|
19
15
|
# a safe way to get a page from the settings
|
@@ -21,11 +17,10 @@ module Skyline::Rendering::Helpers::SettingsHelper
|
|
21
17
|
# @param setting_identifier [Symbol] the symbol of the settings page
|
22
18
|
# @param field [Symbol] the name of the setting that references a page_id
|
23
19
|
#
|
24
|
-
# @return [Page,
|
20
|
+
# @return [Page, NilClass] The page if found, nil otherwise
|
21
|
+
#
|
22
|
+
# @deprecated Will be removed 3.1 in favour of {Skyline::Settings::KlassMethods#get_page}
|
25
23
|
def page_from_setting(setting_identifier, field)
|
26
|
-
|
27
|
-
|
28
|
-
end
|
29
|
-
nil
|
30
|
-
end
|
24
|
+
::Settings.get_page(setting_identifier,field)
|
25
|
+
end
|
31
26
|
end
|
data/lib/skyline/version.rb
CHANGED
@@ -1,13 +1,36 @@
|
|
1
1
|
module Skyline
|
2
2
|
# The defines the current Skyline version.
|
3
|
-
#
|
3
|
+
#
|
4
4
|
#
|
5
5
|
# @private
|
6
6
|
module VERSION
|
7
7
|
MAJOR = 3
|
8
8
|
MINOR = 0
|
9
|
-
TINY =
|
9
|
+
TINY = 8
|
10
|
+
BUILD = 0
|
11
|
+
|
12
|
+
# Some hackery to determine if we're on a development branch or not
|
13
|
+
# this sets BUILD to a timestamp
|
14
|
+
begin
|
15
|
+
git_dir = File.dirname(__FILE__) + "/../../.git"
|
16
|
+
if File.exist?(git_dir)
|
17
|
+
if `git --git-dir=#{git_dir} describe --tags HEAD` =~ /^v\d+\.\d+\.\d+(\.\d+)?$/
|
18
|
+
build = nil
|
19
|
+
else
|
20
|
+
build = `git --git-dir=#{git_dir} show HEAD --format=format:"%ct" --quiet 2>&1`
|
21
|
+
if build =~ /\d+/
|
22
|
+
build = Time.at(build.to_i).strftime("%Y%m%d")
|
23
|
+
else
|
24
|
+
build = nil
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
rescue RuntimeError => e
|
29
|
+
end
|
30
|
+
|
31
|
+
# If no BUILD can be determined or we're on a version, it takes the last number
|
32
|
+
build = build || BUILD
|
10
33
|
|
11
|
-
STRING = [MAJOR, MINOR, TINY].join('.')
|
34
|
+
STRING = [MAJOR, MINOR, TINY, build == 0 ? nil : build].compact.join('.')
|
12
35
|
end
|
13
36
|
end
|
data/lib/skyline.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
require File.dirname(__FILE__) + "/skyline/version"
|
3
|
+
|
1
4
|
# The Skyline contains all Skyline related (core) code and
|
2
5
|
# defines some methods like the root (path) and version
|
3
6
|
# of the Skyline core.
|
@@ -13,10 +16,10 @@ module Skyline
|
|
13
16
|
|
14
17
|
# Shortcut for the current version
|
15
18
|
#
|
16
|
-
# @return [String] The current version in the format x.x.x
|
19
|
+
# @return [String] The current version in the format x.x.x.x (the BUILD version is optional)
|
17
20
|
def version
|
18
21
|
Skyline::VERSION::STRING
|
19
22
|
end
|
20
23
|
module_function :version
|
21
|
-
|
22
|
-
|
24
|
+
|
25
|
+
end
|
data/rails/init.rb
CHANGED
@@ -14,7 +14,9 @@ ActiveSupport::Dependencies.load_once_paths << vendor_path
|
|
14
14
|
|
15
15
|
# Setup public paths
|
16
16
|
public_path = Pathname.new(Rails.public_path) + "skyline"
|
17
|
-
|
17
|
+
unless public_path.exist?
|
18
|
+
FileUtils.rm(public_path) if public_path.symlink?
|
19
|
+
|
18
20
|
puts "=> Skyline: Creating assets symlink to '#{public_path}'"
|
19
21
|
FileUtils.ln_s((Skyline.root + "public/skyline").relative_path_from(Pathname.new(Rails.public_path)),public_path)
|
20
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylinecms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DigitPaint
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-18 00:00:00 +01:00
|
13
13
|
default_executable: skylinecms
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -170,7 +170,6 @@ files:
|
|
170
170
|
- app/controllers/skyline/variant_current_editor_controller.rb
|
171
171
|
- app/controllers/skyline/variants_controller.rb
|
172
172
|
- app/helpers/skyline/application_helper.rb
|
173
|
-
- app/helpers/skyline/browser/tabs/media_library/media_files_helper.rb
|
174
173
|
- app/helpers/skyline/button_helper.rb
|
175
174
|
- app/helpers/skyline/content_helper.rb
|
176
175
|
- app/helpers/skyline/dialog_helper.rb
|
@@ -200,7 +199,6 @@ files:
|
|
200
199
|
- app/helpers/skyline/ref_object_helper.rb
|
201
200
|
- app/helpers/skyline/translation_helper.rb
|
202
201
|
- app/helpers/skyline/tree_helper.rb
|
203
|
-
- app/helpers/skyline/users_helper.rb
|
204
202
|
- app/middleware/skyline/flash_session_cookie_middleware.rb
|
205
203
|
- app/middleware/skyline/plugins_loader_middleware.rb
|
206
204
|
- app/middleware/skyline/sprockets_middleware.rb
|
@@ -411,6 +409,7 @@ files:
|
|
411
409
|
- db/migrate/20091013135821_allow_null_for_position_in_articles.rb
|
412
410
|
- db/migrate/20091202130512_rename_users_destroyed_to_is_destroyed.rb
|
413
411
|
- db/migrate/20091202152514_add_media_nodes_date.rb
|
412
|
+
- doc/Bundler.md
|
414
413
|
- doc/INSTALL.md
|
415
414
|
- doc/MIGRATION.md
|
416
415
|
- lib/skyline.rb
|
@@ -1,6 +0,0 @@
|
|
1
|
-
module Skyline::Browser::Tabs::MediaLibrary::MediaFilesHelper
|
2
|
-
def skyline_browser_tabs_media_library_media_dir_media_files_path_with_session_information(media_dir)
|
3
|
-
session_key = ActionController::Base.session_options[:session_key]
|
4
|
-
skyline_browser_tabs_media_library_media_dir_media_files_path(media_dir, session_key => cookies[session_key], request_forgery_protection_token => form_authenticity_token)
|
5
|
-
end
|
6
|
-
end
|