Remove most CSS, clean up templates

- Assume the existing site has its own styles
This commit is contained in:
Scot Hacker 2014-11-07 22:26:53 -08:00
parent 30127a23de
commit b388aece1b
7 changed files with 201 additions and 281 deletions

View file

@ -24,12 +24,6 @@ a.showlink {
text-decoration: underline;
}
#tasktable a {
font-weight: bold;
font-family: "Arial";
text-decoration: none;
color: #474747;
}
label {
display: block;
@ -50,20 +44,6 @@ input#id_priority {
width: 30px;
}
.todo-button {
border: 1px solid #9B9B9B;
background: #E0E0E0;
padding-bottom: 2px;
font-weight: bold;
}
hr {
color: #E5E5E5;
}
#slideToggle {
color: #4A8251;
}
.todo-break {
margin-top: 30px;
@ -74,25 +54,6 @@ table.nocolor, table.nocolor tr, table.nocolor td {
background-color: transparent;
}
table#tasktable td, table#tasktable th {
padding: 5px;
/* font-size:0.9em;*/
}
table#tasktable th {
text-align: left;
/* background-color: #9BCAE4; */
background-color: #046380;
color: #fff;
}
table#tasktable tr.row1 {
background-color: #AEF0BB;
}
table#tasktable tr.row2 {
background-color: #B6F3D5;
}
.minor {
font-style: italic;

View file

@ -5,79 +5,69 @@
{% block content %}
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
<h2>{{ task }}</h2>
<form action="" method="POST">
{% csrf_token %}
{% if task.note %}
<div class="task_note"><strong>Note:</strong> {{ task.note|safe|urlize|linebreaks }}</div>
{% endif %}
<h2>{{ task }}</h2>
<div id="TaskEdit">
<h3>File Trouble Ticket</h3>
<p>Trouble with a computer or other technical system at the J-School? <br />
Use this form to report the difficulty - we'll get right back to you. </p>
<form action="" method="POST">
{% csrf_token %}
{% if form.errors %}
{% for error in form.errors %}
<ul class="errorlist">
<li><strong>The {{ error|escape }} field is required.</strong></li>
</ul>
{% endfor %}
<br />
{% endif %}
{% if task.note %}
<div class="task_note"><strong>Note:</strong> {{ task.note|safe|urlize|linebreaks }}</div>
{% endif %}
<table>
{{ form.management_form }}
{{ form.id }}
<div id="TaskEdit">
<h3>File Trouble Ticket</h3>
<p>Trouble with a computer or other technical system at the J-School? <br />
Use this form to report the difficulty - we'll get right back to you. </p>
<tr>
<td>Summary:</td>
{% if form.errors %}
{% for error in form.errors %}
<ul class="errorlist">
<li><strong>The {{ error|escape }} field is required.</strong></li>
</ul>
{% endfor %}
<br />
{% endif %}
<td>{{ form.title }} <br />
Include the workstation number in your summary, e.g. <br />
"Radio Lab # 4: Purple smoke pouring out the back."
</td>
</tr>
<table>
{{ form.management_form }}
{{ form.id }}
<tr>
<td valign="top">Note:</td>
<tr>
<td>Summary:</td>
<td valign="top">{{ form.note }}<br />
Please describe the problem. </td>
</tr>
<td>{{ form.title }} <br />
Include the workstation number in your summary, e.g. <br />
"Radio Lab # 4: Purple smoke pouring out the back."
</td>
</tr>
<tr>
<td>Priority:</td>
<td>{{ form.priority }} <br />
Enter a number between 1 and 5, <br />
where 5 is highest ("Computer is on fire = True").
</td>
</tr>
</table>
<p><input type="submit" class="todo-button" name="add_task" value="Submit"></p>
</div>
<tr>
<td valign="top">Note:</td>
<td valign="top">{{ form.note }}<br />
Please describe the problem. </td>
</tr>
<tr>
<td>Priority:</td>
<td>{{ form.priority }} <br />
Enter a number between 1 and 5, <br />
where 5 is highest ("Computer is on fire = True").
</td>
</tr>
</table>
<p><input type="submit" class="todo-button" name="add_task" value="Submit"></p>
</div>
</form>
</form>
{% endblock %}

View file

@ -4,12 +4,12 @@
{% block content %}
<h2>Add a list:</h2>
<h2>Add a list:</h2>
<form action="" method="post">
{% csrf_token %}
<table>{{ form }}</table>
<p><input type="submit" value="Submit" class="todo-button"></p>
</form>
<form action="" method="post">
{% csrf_token %}
<table>{{ form }}</table>
<p><input type="submit" value="Submit" class="todo-button"></p>
</form>
{% endblock %}

View file

@ -5,53 +5,48 @@
{% block content %}
{# Only admins can delete lists. #}
{% ifequal can_del 1 %}
{# Only admins can delete lists. #}
{% ifequal can_del 1 %}
{% if list_killed %}
{% if list_killed %}
<p> {{ list.name }} is gone.</p>
<p> {{ list.name }} is gone.</p>
<a href="{% url 'todo-lists' %}">Return to lists</a>
{% else %}
<h1>Delete entire list: {{ 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>
<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="list" value="{{ list.id }}" id="some_name">
<p><input type="submit" name="delete-confirm" value="Do it! &rarr;" class="todo-button"> </p>
</form>
<a href="{% url 'todo-incomplete_tasks' list.id list_slug %}">Return to list: {{ list.name }}</a>
{% endif %}
<a href="{% url 'todo-lists' %}">Return to lists</a>
{% else %}
<h1>Delete entire list: {{ 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>
<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="list" value="{{ list.id }}" id="some_name">
<p><input type="submit" name="delete-confirm" value="Do it! &rarr;" class="todo-button"> </p>
</form>
<a href="{% url 'todo-incomplete_tasks' list.id list_slug %}">Return to list: {{ list.name }}</a>
{% endif %}
{% else %}
<p>Sorry, you don't have permission to delete lists. Please contact your group administrator.</p>
{% endifequal %}
<p>Sorry, you don't have permission to delete lists. Please contact your group administrator.</p>
{% endifequal %}
{% endblock %}

View file

@ -12,10 +12,6 @@
{% block content %}
{% if message %}
<p class="message">{{ message }}</p>
{% endif %}
{% if found_items %}
<h2>{{found_items.count}} search results for term: "{{ query_string }}"</h2>
<div class="post_list">

View file

@ -5,61 +5,52 @@
{% block content %}
<script type="text/javascript">
<script type="text/javascript">
function order_tasks(data) {
// The JQuery plugin tableDnD provides a serialize() function which provides the re-ordered
// data in a list. We pass that list as an object called "data" to a Django view
// to save the re-ordered data into the database.
function order_tasks(data) {
// The JQuery plugin tableDnD provides a serialize() function which provides the re-ordered
// data in a list. We pass that list as an object called "data" to a Django view
// to save the re-ordered data into the database.
$.post("{% url 'todo-reorder_tasks' %}", data, "json");
return false;
};
$.post("{% url 'todo-reorder_tasks' %}", data, "json");
return false;
};
$(document).ready(function() {
// Initialise the task table for drag/drop re-ordering
$("#tasktable").tableDnD();
$(document).ready(function() {
// Initialise the task table for drag/drop re-ordering
$("#tasktable").tableDnD();
$('#tasktable').tableDnD({
onDrop: function(table, row) {
order_tasks($.tableDnD.serialize());
}
$('#tasktable').tableDnD({
onDrop: function(table, row) {
order_tasks($.tableDnD.serialize());
}
});
// Initially hide the Add Task form
$('#AddTask').hide();
// toggle slide to show the Add Task form when link clicked
$('#slideToggle').click(function(){
$(this).siblings('#AddTask').slideToggle();
});
});
// Initially hide the Add Task form
$('#AddTask').hide();
// toggle slide to show the Add Task form when link clicked
$('#slideToggle').click(function(){
$(this).siblings('#AddTask').slideToggle();
});
});
</script>
</script>
{% ifequal list_slug "mine" %}
<h1>Tasks assigned to {{ request.user }}</h1>
{% else %}
{% ifequal auth_ok 1 %}
<h1>Tasks filed under "{{ list.name }}"</h1>
<p>This list belongs to group {{ list.group }}</p>
{% endifequal %}
{% endifequal %}
{% ifequal auth_ok 1 %}
<h1>Tasks filed under "{{ list.name }}"</h1>
<p>This list belongs to group {{ list.group }}</p>
{% endifequal %}
{% endifequal %}
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% ifequal auth_ok 1 %}
<form action="" method="POST">
{% csrf_token %}
<form action="" method="POST">
{% csrf_token %}
{# Only show task adder if viewing a proper list #}
{% ifnotequal list_slug "mine" %}

View file

@ -5,115 +5,102 @@
{% block content %}
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function() {
// Initially hide the TaskEdit form
$('#TaskEdit').hide();
$(document).ready(function() {
// Initially hide the TaskEdit form
$('#TaskEdit').hide();
// toggle slide to show the Add Task form when link clicked
$('#slideToggle').click(function(){
$(this).siblings('#TaskEdit').slideToggle();
// toggle slide to show the Add Task form when link clicked
$('#slideToggle').click(function(){
$(this).siblings('#TaskEdit').slideToggle();
});
});
});
</script>
</script>
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% ifequal auth_ok 1 %}
<h2>{{ task }}</h2>
<form action="" method="POST">
{% csrf_token %}
<p id="slideToggle" ><strong>&rarr; Click to edit details &larr;</strong></p>
<p><strong>In list:</strong> <a href="{% url 'todo-incomplete_tasks' task.list.id task.list.slug %}" class="showlink">{{ task.list }}</a><br />
<strong>Assigned to:</strong> {{ task.assigned_to.first_name }} {{ task.assigned_to.last_name }}<br />
<strong>Created by:</strong> {{ task.created_by.first_name }} {{ task.created_by.last_name }}<br />
<strong>Due date:</strong> {{ task.due_date }}<br />
<strong>Completed:</strong> {{ form.completed }}<br />
</p>
{% ifequal auth_ok 1 %}
{% if task.note %}
<div class="task_note"><strong>Note:</strong> {{ task.note|safe|urlize|linebreaks }}</div>
{% endif %}
<h2>{{ task }}</h2>
<div id="TaskEdit">
<h3>Edit Task</h3>
<form action="" method="POST">
{% csrf_token %}
<p id="slideToggle" ><strong>&rarr; Click to edit details &larr;</strong></p>
<table>
{{ form.management_form }}
{{ form.id }}
<tr>
<td>Title:</td>
<td>{{ form.title }} </td>
</tr>
<p><strong>In list:</strong> <a href="{% url 'todo-incomplete_tasks' task.list.id task.list.slug %}" class="showlink">{{ task.list }}</a><br />
<strong>Assigned to:</strong> {{ task.assigned_to.first_name }} {{ task.assigned_to.last_name }}<br />
<strong>Created by:</strong> {{ task.created_by.first_name }} {{ task.created_by.last_name }}<br />
<strong>Due date:</strong> {{ task.due_date }}<br />
<strong>Completed:</strong> {{ form.completed }}<br />
</p>
<tr>
<td>List:</td>
<td>{{ form.list }} </td>
</tr>
<tr>
<td>Due:</td>
<td>{{ form.due_date }} </td>
</tr>
<tr>
<td>Assigned to:</td>
<td>{{ form.assigned_to }} </td>
</tr>
<tr>
<td valign="top">Note:</td>
<td>{{ form.note }} </td>
</tr>
<tr>
<td>Priority:</td>
<td>{{ form.priority }} </td>
</tr>
</table>
<p><input type="submit" class="todo-button" name="edit_task" value="Edit task"></p>
</div>
{% if task.note %}
<div class="task_note"><strong>Note:</strong> {{ task.note|safe|urlize|linebreaks }}</div>
{% endif %}
<div id="TaskEdit">
<h3>Edit Task</h3>
<table>
{{ form.management_form }}
{{ form.id }}
<tr>
<td>Title:</td>
<td>{{ form.title }} </td>
</tr>
<tr>
<td>List:</td>
<td>{{ form.list }} </td>
</tr>
<hr />
<tr>
<td>Due:</td>
<td>{{ form.due_date }} </td>
</tr>
<h3>Add comment</h3>
<textarea name="comment-body"></textarea>
<p><input class="todo-button"type="submit" value="Submit"></p>
</form>
<h3>Comments on this task</h3>
<tr>
<td>Assigned to:</td>
<td>{{ form.assigned_to }} </td>
</tr>
<div class="task_comments">
{% for comment in comment_list %}
<p><strong>{{ comment.author.first_name }} {{ comment.author.last_name }}, {{ comment.date|date:"F d Y P" }}</strong> </p>
{{ comment.body|safe|urlize|linebreaks }}
{% empty %}
<p>No Comments</p>
{% endfor %}
</div>
<tr>
<td valign="top">Note:</td>
<td>{{ form.note }} </td>
</tr>
<tr>
<td>Priority:</td>
<td>{{ form.priority }} </td>
</tr>
</table>
<p><input type="submit" class="todo-button" name="edit_task" value="Edit task"></p>
</div>
<hr />
<h3>Add comment</h3>
<textarea name="comment-body"></textarea>
<p><input class="todo-button"type="submit" value="Submit"></p>
</form>
<h3>Comments on this task</h3>
<div class="task_comments">
{% for comment in comment_list %}
<p><strong>{{ comment.author.first_name }} {{ comment.author.last_name }}, {{ comment.date|date:"F d Y P" }}</strong> </p>
{{ comment.body|safe|urlize|linebreaks }}
{% empty %}
<p>No Comments</p>
{% endfor %}
</div>
{% endifequal %}
{% endifequal %}
{% endblock %}