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

{% block content %}
<div class="jumbotron">
    <h2>#{{ checklist.getId() }} {{ checklist.getName() }}</h2>
    {% if checklist.isCompleted() %}
    <p class="label label-success">Completed</p>
    {% else %}
    <p class="label label-danger">Incomplete</p>
    {% endif %}
</div>

<div class="progress">
    <div class="progress-bar" role="progressbar" aria-valuenow="{{ checklist.getCompletionRate() }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ checklist.getCompletionRate() }}%;">
        <span class="sr-only">{{ checklist.getCompletionRate() }}% Complete</span>
    </div>
</div>

<div class="row">
    <form role="form" method="post" action="{{ app.request.baseUrl }}/checklists/{{ checklist.getId() }}/complete" class="col-lg-12 form-horizontal no-padding">
        <div class="list-group">
            {% for step in checklist.getSteps() %}
                <a href="{{ app.request.baseUrl }}/steps/{{ step.getId() }}/complete" class="list-group-item step">
                    {% if step.isCompleted() %}
                    <span class="text-success glyphicon glyphicon-ok" aria-hidden="true"></span>
                    {% else %}
                    <span class="text-danger glyphicon glyphicon-remove" aria-hidden="true"></span>
                    {% endif %}
                    {{ step.getDescription() }}
                </a>
            {% endfor %}
        </div>

        <div class="form-group no-margin">
            <button type="submit" class="btn btn-success pull-right" href="#" role="button">Complete Checklist</button>
        </div>
    </form>
</div>
{% endblock content %}

{% block scripts %}
<script type="text/javascript">
$(document).ready(function() {
    $(document).on('click', '.step', function(event) {
        event.preventDefault();
        var element = event.target,
            url = $(element).attr('href');

        $.post(url, {}, function() {
            window.location.reload();
        });

        return false;
    });
});
</script>
{% endblock scripts %}<commit_msg>Removing the button to complete the checklist from detail if its already completed<commit_after>{% extends "layout.html" %}

{% block content %}
<div class="jumbotron">
    <h2>#{{ checklist.getId() }} {{ checklist.getName() }}</h2>
    {% if checklist.isCompleted() %}
    <p class="label label-success">Completed</p>
    {% else %}
    <p class="label label-danger">Incomplete</p>
    {% endif %}
</div>

<div class="progress">
    <div class="progress-bar" role="progressbar" aria-valuenow="{{ checklist.getCompletionRate() }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ checklist.getCompletionRate() }}%;">
        <span class="sr-only">{{ checklist.getCompletionRate() }}% Complete</span>
    </div>
</div>

<div class="row">
    <form role="form" method="post" action="{{ app.request.baseUrl }}/checklists/{{ checklist.getId() }}/complete" class="col-lg-12 form-horizontal no-padding">
        <div class="list-group">
            {% for step in checklist.getSteps() %}
                <a href="{{ app.request.baseUrl }}/steps/{{ step.getId() }}/complete" class="list-group-item step">
                    {% if step.isCompleted() %}
                    <span class="text-success glyphicon glyphicon-ok" aria-hidden="true"></span>
                    {% else %}
                    <span class="text-danger glyphicon glyphicon-remove" aria-hidden="true"></span>
                    {% endif %}
                    {{ step.getDescription() }}
                </a>
            {% endfor %}
        </div>

        {% if not checklist.isCompleted() %}
        <div class="form-group no-margin">
            <button type="submit" class="btn btn-success pull-right" href="#" role="button">Complete Checklist</button>
        </div>
        {% endif %}
    </form>
</div>
{% endblock content %}

{% block scripts %}
<script type="text/javascript">
$(document).ready(function() {
    $(document).on('click', '.step', function(event) {
        event.preventDefault();
        var element = event.target,
            url = $(element).attr('href');

        $.post(url, {}, function() {
            window.location.reload();
        });

        return false;
    });
});
</script>
{% endblock scripts %}
{'fraction_non_alphanumeric': 0.19090909090909092, 'fraction_numerical': 0.0037296037296037296, 'mean_word_length': 2.569883527454243, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 67, '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': '4915872', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1215, 'n_words': 260}