Commit fa4085d5 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon

Bug 1813987: Tidying up some lastminute problems

like
- allow add block button to drop only inside the grid
- navigation block in collection to copy to other pages
- Smart evidence annotation feedback forms init tinymce
- showing the peer can see content message again
- allow copying of page with old layout

behatnotneeded

Change-Id: I3f552ce8f89125e9fd233513c855879aa7678048
parent 279c2d49
...@@ -157,9 +157,10 @@ class PluginBlocktypeNavigation extends MaharaCoreBlocktype { ...@@ -157,9 +157,10 @@ class PluginBlocktypeNavigation extends MaharaCoreBlocktype {
array( array(
'blocktype' => 'navigation', 'blocktype' => 'navigation',
'title' => $values['title'], 'title' => $values['title'],
'row' => $instance->get('row'), 'positionx' => 0,
'column' => $instance->get('column'), 'positiony' => 0,
'order' => 1, 'width' => 4,
'height' => 3,
'configdata' => array( 'configdata' => array(
'collection' => $values['collection'], 'collection' => $values['collection'],
'retractable' => $values['retractable'], 'retractable' => $values['retractable'],
......
...@@ -448,13 +448,14 @@ ...@@ -448,13 +448,14 @@
var placeholder = $('.grid-stack').children().last(), var placeholder = $('.grid-stack').children().last(),
x = placeholder.attr('data-gs-x'), x = placeholder.attr('data-gs-x'),
y = placeholder.attr('data-gs-y'); y = placeholder.attr('data-gs-y');
if (typeof(x) != 'undefined' && typeof(y) != 'undefined') {
var grid = $('.grid-stack').data('gridstack');
grid.removeWidget(placeholder);
$(placeholder).remove();
var grid = $('.grid-stack').data('gridstack'); $('.grid-stack .blocktype-drag').removeClass('btn btn-primary');
grid.removeWidget(placeholder); addNewBlock({'positionx': x, 'positiony': y}, 'placeholder');
$(placeholder).remove(); }
$('.grid-stack .blocktype-drag').removeClass('btn btn-primary');
addNewBlock({'positionx': x, 'positiony': y}, 'placeholder');
}, },
appendTo: 'body', appendTo: 'body',
}); });
......
...@@ -2405,13 +2405,13 @@ class View { ...@@ -2405,13 +2405,13 @@ class View {
public function addblockinstance(BlockInstance $bi) { public function addblockinstance(BlockInstance $bi) {
if ($this->uses_new_layout()) { if ($this->uses_new_layout()) {
if (!$bi->get('row')) { if (!$bi->get('row')) {
$bi->set('row', 1); $bi->set('row', 1);
} }
if (!$bi->get('column')) { if (!$bi->get('column')) {
$bi->set('column', 1); $bi->set('column', 1);
} }
if (!$bi->get('order')) { if (!$bi->get('order')) {
$bi->set('order', 1); $bi->set('order', 1);
} }
} }
if (!$bi->get('view')) { if (!$bi->get('view')) {
...@@ -5915,13 +5915,14 @@ class View { ...@@ -5915,13 +5915,14 @@ class View {
$oldlayoutcontent = get_blocks_in_old_layout($template->get('id')); $oldlayoutcontent = get_blocks_in_old_layout($template->get('id'));
$newlayoutcontent = translate_to_new_layout($oldlayoutcontent); $newlayoutcontent = translate_to_new_layout($oldlayoutcontent);
foreach ($newlayoutcontent as $block) { foreach ($newlayoutcontent as $block) {
$dimensions[$block->block] = $block; $dimensions[$block['block']] = $block;
} }
foreach ($blocks as $block) { foreach ($blocks as $block) {
$block->positionx = $dimensions[$block->id]->positionx; $block->positionx = $dimensions[$block->id]['positionx'];
$block->positiony = $dimensions[$block->id]->positiony; $block->positiony = $dimensions[$block->id]['positiony'];
$block->width = $dimensions[$block->id]->width; $block->width = $dimensions[$block->id]['width'];
$block->height = $dimensions[$block->id]->height; $block->height = $dimensions[$block->id]['height'];
} }
} }
......
...@@ -27,6 +27,12 @@ ...@@ -27,6 +27,12 @@
<div id="view" class="view-container"> <div id="view" class="view-container">
<div id="bottom-pane"> <div id="bottom-pane">
<div id="column-container" class="user-page-content"> <div id="column-container" class="user-page-content">
{if $peerhidden}
<div class="alert alert-info">
<span class="icon icon-lg icon-info-circle left" role="presentation" aria-hidden="true"></span>
{str tag=nopeerassessmentrequired section=artefact.peerassessment}
</div>
{/if}
<div class="grid-stack"> <div class="grid-stack">
{if $viewcontent} {if $viewcontent}
{$viewcontent|safe} {$viewcontent|safe}
......
...@@ -353,6 +353,7 @@ if ($owner && $owner == $USER->get('id')) { ...@@ -353,6 +353,7 @@ if ($owner && $owner == $USER->get('id')) {
// if the view doesn't have a peer assessment block // if the view doesn't have a peer assessment block
if (!$USER->has_peer_role_only($view) || $view->has_peer_assessement_block() if (!$USER->has_peer_role_only($view) || $view->has_peer_assessement_block()
|| ($USER->is_admin_for_user($view->get('owner')) && $view->is_objectionable())) { || ($USER->is_admin_for_user($view->get('owner')) && $view->is_objectionable())) {
$peerhidden = false;
if ($newlayout = $view->uses_new_layout()) { if ($newlayout = $view->uses_new_layout()) {
$blockresizeonload = "false"; $blockresizeonload = "false";
...@@ -391,6 +392,11 @@ EOF; ...@@ -391,6 +392,11 @@ EOF;
$blocksjs = "$(function () {jQuery(document).trigger('blocksloaded');});"; $blocksjs = "$(function () {jQuery(document).trigger('blocksloaded');});";
} }
} }
else {
$blocksjs = '';
$newlayout = $view->uses_new_layout();
$peerhidden = true;
}
$blocktype_toolbar = $view->get_all_blocktype_toolbar(); $blocktype_toolbar = $view->get_all_blocktype_toolbar();
$smarty = smarty( $smarty = smarty(
...@@ -456,6 +462,10 @@ jQuery(window).on('blocksloaded', {}, function() { ...@@ -456,6 +462,10 @@ jQuery(window).on('blocksloaded', {}, function() {
} }
}); });
}); });
// Wire up the annotation feedback forms
$('.feedbacktable.modal-docked form').each(function() {
initTinyMCE($(this).prop('id'));
});
}); });
function activateModalLinks() { function activateModalLinks() {
...@@ -547,6 +557,7 @@ $smarty->assign('viewid', $viewid); ...@@ -547,6 +557,7 @@ $smarty->assign('viewid', $viewid);
$smarty->assign('viewtype', $viewtype); $smarty->assign('viewtype', $viewtype);
$smarty->assign('feedback', $feedback); $smarty->assign('feedback', $feedback);
$smarty->assign('owner', $owner); $smarty->assign('owner', $owner);
$smarty->assign('peerhidden', $peerhidden);
list($tagcount, $alltags) = $view->get_all_tags_for_view(10); list($tagcount, $alltags) = $view->get_all_tags_for_view(10);
$smarty->assign('alltags', $alltags); $smarty->assign('alltags', $alltags);
$smarty->assign('moretags', ($tagcount > sizeof($alltags) ? true : false)); $smarty->assign('moretags', ($tagcount > sizeof($alltags) ? true : false));
......
...@@ -176,6 +176,7 @@ These list must take into account the sort option chosen in the block config (Bu ...@@ -176,6 +176,7 @@ These list must take into account the sort option chosen in the block config (Bu
# Change the sort options in the "Group pages" block # Change the sort options in the "Group pages" block
Given I log in as "UserA" with password "Kupuh1pa!" Given I log in as "UserA" with password "Kupuh1pa!"
And I follow "GroupA (Administrator)" And I follow "GroupA (Administrator)"
And I wait "1" seconds
And I should see "Page UserB_01" And I should see "Page UserB_01"
And I follow "Pages and collections (tab)" And I follow "Pages and collections (tab)"
And I click on "Edit" in "Group homepage" card menu And I click on "Edit" in "Group homepage" card menu
......
...@@ -78,6 +78,7 @@ The list of shared pages must take into account of access date (Bug 1374163) ...@@ -78,6 +78,7 @@ The list of shared pages must take into account of access date (Bug 1374163)
And I choose "Groups" in "Engage" from main menu And I choose "Groups" in "Engage" from main menu
And I follow "GroupA" And I follow "GroupA"
# the formats "strftimedate" and "j F Y" both resolve to dd Month YYYY, which is wanted here. # the formats "strftimedate" and "j F Y" both resolve to dd Month YYYY, which is wanted here.
And I wait "1" seconds
And I should see the date "today" in the "#sharedcollectionlist" element with the format "d F Y" And I should see the date "today" in the "#sharedcollectionlist" element with the format "d F Y"
# Edit access for Collection 01 # Edit access for Collection 01
...@@ -102,6 +103,7 @@ The list of shared pages must take into account of access date (Bug 1374163) ...@@ -102,6 +103,7 @@ The list of shared pages must take into account of access date (Bug 1374163)
# Check the list of shared pages to group "GroupA" # Check the list of shared pages to group "GroupA"
And I choose "Groups" in "Engage" from main menu And I choose "Groups" in "Engage" from main menu
And I follow "GroupA" And I follow "GroupA"
And I wait "1" seconds
And I should see "Page UserA_05" And I should see "Page UserA_05"
And I should see "Collection UserA_05" And I should see "Collection UserA_05"
And I should not see "Page UserA_03" And I should not see "Page UserA_03"
......
...@@ -101,7 +101,7 @@ Scenario: SmartEvidence interaction by member / staff ...@@ -101,7 +101,7 @@ Scenario: SmartEvidence interaction by member / staff
# Mahara member clicks the next to view next page # Mahara member clicks the next to view next page
And I press "Next page" And I press "Next page"
When I follow "Place feedback" When I follow "Place feedback"
And I fill in "Mahara member placing feedback" in first editor And I fill in "Mahara member placing feedback" in editor "Feedback"
And I press "Place feedback" And I press "Place feedback"
And I wait "1" seconds And I wait "1" seconds
When I follow "Feedback (3)" When I follow "Feedback (3)"
......
...@@ -125,9 +125,8 @@ Scenario: 1) Mahara member creates a collection of 3 pages and submits for marki ...@@ -125,9 +125,8 @@ Scenario: 1) Mahara member creates a collection of 3 pages and submits for marki
And I press "Next page" And I press "Next page"
# Mahara member places feedback # Mahara member places feedback
When I follow "Place feedback" When I follow "Place feedback"
And I fill in "Mahara member placing feedback" in first editor And I fill in "Mahara member placing feedback" in editor "Feedback"
And I press "Place feedback" And I press "Place feedback"
# Mahara member follows "Feedback (3)"
And I wait "1" seconds And I wait "1" seconds
When I follow "Feedback (4)" When I follow "Feedback (4)"
# Mahara member should see 3 feedback annotations # Mahara member should see 3 feedback annotations
......
...@@ -48,6 +48,7 @@ Scenario: Add a text block into the site default portfolio page and create a new ...@@ -48,6 +48,7 @@ Scenario: Add a text block into the site default portfolio page and create a new
And I choose "Pages and collections" in "Create" from main menu And I choose "Pages and collections" in "Create" from main menu
And I follow "Copy" And I follow "Copy"
And I press "Copy page" And I press "Copy page"
And I follow "Edit"
And I follow "Display page" And I follow "Display page"
Then I should see "Town: Wellington" Then I should see "Town: Wellington"
And I log out And I log out
...@@ -57,6 +58,7 @@ Scenario: Add a text block into the site default portfolio page and create a new ...@@ -57,6 +58,7 @@ Scenario: Add a text block into the site default portfolio page and create a new
And I choose "Pages and collections" in "Create" from main menu And I choose "Pages and collections" in "Create" from main menu
And I follow "Copy" And I follow "Copy"
And I press "Copy page" And I press "Copy page"
And I follow "Edit"
And I follow "Display page" And I follow "Display page"
Then I should see "Town: Oslo" Then I should see "Town: Oslo"
And I log out And I log out
...@@ -38,6 +38,4 @@ Scenario: ...@@ -38,6 +38,4 @@ Scenario:
And I should see images within the block "Some HTML" And I should see images within the block "Some HTML"
And I follow "mahara manual" And I follow "mahara manual"
And I wait "3" seconds And I wait "3" seconds
And I switch to the new window
Then I should see "This is the manual for Mahara" Then I should see "This is the manual for Mahara"
And I switch to the main window
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