Internal: Vue UI changes replacing vuetify with bootstrap-vue

pull/3466/head
Julio Montoya 5 years ago
parent 6e1d2440ff
commit 019e7ab938
  1. 2
      assets/vue/components/Snackbar.vue
  2. 147
      assets/vue/components/Toolbar.vue
  3. 34
      assets/vue/components/documents/Form.vue
  4. 75
      assets/vue/components/documents/FormNewDocument.vue
  5. 5
      assets/vue/components/layout/Header.vue
  6. 26
      assets/vue/components/layout/Sidebar.vue
  7. 14
      assets/vue/views/documents/Create.vue
  8. 14
      assets/vue/views/documents/CreateFile.vue
  9. 18
      assets/vue/views/documents/Update.vue
  10. 20
      assets/vue/views/documents/UpdateFile.vue
  11. 13
      assets/vue/views/documents/Upload.vue
  12. 1
      public/main/inc/lib/formvalidator/FormValidator.class.php
  13. 2
      public/main/template/default/admin/index.html.twig

@ -3,7 +3,7 @@
<b-alert <b-alert
v-model="show" v-model="show"
:variant="color" :variant="color"
:dismiss-secs="timeout" dismissible
> >
{{ text }} {{ text }}
<template v-if="subText"> <template v-if="subText">

@ -1,82 +1,79 @@
<template> <template>
<v-toolbar <div class="">
class="my-md-auto" <br>
elevation="0"
>
<slot name="left" /> <slot name="left" />
<v-spacer />
<div>
<b-button
v-if="handleList"
:loading="isLoading"
variant="primary"
@click="listItem"
>
{{ $t('List') }}
</b-button>
<b-button
v-if="handleEdit"
:loading="isLoading"
variant="primary"
@click="editItem"
>
{{ $t('Edit') }}
</b-button>
<b-button
v-if="handleSubmit"
:loading="isLoading"
variant="primary"
@click="submitItem"
>
<v-icon left>
mdi-content-save
</v-icon>
{{ $t('Submit') }}
</b-button>
<!-- <v-btn-->
<!-- v-if="handleReset"-->
<!-- color="primary"-->
<!-- class="ml-sm-2"-->
<!-- @click="resetItem"-->
<!-- >-->
<!-- {{ $t('Reset') }}-->
<!-- </v-btn>-->
<b-button
v-if="handleDelete"
variant="danger"
class="ml-sm-2"
@click="confirmDelete = true"
>
{{ $t('Delete') }}
</b-button>
<b-button <b-button
v-if="handleAdd" v-if="handleList"
variant="primary" :loading="isLoading"
rounded variant="primary"
@click="addItem" @click="listItem"
> >
<font-awesome-icon icon="folder-plus" /> New folder {{ $t('List') }}
</b-button> </b-button>
<b-button
v-if="handleEdit"
:loading="isLoading"
variant="primary"
@click="editItem"
>
{{ $t('Edit') }}
</b-button>
<b-button
v-if="handleSubmit"
:loading="isLoading"
variant="primary"
@click="submitItem"
>
<v-icon left>
mdi-content-save
</v-icon>
{{ $t('Submit') }}
</b-button>
<!-- <v-btn-->
<!-- v-if="handleReset"-->
<!-- color="primary"-->
<!-- class="ml-sm-2"-->
<!-- @click="resetItem"-->
<!-- >-->
<!-- {{ $t('Reset') }}-->
<!-- </v-btn>-->
<b-button
v-if="handleDelete"
variant="danger"
class="ml-sm-2"
@click="confirmDelete = true"
>
{{ $t('Delete') }}
</b-button>
<b-button
v-if="handleAdd"
variant="primary"
rounded
@click="addItem"
>
<font-awesome-icon icon="folder-plus" /> New folder
</b-button>
<b-button <b-button
v-if="handleAddDocument" v-if="handleAddDocument"
variant="primary" variant="primary"
rounded rounded
@click="addDocument" @click="addDocument"
> >
<font-awesome-icon icon="file-alt" /> New document <font-awesome-icon icon="file-alt" /> New document
</b-button> </b-button>
<b-button <b-button
v-if="handleUploadDocument" v-if="handleUploadDocument"
variant="primary" variant="primary"
rounded rounded
@click="uploadDocument" @click="uploadDocument"
> >
<font-awesome-icon icon="cloud-upload-alt" /> File upload <font-awesome-icon icon="cloud-upload-alt" /> File upload
</b-button> </b-button>
</div>
<ConfirmDelete <ConfirmDelete
v-if="handleDelete" v-if="handleDelete"
@ -84,7 +81,7 @@
:handle-delete="handleDelete" :handle-delete="handleDelete"
@close="confirmDelete = false" @close="confirmDelete = false"
/> />
</v-toolbar> </div>
</template> </template>
<script> <script>

@ -1,23 +1,21 @@
<template> <template>
<v-form> <v-form>
<b-container fluid> <b-row>
<b-row> <b-col
<b-col cols="12"
cols="12" sm="6"
sm="6" md="6"
md="6" >
> <b-form-input
<b-form-input v-model="item.title"
v-model="item.title" :error-messages="titleErrors"
:error-messages="titleErrors" :placeholder="$t('Title')"
:placeholder="$t('Title')" required
required @input="$v.item.title.$touch()"
@input="$v.item.title.$touch()" @blur="$v.item.title.$touch()"
@blur="$v.item.title.$touch()" />
/> </b-col>
</b-col> </b-row>
</b-row>
</b-container>
</v-form> </v-form>
</template> </template>

@ -1,12 +1,12 @@
<template> <template>
<v-form> <b-form>
<b-container fluid> <b-row>
<b-row> <b-col
<b-col cols="12"
cols="12" sm="6"
sm="6" md="6"
md="6" >
> <b-form-group>
<b-form-input <b-form-input
v-model="item.title" v-model="item.title"
:error-messages="titleErrors" :error-messages="titleErrors"
@ -15,19 +15,21 @@
@input="$v.item.title.$touch()" @input="$v.item.title.$touch()"
@blur="$v.item.title.$touch()" @blur="$v.item.title.$touch()"
/> />
<editor </b-form-group>
v-if="item.resourceNode && item.resourceNode.fileEditableText || item.newDocument"
v-model="item.contentFile" <editor
:error-messages="contentFileErrors" v-if="item.resourceNode && item.resourceNode.fileEditableText || item.newDocument"
required v-model="item.contentFile"
:init="{ :error-messages="contentFileErrors"
skin_url: '/build/libs/tinymce/skins/ui/oxide', required
content_css: '/build/libs/tinymce/skins/content/default/content.css', :init="{
branding:false, skin_url: '/build/libs/tinymce/skins/ui/oxide',
height: 500, content_css: '/build/libs/tinymce/skins/content/default/content.css',
toolbar_mode: 'sliding', branding:false,
file_picker_callback : browser, height: 500,
/*file_picker_callback: function(callback, value, meta) { toolbar_mode: 'sliding',
file_picker_callback : browser,
/*file_picker_callback: function(callback, value, meta) {
// Provide file and text for the link dialog // Provide file and text for the link dialog
if (meta.filetype == 'file') { if (meta.filetype == 'file') {
callback('mypage.html', {text: 'My text'}); callback('mypage.html', {text: 'My text'});
@ -43,26 +45,25 @@
callback('movie.mp4', {source2: 'alt.ogg', poster: 'image.jpg'}); callback('movie.mp4', {source2: 'alt.ogg', poster: 'image.jpg'});
} }
},*/ },*/
/*images_upload_handler: (blobInfo, success, failure) => { /*images_upload_handler: (blobInfo, success, failure) => {
const img = 'data:image/jpeg;base64,' + blobInfo.base64(); const img = 'data:image/jpeg;base64,' + blobInfo.base64();
//console.log(img); //console.log(img);
success(img); success(img);
},*/ },*/
//menubar: true, //menubar: true,
autosave_ask_before_unload: true, autosave_ask_before_unload: true,
plugins: [ plugins: [
'fullpage advlist autolink lists link image charmap print preview anchor', 'fullpage advlist autolink lists link image charmap print preview anchor',
'searchreplace visualblocks code fullscreen', 'searchreplace visualblocks code fullscreen',
'insertdatetime media table paste wordcount' 'insertdatetime media table paste wordcount'
], ],
toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor code codesample | ltr rtl', toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor code codesample | ltr rtl',
} }
" "
/> />
</b-col> </b-col>
</b-row> </b-row>
</b-container> </b-form>
</v-form>
</template> </template>
<script> <script>

@ -2,7 +2,7 @@
<b-navbar <b-navbar
toggleable="lg" toggleable="lg"
type="dark" type="dark"
variant="info" variant="primary"
sticky sticky
> >
<b-navbar-brand href="/"> <b-navbar-brand href="/">
@ -74,10 +74,11 @@
<b-nav-item-dropdown <b-nav-item-dropdown
v-if="isAuthenticated" v-if="isAuthenticated"
right right
no-caret
> >
<!-- Using 'button-content' slot --> <!-- Using 'button-content' slot -->
<template v-slot:button-content> <template v-slot:button-content>
User <b-avatar variant="light" />
</template> </template>
<b-dropdown-item href="/main/messages/inbox.php"> <b-dropdown-item href="/main/messages/inbox.php">
Inbox Inbox

@ -18,6 +18,32 @@
Sessions Sessions
</b-list-group-item> </b-list-group-item>
<b-list-group-item
v-if="isAuthenticated"
/>
<b-list-group-item
v-if="isAuthenticated"
:to="'/main/admin/user_list.php'"
>
Users
</b-list-group-item>
<b-list-group-item
v-if="isAuthenticated"
:to="'/main/admin/course_list.php'"
>
Courses
</b-list-group-item>
<b-list-group-item
v-if="isAuthenticated"
:to="'/main/session/session_list.php'"
>
Sessions
</b-list-group-item>
<b-list-group-item <b-list-group-item
v-if="isAuthenticated" v-if="isAuthenticated"
:to="'/main/admin/index.php'" :to="'/main/admin/index.php'"

@ -1,7 +1,15 @@
<template> <template>
<div> <div>
<Toolbar :handle-submit="onSendForm" :handle-reset="resetForm"></Toolbar> <DocumentsForm
<DocumentsForm ref="createForm" :values="item" :errors="violations" /> ref="createForm"
:values="item"
:errors="violations"
/>
<Toolbar
:handle-submit="onSendForm"
:handle-reset="resetForm"
/>
<Loading :visible="isLoading" /> <Loading :visible="isLoading" />
</div> </div>
</template> </template>
@ -24,12 +32,12 @@ const { mapFields } = createHelpers({
export default { export default {
name: 'DocumentsCreate', name: 'DocumentsCreate',
servicePrefix, servicePrefix,
mixins: [CreateMixin],
components: { components: {
Loading, Loading,
Toolbar, Toolbar,
DocumentsForm DocumentsForm
}, },
mixins: [CreateMixin],
data() { data() {
return { return {
item: {}, item: {},

@ -1,7 +1,15 @@
<template> <template>
<div> <div>
<Toolbar :handle-submit="onSendForm" :handle-reset="resetForm"></Toolbar> <DocumentsForm
<DocumentsForm ref="createForm" :values="item" :errors="violations" /> ref="createForm"
:values="item"
:errors="violations"
/>
<Toolbar
:handle-submit="onSendForm"
:handle-reset="resetForm"
/>
<Loading :visible="isLoading" /> <Loading :visible="isLoading" />
</div> </div>
</template> </template>
@ -24,12 +32,12 @@ const { mapFields } = createHelpers({
export default { export default {
name: 'DocumentsCreate', name: 'DocumentsCreate',
servicePrefix, servicePrefix,
mixins: [CreateMixin],
components: { components: {
Loading, Loading,
Toolbar, Toolbar,
DocumentsForm DocumentsForm
}, },
mixins: [CreateMixin],
data() { data() {
return { return {
item: { item: {

@ -1,20 +1,20 @@
<template> <template>
<div> <div>
<DocumentsForm
v-if="item"
ref="updateForm"
:values="item"
:errors="violations"
/>
<Toolbar <Toolbar
:handle-submit="onSendForm" :handle-submit="onSendForm"
:handle-reset="resetForm" :handle-reset="resetForm"
:handle-delete="del" :handle-delete="del"
/> />
<DocumentsForm <ResourceLinkForm
ref="updateForm"
v-if="item" v-if="item"
ref="resourceLinkForm"
:values="item" :values="item"
:errors="violations"
/>
<ResourceLinkForm
ref="resourceLinkForm"
v-if="item"
:values="item"
/> />
<Loading :visible="isLoading || deleteLoading" /> <Loading :visible="isLoading || deleteLoading" />
@ -35,13 +35,13 @@ const servicePrefix = 'Documents';
export default { export default {
name: 'DocumentsUpdate', name: 'DocumentsUpdate',
servicePrefix, servicePrefix,
mixins: [UpdateMixin],
components: { components: {
Loading, Loading,
Toolbar, Toolbar,
DocumentsForm, DocumentsForm,
ResourceLinkForm ResourceLinkForm
}, },
mixins: [UpdateMixin],
computed: { computed: {
...mapFields('documents', { ...mapFields('documents', {

@ -1,22 +1,20 @@
<template> <template>
<div> <div>
<DocumentsForm
v-if="item"
ref="updateForm"
:values="item"
:errors="violations"
/>
<Toolbar <Toolbar
:handle-submit="onSendForm" :handle-submit="onSendForm"
:handle-reset="resetForm" :handle-reset="resetForm"
:handle-delete="del" :handle-delete="del"
/> />
<ResourceLinkForm
<DocumentsForm
ref="updateForm"
v-if="item" v-if="item"
ref="resourceLinkForm"
:values="item" :values="item"
:errors="violations"
/>
<ResourceLinkForm
ref="resourceLinkForm"
v-if="item"
:values="item"
/> />
<Loading :visible="isLoading || deleteLoading" /> <Loading :visible="isLoading || deleteLoading" />
@ -37,13 +35,13 @@ const servicePrefix = 'Documents';
export default { export default {
name: 'DocumentsUpdate', name: 'DocumentsUpdate',
servicePrefix, servicePrefix,
mixins: [UpdateMixin],
components: { components: {
Loading, Loading,
Toolbar, Toolbar,
DocumentsForm, DocumentsForm,
ResourceLinkForm ResourceLinkForm
}, },
mixins: [UpdateMixin],
data() { data() {
return { return {
}; };

@ -1,7 +1,14 @@
<template> <template>
<div> <div>
<Toolbar :handle-submit="onSendForm" :handle-reset="resetForm"></Toolbar> <DocumentsForm
<DocumentsForm ref="createForm" :values="item" :errors="violations" /> ref="createForm"
:values="item"
:errors="violations"
/>
<Toolbar
:handle-submit="onSendForm"
:handle-reset="resetForm"
/>
<Loading :visible="isLoading" /> <Loading :visible="isLoading" />
</div> </div>
</template> </template>
@ -24,12 +31,12 @@ const { mapFields } = createHelpers({
export default { export default {
name: 'DocumentsCreate', name: 'DocumentsCreate',
servicePrefix, servicePrefix,
mixins: [CreateMixin],
components: { components: {
Loading, Loading,
Toolbar, Toolbar,
DocumentsForm DocumentsForm
}, },
mixins: [CreateMixin],
data() { data() {
return { return {
item: { item: {

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -14,7 +14,7 @@
<div id="settings" > <div id="settings" >
<div class="row"> <div class="row">
{% for block_item in blocks_admin %} {% for block_item in blocks_admin %}
<div id="tabs-{{ loop.index }}" class="col"> <div id="tabs-{{ loop.index }}" class="col-4">
<div class="card mb-4"> <div class="card mb-4">
<div class="card-header"> <div class="card-header">
<h5 class="card-title">{{ block_item.icon }} {{ block_item.label }}</h5> <h5 class="card-title">{{ block_item.icon }} {{ block_item.label }}</h5>

Loading…
Cancel
Save