templates/index.html
author nishanth
Fri, 26 Feb 2010 23:22:23 +0530
changeset 125 d3cfceb8e120
parent 97 3699550991c6
child 139 56203661002a
permissions -rw-r--r--
homepage now displays a list of unpublished tasks

{% extends 'base.html' %}
{% block content %}
    {% if is_guest %}
        Welcome Guest<br>
        <a href="/accounts/register/">Register</a>
        <a href="/accounts/login/">Login</a><br /><br />
        Recent Tasks:<br />
        {% for task in task_list %}
            <a href="/task/view/tid={{ task.id }}">{{ task.title }}</a><br />
        {% endfor %}
    {% else %}
        Logged in as {{ user.username }} <br />
    {% endif %}
    
    {% if can_create_task %}
        <a href="/task/create/">Create a task</a><br />
    {% endif %}
    
    {% if notifications.count %}
        <br> {{ notifications.count }} unread <a href='/user/notifications/'>
        {% ifnotequal notifications.count 1 %}
        notifications</a>!!
        {% else %}
        notification</a>!!
        {% endifnotequal %}
    {% endif %}
    
    {% if requests.count %}
        <br>{{ requests.count }} unreplied <a href='/user/requests/'>
        {% ifnotequal requests.count 1 %}
        requests</a>!
        {% else %}
        request</a>!
        {% endifnotequal %}
    {% endif %}
    
    {% if user.task_claimed_users.count %}
        <br>{{ user.task_claimed_users.count }} <a href='/user/claimed/'>claimed</a>
        {% ifnotequal user.task_claimed_users.count 1 %}
        tasks!
        {% else %}
        task!
        {% endifnotequal %}
    {% endif %}
    
    {% if user.task_assigned_users.count %}
        <br>You are currently <a href='/user/assigned/'>working</a> on {{ user.task_assigned_users.count }}
        {% ifnotequal user.task_assigned_users.count 1 %}
        tasks!
        {% else %}
        task!
        {% endifnotequal %}
    {% endif %}
    
    {% if user.task_mentors.count %}
        <br><a href="/user/mentor/">Mentoring</a> {{ user.task_mentors.count }}
        {% ifnotequal user.task_mentors.count 1 %}
            tasks!
        {% else %}
            task!
        {% endifnotequal %}
        <br />
    {% endif %}
    
    {% if unpublished_tasks %}
    <br />Unpublished tasks:<br />
        {% for a_task in unpublished_tasks %}
            <a href="/task/view/tid={{a_task.id}}">{{a_task.title}}</a>&nbsp;&nbsp;&nbsp;
        {% endfor %}
    {% endif %}
{% endblock %}