pytask/templates/task/view_textbook.html
author Madhusudan.C.S <madhusudancs@gmail.com>
Thu, 20 Jan 2011 17:42:46 +0530
changeset 498 9f04b7bcc333
parent 435 1217d808d70f
child 500 42516ec56822
permissions -rw-r--r--
Add a new templatetag to render modified on and by line in documents. Add the necessary div tags, html templates, templatetag function and the CSS to give necessary layout and styling.

{% extends "base.html" %}

{% load form_helpers %}
{% load browse_helpers %}


{% block title %}
    {{textbook.name}}
{% endblock %}

{% block content %}
    {% as_modification_display "Created by" textbook.created_by textbook.creation_datetime %}
    <h3>{{ textbook.title }}</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 />

    {% 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 %}
      {% as_div_form form "Comment Form" csrf_token "Submit" %}
    {% endif %}

{% endblock %}