<commit_before>{% extends 'calaccess_website/base_with_top.html' %}
{% load humanize calaccess_website_tags staticfiles %}

{% block breadcrumbs %}
{{ block.super }}
<li><a href="{% url 'version_archive_index' %}">Downloads</a></li>
{% endblock %}

{% block affix-nav %}
<ul class="nav nav-stacked">
  <li class="active"><a href="#full-archive">Full archive</a></li>
  {% if object.processed_version %}
  <li><a href="#processed-files">Processed files</a></li>
  {% endif %}
  <li><a href="#raw-files">Raw files</a></li>
  {% if object.error_count %}
  <li><a href="#errata">Errata</a></li>
  {% endif %}
</ul>
{% endblock %}

{% block javascript %}
<script type="text/javascript">
// Filter logic
$('.dropdown-menu a').click(function() {
    $('#filterDropdown').html($(this).html() + ' <span class="caret"></span>');
    $('.file-card').removeClass('hidden');
    var group = $(this).data('group');
    if (group != 'all') {
      $('.file-card:not(.' + group + ')').addClass('hidden');
    }
});
</script>
{% include 'calaccess_website/affix_nav_logic.html' %}
{% endblock %}

{% block content %}
<section id="full-archive" class="chapter">
    <h2>Full archive</h2>
    {% if object.processed_version %}
    <p>
        Our complete package of {{ processed_file_count }} tables refined from data extracted and scraped from CAL-ACCESS.
    </p>
    {% else %}
    <p>
        The complete package of {{ object.download_file_count }} database tables released by California's Secretary of State, which we have cleaned up with {{ object.clean_record_count|intword }} rows of comma-separated values<sup><a href="#errata">*</a></sup>.
    </p>
    {% endif %}
    {% if object.processed_version %}
        <p>
            <a href="{% archive_url object.processed_version.zip_archive.name is_latest=is_latest %}"
               class="btn btn-calaccess">
                Download
            </a>
            &nbsp; <span>{{ object.processed_version.pretty_zip_size }} zip</span>
        </p>
        <p>
            Alternatively, retrieve with <code>curl</code>.
        </p>
        <input type="text" class="download-link input-monospace"
            value="$ curl -O {% archive_url object.processed_version.zip_archive.name is_latest=is_latest %}"
            readonly>
    {% elif object.clean_zip_archive %}
        <p>
            <a href="{% archive_url object.clean_zip_archive.name is_latest=is_latest %}"
               class="btn btn-calaccess">
                Download
            </a>
            &nbsp; <span>{{ object.pretty_clean_size }} zip</span>
        </p>
        <p>
            Alternatively, retrieve with <code>curl</code>.
        </p>
        <input type="text" class="download-link input-monospace"
            value="$ curl -O {% archive_url object.clean_zip_archive.name is_latest=is_latest %}"
            readonly>
    {% else %}
    <p><a class="btn btn-inactive">Unavailable</a>
    {% endif %}

    <div class="announcement fade in">
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        <span aria-hidden="true">&times;</span>
      </button>
      <h3>New</h3>
      <p>We're now releasing files of data scraped from the CAL-ACCESS website and formatted to meet the Open Civic Data specification. <a href="http://www.californiacivicdata.org/">Learn more &raquo;</a></p>
    </div>
</section>

{% if processed_files %}
<section id="processed-files" class="chapter">
  <div class="filters">
    <h2>Processed Civic Data files</h2>
    <p>
      Our re-formatted files in flat or relational formats.
    </p>
  </div>
  <ul class="list">
  {% for group in processed_files %}
  {% for file in group.list %}
    <li data-name="{{ file.file_name }}" data-type="{{ group.grouper }}" data-description="{{ file.model.doc|first_line|striptags }}">
        <section class="file-card {{ group.grouper|slugify }}">
            <div class="row">
                <div class="col-md-6">
                    <h4>
                        <a href="{% url 'ccdc_file_detail' slug=file.file_name|slugify %}">
                            {{ file.file_name }}
                        </a>
                    </h4>
                </div>
                <div class="col-md-6 align-right">
                    <p class="lbl-group">
                        <mark>{{ group.grouper|upper }}</mark>
                    </p>
                </div>
            </div>
            <hr>
            <div class="row">
                <div class="col-md-6">
                    <p>
                        <span style='color:#ba0a35;font-weight:400;'>**NEW**</span>
                        {{ file.model.doc|first_line|safe }}
                        <a href="{% url 'ccdc_file_detail' slug=file.file_name|slugify %}">Learn more &raquo;</a>
                    </p>
                </div>
                <div class="col-md-5 col-md-offset-1 align-right stats">
                    {% if file.file_archive %}<commit_msg>Lose the "new" announcement, file labels<commit_after>{% extends 'calaccess_website/base_with_top.html' %}
{% load humanize calaccess_website_tags staticfiles %}

{% block breadcrumbs %}
{{ block.super }}
<li><a href="{% url 'version_archive_index' %}">Downloads</a></li>
{% endblock %}

{% block affix-nav %}
<ul class="nav nav-stacked">
  <li class="active"><a href="#full-archive">Full archive</a></li>
  {% if object.processed_version %}
  <li><a href="#processed-files">Processed files</a></li>
  {% endif %}
  <li><a href="#raw-files">Raw files</a></li>
  {% if object.error_count %}
  <li><a href="#errata">Errata</a></li>
  {% endif %}
</ul>
{% endblock %}

{% block javascript %}
<script type="text/javascript">
// Filter logic
$('.dropdown-menu a').click(function() {
    $('#filterDropdown').html($(this).html() + ' <span class="caret"></span>');
    $('.file-card').removeClass('hidden');
    var group = $(this).data('group');
    if (group != 'all') {
      $('.file-card:not(.' + group + ')').addClass('hidden');
    }
});
</script>
{% include 'calaccess_website/affix_nav_logic.html' %}
{% endblock %}

{% block content %}
<section id="full-archive" class="chapter">
    <h2>Full archive</h2>
    {% if object.processed_version %}
    <p>
        Our complete package of {{ processed_file_count }} tables refined from data extracted and scraped from CAL-ACCESS.
    </p>
    {% else %}
    <p>
        The complete package of {{ object.download_file_count }} database tables released by California's Secretary of State, which we have cleaned up with {{ object.clean_record_count|intword }} rows of comma-separated values<sup><a href="#errata">*</a></sup>.
    </p>
    {% endif %}
    {% if object.processed_version %}
        <p>
            <a href="{% archive_url object.processed_version.zip_archive.name is_latest=is_latest %}"
               class="btn btn-calaccess">
                Download
            </a>
            &nbsp; <span>{{ object.processed_version.pretty_zip_size }} zip</span>
        </p>
        <p>
            Alternatively, retrieve with <code>curl</code>.
        </p>
        <input type="text" class="download-link input-monospace"
            value="$ curl -O {% archive_url object.processed_version.zip_archive.name is_latest=is_latest %}"
            readonly>
    {% elif object.clean_zip_archive %}
        <p>
            <a href="{% archive_url object.clean_zip_archive.name is_latest=is_latest %}"
               class="btn btn-calaccess">
                Download
            </a>
            &nbsp; <span>{{ object.pretty_clean_size }} zip</span>
        </p>
        <p>
            Alternatively, retrieve with <code>curl</code>.
        </p>
        <input type="text" class="download-link input-monospace"
            value="$ curl -O {% archive_url object.clean_zip_archive.name is_latest=is_latest %}"
            readonly>
    {% else %}
    <p><a class="btn btn-inactive">Unavailable</a>
    {% endif %}
</section>

{% if processed_files %}
<section id="processed-files" class="chapter">
  <div class="filters">
    <h2>Processed Civic Data files</h2>
    <p>
      Our re-formatted files in flat or relational formats.
    </p>
  </div>
  <ul class="list">
  {% for group in processed_files %}
  {% for file in group.list %}
    <li data-name="{{ file.file_name }}" data-type="{{ group.grouper }}" data-description="{{ file.model.doc|first_line|striptags }}">
        <section class="file-card {{ group.grouper|slugify }}">
            <div class="row">
                <div class="col-md-6">
                    <h4>
                        <a href="{% url 'ccdc_file_detail' slug=file.file_name|slugify %}">
                            {{ file.file_name }}
                        </a>
                    </h4>
                </div>
                <div class="col-md-6 align-right">
                    <p class="lbl-group">
                        <mark>{{ group.grouper|upper }}</mark>
                    </p>
                </div>
            </div>
            <hr>
            <div class="row">
                <div class="col-md-6">
                    <p>
                        {{ file.model.doc|first_line|safe }}
                        <a href="{% url 'ccdc_file_detail' slug=file.file_name|slugify %}">Learn more &raquo;</a>
                    </p>
                </div>
                <div class="col-md-5 col-md-offset-1 align-right stats">
                    {% if file.file_archive %}
{'fraction_non_alphanumeric': 0.16823816082212098, 'fraction_numerical': 0.003178302786312109, 'mean_word_length': 2.2273504273504274, 'pattern_counts': {'":': 0, '<': 209, '<?xml version=': 0, '>': 209, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '417678', 'n_tokens_mistral': 3061, 'n_tokens_neox': 2812, 'n_words': 615}