radiant-relations-extension 1.1.0 → 1.1.1

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.
@@ -1,3 +1,3 @@
1
1
  class RadiantRelationsExtension
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
@@ -1,18 +1,28 @@
1
1
  module RelationsExtension::RelationsTags
2
2
  include Radiant::Taggable
3
3
 
4
- desc %{
5
-
6
- }
7
4
  tag 'related_pages' do |tag|
8
- tag.expand
5
+ related_pages = tag.locals.page.related_pages
6
+ tag.expand unless related_pages.empty?
9
7
  end
8
+ desc %{
9
+ Iterates over all related pages. Page relations should be declared via a Relations page part.
10
+ }
10
11
  tag 'related_pages:each' do |tag|
11
- related_pages = tag.locals.page.related_pages
12
-
13
12
  related_pages.inject('') do |result, related_page|
14
13
  tag.locals.page = related_page
15
14
  result + tag.expand
16
15
  end
17
16
  end
17
+
18
+ desc %{ }
19
+ tag 'related_pages:first' do |tag|
20
+ tag.locals.page = related_pages.first
21
+ tag.expand
22
+ end
23
+ desc %{ }
24
+ tag 'related_pages:last' do |tag|
25
+ tag.locals.page = related_pages.last
26
+ tag.expand
27
+ end
18
28
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-relations-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
9
+ - 1
10
+ version: 1.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jan De Poorter
@@ -48,6 +48,7 @@ files:
48
48
  - lib/tasks/relations_extension_tasks.rake
49
49
  - public/javascripts/admin/relations.js
50
50
  - public/stylesheets/sass/admin/relations.sass
51
+ - radiant-relations-extension-1.1.0.gem
51
52
  - radiant-relations-extension.gemspec
52
53
  - Rakefile
53
54
  - README
@@ -58,7 +59,7 @@ has_rdoc: true
58
59
  homepage: http://github.com/jomz/radiant-relations-extension
59
60
  licenses: []
60
61
 
61
- post_install_message: "\n Add this to your radiant project by putting this line in your Gemfile:\n gem \"radiant-children_config-extension\", \"~> 1.1.0\"\n "
62
+ post_install_message: "\n Add this to your radiant project by putting this line in your Gemfile:\n gem \"radiant-children_config-extension\", \"~> 1.1.1\"\n "
62
63
  rdoc_options: []
63
64
 
64
65
  require_paths: