<commit_before>{% extends "ndf/base.html" %}
{% load i18n %}
{% load ndf_tags %}
{% load pagination_tags %}
{% get_group_name groupid as group_name_tag %}

{% block title %} Term {% endblock %}

{% block meta_content %}

<h2 class="subheader">{% trans "Terms" %}</h2>

{% endblock %}

{% block search_content %}
  {% include "ndf/node_search_base.html" %}
{% endblock %}

{% block body_content %} 

<h3>Terms will appear very soon ! !</h3>
{% endblock %}<commit_msg>code added for displaying all terms with proper pagination implemented<commit_after>{% load i18n %}
{% load ndf_tags %}
{% get_group_name groupid as group_name_tag %}

<ul class="small-block-grid-1 medium-block-grid-2 large-block-grid-4">


  {% group_type_info groupid request.user as grouptype %}

  <!-- Existing card list-->
  {% for node in paged_terms %}

      <li class="card">
        {% if grouptype == "Moderated" %}
          {% if node.status == "DRAFT" %}
            <div class="draft page">
          {% elif node.status == "PUBLISHED" %}
            <div class="published page">
          {% endif %}
        {% else %}
          <div class='{% if node.status == "PUBLISHED" %}published{% endif %} page'>
        {% endif %} 

          <a href="{% url 'term_details' group_name_tag node.pk %}">
          <div class="row">
            <div class="small-10 columns">                             
                <b>
                  {{ node.name }}{% if node.collection_set %} <i class="fi-page-multiple"></i> {% endif %}
                </b>
            </div>
          </div>
          
          <span style="font-size:12px;">{{ node.html_content|default_if_none:"Add some description."|safe|striptags|truncatechars:75 }}</span><br/>

          <footer>
            <div class="age">
              {{ node.member_of_names_list|join:', ' }} created {{node.created_at|timesince}} ago 
              <br/>
              by <span class="user" href="{% url 'dashboard' node.created_by %}" data-gnow="">{{node.user_details_dict.created_by}}</span> 
            </div>
            <span><strong>{{node.contributors|length}}</strong> Contributor{{node.contributors|pluralize}}</span>
          </footer>
          </a>

          <div class="label-list small-12 columns">
          {% for tag in node.tags|slice:":3" %}
            <a href="{% url 'tag_info' groupid tag %}"><span class="label" style="background-color:yellow;">{{tag}}</span></a>
          {% endfor %}
          </div>

        
        </div>
      </li>
      
  {% empty %}
    {% if not searching %}
      <div class="row">
        <div class="small-12 columns">
        <h5>  {% blocktrans %} This group doesn't have any Terms. <b>Be the first to create a Term!</b>{% endblocktrans %} </h5>
        </div>
      </div>
    {% endif %}

  {% endfor %}

</ul>

<!-- pagination -->
{% if page_info %}
  {% if page_info.num_pages > 1 %}
    <div class="pagination-centered">
      <ul class="pagination" role="menubar" aria-label="Pagination">
        {% if page_info.num_pages < 11 %}
  

          {% for each_page in page_info.page_range %}

            {% if page_info.current_page == each_page %}
            <li class="current">
            {% else %}
            <li>
            {% endif %}
              <a class="next_prev" name="{{each_page}}"> {{ each_page }} </a>
            </li>

          {% endfor %}
        
        {% else %}

          {% if page_info.has_previous %}

            <!-- for  << previous  text -->
            <li class="arrow">
              <a class="next_prev" name="{{page_info.previous_page}}">&laquo; Previous</a>
            </li>

            <!-- for page 1, page 2 and ... -->
            {% if page_info.previous_page|add:"-2" != 1 and page_info.previous_page|add:"-2" > 0 %}
              <li><a class="next_prev" name="1">1</a></li>
              <li><a class="next_prev" name="2">2</a></li>
              <li class="unavailable" aria-disabled="true"><span class="subheader">&hellip;</span></li>
            {% endif %}
      
            <!-- for previous page -->
            <li>
              <a class="next_prev" name="{{page_info.previous_page}}">
                {{ page_info.previous_page }}
              </a>
            </li>
          {% endif %}

          <!-- for current page -->
          <li class="current"><a class="next_prev" name="{{page_info.current_page}}">{{ page_info.current_page }}</a></li>
          

          {% if page_info.has_next %}

            <!-- for next page -->
            <li>
              <a class="next_prev" name="{{page_info.next_page}}">
                {{ page_info.next_page }}
              </a>
            </li>
            {% if page_info.next_page != page_info.num_pages %}
              
              {% if page_info.next_page != page_info.num_pages|add:"-1" %}

                <!-- for .... -->
                {% if page_info.next_page != page_info.num_pages|add:"-2" %}
                  <li class="unavailable" aria-disabled="true"><span class="subheader">&hellip;</span></li>
                {% endif %}
        
                <!-- for secondlast page -->
                <li>
                  <a class="next_prev" name="{{page_info.num_pages|add:'-1'}}">
                    {{ page_info.num_pages|add:"-1" }}
                  </a>
                </li>
              {% endif %}
              
              <!-- for last page -->
              <li>
                <a class="next_prev" name="{{page_info.num_pages}}">
                  {{ page_info.num_pages }}
                </a>
              </li>
            {% endif %}

            <!-- for text Next >> -->
            <li class="arrow">
              <a class="next_prev" name="{{page_info.next_page}}">Next &raquo;</a>
            </li>
        
          {% endif %}

        {% endif %}
      </ul>
    </div>
  {% endif %}

{% endif %}

<!-- end of pagination -->
{'fraction_non_alphanumeric': 0.17799627055433123, 'fraction_numerical': 0.006950330564502458, 'mean_word_length': 1.6940639269406392, 'pattern_counts': {'":': 1, '<': 121, '<?xml version=': 0, '>': 122, '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': '3136558', 'n_tokens_mistral': 1956, 'n_tokens_neox': 1734, 'n_words': 359}