Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
more tag references
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Bingman authored and Keith Bingman committed May 13, 2009
1 parent c3c8181 commit b1e66f4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 31 deletions.
43 changes: 15 additions & 28 deletions app/models/standard_tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ class TagError < StandardError; end


desc %{
Renders the tag contents unless the current page is the first child in the context of
a children:each tag
#{I18n.t('tag_desc.children.unless_first')}
*#{I18n.t('tag_desc.usage')}:*
Expand All @@ -158,8 +157,7 @@ class TagError < StandardError; end
end

desc %{
Renders the tag contents only if the current page is the last child in the context of
a children:each tag
#{I18n.t('tag_desc.children.if_last')}
*#{I18n.t('tag_desc.usage')}:*
Expand All @@ -177,8 +175,7 @@ class TagError < StandardError; end


desc %{
Renders the tag contents unless the current page is the last child in the context of
a children:each tag
#{I18n.t('tag_desc.children.unless_last')}
*#{I18n.t('tag_desc.usage')}:*
Expand All @@ -195,16 +192,11 @@ class TagError < StandardError; end
end

desc %{
Renders the tag contents only if the contents do not match the previous header. This
is extremely useful for rendering date headers for a list of child pages.
If you would like to use several header blocks you may use the @name@ attribute to
name the header. When a header is named it will not restart until another header of
the same name is different.
Using the @restart@ attribute you can cause other named headers to restart when the
present header changes. Simply specify the names of the other headers in a semicolon
separated list.
#{I18n.t('tag_desc.children.header_p1')}
#{I18n.t('tag_desc.children.header_p2')}
#{I18n.t('tag_desc.children.header_p3')}
*#{I18n.t('tag_desc.usage')}:*
Expand All @@ -231,8 +223,8 @@ class TagError < StandardError; end
end
end

desc %{
Page attribute tags inside this tag refer to the parent of the current page.
desc %{
#{I18n.t('tag_desc.parent')}
*#{I18n.t('tag_desc.usage')}:*
Expand All @@ -245,9 +237,8 @@ class TagError < StandardError; end
end

desc %{
Renders the contained elements only if the current contextual page has a parent, i.e.
is not the root page.
#{I18n.t('tag_desc.if_parent')}
*#{I18n.t('tag_desc.usage')}:*
<pre><code><r:if_parent>...</r:if_parent></code></pre>
Expand All @@ -258,9 +249,8 @@ class TagError < StandardError; end
end

desc %{
Renders the contained elements only if the current contextual page has no parent, i.e.
is the root page.
#{I18n.t('tag_desc.unless_parent')}
*#{I18n.t('tag_desc.usage')}:*
<pre><code><r:unless_parent>...</r:unless_parent></code></pre>
Expand All @@ -271,10 +261,7 @@ class TagError < StandardError; end
end

desc %{
Renders the contained elements only if the current contextual page has one or
more child pages. The @status@ attribute limits the status of found child pages
to the given status, the default is @"published"@. @status="all"@ includes all
non-virtual pages regardless of status.
#{I18n.t('tag_desc.if_children')}
*#{I18n.t('tag_desc.usage')}:*
Expand Down
2 changes: 1 addition & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ de:

# Standard Tag Descriptions
tag_desc:
usage: 'Usage'
usage: 'Benutzung'

page:
desc: "Causes the tags referring to a page's attributes to refer to the current page."
Expand Down
23 changes: 21 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,28 @@ en:
last: 'Returns the last child. Inside this tag all page attribute tags are mapped tothe last child. <br />
Takes the same ordering options as @<r:children:each>@.›'
each: "Cycles through each of the children. Inside this tag all page attribute tags are mapped to the current child page."
child: "Page attribute tags inside of this tag refer to the current child. This is occasionally <br /> useful if you are inside of another tag (like &lt;r:find&gt;) and need to refer back to the <br /> current child."
child: "Page attribute tags inside of this tag refer to the current child. This is occasionally <br />
useful if you are inside of another tag (like &lt;r:find&gt;) and need to refer back to the <br /> current child."
if_first: "Renders the tag contents only if the current page is the first child in the context of a children:each tag"

unless_first: "Renders the tag contents unless the current page is the first child in the context of a children:each tag"
if_last: "Renders the tag contents unless the current page is the last child in the context of a children:each tag"
unless_last: "Renders the tag contents unless the current page is the last child in the context of a children:each tag"
header_p1: "Renders the tag contents only if the contents do not match the previous header. This is extremely useful
for rendering date headers for a list of child pages."
header_p2: "If you would like to use several header blocks you may use the @name@ attribute to name the header.
When a header is named it will not restart until another header of the same name is different."
header_p3: "Using the @restart@ attribute you can cause other named headers to restart when the present header changes.
Simply specify the names of the other headers in a semicolon separated list."

parent: "Page attribute tags inside this tag refer to the parent of the current page. "
if_parent: "Renders the contained elements only if the current contextual page has a parent, i.e. is not the root page."
unless_parent: "Renders the contained elements only if the current contextual page has no parent, i.e. is the root page."
if_children: 'Renders the contained elements only if the current contextual page has one or <br />
more child pages. The @status@ attribute limits the status of found child pages <br />
to the given status, the default is @"published"@. @status="all"@ includes all <br />
non-virtual pages regardless of status.'


meta:
desc: "The namespace for 'meta' attributes. If used as a singleton tag, both the description and keywords fields will be output as &lt;meta /&gt; tags unless the attribute 'tag' is set to 'false'."
keywords: "Emits the page keywords field in a meta tag, unless attribute 'tag' is set to 'false'."
Expand Down

0 comments on commit b1e66f4

Please sign in to comment.