topStory template variables should be available in standAlone and not standAlone modes. Added template variables for delete and edit icons for the top story. Updated the tests, template and template variable help. Fixes bug #11851.

This commit is contained in:
Colin Kuskie 2010-09-09 11:56:50 -07:00
parent 9991a36c65
commit ef6e78fc27
6 changed files with 36 additions and 19 deletions

View file

@ -198,15 +198,17 @@ sub viewTemplateVariables {
push @{$var->{story_loop}}, $storyVars;
}
if ($self->{_standAlone} and @$storyIds) {
if (@{ $storyIds }) {
my $topStoryData = $storyIds->[0];
shift @{ $var->{story_loop} };
my $topStoryVars = shift @{ $var->{story_loop} };
##Note, this could have saved from the loop above, but this looks more clean and encapsulated to me.
my $topStory = WebGUI::Asset->newById($session, $topStoryData->{assetId}, $topStoryData->{revisionDate});
$var->{topStoryTitle} = $topStory->getTitle;
$var->{topStorySubtitle} = $topStory->subtitle;
$var->{topStoryUrl} = $session->url->append($self->getUrl, 'func=viewStory;assetId='.$topStoryData->{assetId}),
$var->{topStoryCreationDate} = $topStory->creationDate;
$var->{topStoryEditIcon} = $topStoryVars->{editIcon};
$var->{topStoryDeleteIcon} = $topStoryVars->{deleteIcon};
##TODO: Photo variables
my $photoData = $topStory->getPhotoData;
PHOTO: foreach my $photo (@{ $photoData }) {