<commit_before>{% extends "base_home.html" %}

    {% block home-content %}


        {% load dashboard %}

        <div>

          <h3>Material List</h3>

          <div>
            <form id="material-search" action="{{ request.path }}" method="GET">
                <span>Title: </span>
                <input class="input-xlarge" type="text" name="kw" value="{{ request.GET.kw }}" style="margin-bottom:0px">
                <input type="submit" class="btn btn-primary" value="Search">
                <span style="margin-left: 20px;">Type:</span>
                <select name="filter_type" class="input-medium" style="margin-bottom: 0px;">
                    <option value="">All</option>
                    <option value="1" {% if request.GET.filter_type == '1' %}selected{% endif %}>Module (1)</option>
                    <option value="2" {% if request.GET.filter_type == '2' %}selected{% endif %}>Collection (2)</option>
                </select>
            </form>
          </div>
    
          {% if removed %}
          <div id="notifications" class="alert">
            <h5>Material(s) deleted:</h5>
            <ul>
                {% for item in removed %}
                <li>{{ item }}</li>
                {% endfor %}
            </ul>
          </div>
          {% endif %}


          <div>
            {% if page_total > 1 %}
                {% with rg=request.GET %}
                {% if current_page > 1 %}
                <a href="{{ request.path }}?page={{ current_page|add:-1 }}&kw={{ rg.kw }}&filter_type={{ rg.filter_type }}">Previous</a>
                {% endif %}
                <span> - {{ current_page }}/{{ page_total }} - </span>
                {% if current_page < page_total %}
                <a href="{{ request.path }}?page={{ current_page|add:+1 }}&kw={{ rg.kw }}&filter_type={{ rg.filter_type }}">Next</a>
                {% endif %}
                {% endwith %}
            {% endif %}
          </div>

          <form name="material-list" action="{{ request.get_full_path }}" method="POST">
            {% csrf_token %}

          <table class="table table-striped table-bordered" 
                 style="margin-bottom:5px">
            <tr>
              <th>Title</th>
              <th>Material ID</th>
              <th>Modified</th>
              <th>Summary</th>
              <th>Select</th>
            </tr> 
            
            {% for material in materials %}
            <tr style="font-size:0.85em">
                <td>
                    {% if material.material_type == 1 %}
                        <span class="label">
                    {% else %}
                        <span class="label label-warning">
                    {% endif %}
                    {{ material.material_type }}</span>
                    &nbsp;<a href="http://{{ web_url }}/m/{{ material.material_id }}">{{ material.title }}</a></td>
                <td><a href="/1/materials/{{ material.material_id }}">{{ material.material_id }}</a></td>
                <td>{{ material.modified|date:"y-m-d h:i" }}</td>
                <td><a href="/dashboard/render/{{ material.material_id }}">{{ material.description|truncatewords:4 }}</a></td>
                <td style="text-align:center;"><input type="checkbox" name="check-delete" value="{{ material.pk }}"></td>
            </tr> 
            {% endfor %}

          </table>
        <commit_msg>fix collection/material false link in materials view<commit_after>{% extends "base_home.html" %}

    {% block home-content %}


        {% load dashboard %}

        <div>

          <h3>Material List</h3>

          <div>
            <form id="material-search" action="{{ request.path }}" method="GET">
                <span>Title: </span>
                <input class="input-xlarge" type="text" name="kw" value="{{ request.GET.kw }}" style="margin-bottom:0px">
                <input type="submit" class="btn btn-primary" value="Search">
                <span style="margin-left: 20px;">Type:</span>
                <select name="filter_type" class="input-medium" style="margin-bottom: 0px;">
                    <option value="">All</option>
                    <option value="1" {% if request.GET.filter_type == '1' %}selected{% endif %}>Module (1)</option>
                    <option value="2" {% if request.GET.filter_type == '2' %}selected{% endif %}>Collection (2)</option>
                </select>
            </form>
          </div>
    
          {% if removed %}
          <div id="notifications" class="alert">
            <h5>Material(s) deleted:</h5>
            <ul>
                {% for item in removed %}
                <li>{{ item }}</li>
                {% endfor %}
            </ul>
          </div>
          {% endif %}


          <div>
            {% if page_total > 1 %}
                {% with rg=request.GET %}
                {% if current_page > 1 %}
                <a href="{{ request.path }}?page={{ current_page|add:-1 }}&kw={{ rg.kw }}&filter_type={{ rg.filter_type }}">Previous</a>
                {% endif %}
                <span> - {{ current_page }}/{{ page_total }} - </span>
                {% if current_page < page_total %}
                <a href="{{ request.path }}?page={{ current_page|add:+1 }}&kw={{ rg.kw }}&filter_type={{ rg.filter_type }}">Next</a>
                {% endif %}
                {% endwith %}
            {% endif %}
          </div>

          <form name="material-list" action="{{ request.get_full_path }}" method="POST">
            {% csrf_token %}

          <table class="table table-striped table-bordered" 
                 style="margin-bottom:5px">
            <tr>
              <th>Title</th>
              <th>Material ID</th>
              <th>Modified</th>
              <th>Summary</th>
              <th>Select</th>
            </tr> 
            
            {% for material in materials %}
            <tr style="font-size:0.85em">
                <td>
                    {% if material.material_type == 1 %}
                        <span class="label">
                    {% else %}
                        <span class="label label-warning">
                    {% endif %}
                    {{ material.material_type }}</span>
                    &nbsp;<a href="http://{{ web_url }}{% if material.material_type == 1%}/m/{% else %}/c/{% endif %}{{ material.material_id }}">{{ material.title }}</a></td>
                <td><a href="/1/materials/{{ material.material_id }}">{{ material.material_id }}</a></td>
                <td>{{ material.modified|date:"y-m-d h:i" }}</td>
                <td><a href="/dashboard/render/{{ material.material_id }}">{{ material.description|truncatewords:4 }}</a></td>
                <td style="text-align:center;"><input type="checkbox" name="check-delete" value="{{ material.pk }}"></td>
            </tr> 
            {% endfor %}

          </table>
        
{'fraction_non_alphanumeric': 0.1802612481857765, 'fraction_numerical': 0.007402031930333817, 'mean_word_length': 1.525100769512642, 'pattern_counts': {'":': 0, '<': 153, '<?xml version=': 0, '>': 155, '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': '2634783', 'n_tokens_mistral': 2106, 'n_tokens_neox': 1873, 'n_words': 391}