Prettier task edit UI
This commit is contained in:
parent
5a26aa65ab
commit
24119b91ac
2 changed files with 89 additions and 74 deletions
|
@ -3,8 +3,7 @@
|
|||
<form action="" name="add_task" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
|
||||
<div id="AddEditTask" class="collapse mt-3">
|
||||
<div id="AddEditTask" class="mt-3">
|
||||
<div class="form-group">
|
||||
<label for="id_title" name="title">Task</label>
|
||||
<input type="text" class="form-control" id="id_title" name="title" required placeholder="Task title"
|
||||
|
@ -33,13 +32,16 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_notify">Notify</label>
|
||||
<input type="checkbox" checked="checked" class="form-control" id="id_notify" name="notify" aria-describedby="inputNotifyHelp"
|
||||
value="{{ form.notify.text }}">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" aria-describedby="inputNotifyHelp" checked="checked" id="id_notify">
|
||||
<label class="form-check-label" for="id_notify">
|
||||
Notify
|
||||
</label>
|
||||
<small id="inputNotifyHelp" class="form-text text-muted">
|
||||
Email notifications will only be sent if task is assigned to someone other than yourself.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="priority"
|
||||
value="{% if form.priority.value %}{{ form.priority.value }}{% else %}999{% endif %}" id="id_priority">
|
||||
|
|
|
@ -19,28 +19,29 @@
|
|||
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<div class="card-deck">
|
||||
<div class="card col-sm-8">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">{{ task.title }}</h3>
|
||||
{% if task.note %}
|
||||
<p class="card-text">{{ task.note|safe|urlize|linebreaks }}</p>
|
||||
<div class="card-text">{{ task.note|safe|urlize|linebreaks }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<div class="mb-2">
|
||||
|
||||
<div class="card col-sm-4 p-0">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item">
|
||||
<button
|
||||
class="btn btn-sm btn-primary"
|
||||
id="EditTaskButton"
|
||||
type="button"
|
||||
data-toggle="collapse"
|
||||
data-target="#AddEditTask"
|
||||
>
|
||||
data-target="#TaskEdit">
|
||||
Edit Task
|
||||
</button>
|
||||
|
||||
<form method="post" action="{% url "todo:task_toggle_done" task.id %}" role="form" style="display:inline;">
|
||||
<form method="post" action="{% url "todo:task_toggle_done" task.id %}" role="form" class="d-inline">
|
||||
{% csrf_token %}
|
||||
<div style="display:inline;">
|
||||
<button class="btn btn-info btn-sm" type="submit" name="toggle_done">
|
||||
|
@ -49,7 +50,7 @@
|
|||
</div>
|
||||
</form>
|
||||
|
||||
<form method="post" action="{% url "todo:delete_task" task.id %}" role="form" style="display:inline;">
|
||||
<form method="post" action="{% url "todo:delete_task" task.id %}" role="form" class="d-inline">
|
||||
{% csrf_token %}
|
||||
<div style="display:inline;">
|
||||
<button class="btn btn-danger btn-sm" type="submit" name="submit_delete">
|
||||
|
@ -57,11 +58,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<ul class="list-group">
|
||||
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<strong>Assigned to:</strong>
|
||||
{% if task.assigned_to %} {{ task.assigned_to.get_full_name }} {% else %} Anyone {% endif %}
|
||||
|
@ -89,8 +86,19 @@
|
|||
{{ task.task_list }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="TaskEdit" class="collapse">
|
||||
{# Task edit / new task form #}
|
||||
{% include 'todo/include/task_edit.html' %}
|
||||
<form action="" method="post">
|
||||
<div class="card border-danger">
|
||||
<div class="card-header">Merge task</div>
|
||||
<div class="card-body">
|
||||
<div class="">
|
||||
<p>Merging is a destructive operation. This task will not exist anymore, and comments will be moved to the target task.</p>
|
||||
{% csrf_token %}
|
||||
{% for field in merge_form.visible_fields %}
|
||||
<p>
|
||||
|
@ -98,19 +106,14 @@
|
|||
{{ field }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
<input class="btn btn-sm btn-primary" type="submit" name="merge_task_into" value="Merge task">
|
||||
<input class="d-inline btn btn-sm btn-outline-danger" type="submit" name="merge_task_into" value="Merge">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="TaskEdit">
|
||||
{# Task edit / new task form #}
|
||||
{% include 'todo/include/task_edit.html' %}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-3">
|
||||
<h5>Add comment</h5>
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
|
@ -119,21 +122,31 @@
|
|||
</div>
|
||||
<input class="btn btn-sm btn-primary" type="submit" name="add_comment" value="Add Comment">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="task_comments mt-4">
|
||||
{% if comment_list %}
|
||||
<h5>Comments on this task</h5>
|
||||
{% for comment in comment_list %}
|
||||
<p>
|
||||
<strong>{{ comment.author_text }},
|
||||
<div class="mb-3 card">
|
||||
<div class="card-header">
|
||||
<div class="float-left">
|
||||
{% if comment.email_message_id %}
|
||||
<span class="badge badge-warning">email</span>
|
||||
{% endif %}
|
||||
{{ comment.author_text }}
|
||||
</div>
|
||||
<span class="float-right d-inline-block text-muted">
|
||||
{{ comment.date|date:"F d Y P" }}
|
||||
</strong>
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-monospace card-body">
|
||||
{{ comment.body|safe|urlize|linebreaks }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<h5>No comments (yet).</h5>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue