Updates to person model. Removed comments for now in favour of a simple notes section that can be easily modified as a text field. Will look at introducing this again in the future.

This commit is contained in:
tomtom5152
2014-10-31 02:23:20 +00:00
parent c39504a4ce
commit 2a0a223902
9 changed files with 121 additions and 21 deletions

View File

@@ -6,8 +6,10 @@
{% block content %}
<div class="col-sm-10 col-sm-offset-1">
<h3>{{ object.name }}</h3>
<div class="pull-right">
<a href="{% url 'person_update' object.pk %}" class="btn btn-primary">Edit <span class="glyphicon glyphicon-pencil"></span></a>
<a href="{% url 'person_update' object.pk %}" class="btn btn-primary">Edit <span
class="glyphicon glyphicon-pencil"></span></a>
</div>
<div class="row col-sm-12">
<div class="col-sm-6">
@@ -23,6 +25,9 @@
<dt>Address</dt>
<dd>{{ object.address|linebreaksbr }}</dd>
<dt>Notes</dt>
<dd>{{ object.notes|linebreaksbr }}</dd>
</dl>
</div>
</div>

View File

@@ -37,6 +37,13 @@
</div>
</div>
<div class="form-group">
<label for="{{ form.notes.id_for_label }}" class="col-sm-2 control-label">{{ form.notes.label }}</label>
<div class="col-sm-10">
{% render_field form.notes class+="form-control" placeholder=form.notes.label %}
</div>
</div>
<div class="form-group">
<input class="btn btn-primary pull-right" type="submit" />
</div>

View File

@@ -16,7 +16,7 @@
<td>Name</td>
<td>Email</td>
<td>Phone</td>
<td>Comments</td>
<td>Notes</td>
<td></td>
</tr>
</thead>
@@ -27,7 +27,7 @@
<td>{{ person.name }}</td>
<td>{{ person.email }}</td>
<td>{{ person.phone }}</td>
<td>{{ person.comment_list|length }}</td>
<td>{{ person.notes|yesno|capfirst }}</td>
<td>Add buttons</td>
</tr>
{% empty %}