<commit_before>{% extends "base_with_margins.html" %}
{% load extras %}
{% load staticfiles %}
{% block title %}{{committee.name}}{% endblock %}
{% block content %}

    <div class="row-fluid">
        <div class="col-sm-12">
            <br/>
            <h1>{{committee.name}}</h1>
            {% if committee_description %}
                <p>{{committee_description}}</p>
            {% endif %}
            {% if committee.source_url %}
                <p class="small">
                    <a href='{{committee.source_url}}' title='View the source for this page' target="_blank">
                        <i class='fa fa-fw fa-external-link'></i> 
                        View the source for this page
                    </a>
                </p>
            {% endif %}

            <hr />
            <ul class="nav nav-pills">
              <li role="presentation" {% if request.GET.view != 'members' %}class='active' {% endif %}><a href="/committee/{{committee.slug}}?view=actions"><i class='fa fa-fw fa-list-ul'></i><span class="desktop-only"> Committee</span> Activity</a></li>
              <li role="presentation" {% if request.GET.view == 'members' %}class='active' {% endif %}><a href="/committee/{{committee.slug}}?view=members"><i class='fa fa-fw fa-group'></i><span class="desktop-only"> Committee</span> Members ({{ committee.memberships.all|length }})</a></li>
            </ul>

            {% if request.GET.view != 'members' %}
                <h3><i class='fa fa-fw fa-list-ul'></i> Committee Activity</h3>
                {% if committee.recent_activity %}
                <div class="table-responsive">
                    <table class='table' id='committee-actions'>
                        <thead>
                            <tr>
                                <th>Date</th>
                                <th>Legislation</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for action in committee.recent_activity %}
                                <tr>
                                    <td class='nowrap text-muted small'>{{action.date|date:'n/d/Y'}}</td>
                                    <td><a href="/legislation/{{action.bill.slug}}">{{action.bill.friendly_name}}</a></td>
                                    <td><span class='text-{{action.label}}'>{{action.description | remove_action_subj}}</span></td>
                                </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
                {% else %}
                    <p>No recent activity</p>
                {% endif %}
            {% endif %}


            {% if request.GET.view == 'members' %}
                <h3><i class='fa fa-fw fa-group'></i> Committee Members</h3>
                <table class='table' id='council-members'>
                    <thead>
                        <tr>
                            <th></th>
                            <th>Committee Member</th>
                            <th>
                                {% if MUNICIPAL_DISTRICT_NAME %}
                                    {{MUNICIPAL_DISTRICT_NAME}}
                                {% else %}
                                    District
                                {% endif %}
                            </th>
                            <th>Role</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for membership in committee.chairs %}
                            <tr>
                                <td>
                                    <img src='{{membership.person.headshot_url}}' alt='{{membership.person.name}}' title='{{membership.person.name}}' class='img-responsive img-thumbnail' />
                                </td>
                                <td>
                                    {{ membership.person.link_html | safe }}
                                </td>
                                <td>
                                    {{membership.person.council_seat}}
                                </td>
                                <td>
                                    Chairperson
                                </td>
                            </tr>
                        {% endfor %}
                        {% for membership in committee.non_chair_members %}
                            <tr>
                                <td>
                                    <img src='{{membership.person.headshot_url}}' alt='{{membership.person.name}}' title='{{membership.person.name}}' class='img-responsive img-thumbnail' />
                                </td>
                                <td>
                                    {{ membership.person.link_html | safe }}
                                </td>
                                <td>
                                    {{membership.person.council_seat}}
                                </td>
                                <td>
                                    Member
                                </td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            {% endif %}
        </div>
    </div>

{% endblock %}

{% block extra_js %}
    <script src="{% static 'js/jquery.dataTables.min.js' %}"></script>
    <script src="{% static 'js/jquery.dataTables.sorting.js' %}"></script>
    <script src="{% static 'js/dataTables.bootstrap.js' %}"></script>

    <script>
        $("#council-members").DataTable({
            "info": false,
            "searching": false,
            "bLengthChange": false,
            "paging": false,
            "aaSorting": [ [3,'asc'] ],
            "aoColumns": [
                { "bSortable": false },
                null,
                { "sType": "num-html" },
                null
            ]
        });

        // for reference purposes
        console.log( "OCD ID: {{committee.ocd_id}}" )

    </script>
{% endblock %}<commit_msg>js to expand/collapse committee activity table<commit_after>{% extends "base_with_margins.html" %}
{% load extras %}
{% load staticfiles %}
{% block title %}{{committee.name}}{% endblock %}
{% block content %}

    <div class="row-fluid">
        <div class="col-sm-12">
            <br/>
            <h1>{{committee.name}}</h1>
            {% if committee_description %}
                <p>{{committee_description}}</p>
            {% endif %}
            {% if committee.source_url %}
                <p class="small">
                    <a href='{{committee.source_url}}' title='View the source for this page' target="_blank">
                        <i class='fa fa-fw fa-external-link'></i> 
                        View the source for this page
                    </a>
                </p>
            {% endif %}

            <hr />
            <ul class="nav nav-pills">
              <li role="presentation" {% if request.GET.view != 'members' %}class='active' {% endif %}><a href="/committee/{{committee.slug}}?view=actions"><i class='fa fa-fw fa-list-ul'></i><span class="desktop-only"> Committee</span> Activity</a></li>
              <li role="presentation" {% if request.GET.view == 'members' %}class='active' {% endif %}><a href="/committee/{{committee.slug}}?view=members"><i class='fa fa-fw fa-group'></i><span class="desktop-only"> Committee</span> Members ({{ committee.memberships.all|length }})</a></li>
            </ul>

            {% if request.GET.view != 'members' %}
                <h3><i class='fa fa-fw fa-list-ul'></i> Committee Activity</h3>
                {% if committee.recent_activity %}
                <div class="table-responsive">
                    <table class='table' id='committee-actions'>
                        <thead>
                            <tr>
                                <th>Date</th>
                                <th>Legislation</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for action in committee.recent_activity %}
                                <tr class="activity-row">
                                    <td class='nowrap text-muted small'>{{action.date|date:'n/d/Y'}}</td>
                                    <td><a href="/legislation/{{action.bill.slug}}">{{action.bill.friendly_name}}</a></td>
                                    <td><span class='text-{{action.label}}'>{{action.description | remove_action_subj}}</span></td>
                                </tr>
                            {% endfor %}
                            <tr>
                                <td colspan="3" align="center">
                                    <a href="" id="more-activity"><i class="fa fa-fw fa-chevron-down"></i>Show more</a>
                                    <a href="" id="less-activity"><i class="fa fa-fw fa-chevron-up"></i>Show less</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>

                {% else %}
                    <p>No recent activity</p>
                {% endif %}
            {% endif %}


            {% if request.GET.view == 'members' %}
                <h3><i class='fa fa-fw fa-group'></i> Committee Members</h3>
                <table class='table' id='council-members'>
                    <thead>
                        <tr>
                            <th></th>
                            <th>Committee Member</th>
                            <th>
                                {% if MUNICIPAL_DISTRICT_NAME %}
                                    {{MUNICIPAL_DISTRICT_NAME}}
                                {% else %}
                                    District
                                {% endif %}
                            </th>
                            <th>Role</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for membership in committee.chairs %}
                            <tr>
                                <td>
                                    <img src='{{membership.person.headshot_url}}' alt='{{membership.person.name}}' title='{{membership.person.name}}' class='img-responsive img-thumbnail' />
                                </td>
                                <td>
                                    {{ membership.person.link_html | safe }}
                                </td>
                                <td>
                                    {{membership.person.council_seat}}
                                </td>
                                <td>
                                    Chairperson
                                </td>
                            </tr>
                        {% endfor %}
                        {% for membership in committee.non_chair_members %}
                            <tr>
                                <td>
                                    <img src='{{membership.person.headshot_url}}' alt='{{membership.person.name}}' title='{{membership.person.name}}' class='img-responsive img-thumbnail' />
                                </td>
                                <td>
                                    {{ membership.person.link_html | safe }}
                                </td>
                                <td>
                                    {{membership.person.council_seat}}
                                </td>
                                <td>
                                    Member
                                </td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            {% endif %}
        </div>
    </div>

{% endblock %}

{% block extra_js %}
    <script src="{% static 'js/jquery.dataTables.min.js' %}"></script>
    <script src="{% static 'js/jquery.dataTables.sorting.js' %}"></script>
    <script src="{% static 'js/dataTables.bootstrap.js' %}"></script>

    <script>
        $("#council-members").DataTable({
            "info": false,
            "searching": false,
            "bLengthChange": false,
            "paging": false,
            "aaSorting": [ [3,'asc'] ],
            "aoColumns": [
                { "bSortable": false },
                null,
                { "sType": "num-html" },
                null
            ]
        });

        function collapseActivity(){
            $(".activity-row:gt(4)").hide();
            $("#more-activity").show();
            $("#less-activity").hide();
        }
        function expandActivity(){
            $(".activity-row:gt(4)").show();
            $("#more-activity").hide();
            $("#less-activity").show();
        }

        collapseActivity();
        $("#more-activity").click(function() {
            expandActivity();
            return false;
        });
        $("#less-activity").click(function() {
            collapseActivity();
            return false;
        });

        // for reference purposes
        console.log( "OCD ID: {{committee.ocd_id}}" )

    </script>
{% endblock %}
{'fraction_non_alphanumeric': 0.1424731182795699, 'fraction_numerical': 0.0015681003584229391, 'mean_word_length': 0.9537563822027717, 'pattern_counts': {'":': 16, '<': 251, '<?xml version=': 0, '>': 251, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 42, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1085872', 'n_tokens_mistral': 3551, 'n_tokens_neox': 3134, 'n_words': 575}