pytask/templates/task/view_textbook.html
author Madhusudan.C.S <madhusudancs@gmail.com>
Sat, 15 Jan 2011 21:21:49 +0530
changeset 417 b37e541bf950
parent 379 ed2dadfc829a
child 431 fcc87a3f0311
permissions -rw-r--r--
Manipulate all the templates to use {% url %} templatetag instead of hard coded URLs.

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

    {% if can_edit %}
        <a href="{% url edit_textbook textbook.id %}">Edit Text book</a>
    {% endif %}
    
    {% if can_approve %}
        <a href="{% url approve_textbook textbook.id %}">Approve Text book</a>
    {% endif %}

    <hr />created by <a href="{% url view_textbook 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="{% url view_task chap.id %}">{{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="{% url view_profile 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 %}