{% extends "base.html" %} {% block header_script_files %} {% endblock %} {% block header %} {{ emit_tep('all_volumes_page_header') }} {% endblock %} {% block content %}
{% endblock %} {% block modals %} {{ emit_tep('all_volumes_modals') }} {% endblock %} {% block button_container %} {% if current_user.role == 'admin' %} {% endif %} {{ emit_tep('all_volumes_button_container') }} {% endblock %} {% block script %} Vue.component('volume-item', { props: ['volume'], template: `
  • [[ volume.age_rating[0].rating_short ]]
    [[ volume.volume_have ]]/[[ volume.volume_total ]]
    [[ statusWord ]]
  • `, computed: { statusClass() { let classname = 'bg-danger'; if(this.volume.volume_status) { classname = 'bg-success'; }; return classname; }, statusWord() { let status = 'ENDED'; if(this.volume.volume_status) { status = 'ONGOING'; }; return status; } }, data() { return { hover: false } }, delimiters: ["[[","]]"], }) Vue.component('volumes', { props: ['volumes'], template: `
    `, data() { return { loading: true, search: '', } }, computed: { filteredList() { return this.volumes.filter(volume => { return volume.volume_name.toLowerCase().includes(this.search.toLowerCase()) }) }, }, delimiters: ["[[","]]"], }) var app = new Vue({ el: '#app', data: { volumesList: [], }, created() { this.getVolumes() }, methods:{ getVolumes() { axios.get('{{ url_for('api.api_get_all_volumes') }}', { params: { offset: this.volumesList.length } }) .then(res => { if(res.data.number_of_page_results > 0) { res.data.results.forEach(result => { this.volumesList.push(result) }) if(this.volumesList.length < res.data.number_of_total_results) { this.getVolumes() } } }) }, }, delimiters: ["[[","]]"] }); {{ emit_tep('all_volumes_page_script') }} {% endblock %}