<commit_before>{% load cms_tags sekizai_tags staticfiles %}


{% block content %}

  {% addtoblock "css" %}
    {% if instance.data_file_set.searchable %}
      <link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" rel="stylesheet" />
    {% endif %}
    <link rel="stylesheet" type="text/css" href="{% static 'cms_lab_data/css/app.css' %}">
  {% endaddtoblock %}

  <div id="data-list-dfs{{ instance.data_file_set.id }}-i{{ instance.id }}">
    <form style="display:inline;">

    {% if instance.data_file_set.searchable %}
      {% include "cms_lab_data/_header-with-search-filter.html" with data_file_set=instance.data_file_set %}
    {% else %}
      <h4>{{ instance.data_file_set.label }}</h4>
    {% endif %}

      <ul class="list" style="list-style: none; padding-left: 0;">
        {% for data_file in instance.data_file_set.data_files.all %}
          <li>
            <p>
              <strong>
                <a class="hide-on-mobile name" href="{{ data_file.file.url }}" target="_blank">
                    {{ data_file.name }}
                </a>
                <a class="show-on-mobile name" href="#" data-toggle="modal" data-target="#modal-data-{{ data_file.id }}">
                    {{ data_file.name }}
                </a>
              </strong>

              <span style="color: gray;" class="hide-on-mobile">
                [&nbsp;<em class="filename">{{ data_file.file.original_filename }},
                {{ data_file.file_size_fmt }}</em>&nbsp;]
              </span>

              {% if data_file.description %}
                <div class="hide-on-mobile description">
                  {{ data_file.description|linebreaks }}
                </div>
              {% endif %}
            </p>

            {% if instance.data_file_set.searchable %}
              <!-- Hidden search/filter fields -->
              <p class="tags" style="display: none;">{% for tag in data_file.tags.values %}{{ tag.id }} {% endfor %}</p>
            {% endif %}
          </li>
        {% endfor %}
      </ul><commit_msg>Truncate description to 40 words and add '+' button if > 50 words<commit_after>{% load cms_tags sekizai_tags staticfiles %}


{% block content %}

  {% addtoblock "css" %}
    {% if instance.data_file_set.searchable %}
      <link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" rel="stylesheet" />
    {% endif %}
    <link rel="stylesheet" type="text/css" href="{% static 'cms_lab_data/css/app.css' %}">
  {% endaddtoblock %}

  <div id="data-list-dfs{{ instance.data_file_set.id }}-i{{ instance.id }}">
    <form style="display:inline;">

    {% if instance.data_file_set.searchable %}
      {% include "cms_lab_data/_header-with-search-filter.html" with data_file_set=instance.data_file_set %}
    {% else %}
      <h4>{{ instance.data_file_set.label }}</h4>
    {% endif %}

      <ul class="list" style="list-style: none; padding-left: 0;">
        {% for data_file in instance.data_file_set.data_files.all %}
          <li>
            <p>
              <strong>
                <a class="hide-on-mobile name" href="{{ data_file.file.url }}" target="_blank">
                    {{ data_file.name }}
                </a>
                <a class="show-on-mobile name" href="#" data-toggle="modal" data-target="#modal-data-{{ data_file.id }}">
                    {{ data_file.name }}
                </a>
              </strong>

              <span style="color: gray;" class="hide-on-mobile">
                [&nbsp;<em class="filename">{{ data_file.file.original_filename }},
                {{ data_file.file_size_fmt }}</em>&nbsp;]
              </span>

              {% if data_file.description %}
                <div class="hide-on-mobile description">
                  {% if data_file.description|wordcount > 50 %}
                    {{ data_file.description|linebreaks|truncatewords:40 }}
                    <a class="name btn btn-xs btn-default" href="#" data-toggle="modal" data-target="#modal-data-{{ data_file.id }}">
                      <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                    </a>
                  {% else %}
                    {{ data_file.description|linebreaks }}
                  {% endif %}
                </div>
              {% endif %}
            </p>

            {% if instance.data_file_set.searchable %}
              <!-- Hidden search/filter fields -->
              <p class="tags" style="display: none;">{% for tag in data_file.tags.values %}{{ tag.id }} {% endfor %}</p>
            {% endif %}
          </li>
        {% endfor %}
      </ul>
{'fraction_non_alphanumeric': 0.16882556131260795, 'fraction_numerical': 0.0051813471502590676, 'mean_word_length': 1.9138364779874213, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 63, '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': '5004173', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1372, 'n_words': 249}