<commit_before>{% extends "todo/base.html" %}

{% block title %}Todo List: {{ list.name }}{% endblock %}

{% block content %}
    <script type="text/javascript">
        function order_tasks(data) {
            // The JQuery plugin tableDnD provides a serialize() function which provides the re-ordered
            // data in a list. We pass that list as an object called "data" to a Django view
            // to save the re-ordered data into the database.

            $.post("{% url 'todo-reorder_tasks' %}", data, "json");
            return false;
        };

        $(document).ready(function() {
            // Initialise the task table for drag/drop re-ordering
            $("#tasktable").tableDnD();

            $('#tasktable').tableDnD({
                onDrop: function(table, row) {
                    order_tasks($.tableDnD.serialize());
                }
            });

            // Initially hide the Add Task form
            $('#AddTask').hide();

            // toggle slide to show the Add Task form when link clicked
            $('#slideToggle').click(function(){
                $(this).siblings('#AddTask').slideToggle();
            });
        });
    </script>

    {% if list_slug == "mine" %}
        <h1>Tasks assigned to {{ request.user }}</h1>
    {% elif auth_ok %}
       <h1>Tasks filed under "{{ list.name }}"</h1>
       <p>This list belongs to group {{ list.group }}</p>
    {% endif %}

    {% if auth_ok %}
        <form action="" method="POST">
            {% csrf_token %}

            {# Only show task adder if viewing a proper list #}
            {% if list_slug != "mine" %}
                <h2 style="margin-bottom:0px;" id="slideToggle" >&rarr; Click to add task &larr;</h2>

                <div id="AddTask">
            	    <table class="nocolor" border="0" cellspacing="5" cellpadding="5">
            	       <tr>
            	           <td>{{ form.title.errors }}</td>
            	           <td>{{ form.due_date.errors }}</td>
            	       </tr>
            	       <tr>
            	           <td><label for="id_title">Task:</label> {{ form.title }}</td>
            	           <td><label for="id_due_date">Due date:</label> {{ form.due_date }}</td>
            	           <td><label for="id_assigned">Assign to:</label> {{ form.assigned_to }}</td>
            	           <td><label for="id_notify">Notify*:</label> <input type="checkbox" checked="checked" name="notify" value="1" id="notify"></td>
             	       </tr>
            	       <tr>
            	           <td><label for="id_note">Note:</label>
                                {{ form.note }}
            	               <p class="minor">*Email notifications will only be sent if task is assigned to someone besides yourself.</p>
            	           </td>
             	       </tr>
            	    </table>

                    <input type="hidden" name="priority" value="999" id="id_priority">
                    <input type="hidden" name="created_by" value="{{ request.user.id }}" id="id_created_by">
                    <input type="hidden" name="list" value="{{ listid }}" id="id_list">
                    <input type="hidden" name="created_date" value="{{ created_date }}" id="id_created_date">
            	    <p><input type="submit" name="add_task" value="Add task" class="todo-button"></p>
                </div>
            {% endif %}

            {% if not view_completed %}

            	<h3>Incomplete tasks :: Drag rows to set priorities</h3>

            	<table border="0" id="tasktable">
                    <tr>
                        <th>Done</th>
                        <th>Task</th>
                        <th>Created</th>
                        <th>Due on</th>
                        <th>Owner</th>
                        <th>Assigned</th>
                        <th>Note</th>
                        <th>Comm</th>
                        {% if list_slug == "mine" %}
                            <th>List</th><commit_msg>Fix variable name in list_view template<commit_after>{% extends "todo/base.html" %}

{% block title %}Todo List: {{ list.name }}{% endblock %}

{% block content %}
    <script type="text/javascript">
        function order_tasks(data) {
            // The JQuery plugin tableDnD provides a serialize() function which provides the re-ordered
            // data in a list. We pass that list as an object called "data" to a Django view
            // to save the re-ordered data into the database.

            $.post("{% url 'todo-reorder_tasks' %}", data, "json");
            return false;
        };

        $(document).ready(function() {
            // Initialise the task table for drag/drop re-ordering
            $("#tasktable").tableDnD();

            $('#tasktable').tableDnD({
                onDrop: function(table, row) {
                    order_tasks($.tableDnD.serialize());
                }
            });

            // Initially hide the Add Task form
            $('#AddTask').hide();

            // toggle slide to show the Add Task form when link clicked
            $('#slideToggle').click(function(){
                $(this).siblings('#AddTask').slideToggle();
            });
        });
    </script>

    {% if list_slug == "mine" %}
        <h1>Tasks assigned to {{ request.user }}</h1>
    {% elif auth_ok %}
       <h1>Tasks filed under "{{ list.name }}"</h1>
       <p>This list belongs to group {{ list.group }}</p>
    {% endif %}

    {% if auth_ok %}
        <form action="" method="POST">
            {% csrf_token %}

            {# Only show task adder if viewing a proper list #}
            {% if list_slug != "mine" %}
                <h2 style="margin-bottom:0px;" id="slideToggle" >&rarr; Click to add task &larr;</h2>

                <div id="AddTask">
            	    <table class="nocolor" border="0" cellspacing="5" cellpadding="5">
            	       <tr>
            	           <td>{{ form.title.errors }}</td>
            	           <td>{{ form.due_date.errors }}</td>
            	       </tr>
            	       <tr>
            	           <td><label for="id_title">Task:</label> {{ form.title }}</td>
            	           <td><label for="id_due_date">Due date:</label> {{ form.due_date }}</td>
            	           <td><label for="id_assigned">Assign to:</label> {{ form.assigned_to }}</td>
            	           <td><label for="id_notify">Notify*:</label> <input type="checkbox" checked="checked" name="notify" value="1" id="notify"></td>
             	       </tr>
            	       <tr>
            	           <td><label for="id_note">Note:</label>
                                {{ form.note }}
            	               <p class="minor">*Email notifications will only be sent if task is assigned to someone besides yourself.</p>
            	           </td>
             	       </tr>
            	    </table>

                    <input type="hidden" name="priority" value="999" id="id_priority">
                    <input type="hidden" name="created_by" value="{{ request.user.id }}" id="id_created_by">
                    <input type="hidden" name="list" value="{{ list.id }}" id="id_list">
                    <input type="hidden" name="created_date" value="{{ created_date }}" id="id_created_date">
            	    <p><input type="submit" name="add_task" value="Add task" class="todo-button"></p>
                </div>
            {% endif %}

            {% if not view_completed %}

            	<h3>Incomplete tasks :: Drag rows to set priorities</h3>

            	<table border="0" id="tasktable">
                    <tr>
                        <th>Done</th>
                        <th>Task</th>
                        <th>Created</th>
                        <th>Due on</th>
                        <th>Owner</th>
                        <th>Assigned</th>
                        <th>Note</th>
                        <th>Comm</th>
                        {% if list_slug == "mine" %}
                            <th>List</th>
{'fraction_non_alphanumeric': 0.1519223590892124, 'fraction_numerical': 0.00423043424163245, 'mean_word_length': 1.4424187177149803, 'pattern_counts': {'":': 0, '<': 157, '<?xml version=': 0, '>': 157, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5812536', 'n_tokens_mistral': 2306, 'n_tokens_neox': 2169, 'n_words': 530}