{% extends "base.html" %} {% block header_script_files %} {% endblock %} {% block header %} {{ emit_tep('single_publisher_page_header', publisher_id=publisher_id) }} {% endblock %} {% block content %}
{% endblock %} {% block modals %} {{ emit_tep('single_publisher_page_modals', publisher_id=publisher_id) }} {% endblock %} {% block button_container %} {{ emit_tep('single_publisher_page_button_container', publisher_id=publisher_id) }} {% endblock %} {% block script %} 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: ["[[","]]"], }) 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('publisher-jumbo', { props: ['publisher'], template: `

    [[ publisher.publisher_name ]]

    `, computed: {}, methods: {}, created() {}, delimiters: ["[[","]]"] }) var app = new Vue({ el: '#app', data: { publisher: [], volumes: [], }, created() { this.getPublisher(); this.getVolumes(); }, methods: { getPublisher() { axios.get('{{ url_for('api.api_get_single_publisher', publisher_id=publisher_id) }}') .then(res => { console.log(res) if(res.data.status_code == 200) { console.log('woooo') this.publisher = res.data.results } else { displayToast(res.data.message, 'error') } }) .catch(err => console.log('boo-'+err)) }, getVolumes() { console.log('getting vols') axios.get('{{ url_for('api.api_get_single_publisher_volumes', publisher_id=publisher_id) }}', { params: { offset: this.volumes.length } }) .then(res => { // console.log(res) if(res.data.number_of_page_results > 0) { res.data.results.forEach(result => { this.volumes.push(result) this.publisher = this.volumes[0].publisher }); if(this.volumes.length < res.data.number_of_total_results) { this.getVolumes(); } } }) .catch(err => console.log('ERROR: ' + err)) // this.publisher = this.volumes[0].publisher }, }, delimiters: ["[[","]]"] }) {{ emit_tep('single_publisher_page_script', publisher_id=publisher_id) }} {% endblock %}