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

Merge "Bug 1827811: Journal and resume details buttons overlap"

parents 76cbe984 f5ca6b3a
......@@ -135,7 +135,7 @@ class PluginBlocktypeRecentposts extends MaharaCoreBlocktype {
$smarty->assign('blockid', $instance->get('id'));
$smarty->assign('editing', $editing);
$smarty->assign('licensemetadata', get_config('licensemetadata') ? true : false);
$smarty->assign('canviewblog', $data->owner == $USER->can_view_artefact($blog));
$smarty->assign('canviewblog', $USER->can_view_artefact($blog));
if ($editing) {
// Get id and title of configued blogs
......
......@@ -419,11 +419,11 @@ class PluginBlocktypeGallery extends MaharaCoreBlocktype {
$smarty = smarty_core();
$smarty->assign('count', count($images));
$smarty->assign('instanceid', $instance->get('id'));
$smarty->assign('images', $images);
$smarty->assign('showdescription', (!empty($configdata['showdescription'])) ? $configdata['showdescription'] : false);
$smarty->assign('width', $width);
$smarty->assign('editing', $editing);
$smarty->assign('blockid', $instance->get('id'));
if (isset($height)) {
$smarty->assign('height', $height);
}
......
......@@ -1411,7 +1411,12 @@ class BlockInstance {
$artefact = $this->get_artefact_instance($configdata['artefactid']);
$smarty->assign('allowcomments', $artefact->get('allowcomments'));
if (!$artefact->get('allowcomments')) {
$smarty->assign('justdetails', (int)get_config('licensemetadata'));
if ($this->get('blocktype') == 'textbox') {
$smarty->assign('justdetails', (int)get_config('licensemetadata'));
}
else {
$smarty->assign('justdetails', true);
}
}
else {
$commentoptions = ArtefactTypeComment::get_comment_options();
......@@ -1426,6 +1431,10 @@ class BlockInstance {
}
}
}
// Image gallery's from folders should always have details
if ($blockheader && $this->get('blocktype') == 'gallery') {
$smarty->assign('justdetails', true);
}
return $smarty->fetch('view/blocktypecontainerviewing.tpl');
}
......
......@@ -630,13 +630,27 @@ class PluginExportHtml extends PluginExport {
* @param BlockInstance $bi The File(s) to download block
* @param array &$idarray The exisiting array that stores modal ids to be created
*/
private function get_folder_modals(&$idarray, BlockInstance $bi) {
require_once(get_config('docroot') . 'artefact/resume/blocktype/entireresume/lib.php');
$artefacts = PluginBlocktypeFolder::get_current_artefacts($bi);
if (!empty($artefacts)) {
$idarray = array_merge($idarray, $artefacts);
private function get_folder_modals(&$idarray, BlockInstance $bi) {
$artefacts = PluginBlocktypeFolder::get_current_artefacts($bi);
$i = 0;
$allartefacts = array();
while (count($artefacts) > 0) {
if ($artefact = artefact_instance_from_id($artefacts[$i])) {
if ($artefact->get('artefacttype') == 'folder') {
$children = $artefact->get_children_instances();
foreach ($children as $childid) {
array_push($artefacts, $childid->get('id'));
}
}
}
$allartefacts[] = $artefacts[$i];
unset($artefacts[$i]);
$i++;
}
if (!empty($allartefacts)) {
$idarray = array_unique(array_merge($idarray, $allartefacts));
}
}
/**
* Exports the hard-coded modals for the blocks into relevant pages.
......
......@@ -156,7 +156,11 @@ function set_up_modal_events() {
$('#configureblock .submitcancel[name="submit"]').off('click');
$('#configureblock .submitcancel[name="submit"]').on('click', function(e) {
if (tinymce.activeEditor.getContent() !== '') {
if (tinymce.activeEditor.getContent()) {
$('#configureblock').find('textarea.wysiwyg').each(function() {
modal_textarea_id = $(this).attr('id');
tinymce.EditorManager.execCommand('mceRemoveEditor', true, modal_textarea_id);
});
dock.hide();
}
$("#configureblock input:file").each(function() {
......@@ -172,11 +176,6 @@ function set_up_modal_events() {
dock.hide();
}
});
$('#configureblock').find('textarea.wysiwyg').each(function() {
modal_textarea_id = $(this).attr('id');
tinymce.EditorManager.execCommand('mceRemoveEditor', true, modal_textarea_id);
});
});
$('#configureblock .submitcancel[name="cancel_submit"]').off('click');
......@@ -388,6 +387,15 @@ function toggleDetailsBtn() {
});
}
// Make sure active block headers still display after pagination
$(document).on('pageupdated', function(e, data) {
console.log('pageupdated');
var headers = $('#main-column-container').find('.block-header');
if ($('#details-btn').hasClass('active')) {
headers.removeClass('d-none');
}
});
jQuery(function($) {
toggleDetailsBtn();
......
......@@ -245,7 +245,8 @@ function expected_account_preferences() {
'viewsperpage' => 20,
'itemsperpage' => 10,
'orderpagesby' => 'latestmodified',
'searchinfields' => 'titleanddescriptionandtags'
'searchinfields' => 'titleanddescriptionandtags',
'view_details_active' => 0,
);
}
......
<div id="thumbnails{$blockid}" class="card-body thumbnails js-masonry">
<div id="thumbnails{$instanceid}" class="card-body thumbnails js-masonry">
{foreach from=$images item=image}
<div {if $image.squaredimensions}style="width:{$image.squaredimensions}px;height:{$image.squaredimensions}px;"{/if} class="thumb">
<a data-fancybox="{$image.fancybox}" href="{$image.link}" title="{$image.title}" data-caption="{$image.title}">
......
<div id="thumbnails{$blockid}" class="card-body thumbnails js-masonry">
<div id="thumbnails{$instanceid}" class="card-body thumbnails js-masonry">
{foreach from=$images item=image}
<div style="width: {$width * 1.5}px;" class="thumb">
<a data-fancybox="{$image.fancybox}" href="{$image.link}" title="{$image.title}" data-caption="{$image.title}">
......
......@@ -65,30 +65,65 @@
margin-left: 10px;
}
.card.card-secondary .card-body {
.block-header {
margin-top: -15px;
}
// exception of pdf block
.card.card-secondary {
.card-body {
.block-header {
margin-top: -15px;
}
// exception of attachments lists in resume
.has-attachment .list-unstyled {
.block-header {
margin-top: 0;
~ .list-group-item {
.title {
margin-right: 100px;
display: inline-block;
max-width: 80%;
}
img.file-icon {
vertical-align: top;
}
}
// exception of attachments lists in resume
.has-attachment .list-unstyled {
&.d-none {
~ .list-group-item .title {
margin-right: 0;
}
}
}
}
}
// journal titles need margin-right to not wrap under buttons
&.bt-recentposts,
&.bt-recentposts-editor,
&.bt-taggedposts,
&.bt-taggedposts-editor {
.block-header {
margin-top: 0;
~ .list-group-item {
.title {
margin-right: 100px;
display: inline-block;
max-width: 80%;
h4.list-group-item-heading {
margin-right: 80px;
}
img.file-icon {
vertical-align: top;
}
&.d-none {
~ .list-group-item h4.list-group-item-heading {
margin-right: 0;
}
}
}
}
.resume-content .list-group {
.block-header {
~ .list-group-item {
.title {
margin-right: 80px;
}
}
&.d-none {
~ .list-group-item .title {
margin-right: 0;
......
......@@ -29,7 +29,7 @@
{/if}
{/if}
</a>
{else if $justdetails}
{elseif $justdetails}
<a class="modal_link list-group-heading {if $displayiconsonly}btn btn-secondary{/if}"
data-toggle="modal-docked"
data-target="#configureblock"
......
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