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:
parent
9991a36c65
commit
ef6e78fc27
6 changed files with 36 additions and 19 deletions
|
|
@ -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 }) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ our $HELP = {
|
|||
{ name => 'editIcon' },
|
||||
],
|
||||
},
|
||||
{ name => 'topStoryDeleteIcon',
|
||||
description => 'deleteIcon', },
|
||||
{ name => 'topStoryEditIcon'
|
||||
description => 'editIcon', },
|
||||
{ name => 'topStoryTitle' },
|
||||
{ name => 'topStorySubtitle' },
|
||||
{ name => 'topStoryUrl' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue