<commit_before>{% extends "admin/change_list.html" %}
{% load i18n admin_modify adminmedia mptt_tags %}

{% block title %}{{ block.super }}{% endblock %}

{% block extrahead %}{{ block.super }}
{% full_tree_for_model feincms.Page as pages %}
<script type="text/javascript" src="../../../jsi18n/"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery-1.3.min.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.ui.all.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.livequery.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.alerts.js"></script>

<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}helper.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}listener.js"></script>

<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.treeTable.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.json-1.3.js"></script>
<script type="text/javascript">

    ancestors = [];
    {% for page, structure in pages|tree_info %}
        {% if page.parent %}ancestors[{{ forloop.counter0 }}] = '{{ page.parent.id }}';{% else %}ancestors[{{ forloop.counter0 }}] = '0';{% endif %}
    {% endfor %}

    tablestr = [];
    {% for page, structure in pages|tree_info %}
        {% if page.parent %}
            tablestr += add_row({{ forloop.counter }},{{ page.id }},"{{ page.title }}","{{ page.active }}","{{ page.in_navigation }}","{{ page.parent.id }}" )
        {% else %}
            tablestr += add_row({{ forloop.counter }},{{ page.id }},"{{ page.title }}","{{ page.active }}","{{ page.in_navigation }}",-1)
        {% endif %}
    {% endfor %}

    function add_row(node_id, page_id, page_title, is_active, in_navi, parent_id) {
        var str = '<tr id="node-' + node_id + '" class="page-id-' + page_id + ' ';
        if (parseInt(parent_id) >= 0)
            str += 'child-of-node-'+ancestors.indexOf(parent_id);
        str += '">';
        str += '<td><div class="wrap nohover">';
        str += '<div class="insert-as-child"></div>';
        str += '<span class="title-col"><a href="'+page_id+'"><strong>'+page_title+'</strong></a><img class="move-node" src="{{ FEINCMS_ADMIN_MEDIA }}img/icon_move.gif" /></span>';
        str += '<div class="insert-as-sibling"></div>';
        str += '</div></td>';
        str += '<td>'+is_active+'</td>';
        str += '<td>'+in_navi+'</td>';<commit_msg>Make generated javascript code terser<commit_after>{% extends "admin/change_list.html" %}
{% load i18n admin_modify adminmedia mptt_tags %}

{% block title %}{{ block.super }}{% endblock %}

{% block extrahead %}{{ block.super }}
{% full_tree_for_model feincms.Page as pages %}
<script type="text/javascript" src="../../../jsi18n/"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery-1.3.min.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.ui.all.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.livequery.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.alerts.js"></script>

<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}helper.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}listener.js"></script>

<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.treeTable.js"></script>
<script type="text/javascript" src="{{ FEINCMS_ADMIN_MEDIA }}jquery.json-1.3.js"></script>
<script type="text/javascript">



    ancestors = [{% for page in pages %}'{{ page.parent_id|default_if_none:"0" }}'{% if not forloop.last %},{% endif %} {% endfor %}];

    tablestr = '';
    {% for page in pages %}tablestr += add_row({{ forloop.counter }}, {{ page.id }}, "{{ page.title }}", "{{ page.active }}", "{{ page.in_navigation }}", "{{ page.parent_id|default_if_none:"-1" }}");
    {% endfor %}

    function add_row(node_id, page_id, page_title, is_active, in_navi, parent_id) {
        var str = '<tr id="node-' + node_id + '" class="page-id-' + page_id + ' ';
        if (parseInt(parent_id) >= 0)
            str += 'child-of-node-'+ancestors.indexOf(parent_id);
        str += '">';
        str += '<td><div class="wrap nohover">';
        str += '<div class="insert-as-child"></div>';
        str += '<span class="title-col"><a href="'+page_id+'"><strong>'+page_title+'</strong></a><img class="move-node" src="{{ FEINCMS_ADMIN_MEDIA }}img/icon_move.gif" /></span>';
        str += '<div class="insert-as-sibling"></div>';
        str += '</div></td>';
        str += '<td>'+is_active+'</td>';
        str += '<td>'+in_navi+'</td>';
{'fraction_non_alphanumeric': 0.22911338448422847, 'fraction_numerical': 0.005115089514066497, 'mean_word_length': 4.179911699779249, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2135508', 'n_tokens_mistral': 1672, 'n_tokens_neox': 1603, 'n_words': 290}