Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div>
- <nav aria-label="breadcrumb">
- <ol class="breadcrumb breadcrumb-alt bg-white px-4 push font-size-sm">
- <li class="breadcrumb-item">
- <a href="#">
- <i class="fa fa-school"></i>
- </a>
- </li>
- <li class="breadcrumb-item" aria-current="page">
- <a href="#">
- Modules
- </a>
- </li>
- <li class="breadcrumb-item active" aria-current="page">
- <div class="dropdown d-inline">
- <a href="javascript:void(0)" id="example-dropdown-folder-2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- {{ module.name}} <i class="fa fa-angle-down ml-1"></i>
- </a>
- <div class="dropdown-menu font-size-sm" aria-labelledby="example-dropdown-folder-2" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 19px, 0px);">
- <a v-for="(m) in this.module.map.maps" class="dropdown-item" @click="openMap(m)">
- <i class="fa fa-folder mr-1"></i> {{ m.name }}
- </a>
- </div>
- </div>
- </li>
- <li class="breadcrumb-item" aria-current="page">
- <a href="#" @click="openMap(module.map)">
- Hoofdmap
- </a>
- </li>
- <li v-for="(bc) in breadcrumbs" class="breadcrumb-item" aria-current="page">
- <a href="#" @click="openMap(bc.id)">
- {{ bc.name }}
- </a>
- </li>
- </ol>
- </nav>
- <h2 class="content-heading border-black-op">
- <i class="far fa-fw fa-folder mr-1"></i> Mappen ({{ map.maps.length}})
- <div class="input-group col-xl-4" style="float: right;">
- <input placeholder="Map naam" type="text" class="form-control" v-model="mapNameInput">
- <button class="btn btn-primary" @click="addMap()">Toevoegen</button>
- </div>
- </h2>
- <div class="row items-push">
- <div v-for="(m) in map.maps" class="col-sm-6 col-md-4 col-xl-3 d-flex align-items-center">
- <div class="options-container fx-overlay-zoom-in w-100">
- <div class="options-item block block-rounded block-transparent mb-0">
- <div class="block-content text-center">
- <p class="mb-2">
- <i class="fa fa-folder fa-4x text-info"></i>
- </p>
- <p class="font-w600 font-size-lg mb-0">
- {{ m.name}}
- </p>
- <p class="font-size-sm text-muted">
- {{ m.maps.length }} Mappen
- </p>
- </div>
- </div>
- <div class="options-overlay rounded-lg bg-white-50">
- <div class="options-overlay-content">
- <div class="mb-3">
- <a class="btn btn-hero-light" @click="openMap(m)">
- <i class="fa fa-share text-primary mr-1"></i> Open
- </a>
- </div>
- <div class="btn-group">
- <a class="btn btn-sm btn-light" href="javascript:void(0)">
- <i class="fa fa-pencil-alt text-black mr-1"></i>
- </a>
- <button class="btn btn-sm btn-light" @click="deleteMap(m)">
- <i class="fa fa-trash text-danger mr-1"></i>
- </button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <h2 class="content-heading border-black-op">
- <i class="far fa-fw fa-file mr-1"></i> Leermiddelen ({{ map.resources.length }})
- </h2>
- <div class="row items-push">
- <div v-for="(resource) in map.resources" class="col-sm-6 col-md-4 col-xl-3 d-flex align-items-center">
- <div class="options-container w-100">
- <div class="options-item block block-rounded block-transparent mb-0">
- <div class="block-content text-center">
- <p class="mb-2 overflow-hidden">
- <i class="fa fa-fw fa-4x fa-file-powerpoint text-warning"></i>
- </p>
- <p class="font-w600 mb-0">
- {{ resource.name }}
- </p>
- <p class="font-size-sm text-muted">
- 4.5mb
- </p>
- </div>
- </div>
- <div class="options-overlay rounded-lg bg-white-50">
- <div class="options-overlay-content">
- <div class="mb-3">
- <a class="btn btn-hero-light" href="javascript:void(0)">
- <i class="fa fa-eye text-primary mr-1"></i> View
- </a>
- </div>
- <div class="btn-group">
- <a class="btn btn-sm btn-light" href="javascript:void(0)">
- <i class="fa fa-download text-black mr-1"></i>
- </a>
- <a class="btn btn-sm btn-light" href="javascript:void(0)">
- <i class="fa fa-trash text-danger mr-1"></i>
- </a>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- <div class="row">-->
- <!-- <div class="col-md-3">-->
- <!-- <div class="block block-rounded block-themed">-->
- <!-- <div class="block-header block-header-default">-->
- <!-- Mappen overzicht-->
- <!-- </div>-->
- <!-- <div class="block-content">-->
- <!-- <ul>-->
- <!-- </ul>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="col-md-9">-->
- <!-- <div class="block block-rounded">-->
- <!-- <div class="block-content">-->
- <!-- <div class="clearfix">-->
- <!-- <h5 class="float-left">Map naam</h5>-->
- <!-- <div class="float-right">-->
- <!-- <button class="btn btn-secondary btn-sm" @click="CreateMapForm('show')" v-if="this.create_map_visible == 0">Map toevoegen</button>-->
- <!-- <button class="btn btn-secondary btn-sm" @click="CreateMapForm('hide')" v-if="create_map_visible == 1">Map toevoegen verbergen</button>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="form-group pt-2" v-if="create_map_visible == 1">-->
- <!-- <div class="input-group">-->
- <!-- <input type="text" class="form-control form-control-sm" v-model="mapNameInput" placeholder="Map toevoegen">-->
- <!-- <div class="input-group-append">-->
- <!-- <button type="button" class="btn btn-secondary" @click="addMap()">Toevoegen</button>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <hr />-->
- <!-- <table class="table table-borderless table-striped table-vcenter">-->
- <!-- <thead class="bg-white">-->
- <!-- <tr class="text-uppercase font-size-sm">-->
- <!-- <th class="text-center" style="width: 50px;">Type</th>-->
- <!-- <th>Naam</th>-->
- <!-- <th class="text-center" style="width: 100px;">Acties</th>-->
- <!-- </tr>-->
- <!-- </thead>-->
- <!-- <tbody>-->
- <!-- <tr>-->
- <!-- <th class="text-center" scope="row">1</th>-->
- <!-- <td class="font-w600">-->
- <!-- <a href="be_pages_generic_profile.html">Jack Estrada</a>-->
- <!-- </td>-->
- <!-- <td class="text-center">-->
- <!-- <div class="btn-group">-->
- <!-- <button type="button" class="btn btn-sm btn-primary js-tooltip-enabled" data-toggle="tooltip" title="" data-original-title="Edit">-->
- <!-- <i class="fa fa-pencil-alt"></i>-->
- <!-- </button>-->
- <!-- <button type="button" class="btn btn-sm btn-primary js-tooltip-enabled" data-toggle="tooltip" title="" data-original-title="Delete">-->
- <!-- <i class="fa fa-times"></i>-->
- <!-- </button>-->
- <!-- </div>-->
- <!-- </td>-->
- <!-- </tr>-->
- <!-- </tbody>-->
- <!-- </table>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- </div>-->
- </template>
- <script>
- export default {
- props: ['moduleProp'],
- data() {
- return {
- module: this.moduleProp,
- map: this.moduleProp.map,
- create_map_visible: 0,
- mapNameInput: '',
- breadcrumbs: [],
- }
- },
- mounted() {
- this.updateBreadcrumb();
- },
- methods: {
- updateBreadcrumb()
- {
- while(map.map) {
- breadcrumbs.push({
- 'name': map.name,
- 'id': map.id,
- });
- }
- },
- openMap(map) {
- // Make post request to server
- axios.get(`/staff/maps/` + map.id).then((response) => {
- this.map = response.data;
- }).catch(err => console.log(err));
- this.updateBreadcrumb();
- },
- CreateMapForm(action) {
- switch(action) {
- case('show'):
- this.create_map_visible = 1;
- break;
- case('hide'):
- this.create_map_visible = 0;
- break;
- }
- },
- addMap() {
- // POST REQUEST
- axios.post(`/staff/maps/` + this.map.id + `/create`, {
- name: this.mapNameInput,
- }).then((response) => {
- this.map = response.data;
- this.mapNameInput = '';
- }).catch(err => console.log(err));
- },
- deleteMap(map) {
- swal({
- title: "Weet je het zeker?",
- text: "Eenmaal verwijderd kunt u \'"+ map.name +"\' niet terug halen.",
- icon: "warning",
- buttons: ["Annuleren", "Ok"],
- dangerMode: true,
- }).then((willDelete) => {
- if(willDelete) {
- axios.delete(`/staff/maps/` + map.id + `/delete`)
- .then((response) => {
- this.map = response.data;
- swal({
- title: "Map verwijderd!",
- icon: "success",
- });
- }).catch((error) => {
- if(error) {
- console.log(error);
- }
- })
- }
- });
- }
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement