info.html 6.29 KB
{% extends "base.html" %}
{% block content %}
    {{ super() }}
    <div class="container">
        <div class="row">
            <div class="col-md-8 col-md-offset-2">

                <div class="jumbotron">
                    <table id="datable" class="table table-striped table-bordered dt-head-right"
                           cellspacing="0"
                           width="100%">
                        {#                        <thead>#}
                        {#                        <tr>#}
                        {#                            <th><strong>INFO</strong></th>#}
                        {#                            <th><strong>VALUE</strong></th>#}
                        {#                        </tr>#}
                        {#                        </thead>#}

                        <tbody>
                        <tr>

                            <td align="center"><strong>Task Name</strong>
                            </td>
                            <td align="center" class="text-info">
                                <strong><em>{{ task.name }}</em></strong>
                        </tr>
                        <tr>

                            <td align="center"><strong>Pub Date</strong></td>
                            <td align="center">{{ task.pubdate }}</td>
                        </tr>
                        <tr>

                            <td align="center"><strong>Due Date</strong></td>
                            <td align="center">{{ task.duedate }}</td>
                        </tr>
                        <tr>

                            <td align="center"><strong>Description</strong></td>
                            <td align="center">{{ task.description }}</td>
                        </tr>
                        <tr>

                            <td align="center"><strong>Attached File</strong></td>
                            <td align="center">{% if task.attachfile != None %}

                                <a href="{{ url_for('download', filename=task.attachfile) }}"
                                   target="_blank">{{ task.attachfile }}</a>{% endif %}</td>
                        </tr>
                        <tr>

                            <td align="center"><strong>Priority</strong></td>
                            {% if task.priority ==0 %}
                                <td align="center"
                                    class="text-success">
                                    {{ task.priority }} ({{ task.enum_priority[task.priority] }})
                                </td>
                            {% elif task.priority ==1 %}
                                <td align="center"
                                    class="text-primary">
                                    {{ task.priority }} ({{ task.enum_priority[task.priority] }})
                                </td>
                            {% elif task.priority ==2 %}
                                <td align="center"
                                    class="text-warning">
                                    {{ task.priority }} ({{ task.enum_priority[task.priority] }})
                                </td>
                            {% elif task.priority ==3 %}
                                <td align="center"
                                    class="text-danger">
                                    {{ task.priority }} ({{ task.enum_priority[task.priority] }})
                                </td>
                            {% endif %}
                        </tr>
                        <tr>

                            <td align="center"><strong>Status</strong></td>
                            {% if task.status ==0 %}
                                <td align="center"
                                    class="text-info">
                                    {{ task.status }} ({{ task.enum_status[task.status] }})
                                </td>
                            {% elif task.status ==1 %}
                                <td align="center"
                                    class="text-muted">
                                    {{ task.status }} ({{ task.enum_status[task.status] }})
                                </td>
                            {% elif task.status ==-1 %}
                                <td align="center" class="text-warning">
                                    {{ task.status }} ({{ task.enum_status[task.status] }})
                                </td>
                            {% endif %}
                        </tr>
                        <tr>

                            <td align="center"><strong>Workers</strong></td>

                            <td align="center">
                                {% for user in users %}
                                    <span class="label colored">{{ user.username }}</span>
                                {% endfor %}

                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div class="form-actions">
                        {% if current_user in users %}
                            <button type="button" class="btn btn-danger"
                                    onclick="location.href='{{ url_for('untake',task_id=task.id) }}'">
                                Detach
                            </button>
                        {% else %}
                            <button type="button" class="btn btn-primary"
                                    onclick="location.href='{{ url_for('take',task_id=task.id) }}'">
                                Take
                            </button>
                        {% endif %}
                        {% if current_user.is_authenticated() and current_user.username == 'admin' %}
                            <button type="button" class="btn btn-warning"
                                    onclick="location.href='{{ url_for('edit',task_id=task.id) }}'">
                                Edit
                            </button>
                        {% endif %}
                        <button type="button" class="btn"
                                onclick="location.href='{{ request.path }}'">
                            Cancel
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}