Commit 7cf09839 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Gerrit Code Review

Merge "Bug 1850561: Plan task preview link needs to render gridstack"

parents 18cf717d 43efaa8c
......@@ -32,12 +32,22 @@ if (!can_view_view($firstViewId)) {
$firstview = new View($firstViewId);
$collection = $firstview->get('collection');
if ($firstview->uses_new_layout()) {
$blocks = $firstview->get_blocks(false, true);
$newlayout = true;
}
else {
$blocks = $view->build_rows();
$newlayout = false;
}
$smarty = smarty_core();
$smarty->assign('viewid', $id);
$smarty->assign('collectiontitle', $collection->get('name'));
$smarty->assign('ownername', $firstview->formatted_owner());
$smarty->assign('collectiondescription', $collection->get('description'));
$smarty->assign('viewcontent', $firstview->build_rows(false, true));
$smarty->assign('newlayout', $newlayout);
$smarty->assign('blocks', $blocks);
$smarty->assign('tags', $firstview->get('tags'));
$shownav = $collection->get('navigation');
......
......@@ -85,7 +85,9 @@ $pagestrings = [
'emptycollection'
]
];
$smarty = smarty(['paginator', 'js/preview.js', 'artefact/plans/js/planview.js'], null, $pagestrings);
$smarty = smarty(['paginator', 'js/preview.js', 'artefact/plans/js/planview.js',
'js/lodash/lodash.js', 'js/gridstack/gridstack.js',
'js/gridlayout.js'], null, $pagestrings);
$smarty->assign('tasks', $tasks);
//$smarty->assign('plan', $id);
......
......@@ -62,7 +62,8 @@ define('TITLE', $title);
$form = ArtefactTypeTask::get_form($task->get('parent'), $group, $task);
$smarty = smarty(['js/preview.js', 'artefact/plans/js/taskedit.js']);
$smarty = smarty(['js/preview.js', 'artefact/plans/js/taskedit.js',
'js/lodash/lodash.js', 'js/gridstack/gridstack.js', 'js/gridlayout.js']);
$smarty->assign('editform', $form);
$smarty->assign('PAGEHEADING', $pageheading);
$smarty->assign('SUBSECTIONHEADING', $subsectionheading);
......
......@@ -60,7 +60,8 @@ else {
$form = ArtefactTypeTask::get_form($planId, $group);
$smarty = smarty(['js/preview.js', 'artefact/plans/js/taskedit.js']);
$smarty = smarty(['js/preview.js', 'artefact/plans/js/taskedit.js',
'js/lodash/lodash.js', 'js/gridstack/gridstack.js', 'js/gridlayout.js']);
$smarty->assign('form', $form);
$smarty->assign('PAGEHEADING', $pageheading);
......
......@@ -22,12 +22,22 @@ if (!can_view_view($id)) {
$firstview = new View($id);
$collection = $firstview->get('collection');
if ($firstview->uses_new_layout()) {
$blocks = $firstview->get_blocks(false, true);
$newlayout = true;
}
else {
$blocks = $view->build_rows();
$newlayout = false;
}
$smarty = smarty_core();
$smarty->assign('viewid', $id);
$smarty->assign('collectiontitle', $collection->get('name'));
$smarty->assign('ownername', $firstview->formatted_owner());
$smarty->assign('collectiondescription', $collection->get('description'));
$smarty->assign('viewcontent', $firstview->build_rows(false, true));
$smarty->assign('newlayout', $newlayout);
$smarty->assign('blocks', $blocks);
list($tagcount, $alltags) = $firstview->get_all_tags_for_view();
$smarty->assign('tags', $alltags);
......
......@@ -8,9 +8,32 @@
<div id="view" class="cb">
<div id="bottom-pane">
<div id="column-container">
{$viewcontent|safe}
<div class="cb">
{if $newlayout}
<script>
$(function () {
var options = {
verticalMargin: 10,
float: true,
ddPlugin: false,
};
var grid = $('.grid-stack');
grid.gridstack(options);
grid = $('.grid-stack').data('gridstack');
// should add the blocks one by one
var blocks = {json_encode arg=$blocks};
loadGrid(grid, blocks);
jQuery(document).trigger('blocksloaded');
});
</script>
<div class="container-fluid">
<div class="grid-stack">
</div>
</div>
{else}
{$viewcontent|safe}
{/if}
<div class="cb"></div>
</div>
</div>
{if $tags}
......
......@@ -142,7 +142,7 @@ jQuery(function($) {
EOF;
$smarty = smarty(
array('js/preview.js', 'searchtable', 'paginator'),
array('js/preview.js', 'searchtable', 'paginator', 'js/lodash/lodash.js', 'js/gridstack/gridstack.js', 'js/gridlayout.js'),
array(),
array('stylesheets' => array('style/views.css'))
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment