<commit_before>{% extends 'certificates/certificate_base.html' %}{% load staticfiles events_tags %}

{% block content %}
<h1 style="text-align: center">الشهادات</h1>
<table class="display datatable compact dt-responsive">
    <thead>
        <th>الشهادة</th>
        <th class="not-mobile">الرمز</th>
        <th class="not-mobile">التاريخ</th>
        <th class="always">تنزيل</th>
    </thead>
    <tbody>
        {% for certificate in certificates %}
        <tr>
            <td>{{ certificate }}</td>
            <td class="english-field">{{ certificate.verification_code }}</td>
            <td data-order="{{ certificate.submission_date|date:'U' }}">{{ certificate.submission_date|date:"j F Y" }}</td>
            <td>
                {% if certificate.is_related_to_session and certificate.content_object|has_mandatory_survey_to_fill:user %}
                <button data-session-title="{{ certificate.content_object.name }}" data-session-pk="{{ certificate.content_object.pk }}" data-url="{% url 'events:handle_survey' certificate.content_object.pk %}" class="survey btn btn-icon btn-success">
                    <i class="entypo-pencil"></i>
                   تعبئة الاستبيان
                </button>
                {% else %}
                <a class="btn btn-success" href="{% url 'certificates:download_certificate' certificate.verification_code %}"><i class="fa fa-download" aria-hidden="true"></i> تنزيل</a>
                {% endif %}
                {% if certificate.is_related_to_session and certificate.content_object|has_optional_survey_to_fill:user and not certificate.content_object|has_mandatory_survey_to_fill:user %}
                <button data-session-title="{{ certificate.content_object.name }}" data-session-pk="{{ certificate.content_object.pk }}" data-url="{% url 'events:handle_survey' certificate.content_object.pk 'optional' %}" class="survey btn btn-icon btn-warning">
                    <i class="entypo-pencil"></i>
                   ساعدنا عبر تعبئة الاستبيان!
                </button>
                {% endif %}
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>


{% endblock %}
{% block customscript %}
    <script src="{% static 'neon/assets/js/toastr.js' %}"></script>
	<link rel="stylesheet" href="{% static 'css/jquery.dataTables.min.css' %}">
	<link rel="stylesheet" href="{% static 'js/datatables/responsive/css/responsive.dataTables.min.css' %}">
	<script src="{% static 'js/jquery.dataTables.min.js' %}"></script>
    <script src="{% static 'js/datatables/responsive/js/dataTables.responsive.min.js' %}"></script><commit_msg>If URL has #fill_survey, show the survey regardless of previous filling status<commit_after>{% extends 'certificates/certificate_base.html' %}{% load staticfiles events_tags %}

{% block content %}
<h1 style="text-align: center">الشهادات</h1>
<table class="display datatable compact dt-responsive">
    <thead>
        <th>الشهادة</th>
        <th class="not-mobile">الرمز</th>
        <th class="not-mobile">التاريخ</th>
        <th class="always">تنزيل</th>
    </thead>
    <tbody>
        {% for certificate in certificates %}
        <tr>
            <td>{{ certificate }}</td>
            <td class="english-field">{{ certificate.verification_code }}</td>
            <td data-order="{{ certificate.submission_date|date:'U' }}">{{ certificate.submission_date|date:"j F Y" }}</td>
            <td>
                {% if certificate.is_related_to_session and certificate.content_object|has_mandatory_survey_to_fill:user %}
                <button data-session-title="{{ certificate.content_object.name }}" data-session-pk="{{ certificate.content_object.pk }}" data-url="{% url 'events:handle_survey' certificate.content_object.pk %}" class="survey btn btn-icon btn-success">
                    <i class="entypo-pencil"></i>
                   تعبئة الاستبيان
                </button>
                {% else %}
                <a class="btn btn-success" href="{% url 'certificates:download_certificate' certificate.verification_code %}"><i class="fa fa-download" aria-hidden="true"></i> تنزيل</a>
{% if certificate.is_related_to_session and not certificate.content_object|has_optional_survey_to_fill:user and not certificate.content_object|has_mandatory_survey_to_fill:user %}
                <button style="display: none;" data-session-title="{{ certificate.content_object.name }}" data-session-pk="{{ certificate.content_object.pk }}" data-url="{% url 'events:handle_survey' certificate.content_object.pk 'optional' %}" class="survey btn btn-icon btn-warning">

                    <i class="entypo-pencil"></i>
                   ساعدنا عبر تعبئة الاستبيان!
                </button>
{% endif %}
                {% endif %}
                {% if certificate.is_related_to_session and certificate.content_object|has_optional_survey_to_fill:user and not certificate.content_object|has_mandatory_survey_to_fill:user %}
                <button data-session-title="{{ certificate.content_object.name }}" data-session-pk="{{ certificate.content_object.pk }}" data-url="{% url 'events:handle_survey' certificate.content_object.pk 'optional' %}" class="survey btn btn-icon btn-warning">
                    <i class="entypo-pencil"></i>
                   ساعدنا عبر تعبئة الاستبيان!
                </button>
                {% endif %}
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>


{% endblock %}
{% block customscript %}
    <script src="{% static 'neon/assets/js/toastr.js' %}"></script>
	<link rel="stylesheet" href="{% static 'css/jquery.dataTables.min.css' %}">
	<link rel="stylesheet" href="{% static 'js/datatables/responsive/css/responsive.dataTables.min.css' %}">
	<script src="{% static 'js/jquery.dataTables.min.js' %}"></script>
    <script src="{% static 'js/datatables/responsive/js/dataTables.responsive.min.js' %}"></script>
{'fraction_non_alphanumeric': 0.1583064104744091, 'fraction_numerical': 0.0006801564359802754, 'mean_word_length': 3.0122783083219646, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 99, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6958131', 'n_tokens_mistral': 1940, 'n_tokens_neox': 1784, 'n_words': 330}