Changed toolbox button to switch and renamed toolbox

This commit is contained in:
PMKuipers 2023-09-03 20:57:14 +02:00
parent efd2eaa451
commit e3254a45c0
12 changed files with 74 additions and 48 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -78,6 +78,7 @@ export function init(contextid,categoryid) {
} }
}, },
toolbox: { toolbox: {
shown: false,
right: true, right: true,
}, },
activestudyplan: null, activestudyplan: null,
@ -261,6 +262,10 @@ export function init(contextid,categoryid) {
download(plan.shortname+".json",response.content,response.format); download(plan.shortname+".json",response.content,response.format);
}).fail(notification.exception); }).fail(notification.exception);
}, },
toggletoolbox(event) {
debug.info(event);
this.toolbox.shown = event;
}
}, },
}); });
} }

View File

@ -70,6 +70,7 @@ export default {
let strings = load_strings({ let strings = load_strings({
studyplan_text: { studyplan_text: {
studyline_editmode: 'studyline_editmode', studyline_editmode: 'studyline_editmode',
toolbox_toggle: 'toolbox_toggle',
editmode_modules_hidden:'editmode_modules_hidden', editmode_modules_hidden:'editmode_modules_hidden',
studyline_add: 'studyline_add', studyline_add: 'studyline_add',
add$core: 'add$core', add$core: 'add$core',
@ -1308,6 +1309,7 @@ export default {
}, },
}, },
edit: { edit: {
toolbox_shown: false,
studyline: { studyline: {
editmode: false, editmode: false,
data: { data: {
@ -1601,36 +1603,47 @@ export default {
} }
return add_days(date,0 - days); return add_days(date,0 - days);
}, },
toolbox_switched(event){
this.$emit('toggletoolbox',event);
}
} }
, ,
template: template:
` `
<div> <div>
<div class='controlbox t-studyplan-controlbox'> <div class='controlbox t-studyplan-controlbox'>
<b-form-checkbox v-model="edit.studyline.editmode" class="sw-studyline-editmode" switch <div class="controlbox-group">
>{{ text.studyline_editmode }}</b-form-checkbox> <b-form-checkbox v-model="edit.studyline.editmode" class="sw-studyplan-toolbar" switch
<drop @change="toolbox_switched(edit.toolbox_shown && !edit.studyline.editmode); "
mode='copy' >{{ text.studyline_editmode }}</b-form-checkbox>
class='t-item-deletebox text-danger border-danger' <b-form-checkbox v-if="!edit.studyline.editmode" v-model="edit.toolbox_shown" class="sw-studyplan-toolbar" switch
@drop='deleteStudyItem' @change="toolbox_switched"
:accepts-type="trashbin_accepts" >{{ text.toolbox_toggle}}</b-form-checkbox>
><i class='fa fa-trash'></i> <drop
</drop> mode='copy'
<span class='control deletable'> class='t-item-deletebox text-danger border-danger'
<a v-if='page.studylines.length == 0' href='#' @click='deletePlan(value)' @drop='deleteStudyItem'
><i class='text-danger fa fa-trash'></i></a> :accepts-type="trashbin_accepts"
</span> ><i class='fa fa-trash'></i>
<span class='control editable'> </drop>
<t-studyplan-edit v-model="value" @moved="movedStudyplan" </div>
><i class='fa fa-gear'></i> {{text.edit$core}}</t-studyplan-edit> <div class="controlbox-group">
</span> <span class='control editable'>
<span class='control editable'> <t-studyplan-advanced v-model="value"></t-studyplan-advanced>
<t-studyplan-associate </span>
v-model="value"><i class='fa fa-users'></i> {{text.associations}}</t-studyplan-associate> <span class='control editable'>
</span> <t-studyplan-associate
<span class='control editable'> v-model="value"><i class='fa fa-users'></i> {{text.associations}}</t-studyplan-associate>
<t-studyplan-advanced v-model="value"></t-studyplan-advanced> </span>
</span> <span class='control editable'>
<t-studyplan-edit v-model="value" @moved="movedStudyplan"
><i class='fa fa-gear'></i> {{text.edit$core}}</t-studyplan-edit>
</span>
<span class='control deletable'>
<a v-if='page.studylines.length == 0' href='#' @click='deletePlan(value)'
><i class='text-danger fa fa-trash'></i></a>
</span>
</div>
</div> </div>
<div class='t-studyplan-content-edit' v-if="edit.studyline.editmode"> <div class='t-studyplan-content-edit' v-if="edit.studyline.editmode">
<drop-list <drop-list

View File

@ -212,10 +212,12 @@
.path-local-treestudyplan .t-studyplan-controlbox, .path-local-treestudyplan .t-studyplan-controlbox,
.features-treestudyplan .t-studyplan-controlbox { .features-treestudyplan .t-studyplan-controlbox {
height: 30px; height: 30px;
display: flex;
justify-content: space-between;
max-width: 80em;
} }
.path-local-treestudyplan .t-studyplan-controlbox .control, .path-local-treestudyplan .t-studyplan-controlbox .control,
.features-treestudyplan .t-studyplan-controlbox .control { .features-treestudyplan .t-studyplan-controlbox .control {
float: right;
margin-left: 10px; margin-left: 10px;
margin-right: 5px; margin-right: 5px;
} }
@ -544,8 +546,8 @@
stroke: #f00; stroke: #f00;
fill: #f00; fill: #f00;
} }
.path-local-treestudyplan .sw-studyline-editmode, .path-local-treestudyplan .sw-studyplan-toolbar,
.features-treestudyplan .sw-studyline-editmode { .features-treestudyplan .sw-studyplan-toolbar {
display: inline-block; display: inline-block;
} }
.path-local-treestudyplan .t-item-base .deletebox, .path-local-treestudyplan .t-item-base .deletebox,

View File

@ -138,11 +138,10 @@ print $OUTPUT->header();
<b-button v-if='!activestudyplan && !loadingstudyplan' <b-button v-if='!activestudyplan && !loadingstudyplan'
variant='danger' href='#' role='presentation' @click="import_studyplan " variant='danger' href='#' role='presentation' @click="import_studyplan "
><i class='fa fa-upload'></i> <?php t("advanced_import_from_file");?></b-button> ><i class='fa fa-upload'></i> <?php t("advanced_import_from_file");?></b-button>
<b-button v-if='activestudyplan' variant='primary' v-b-toggle.toolbox-sidebar><?php t('opentoolbox') ?></b-button>
</div> </div>
<div class='t-studyplan-container'> <div class='t-studyplan-container'>
<t-studyplan v-if='activestudyplan' v-model='activestudyplan' @moved="movedStudyplan"></t-studyplan> <t-studyplan v-if='activestudyplan' v-model='activestudyplan' @moved="movedStudyplan" @toggletoolbox="toggletoolbox"></t-studyplan>
<div v-else-if='loadingstudyplan' class="spinner-border text-primary" role="status"> <div v-else-if='loadingstudyplan' class="spinner-border text-primary" role="status">
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
</div> </div>
@ -172,9 +171,10 @@ print $OUTPUT->header();
id="toolbox-sidebar" id="toolbox-sidebar"
:right='toolbox.right' :right='toolbox.right'
shadow shadow
title='<?php t("toolbox")?>' v-model="toolbox.shown"
no-header
> >
<div class="m-3 border-bottom-1 border-primary"><h3><?php t("toolbox")?></h3></div>
<div class='t-toolbox-preface'> <div class='t-toolbox-preface'>
<b-form-checkbox v-model="toolbox.right" switch><?php t("toolbar-right");?></b-form-checkbox> <b-form-checkbox v-model="toolbox.right" switch><?php t("toolbar-right");?></b-form-checkbox>
</div> </div>
@ -182,7 +182,7 @@ print $OUTPUT->header();
<b-tab title="<?php t('courses')?>"> <b-tab title="<?php t('courses')?>">
<t-coursecat-list v-model="courses"></t-coursecat-list> <t-coursecat-list v-model="courses"></t-coursecat-list>
</b-tab> </b-tab>
<b-tab title="<?php t('toolbox')?>"> <b-tab title="<?php t('flow')?>">
<ul class="t-toolbox"> <ul class="t-toolbox">
<li><drag <li><drag
:type="filterComponentType" :type="filterComponentType"

View File

@ -124,6 +124,7 @@ $string["studyplan_select_placeholder"] = "Select study plan";
$string["studyline_add"] = 'Add study line'; $string["studyline_add"] = 'Add study line';
$string["studyline_edit"] = 'Edit study line'; $string["studyline_edit"] = 'Edit study line';
$string["studyline_editmode"] = 'Edit study lines'; $string["studyline_editmode"] = 'Edit study lines';
$string["toolbox_toggle"] = 'Insert components and courses';
$string["studyline_remove"] = 'Remove study line'; $string["studyline_remove"] = 'Remove study line';
$string["studyline_confirm_remove"] = 'Are you sure you want to remove studyline {$a}?'; $string["studyline_confirm_remove"] = 'Are you sure you want to remove studyline {$a}?';
$string["studyline_name"] = 'Full name'; $string["studyline_name"] = 'Full name';
@ -135,9 +136,9 @@ $string["studyline_color"] = 'Background color';
$string["studyitem_confirm_remove"] = 'Are you sure you want to remove module {$a}?'; $string["studyitem_confirm_remove"] = 'Are you sure you want to remove module {$a}?';
$string["editmode_modules_hidden"] = 'Modules hidden in edit mode'; $string["editmode_modules_hidden"] = 'Modules hidden in edit mode';
$string["toolbox"] = 'Toolbox'; $string["toolbox"] = 'Components';
$string["opentoolbox"] = 'Open toolbox'; $string["flow"] = 'Flow';
$string["toolbar-right"] = 'Show toolbox at the right'; $string["toolbar-right"] = 'Show this bar at the right';
$string["tool-junction"] = 'Junction'; $string["tool-junction"] = 'Junction';
$string["tool-start"] = 'Start/continue'; $string["tool-start"] = 'Start/continue';

View File

@ -124,6 +124,7 @@ $string["studyplan_select_placeholder"] = "Selecteer studieplan";
$string["studyline_add"] = 'Nieuwe leerlijn'; $string["studyline_add"] = 'Nieuwe leerlijn';
$string["studyline_edit"] = 'Leerlijn bewerken'; $string["studyline_edit"] = 'Leerlijn bewerken';
$string["studyline_editmode"] = 'Leerlijnen bewerken'; $string["studyline_editmode"] = 'Leerlijnen bewerken';
$string["toolbox_toggle"] = 'Cursussen en elementen invoegen';
$string["studyline_remove"] = 'Leerlijn verwijderen'; $string["studyline_remove"] = 'Leerlijn verwijderen';
$string["studyline_confirm_remove"] = 'Weet je zeker dat je leerlijn {$a} wilt verwijderen?'; $string["studyline_confirm_remove"] = 'Weet je zeker dat je leerlijn {$a} wilt verwijderen?';
$string["studyline_name"] = 'Naam'; $string["studyline_name"] = 'Naam';
@ -135,9 +136,9 @@ $string["studyline_color"] = 'Achtergrondkleur';
$string["studyitem_confirm_remove"] = 'Weet je zeker dat je module {$a} wilt verwijderen?'; $string["studyitem_confirm_remove"] = 'Weet je zeker dat je module {$a} wilt verwijderen?';
$string["editmode_modules_hidden"] = 'Modules verborgen tijdens bewerken'; $string["editmode_modules_hidden"] = 'Modules verborgen tijdens bewerken';
$string["toolbox"] = 'Toolbox'; $string["toolbox"] = 'Onderdelen';
$string["opentoolbox"] = 'Toolbox openen'; $string["flow"] = 'Flow';
$string["toolbar-right"] = 'Toolbox rechts tonen'; $string["toolbar-right"] = 'Deze balk rechts tonen';
$string["tool-junction"] = 'Kruispunt'; $string["tool-junction"] = 'Kruispunt';
$string["tool-start"] = 'Start/Vervolgpunt'; $string["tool-start"] = 'Start/Vervolgpunt';

View File

@ -7,7 +7,6 @@
.t-studyplan-container { .t-studyplan-container {
margin-top: 16px; margin-top: 16px;
min-height: 500px; min-height: 500px;
} }
.t-studyplan-content, .t-studyplan-content,
@ -116,10 +115,13 @@
.t-studyplan-controlbox { .t-studyplan-controlbox {
height: 30px; height: 30px;
display: flex;
justify-content: space-between;
max-width: 80em;
} }
.t-studyplan-controlbox .control { .t-studyplan-controlbox .control {
float: right;
margin-left: 10px; margin-left: 10px;
margin-right: 5px; margin-right: 5px;
} }
@ -436,7 +438,7 @@
fill: #f00; fill: #f00;
} }
.sw-studyline-editmode { .sw-studyplan-toolbar {
display: inline-block; display: inline-block;
} }

View File

@ -212,10 +212,12 @@
.path-local-treestudyplan .t-studyplan-controlbox, .path-local-treestudyplan .t-studyplan-controlbox,
.features-treestudyplan .t-studyplan-controlbox { .features-treestudyplan .t-studyplan-controlbox {
height: 30px; height: 30px;
display: flex;
justify-content: space-between;
max-width: 80em;
} }
.path-local-treestudyplan .t-studyplan-controlbox .control, .path-local-treestudyplan .t-studyplan-controlbox .control,
.features-treestudyplan .t-studyplan-controlbox .control { .features-treestudyplan .t-studyplan-controlbox .control {
float: right;
margin-left: 10px; margin-left: 10px;
margin-right: 5px; margin-right: 5px;
} }
@ -544,8 +546,8 @@
stroke: #f00; stroke: #f00;
fill: #f00; fill: #f00;
} }
.path-local-treestudyplan .sw-studyline-editmode, .path-local-treestudyplan .sw-studyplan-toolbar,
.features-treestudyplan .sw-studyline-editmode { .features-treestudyplan .sw-studyplan-toolbar {
display: inline-block; display: inline-block;
} }
.path-local-treestudyplan .t-item-base .deletebox, .path-local-treestudyplan .t-item-base .deletebox,