pytask/templates/task/view_textbook.html
author Nishanth Amuluru <nishanth@fossee.in>
Tue, 11 Jan 2011 12:36:55 +0530
changeset 141 ed2dadfc829a
parent 139 4f0cfd486d9b
permissions -rw-r--r--
corrected the user view url

{% extends 'base.html' %}
{% block title %}
    {{textbook.name}}
{% endblock %}
{% block content %}
    <h3>{{ textbook.name }}</h3>

    {% if can_edit %}
        <a href="/task/textbook/edit/tid={{textbook.uniq_key}}">Edit Text book</a>
    {% endif %}
    
    {% if can_approve %}
        <a href="/task/textbook/approve/tid={{textbook.uniq_key}}">Approve Text book</a>
    {% endif %}

    <hr />created by <a href="/profile/user/view/uid={{ textbook.created_by.id }}">{{ textbook.created_by.username }}</a>
    on {{textbook.creation_datetime|date:"D d M Y"}} at {{textbook.creation_datetime|time:"H:i"}}<br />
    <hr />
    
    {% if textbook.tags.count %}
        Tags: 
        {% for tag in textbook.tags %}
            {{tag}}
        {% endfor %}
        <hr />
    {% endif %}

    {% if chapters %}
    Chapters: <br />
    <table>
    {% for chap in chapters %}
    <tr>
	    <td><a href="/task/view/tid={{chap.uniq_key}}">{{chap.title}}</a> </td>
	    <td> {{chap.status}} </td>
    </tr>
    {% endfor %}
    </table>
    {% else %}
    There are no chapters in this textbook as of now.<br />
    {% endif %}


    
    
        <hr />
    {% if comments %}
        comments:<br /><br />
        {% for comment in comments %}
            <a href="/profile/user/view/uid={{comment.commented_by.id}}">{{ comment.commented_by.username }}</a> 
            on {{ comment.comment_datetime|date:"D d M Y"}} at {{comment.comment_datetime|time:"H:i"}} wrote:<br />
        {{ comment.data|linebreaksbr }}<br />
        {% endfor %}
    {% endif %}
    <hr />

    {% if can_comment %}
    Add comment:<br />
	<form action="" method="post">
	    {% csrf_token %}
	    {{form.as_p}}
	<input type="submit" value="Submit">
	</form>                
    {% endif %}

{% endblock %}