radiant-relations-extension 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  class RadiantRelationsExtension
2
- VERSION = '1.2.4'
3
- end
2
+ VERSION = '1.2.5'
3
+ end
@@ -11,7 +11,7 @@ module RelationsExtension::RelationsTags
11
11
  end
12
12
  desc %{
13
13
  Iterates over all related pages. Page relations should be declared via a Relations page part.
14
- You can limit the results by use of a @from_ancestor@ attribute.
14
+ You can limit the results by use of a @from_ancestor@ attribute.
15
15
  For example: <r:related_pages from_ancestor="8"><r:each:link/></r:related_pages> where 8 is a page id
16
16
  The from_ancestor attribute accepts only one page id.
17
17
  }
@@ -21,15 +21,26 @@ module RelationsExtension::RelationsTags
21
21
  result + tag.expand
22
22
  end
23
23
  end
24
-
24
+
25
+ desc %{ Expands only if there are related pages. }
26
+ tag 'if_related_pages' do |tag|
27
+ tag.expand if tag.locals.page.related_pages.any?
28
+ end
29
+
30
+ desc %{ Expands only if there are no related pages. }
31
+ tag 'unless_related_pages' do |tag|
32
+ tag.expand unless tag.locals.page.related_pages.any?
33
+ end
34
+
25
35
  desc %{ Sets the scope to the first related page. }
26
36
  tag 'related_pages:first' do |tag|
27
37
  tag.locals.page = tag.locals.related_pages.first
28
38
  tag.expand
29
39
  end
40
+
30
41
  desc %{ Sets the scope to the last related page. }
31
42
  tag 'related_pages:last' do |tag|
32
43
  tag.locals.page = tag.locals.related_pages.last
33
44
  tag.expand
34
45
  end
35
- end
46
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-relations-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-02-21 00:00:00.000000000 Z
13
+ date: 2019-06-06 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Allows you to define relations between pages
16
16
  email:
@@ -19,35 +19,35 @@ executables: []
19
19
  extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
- - app/helpers/relations_helper.rb
23
- - app/models/relation_page_part.rb
24
- - app/views/admin/page_parts/_relation_page_part.html.haml
25
- - app/views/admin/pages/_relations_header_load.html.haml
22
+ - db/migrate/20110623112105_add_related_pages.rb
23
+ - radiant-relations-extension.gemspec
26
24
  - config/initializers/radiant_config.rb
27
- - config/locales/en.yml
28
- - config/locales/nl.yml
29
25
  - config/routes.rb
30
- - cucumber.yml
31
- - db/migrate/20110623112105_add_related_pages.rb
26
+ - config/locales/nl.yml
27
+ - config/locales/en.yml
28
+ - public/stylesheets/sass/admin/relations.sass
29
+ - public/javascripts/admin/relations.js
32
30
  - features/support/env.rb
33
31
  - features/support/paths.rb
32
+ - cucumber.yml
33
+ - relations_extension.rb
34
+ - Rakefile
35
+ - README
34
36
  - lib/radiant-relations-extension.rb
37
+ - lib/tasks/relations_extension_tasks.rake
35
38
  - lib/relations_extension/page_extension.rb
36
39
  - lib/relations_extension/relations_tags.rb
37
- - lib/tasks/relations_extension_tasks.rake
38
- - public/javascripts/admin/relations.js
39
- - public/stylesheets/sass/admin/relations.sass
40
- - radiant-relations-extension-1.2.3.gem
41
- - radiant-relations-extension.gemspec
42
- - Rakefile
43
- - README
44
- - relations_extension.rb
45
40
  - spec/spec.opts
46
41
  - spec/spec_helper.rb
42
+ - app/views/admin/page_parts/_relation_page_part.html.haml
43
+ - app/views/admin/pages/_relations_header_load.html.haml
44
+ - app/models/relation_page_part.rb
45
+ - app/helpers/relations_helper.rb
46
+ - radiant-relations-extension-1.2.3.gem
47
47
  homepage: http://github.com/jomz/radiant-relations-extension
48
48
  licenses: []
49
49
  post_install_message: ! "\n Add this to your radiant project by putting this line
50
- in your Gemfile:\n gem \"radiant-relations-extension\", \"~> 1.2.4\"\n "
50
+ in your Gemfile:\n gem \"radiant-relations-extension\", \"~> 1.2.5\"\n "
51
51
  rdoc_options: []
52
52
  require_paths:
53
53
  - lib
@@ -74,4 +74,3 @@ test_files:
74
74
  - spec/spec_helper.rb
75
75
  - features/support/env.rb
76
76
  - features/support/paths.rb
77
- has_rdoc: