templates/task/view.html
changeset 156 7cad1e92713d
parent 134 3a49a7e23442
child 159 a74a32a5a3e1
equal deleted inserted replaced
155:52958289d81f 156:7cad1e92713d
     3     {{task.title}}
     3     {{task.title}}
     4 {% endblock %}
     4 {% endblock %}
     5 {% block content %}
     5 {% block content %}
     6     {% if task_viewable %}
     6     {% if task_viewable %}
     7         <h3>{{ task.title }}</h3><br />
     7         <h3>{{ task.title }}</h3><br />
     8         <!-- we have to write our own datetime.strftime filter and use in the next line -->
     8 
     9         created by <a href="/user/view/uid={{ task.created_by.id }}">{{ task.created_by.username }}</a>
     9         {% if can_edit %}
       
    10             <a href="/task/edit/tid={{task.id}}">Edit task</a>
       
    11         {% endif %}
       
    12         
       
    13         {% if can_close %}
       
    14             <a href="/task/close/tid={{task.id}}">Close this task</a>
       
    15         {% endif %}
       
    16                     
       
    17         {% if can_publish %}
       
    18             <a href="/task/publish/tid={{task.id}}">Publish task</a>
       
    19         {% endif %}
       
    20 
       
    21         <hr />created by <a href="/user/view/uid={{ task.created_by.id }}">{{ task.created_by.username }}</a>
    10         on {{task.creation_datetime|date:"D d M Y"}} at {{task.creation_datetime|time:"H:i"}}<br />
    22         on {{task.creation_datetime|date:"D d M Y"}} at {{task.creation_datetime|time:"H:i"}}<br />
    11 
       
    12         {% if is_mentor %}
       
    13         
       
    14             {% ifequal task.status "UP" %}
       
    15                 <a href="/task/edit/tid={{task.id}}">Edit task</a>
       
    16             {% else %}
       
    17                 <a href="/task/close/tid={{task.id}}">Close this task</a>
       
    18             {% endifequal %}
       
    19             
       
    20             {% if can_publish %}
       
    21                 <a href="/task/publish/tid={{task.id}}">Publish task</a>
       
    22             {% endif %}
       
    23             <br />
       
    24         {% endif %}
       
    25         
    23         
    26         {% ifequal task.status "UP" %}
    24         {% ifequal task.status "UP" %}
    27             Task can be viewed by:
    25             Task can be viewed by:
    28         {% else %}
    26         {% else %}
    29             Mentors:
    27             Mentors:
    30         {% endifequal %}
    28         {% endifequal %}
       
    29         
    31         {% for mentor in mentors %}
    30         {% for mentor in mentors %}
    32             <a href="/user/view/uid={{mentor.id}}">{{mentor.username}}|</a>
    31             <a href="/user/view/uid={{mentor.id}}">{{mentor.username}}</a>
    33         {% endfor %}
    32         {% endfor %}
       
    33         
    34         {% if can_mod_mentors %}
    34         {% if can_mod_mentors %}
    35             <a href="/task/addmentor/tid={{task.id}}">
    35             <a href="/task/addmentor/tid={{task.id}}">
    36             {% ifequal task.status "UP" %}
    36             {% ifequal task.status "UP" %}
    37                 Request others to view/edit the task
    37                 Request others to view/edit the task
    38             {% else %}
    38             {% else %}
    39                 Add another Mentor to this task
    39                 Add another Mentor to this task
    40             {% endifequal %}</a><br />
    40             {% endifequal %}</a>
    41         {% endif %}
    41         {% endif %}
       
    42         <br />
       
    43         
       
    44         <hr />
       
    45         <b>Description:</b><br />
       
    46         {{ task.desc }}
       
    47         <hr />
    42 
    48 
    43         {% if deps %}
    49         {% if deps %}
    44         
    50         
    45             <br />The task has following dependencies.<br />
    51             <br />The task has following dependencies.<br />
    46             {% for dep in deps %}
    52             {% for dep in deps %}
    73                 {% endif %}
    79                 {% endif %}
    74                 
    80                 
    75             {% endif %}
    81             {% endif %}
    76         {% endif %}
    82         {% endif %}
    77         
    83         
       
    84         {% ifequal task.status "CD" %}
       
    85             Task has been closed by <a href="/user/view={{closing_notification.sent_from.id}}">{{closing_notification.sent_from.username}}</a>
       
    86             on {{closing_notification.sent_date|date:"D d M Y"}} at {{closing_notification.sent_date|time:"H:i"}}<br />
       
    87             <b>Reason: </b>{{closing_notification.remarks}}<br />
       
    88         {% endifequal %}
    78         
    89         
    79         <hr>
    90         {% ifequal task.status "CM" %}
    80         <br />Description:<br />
    91             Task has been marked complete by <a href="/user/view={{completed_notification.sent_from.id}}">
    81         <br />{{ task.desc }}<br />
    92             {{completed_notification.sent_from.username}}</a>
    82         <hr>
    93             on {{completed_notification.sent_date|date:"D d M Y"}} at {{completed_notification.sent_date|time:"H:i"}}<br />
       
    94         {% endifequal %}
       
    95             
       
    96         {% ifequal task.status "OP" %}
       
    97             <br />There are no users working on this task.<br />
       
    98         {% endifequal %}
       
    99             
       
   100         {% if assigned_users %}
       
   101             Users working on this task:
       
   102             {% for user in assigned_users %}
       
   103                 <a href="/user/view/uid={{user.id}}">{{user.username}}</a>
       
   104             {% endfor %}
       
   105             {% if is_mentor %}
       
   106                 <a href="/task/remuser/tid={{task.id}}">Remove an existing user</a>
       
   107             {% endif %}
       
   108             <br />
       
   109         {% endif %}
    83         
   110         
    84         {% ifnotequal task.status "CM" %}
   111         {% if can_assign_credits %}
    85             {% if assigned_users %}
   112             <a href="/task/assigncredits/tid={{task.id}}">View/Assign credits</a>
    86                 Users working on this task:
   113         {% endif %}
    87                 {% for user in assigned_users %}
   114         
    88                     <a href="/user/view/uid={{user.id}}">{{user.username}}</a>|
   115         {% if task_claimable %}
    89                 {% endfor %}
   116             <a href="/task/claim/tid={{task.id}}">View claims</a>
    90                 {% if is_mentor %}
   117         {% endif %}
    91                     <a href="/task/remuser/tid={{task.id}}">Remove an existing user</a>
       
    92                 <br />
       
    93                 {% endif %}
       
    94             {% else %}
       
    95                 There are no users currently working on this task.<br />
       
    96             {% endif %}
       
    97             {% if can_assign_credits %}
       
    98                 <a href="/task/assigncredits/tid={{task.id}}">View/Assign credits</a>
       
    99             {% endif %}
       
   100             {% if not is_guest and task_claimable %}
       
   101                 <a href="/task/claim/tid={{task.id}}">View claims</a><br />
       
   102             {% endif %}
       
   103         {% else %}
       
   104             {% ifequal task.status "CD" %}
       
   105                 The task has been closed by .. due to ..
       
   106             {% else %}
       
   107                 The task is complete.
       
   108             {% endifequal %}
       
   109         {% endifnotequal %}
       
   110         
   118         
   111         {% if comments %}
   119         {% if comments %}
   112             <hr />
   120             <hr />
   113             <br/>comments:<br />
   121             comments:<br /><br />
   114             {% for comment in comments %}
   122             {% for comment in comments %}
   115                 <br /><a href="/user/view/uid={{comment.created_by.id}}">{{ comment.created_by.username }}</a> at {{ comment.creation_datetime.ctime }} wrote:<br />
   123                 <a href="/user/view/uid={{comment.created_by.id}}">{{ comment.created_by.username }}</a> 
   116             {{ comment.data }}<br />
   124                 on {{ comment.creation_datetime|date:"D d M Y"}} at {{comment.creation_datetime|time:"H:i"}} wrote:<br />
       
   125             {{ comment.data }}<br /><br />
   117             {% endfor %}
   126             {% endfor %}
   118         {% endif %}
   127         {% endif %}
   119 
   128 
   120         {% if not is_guest %}
   129         {% if not is_guest %}
       
   130         <hr />
   121             {% ifnotequal task.status "CM" %}
   131             {% ifnotequal task.status "CM" %}
   122                 <br />Add comment:<br />
   132                 Add comment:<br />
   123                 <form action="" method="post">
   133                 <form action="" method="post">
   124                 <!-- we might even want to use forms here -->
   134                 <!-- we might even want to use forms here -->
   125                 <textarea  name="data"></textarea><br />
   135                 <textarea  name="data"></textarea><br />
   126                 <input type="submit" value="Submit">
   136                 <input type="submit" value="Submit">
   127                 </form>
   137                 </form>