Finish bootstrapping list_detail
This commit is contained in:
parent
3be7ea7745
commit
998b53463d
8 changed files with 89 additions and 92 deletions
|
@ -54,11 +54,11 @@
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<p><input type="submit" class="todo-button" name="add_task" value="Submit"></p>
|
<p><input type="submit" class="btn btn-primary" name="add_task" value="Submit"></p>
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{{ form.as_p }}
|
{{ form.as_p }}
|
||||||
<p><input type="submit" class="todo-button" name="add_task" value="Submit"></p>
|
<p><input type="submit" class="btn btn-primary" name="add_task" value="Submit"></p>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -2,6 +2,7 @@
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
|
|
||||||
{% block extrahead %}
|
{% block extrahead %}
|
||||||
<!-- CSS and JavaScript for django-todo -->
|
<!-- CSS and JavaScripts for django-todo -->
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'todo/css/styles.css' %}" />
|
<link rel="stylesheet" type="text/css" href="{% static 'todo/css/styles.css' %}" />
|
||||||
{% endblock extrahead %}
|
{% endblock extrahead %}
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,33 @@
|
||||||
{% extends "todo/base.html" %}
|
{% extends "todo/base.html" %}
|
||||||
|
|
||||||
{% block title %}Delete list{% endblock %}
|
{% block title %}Delete list{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
{% if user.is_staff %}
|
||||||
|
<h1>Delete entire list: {{ task_list.name }} ?</h1>
|
||||||
|
|
||||||
{% if user.is_staff %}
|
<p>Category tally:</p>
|
||||||
<h1>Delete entire list: {{ task_list.name }} ?</h1>
|
|
||||||
|
|
||||||
<p>Category tally:</p>
|
<ul>
|
||||||
|
<li>Incomplete: {{ item_count_undone }} </li>
|
||||||
|
<li>Complete: {{ item_count_done }} </li>
|
||||||
|
<li>
|
||||||
|
<strong>Total: {{ item_count_total }}</strong>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<ul>
|
<p> ... all of which will be irretrievably
|
||||||
<li>Incomplete: {{ item_count_undone }} </li>
|
<strong>blown away</strong>. Are you sure you want to do that?</p>
|
||||||
<li>Complete: {{ item_count_done }} </li>
|
|
||||||
<li><strong>Total: {{ item_count_total }}</strong> </li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p> ... all of which will be irretrievably <strong>blown away</strong>. Are you sure you want to do that?</p>
|
<form action="" method="post" accept-charset="utf-8">
|
||||||
|
{% csrf_token %}
|
||||||
|
<input type="hidden" name="task_list" value="{{ task_list.id }}">
|
||||||
|
<p>
|
||||||
|
<a href="{% url 'todo:list_detail' task_list.id task_list.slug %}" class="btn btn-success">Return to list: {{ task_list.name }}</a>
|
||||||
|
<input type="submit" name="delete-confirm" value="Do it! →" class="btn btn-danger">
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
|
||||||
<form action="" method="post" accept-charset="utf-8">
|
|
||||||
{% csrf_token %}
|
|
||||||
<input type="hidden" name="task_list" value="{{ task_list.id }}">
|
|
||||||
<p><input type="submit" name="delete-confirm" value="Do it! →" class="todo-button"> </p>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<a href="{% url 'todo:list_detail' task_list.id task_list.slug %}">Return to list: {{ task_list.name }}</a>
|
{% else %}
|
||||||
|
<p>Sorry, you don't have permission to delete lists. Please contact your group administrator.</p>
|
||||||
{% else %}
|
{% endif %} {% endblock %}
|
||||||
<p>Sorry, you don't have permission to delete lists. Please contact your group administrator.</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
8
todo/templates/todo/include/toggle_delete.html
Normal file
8
todo/templates/todo/include/toggle_delete.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{% if list_slug != "mine" %} {% if view_completed %}
|
||||||
|
<a href="{% url 'todo:list_detail' list_id list_slug %}" class="btn btn-sm btn-warning">View incomplete tasks</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{% url 'todo:list_detail_completed' list_id list_slug %}" class="btn btn-sm btn-info">View completed tasks</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<a href="{% url 'todo:del_list' list_id list_slug %}" class="btn btn-sm btn-danger">Delete this list</a>
|
||||||
|
{% endif %}
|
|
@ -57,7 +57,7 @@
|
||||||
<h1>Tasks assigned to me (in all groups)</h1>
|
<h1>Tasks assigned to me (in all groups)</h1>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h1>{{ view_completed|yesno:"Completed tasks, Tasks" }} in "{{ task_list.name }}"</h1>
|
<h1>{{ view_completed|yesno:"Completed tasks, Tasks" }} in "{{ task_list.name }}"</h1>
|
||||||
<p>This list belongs to group {{ task_list.group }}</p>
|
<p><small><i>In workgroup "{{ task_list.group }}" - drag rows to set priorities.</i></small></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<form action="" name="show_tasks" method="post">
|
<form action="" name="show_tasks" method="post">
|
||||||
|
@ -77,10 +77,12 @@
|
||||||
{% for task in items %}
|
{% for task in items %}
|
||||||
<tr id="{{ task.id }}">
|
<tr id="{{ task.id }}">
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" name="toggle_done_tasks" value="{{ task.id }}" id="{{ task.id }}">
|
<input type="checkbox" name="toggle_done_tasks"
|
||||||
|
value="{{ task.id }}" id="{{ task.id }}"
|
||||||
|
{% if task.completed %}checked{% endif %}>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'todo:task_detail' task.id %}">{{ task.title|truncatewords:20 }}</a>
|
<a href="{% url 'todo:task_detail' task.id %}">{{ task.title|truncatewords:10 }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ task.created_date|date:"m/d/Y" }}
|
{{ task.created_date|date:"m/d/Y" }}
|
||||||
|
@ -108,24 +110,14 @@
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
<p>
|
|
||||||
<small><i>Drag rows to set priorities</i></small>
|
<input type="submit" name="process_tasks" value="Process selection" class="btn btn-sm btn-success">
|
||||||
</p>
|
{% include 'todo/include/toggle_delete.html' %}
|
||||||
<p><input type="submit" name="process_tasks" value="Continue..." class="todo-button"></p>
|
|
||||||
</form>
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h4>No items on this list yet (add one!)</h4>
|
<h4>No items on this list yet (add one!)</h4>
|
||||||
{% endif %}
|
{% include 'todo/include/toggle_delete.html' %}
|
||||||
|
|
||||||
{% if list_slug != "mine" %}
|
|
||||||
|
|
||||||
{% if view_completed %}
|
|
||||||
<p><a href="{% url 'todo:list_detail' list_id list_slug %}">View incomplete tasks</a></p>
|
|
||||||
{% else %}
|
|
||||||
<p><a href="{% url 'todo:list_detail_completed' list_id list_slug %}">View completed tasks</a></p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<p><a class="todo" href="{% url 'todo:del_list' list_id list_slug %}">Delete this list</a></p>
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,26 @@
|
||||||
{% extends "todo/base.html" %}
|
{% extends "todo/base.html" %}
|
||||||
|
|
||||||
{% block title %}{{ list_title }} Todo Lists{% endblock %}
|
{% block title %}{{ list_title }} Todo Lists{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<h1>Todo Lists</h1>
|
||||||
|
|
||||||
<h1>Todo Lists</h1>
|
<p>{{ item_count }} items in {{ list_count }} list{{ list_count|pluralize }}</p>
|
||||||
|
|
||||||
<p>{{ item_count }} items in {{ list_count }} list{{ list_count|pluralize }}</p>
|
{% regroup lists by group as section_list %}
|
||||||
|
{% for group in section_list %}
|
||||||
|
<h3>Group: {{ group.grouper }}</h3>
|
||||||
|
<ul class="list-group">
|
||||||
|
{% for item in group.list %}
|
||||||
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||||
|
<a href="{% url 'todo:list_detail' item.id item.slug %}">{{ item.name }}</a>
|
||||||
|
<span class="badge badge-primary badge-pill">{{ item.item_set.count }}</span>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
{% regroup lists by group as section_list %}
|
<div class="mt-3">
|
||||||
|
<a href="{% url 'todo:add_list' %}" class="btn btn-primary">Create new todo list</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% for group in section_list %}
|
{% endblock %}
|
||||||
<h3>Group: {{ group.grouper }}</h3>
|
|
||||||
<ul class="list-group">
|
|
||||||
{% for item in group.list %}
|
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
||||||
<a href="{% url 'todo:list_detail' item.id item.slug %}">{{ item.name }}</a>
|
|
||||||
<span class="badge badge-primary badge-pill">{{ item.item_set.count }}</span>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
<div class="mt-3"><a href="{% url 'todo:add_list' %}" class="btn btn-primary">Create new todo list</a></div>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
|
@ -1,33 +1,30 @@
|
||||||
{% extends "todo/base.html" %}
|
{% extends "todo/base.html" %}
|
||||||
|
|
||||||
{% block title %}Search results{% endblock %}
|
{% block title %}Search results{% endblock %}
|
||||||
|
{% block content_title %}<h2 class="page_title">Search</h2>{% endblock %}
|
||||||
{% block content_title %}
|
|
||||||
<h2 class="page_title">Search</h2>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if found_items %}
|
{% if found_items %}
|
||||||
<h2>{{found_items.count}} search results for term: "{{ query_string }}"</h2>
|
<h2>{{found_items.count}} search results for term: "{{ query_string }}"</h2>
|
||||||
<div class="post_list">
|
<div class="post_list">
|
||||||
{% for f in found_items %}
|
{% for f in found_items %}
|
||||||
<p><strong><a href="{% url 'todo:task_detail' f.id %}">{{ f.title }}</a></strong><br />
|
<p>
|
||||||
<span class="minor">
|
<strong>
|
||||||
In list:
|
<a href="{% url 'todo:task_detail' f.id %}">{{ f.title }}</a>
|
||||||
<a href="{% url 'todo:list_detail' f.task_list.id f.task_list.slug %}">
|
</strong>
|
||||||
{{ f.task_list.name }}
|
<br />
|
||||||
</a>
|
<span class="minor">
|
||||||
<br />
|
In list:
|
||||||
Assigned to:
|
<a href="{% url 'todo:list_detail' f.task_list.id f.task_list.slug %}">
|
||||||
{% if f.assigned_to %}{{ f.assigned_to }}{% else %}Anyone{% endif %}
|
{{ f.task_list.name }}
|
||||||
(created by: {{ f.created_by }})
|
</a>
|
||||||
<br />
|
<br /> Assigned to: {% if f.assigned_to %}{{ f.assigned_to }}{% else %}Anyone{% endif %} (created by: {{ f.created_by }})
|
||||||
Complete: {{ f.completed|yesno:"Yes,No" }}
|
<br /> Complete: {{ f.completed|yesno:"Yes,No" }}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h2> No results to show, sorry.</h2>
|
<h2> No results to show, sorry.</h2>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -87,14 +87,14 @@
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<p><input type="submit" class="todo-button" name="edit_task" value="Edit task"></p>
|
<p><input type="submit" class="btn btn-primary" name="edit_task" value="Edit task"></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
<h3>Add comment</h3>
|
<h3>Add comment</h3>
|
||||||
<textarea name="comment-body"></textarea>
|
<textarea name="comment-body"></textarea>
|
||||||
<p><input class="todo-button" type="submit" value="Submit"></p>
|
<p><input class="btn btn-primary" type="submit" value="Submit"></p>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue