From 8e7fcd0e6c760bb95074e34e6ca83952b2c15b45 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 20 Mar 2009 03:46:10 +0000 Subject: [PATCH] Remove quotes from Help vars. Add crumb trail template variables to the Story. Fix links for keywords in the Story. --- lib/WebGUI/Asset/Story.pm | 2 +- lib/WebGUI/Help/Asset_Story.pm | 126 ++++++++++++++++--------- lib/WebGUI/i18n/English/Asset_Story.pm | 19 +++- t/Asset/Story.t | 6 +- 4 files changed, 103 insertions(+), 50 deletions(-) diff --git a/lib/WebGUI/Asset/Story.pm b/lib/WebGUI/Asset/Story.pm index 666ca8311..3d5d004a5 100644 --- a/lib/WebGUI/Asset/Story.pm +++ b/lib/WebGUI/Asset/Story.pm @@ -684,7 +684,7 @@ sub viewTemplateVariables { foreach my $keyword (@{ $keywords }) { push @{ $var->{keyword_loop} }, { keyword => $keyword, - url => $archive->getUrl("func=search;submit=1;keywords=".$session->url->escape($keyword)), + url => $archive->getUrl("func=view;keywords=".$session->url->escape($keyword)), }; } ##TODO: publish time, calculated from revisionDate diff --git a/lib/WebGUI/Help/Asset_Story.pm b/lib/WebGUI/Help/Asset_Story.pm index d97e877a9..e9c123f25 100644 --- a/lib/WebGUI/Help/Asset_Story.pm +++ b/lib/WebGUI/Help/Asset_Story.pm @@ -7,29 +7,29 @@ our $HELP = { title => 'edit template', body => '', isa => [ - { namespace => "Asset_Template", - tag => "template variables" + { namespace => 'Asset_Template', + tag => 'template variables' }, ], fields => [], variables => [ - { 'name' => 'formHeader', + { name => 'formHeader', 'required' => 1 }, - { 'name' => 'formTitle', }, - { 'name' => 'formFooter', + { name => 'formTitle', }, + { name => 'formFooter', 'required' => 1 }, - { 'name' => 'titleForm', }, - { 'name' => 'subtitleForm', }, - { 'name' => 'bylineForm', }, - { 'name' => 'locationForm', }, - { 'name' => 'keywordsForm', }, - { 'name' => 'summaryForm', }, - { 'name' => 'highlightsForm', }, - { 'name' => 'storyForm', }, - { 'name' => 'saveButton', }, - { 'name' => 'previewButton', }, - { 'name' => 'saveAndAddButton', }, - { 'name' => 'cancelButton', }, + { name => 'titleForm', }, + { name => 'subtitleForm', }, + { name => 'bylineForm', }, + { name => 'locationForm', }, + { name => 'keywordsForm', }, + { name => 'summaryForm', }, + { name => 'highlightsForm', }, + { name => 'storyForm', }, + { name => 'saveButton', }, + { name => 'previewButton', }, + { name => 'saveAndAddButton', }, + { name => 'cancelButton', }, ], related => [] }, @@ -38,25 +38,37 @@ our $HELP = { title => 'view template', body => '', isa => [ - { namespace => "Asset_Template", - tag => "template variables" + { namespace => 'Asset_Template', + tag => 'template variables' }, ], fields => [], variables => [ - { 'name' => 'highlights_loop', + { name => 'highlights_loop', 'variables' => [ - { 'name' => 'highlight', }, + { name => 'highlight', }, ], }, - { 'name' => 'keywords_loop', + { name => 'keywords_loop', 'variables' => [ - { 'name' => 'keyword', }, - { 'name' => 'url', }, + { name => 'keyword', }, + { name => 'url', + description => 'keyword_url' + }, + ], + }, + { name => 'updatedTime', }, + { name => 'updatedTimeEpoch', }, + { name => 'crumb_loop', + 'variables' => [ + { name => 'title', + description => 'crumb_title' + }, + { name => 'url', + description => 'crumb_url' + }, ], }, - { 'name' => 'updatedTime', }, - { 'name' => 'updatedTimeEpoch', }, ], related => [] }, @@ -66,35 +78,61 @@ our $HELP = { title => 'story asset template variables title', body => '', isa => [ - { namespace => "Asset", - tag => "asset template variables" + { namespace => 'Asset', + tag => 'asset template variables' }, ], fields => [], variables => [ - { 'name' => 'headline', - 'description' => 'headline tmplvar', + { name => 'headline', + description => 'headline tmplvar', }, - { 'name' => 'subtitle', - 'description' => 'subtitle tmplvar', + { name => 'subtitle', + description => 'subtitle tmplvar', }, - { 'name' => 'byline', - 'description' => 'byline tmplvar', + { name => 'byline', + description => 'byline tmplvar', }, - { 'name' => 'location', - 'description' => 'location tmplvar', + { name => 'updatedTime', }, + { name => 'updatedTimeEpoch', }, + ], + related => [] + }, + + 'story asset template variables' => { + private => 1, + title => 'story asset template variables title', + body => '', + isa => [ + { namespace => 'Asset', + tag => 'asset template variables' }, - { 'name' => 'highlights', - 'description' => 'highlights tmplvar', + ], + fields => [], + variables => [ + { name => 'headline', + description => 'headline tmplvar', }, - { 'name' => 'story', - 'description' => 'story tmplvar', + { name => 'subtitle', + description => 'subtitle tmplvar', }, - { 'name' => 'photo', - 'description' => 'photo tmplvar', + { name => 'byline', + description => 'byline tmplvar', }, - { 'name' => 'storageId', - 'description' => 'storageId tmplvar', + { name => 'location', + description => 'location tmplvar', + }, + { name => 'highlights', + description => 'highlights tmplvar', + }, + { name => 'story', + description => 'story tmplvar', + }, + { name => 'photo', + description => 'photo tmplvar', + }, + { name => 'storageId', + description => 'storageId tmplvar', }, ], related => [] diff --git a/lib/WebGUI/i18n/English/Asset_Story.pm b/lib/WebGUI/i18n/English/Asset_Story.pm index 6c5afd1ee..c1c4b07eb 100644 --- a/lib/WebGUI/i18n/English/Asset_Story.pm +++ b/lib/WebGUI/i18n/English/Asset_Story.pm @@ -245,8 +245,23 @@ our $I18N = { lastUpdated => 0, }, - 'url' => { - message => q|A URL to view all stories in this archive.|, + 'keyword_url' => { + message => q|A URL to view all stories in this archive related to this keyword.|, + lastUpdated => 0, + }, + + 'crumb_loop' => { + message => q|A loop containing the crumbtrail. The first element will be a link to the archive that contains the story. The last element will be the story, with title and url. If there are 3 elements, the middle element will be the topic.|, + lastUpdated => 0, + }, + + 'crumb_title' => { + message => q|The title of a page in the crumb trail.|, + lastUpdated => 0, + }, + + 'crumb_url' => { + message => q|The title of a page in the crumb trail.|, lastUpdated => 0, }, diff --git a/t/Asset/Story.t b/t/Asset/Story.t index 70734e1c7..0325e1fb5 100644 --- a/t/Asset/Story.t +++ b/t/Asset/Story.t @@ -227,9 +227,9 @@ cmp_deeply( cmp_bag( $viewVariables->{keyword_loop}, [ - { keyword => "foxtrot", url => '/home/test-archive?func=search;submit=1;keywords=foxtrot', }, - { keyword => "tango", url => '/home/test-archive?func=search;submit=1;keywords=tango', }, - { keyword => "whiskey", url => '/home/test-archive?func=search;submit=1;keywords=whiskey', }, + { keyword => "foxtrot", url => '/home/test-archive?func=view;keywords=foxtrot', }, + { keyword => "tango", url => '/home/test-archive?func=view;keywords=tango', }, + { keyword => "whiskey", url => '/home/test-archive?func=view;keywords=whiskey', }, ], 'viewTemplateVariables: keywords_loop is okay' );