tag cloud urls in export mode
This commit is contained in:
parent
54aaa673cf
commit
070df97708
2 changed files with 32 additions and 5 deletions
|
|
@ -501,6 +501,7 @@ sub viewTemplateVariables {
|
|||
});
|
||||
my $storiesPerPage = $self->get('storiesPerPage');
|
||||
if ($self->{_exportMode}) {
|
||||
##10 pages worth of data on 1 page in export mode
|
||||
$storiesPerPage *= 10;
|
||||
}
|
||||
$p = WebGUI::Paginator->new($session, $self->getUrl, $storiesPerPage);
|
||||
|
|
@ -508,6 +509,7 @@ sub viewTemplateVariables {
|
|||
}
|
||||
my $storyIds = $p->getPageData();
|
||||
if (! $self->{_exportMode} ) {
|
||||
##Pagination variables aren't useful in export mode
|
||||
$p->appendTemplateVars($var);
|
||||
}
|
||||
$var->{date_loop} = [];
|
||||
|
|
@ -544,6 +546,11 @@ sub viewTemplateVariables {
|
|||
startAsset => $self,
|
||||
displayFunc => 'view',
|
||||
};
|
||||
##In export mode, tags should link to the pages generated during the collateral export
|
||||
if($self->{_exportMode}) {
|
||||
$cloudOptions->{urlCallback} = 'getKeywordStaticUrl';
|
||||
$cloudOptions->{displayFunc} = '';
|
||||
}
|
||||
$var->{keywordCloud} = WebGUI::Keyword->new($session)->generateCloud($cloudOptions);
|
||||
if (! $self->{_exportMode}) {
|
||||
my $i18n = WebGUI::International->new($session, 'Asset');
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ use DateTime;
|
|||
my $session = WebGUI::Test->session;
|
||||
|
||||
my $staff = WebGUI::Group->new($session, 'new');
|
||||
WebGUI::Test->groupsToDelete($staff);
|
||||
$staff->name('Reporting Staff');
|
||||
|
||||
my $reporter = WebGUI::User->new($session, 'new');
|
||||
|
|
@ -61,7 +62,7 @@ $canPostMaker->prepare({
|
|||
fail => [1, $reader ],
|
||||
});
|
||||
|
||||
my $tests = 41
|
||||
my $tests = 42
|
||||
+ $canPostMaker->plan
|
||||
;
|
||||
plan tests => 1
|
||||
|
|
@ -456,6 +457,28 @@ cmp_bag(
|
|||
'keywordCloud template variable has keywords and correct links',
|
||||
);
|
||||
|
||||
################################################################
|
||||
#
|
||||
# tagCloud template variable in view, exportMode
|
||||
#
|
||||
################################################################
|
||||
|
||||
$archive->{_exportMode} = 1;
|
||||
|
||||
$templateVars = $archive->viewTemplateVariables();
|
||||
@anchors = simpleHrefParser($templateVars->{keywordCloud});
|
||||
@expectedAnchors = ();
|
||||
foreach my $keyword(qw/echo foxtrot roger/) {
|
||||
push @expectedAnchors, [ $keyword, 'keyword_'.$keyword.'.html' ];
|
||||
}
|
||||
cmp_bag(
|
||||
\@anchors,
|
||||
\@expectedAnchors,
|
||||
'keywordCloud template variable has keywords and correct links in export mode',
|
||||
);
|
||||
|
||||
$archive->{_exportMode} = 0;
|
||||
|
||||
################################################################
|
||||
#
|
||||
# RSS and Atom checks
|
||||
|
|
@ -519,7 +542,7 @@ cmp_bag(
|
|||
keyword_foxtrot.html mystories.atom
|
||||
keyword_echo.html
|
||||
/],
|
||||
'exportAssetCollateral: correct files exported, including dummy directory'
|
||||
'exportAssetCollateral: keyword and feed files exported'
|
||||
);
|
||||
|
||||
my $roger = $exportStorage->getFileContentsAsScalar('keyword_roger.html');
|
||||
|
|
@ -572,9 +595,6 @@ END {
|
|||
foreach my $user ($editor, $reporter, $reader) {
|
||||
$user->delete if defined $user;
|
||||
}
|
||||
foreach my $group ($staff) {
|
||||
$group->delete if defined $group;
|
||||
}
|
||||
$creationDateSth->finish;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue