pytask/templates/task/view_textbook.html
author Nishanth Amuluru <nishanth@fossee.in>
Tue, 11 Jan 2011 00:34:23 +0530
changeset 135 014d812e625e
parent 132 1be4a3c09a47
child 139 4f0cfd486d9b
permissions -rw-r--r--
edit textbook works fine
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
132
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     1
{% extends 'base.html' %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     2
{% block title %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     3
    {{textbook.name}}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     4
{% endblock %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     5
{% block content %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     6
    <h3>{{ textbook.name }}</h3>
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     7
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     8
    {% if can_edit %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     9
        <a href="/task/textbook/edit/tid={{textbook.uniq_key}}">Edit Text book</a>
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    10
    {% endif %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    11
    
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    12
    {% if can_approve %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    13
        <a href="/task/textbook/approve/tid={{textbook.uniq_key}}">Approve Text book</a>
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    14
    {% endif %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    15
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    16
    <hr />created by <a href="/user/view/uid={{ textbook.created_by.id }}">{{ textbook.created_by.username }}</a>
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    17
    on {{textbook.creation_datetime|date:"D d M Y"}} at {{textbook.creation_datetime|time:"H:i"}}<br />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    18
    <hr />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    19
    
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    20
    {% if textbook.tags.count %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    21
        Tags: 
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    22
        {% for tag in textbook.tags %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    23
            {{tag}}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    24
        {% endfor %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    25
        <hr />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    26
    {% endif %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    27
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    28
    Chapters: <br />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    29
    {% for chap in chapters %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    30
    <ul>
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    31
	    <li><a href="/task/view/tid={{chap.uniq_key}}">{{chap.title}}</a> </li>
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    32
    </ul>
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    33
    {% endfor %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    34
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    35
    
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    36
    
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    37
        <hr />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    38
    {% if comments %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    39
        comments:<br /><br />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    40
        {% for comment in comments %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    41
            <a href="/user/view/uid={{comment.commented_by.id}}">{{ comment.commented_by.username }}</a> 
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    42
            on {{ comment.comment_datetime|date:"D d M Y"}} at {{comment.comment_datetime|time:"H:i"}} wrote:<br />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    43
        {{ comment.data|linebreaksbr }}<br />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    44
        {% endfor %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    45
    {% endif %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    46
    <hr />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    47
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    48
    {% if can_comment %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    49
    Add comment:<br />
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    50
	<form action="" method="post">
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    51
	    {% csrf_token %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    52
	    {{form.as_p}}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    53
	<input type="submit" value="Submit">
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    54
	</form>                
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    55
    {% endif %}
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    56
1be4a3c09a47 view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    57
{% endblock %}