pytask/templates/task/view_textbook.html
author Madhusudan.C.S <madhusudancs@gmail.com>
Thu, 20 Jan 2011 17:46:49 +0530
changeset 501 b84d6a1d4603
parent 500 42516ec56822
child 530 ab9b9e59de9d
permissions -rw-r--r--
Change all the queries to Textbook model to Tasks. Since Textbook model is deprecated now, implemented the changes in the views to query respected queries and make corresponding changes in the views.

{% extends "base.html" %}


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


{% block title %}
    {{ textbook.title }}
{% 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 %}

    Chapters: <br />
    {% if chapters %}
      <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 %}
      (Chapters are yet to be added by the Coordinator or T/A.)<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 %}