templates/task/view.html
author nishanth
Thu, 25 Feb 2010 16:37:46 +0530
changeset 95 e4034904f82e
parent 94 d1f59bbc2685
child 96 2881ed1c52b0
permissions -rw-r--r--
added the event completeTask.

{% extends 'base.html' %}
{% block title %}
    {{task.title}}
{% endblock %}
{% block content %}
    {% if task_viewable %}
        <a href="/task/edit/tid={{task.id}}">Edit task</a>
        <h3>{{ task.title }}</h3><br />
        <!-- we have to write our own datetime.strftime filter and use in the next line -->
        created by <a href="/user/view/uid={{ task.created_by.id }}">{{ task.created_by.username }}</a> on {{ task.creation_datetime.ctime }}<br />
        Mentors:
        {% for mentor in mentors %}
            <a href="/user/view/uid={{mentor.id}}">{{mentor.username}}|</a>
        {% endfor %}
        {% if can_mod_mentors %}
            <a href="/task/addmentor/tid={{task.id}}">Add another Mentor to this task</a>
            <br />
            edit task goes here and it should contain all those add subs and add deps depending on availability<br />
        {% endif %}

        {% if deps %}
        
            <br />The task has following dependencies.<br />
            {% for dep in deps %}
                <a href="/task/view/tid={{dep.id}}">{{dep.title}}</a><br />
            {% endfor %}
            
            {% if can_mod_tasks %}
                <a href="/task/addtask/tid={{task.id}}">add more dependencies</a>
                <a href="/task/remtask/tid={{task.id}}">remove an existing dependency</a>
            {% endif %}
            
        {% else %}
        
            {% if subs %}
            
                <br />The task has following sub tasks.<br />
                {% for sub in subs %}
                    <a href="/task/view/tid={{sub.id}}">{{sub.title}}</a><br />
                {% endfor %}
                
                {% if can_mod_tasks %}
                    <a href="/task/addtask/tid={{task.id}}">add more subtasks</a>
                    <a href="/task/remtask/tid={{task.id}}">remove an existing subtask</a>
                {% endif %}
                
            {% else %}
            
                {% if can_mod_tasks %}
                    <a href="/task/addtask/tid={{task.id}}">add a subtask/dependency </a>
                {% endif %}
                
            {% endif %}
        {% endif %}
        
        
        <hr>
        <br />Description:<br />
        <br />{{ task.desc }}<br />
        <hr>
        
        status of task is {{task.status}}<br />
        {% if assigned_users %}
            Users working on this task:
            {% for user in assigned_users %}
                <a href="/user/view/uid={{user.id}}">{{user.username}}</a>|
            {% endfor %}
            {% if is_mentor %}
                <a href="/task/remuser/tid={{task.id}}">Remove an existing user</a>
            <br />
            {% endif %}
        {% else %}
            There are no users currently working on this task.<br />
        {% endif %}
        {% if can_assign_credits %}
            <a href="/task/assigncredits/tid={{task.id}}">Assign credits</a>
        {% endif %}
        {% if not is_guest and task_claimable %}
            <a href="/task/claim/tid={{task.id}}">View claims for this task</a>.<br />
        {% endif %}
        
        {% if comments %}
            <hr />
            <br/>comments:<br />
            {% for comment in comments %}
                <br /><a href="/user/view/uid={{comment.created_by.id}}">{{ comment.created_by.username }}</a> at {{ comment.creation_datetime.ctime }} wrote:<br />
            {{ comment.data }}<br />
            {% endfor %}
        {% endif %}

        {% if not is_guest %}
            <br />Add comment:<br />
            <form action="" method="post">
            <!-- we might even want to use forms here -->
            <textarea  name="data"></textarea><br />
            <input type="submit" value="Submit">
            </form>
        {% endif %}
    {% else %}
        You are not authorised to view this task. <a href="/task/browse/">click here</a> to return to browsing the tasks.
    {% endif %}
{% endblock %}