<commit_before>{% extends 'reviews/base.html' %}
{% block allreviews %}{{ block.super }}{% endblock %}
{% block allreviewers %}{{ block.super }}{% endblock %}
{% block loginout %}{{ block.super }}{% endblock %}
{% block allcomics %}{{ block.super }}{% endblock %}

{% block comicstags %}
    {{ block.super }}
    <script>$( "#menubtn_comicswithtags" ).button({  disabled: true });</script>
{% endblock %}

{% block title %}
    {{ block.super }}: Comics by Tag
{% endblock %}

{% block content %}
    {% if comic_list %}
        <table class="comicstags" id="comicstags"></table>
        <script>
            tableid = "comicstags";
            $(document).ready(function() {
                comicTagTable = $('#'+tableid).dataTable({
                    "bProcessing" : true,
                    "sPaginationType" : "full_numbers",
                    "iDisplayLength"  : 15,
                    "bLengthChange"   : false,
                    "bDeferRender"    : true,
                    "oSearch"         : {"sSearch": "{{ search_tag }}",},
                    "fnDrawCallback"  : function(){ /* hide pagination if single-page results */
                            if ( $('#'+tableid+'_paginate span a.paginate_button').size() ) {
                                $('#'+tableid+'_paginate')[0].style.display = "block";
                            } else {
                                $('#'+tableid+'_paginate')[0].style.display = "none";
                            }
                        },                    
                    "aoColumns" : [
                        {'sTitle' : 'Avg. Stars', 'sWidth' : '7em', "asSorting" : ["desc", "asc"], "bSearchable" : false},
                        {'sTitle' : 'Comic', 'sWidth' : '8em', "bSearchable" : false},
                        {'sTitle' : 'Tags', "asSorting" : []},
                    ],
                    "aaSorting"       : [[1, 'asc']],
                    "aaData" : [
                        {% for comic in comic_list %}
                            [
                                {% with avg=comic.average_rating count=comic.review_set.count %}
                                    '<span class="rateit" data-rateit-value="{{ avg }}" ' + 
                                        'data-rateit-ispreset="true" data-rateit-readonly="true"></span>' + 
                                        '({{ avg }})',
                                    '<a href="{% url 'comicdetail' comic.id %}">{{ comic.name }}</a>',
                                    {% for tag in comic.comictag_set.all %}
                                        '<button class="tagbtn" onclick="comicTagTable.fnFilter(\'{{ tag }}\');">{{ tag }}</button>'+
                                    {% endfor %}
                                    '',
                                {% endwith %}
                            ],
                        {% endfor %}
                    ],<commit_msg>adjust tags view<commit_after>{% extends 'reviews/base.html' %}
{% block allreviews %}{{ block.super }}{% endblock %}
{% block allreviewers %}{{ block.super }}{% endblock %}
{% block loginout %}{{ block.super }}{% endblock %}
{% block allcomics %}{{ block.super }}{% endblock %}

{% block comicstags %}
    {{ block.super }}
    <script>$( "#menubtn_comicswithtags" ).button({  disabled: true });</script>
{% endblock %}

{% block title %}
    {{ block.super }}: Comics by Tag
{% endblock %}

{% block content %}
    {% if comic_list %}
        <table class="comicstags" id="comicstags"></table>
        <script>
            tableid = "comicstags";
            $(document).ready(function() {
                comicTagTable = $('#'+tableid).dataTable({
                    "bProcessing" : true,
                    "bPaginate"   : false,
                    "sScrollY": "30em",
                    "bDeferRender"    : true,
                    "oSearch"         : {"sSearch": "{{ search_tag }}",},
                    "fnDrawCallback"  : function(){ /* hide pagination if single-page results */
                            if ( $('#'+tableid+'_paginate span a.paginate_button').size() ) {
                                $('#'+tableid+'_paginate')[0].style.display = "block";
                            } else {
                                $('#'+tableid+'_paginate')[0].style.display = "none";
                            }
                        },                    
                    "aoColumns" : [
                        {'sTitle' : 'Avg. Stars', 'sWidth' : '7em', "asSorting" : ["desc", "asc"], "bSearchable" : false},
                        {'sTitle' : 'Comic', 'sWidth' : '8em', "bSearchable" : false},
                        {'sTitle' : 'Tags', 'iDataSort' : 3},
                        {'sTitle' : 'numTags', "asSorting" : ['desc', 'asc'], 'bSearchable':false, 'bVisible':false},
                    ],
                    "aaSorting"       : [[2, 'desc']],
                    "aaData" : [
                        {% for comic in comic_list %}
                            [
                                {% with avg=comic.average_rating count=comic.review_set.count %}
                                    '<span class="rateit" data-rateit-value="{{ avg }}" ' + 
                                        'data-rateit-ispreset="true" data-rateit-readonly="true"></span>' + 
                                        '({{ avg }})',
                                    '<a href="{% url 'comicdetail' comic.id %}">{{ comic.name }}</a>',
                                    {% for tag in comic.comictag_set.all %}
                                        '<button class="tagbtn" onclick="comicTagTable.fnFilter(\'{{ tag }}\');">{{ tag }}</button>'+
                                    {% endfor %}
                                    '',
                                    {{ comic.comictag_set.count }},
                                {% endwith %}
                            ],
                        {% endfor %}
                    ],
{'fraction_non_alphanumeric': 0.16374269005847952, 'fraction_numerical': 0.002506265664160401, 'mean_word_length': 1.1846715328467152, 'pattern_counts': {'":': 3, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 27, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4812966', 'n_tokens_mistral': 1662, 'n_tokens_neox': 1535, 'n_words': 281}