Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/assets/vue/views/course/CatalogSession.vue

73 lines
1.6 KiB

<template>
<div class="card">
Session catalog todo
</div>
</template>
<script>
import {ENTRYPOINT} from '../../config/entrypoint';
import axios from "axios";
import Dropdown from "primevue/dropdown";
import DataView from 'primevue/dataview';
import DataViewLayoutOptions from 'primevue/dataviewlayoutoptions';
export default {
name: 'Catalog',
components: {
DataView,
Dropdown,
DataViewLayoutOptions
},
data() {
return {
status: '',
courses: [],
layout: 'list',
sortKey: null,
sortOrder: null,
sortField: null,
sortOptions: [
{label: 'A-z', value: 'title'},
{label: 'Z-a', value: '!title'},
]
};
},
created: function () {
this.load();
},
mounted: function () {
},
methods: {
load: function () {
//this.status = 'Loading';
//let user = this.$store.getters['security/getUser'];
axios.get(ENTRYPOINT + 'courses.json').then(response => {
this.status = '';
if (Array.isArray(response.data)) {
this.courses = response.data;
}
}).catch(function (error) {
console.log(error);
});
},
onSortChange(event) {
const value = event.value.value;
const sortValue = event.value;
if (value.indexOf('!') === 0) {
this.sortOrder = -1;
this.sortField = value.substring(1, value.length);
this.sortKey = sortValue;
}
else {
this.sortOrder = 1;
this.sortField = value;
this.sortKey = sortValue;
}
}
}
};
</script>