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 {
array(
'blocktype' => 'navigation',
'title' => $values['title'],
'row' => $instance->get('row'),
'column' => $instance->get('column'),
'order' => 1,
'positionx' => 0,
'positiony' => 0,
'width' => 4,
'height' => 3,
'configdata' => array(
'collection' => $values['collection'],
'retractable' => $values['retractable'],
......
......@@ -448,13 +448,14 @@
var placeholder = $('.grid-stack').children().last(),
x = placeholder.attr('data-gs-x'),
y = placeholder.attr('data-gs-y');
if (typeof(x) != 'undefined' && typeof(y) != 'undefined') {
var grid = $('.grid-stack').data('gridstack');
grid.removeWidget(placeholder);
$(placeholder).remove();
$('.grid-stack .blocktype-drag').removeClass('btn btn-primary');
addNewBlock({'positionx': x, 'positiony': y}, 'placeholder');
}
},
appendTo: 'body',
});
......
......@@ -5915,13 +5915,14 @@ class View {
$oldlayoutcontent = get_blocks_in_old_layout($template->get('id'));
$newlayoutcontent = translate_to_new_layout($oldlayoutcontent);
foreach ($newlayoutcontent as $block) {
$dimensions[$block->block] = $block;
$dimensions[$block['block']] = $block;
}
foreach ($blocks as $block) {
$block->positionx = $dimensions[$block->id]->positionx;
$block->positiony = $dimensions[$block->id]->positiony;
$block->width = $dimensions[$block->id]->width;
$block->height = $dimensions[$block->id]->height;
$block->positionx = $dimensions[$block->id]['positionx'];
$block->positiony = $dimensions[$block->id]['positiony'];
$block->width = $dimensions[$block->id]['width'];
$block->height = $dimensions[$block->id]['height'];
}
}
......
......@@ -27,6 +27,12 @@
<div id="view" class="view-container">
<div id="bottom-pane">
<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">
{if $viewcontent}
{$viewcontent|safe}
......
......@@ -353,6 +353,7 @@ if ($owner && $owner == $USER->get('id')) {
// if the view doesn't have a peer assessment block
if (!$USER->has_peer_role_only($view) || $view->has_peer_assessement_block()
|| ($USER->is_admin_for_user($view->get('owner')) && $view->is_objectionable())) {
$peerhidden = false;
if ($newlayout = $view->uses_new_layout()) {
$blockresizeonload = "false";
......@@ -391,6 +392,11 @@ EOF;
$blocksjs = "$(function () {jQuery(document).trigger('blocksloaded');});";
}
}
else {
$blocksjs = '';
$newlayout = $view->uses_new_layout();
$peerhidden = true;
}
$blocktype_toolbar = $view->get_all_blocktype_toolbar();
$smarty = smarty(
......@@ -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() {
......@@ -547,6 +557,7 @@ $smarty->assign('viewid', $viewid);
$smarty->assign('viewtype', $viewtype);
$smarty->assign('feedback', $feedback);
$smarty->assign('owner', $owner);
$smarty->assign('peerhidden', $peerhidden);
list($tagcount, $alltags) = $view->get_all_tags_for_view(10);
$smarty->assign('alltags', $alltags);
$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
# Change the sort options in the "Group pages" block
Given I log in as "UserA" with password "Kupuh1pa!"
And I follow "GroupA (Administrator)"
And I wait "1" seconds
And I should see "Page UserB_01"
And I follow "Pages and collections (tab)"
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)
And I choose "Groups" in "Engage" from main menu
And I follow "GroupA"
# 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"
# Edit access for Collection 01
......@@ -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"
And I choose "Groups" in "Engage" from main menu
And I follow "GroupA"
And I wait "1" seconds
And I should see "Page UserA_05"
And I should see "Collection UserA_05"
And I should not see "Page UserA_03"
......
......@@ -101,7 +101,7 @@ Scenario: SmartEvidence interaction by member / staff
# Mahara member clicks the next to view next page
And I press "Next page"
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 wait "1" seconds
When I follow "Feedback (3)"
......
......@@ -125,9 +125,8 @@ Scenario: 1) Mahara member creates a collection of 3 pages and submits for marki
And I press "Next page"
# Mahara member places 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"
# Mahara member follows "Feedback (3)"
And I wait "1" seconds
When I follow "Feedback (4)"
# 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
And I choose "Pages and collections" in "Create" from main menu
And I follow "Copy"
And I press "Copy page"
And I follow "Edit"
And I follow "Display page"
Then I should see "Town: Wellington"
And I log out
......@@ -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 follow "Copy"
And I press "Copy page"
And I follow "Edit"
And I follow "Display page"
Then I should see "Town: Oslo"
And I log out
......@@ -38,6 +38,4 @@ Scenario:
And I should see images within the block "Some HTML"
And I follow "mahara manual"
And I wait "3" seconds
And I switch to the new window
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