Added the ability to add notes to user's accounts

This commit is contained in:
2011-12-07 19:29:40 +00:00
parent 5adc4001f8
commit 289f591eac
5 changed files with 103 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block title %}Add User Note{% endblock %}
{% block content %}
<div class="page-header">
<h1>Add User Note</h1>
</div>
<p>This will add a note to {{ user.username }}'s account that'll be visible to everyone able to view user profiles</p>
<form action="{% url sso-addusernote user.username %}" method="post">
<fieldset>
{% include "formtools/formerror.html" %}
{% include "formtools/formfield.html" with field=form.user %}
{% include "formtools/formfield.html" with field=form.note class="xxlarge" %}
{% csrf_token %}
<input type="submit" value="Add Note" class="btn primary" />
</fieldset>
</form>
{% endblock %}

View File

@@ -28,8 +28,27 @@
<a href="{% url hr-blacklistuser user.id %}" class="btn error">Blacklist User</a>
{% endif %}
{% endif %}
{% if perms.sso.add_ssousernote %}
<a href="{% url sso-addusernote user %}" class="btn">Add Note</a>
{% endif %}
</p>
{% if user.notes.count %}
<h2>User Notes</h2>
<table class="zebra-striped">
<thead>
<tr><th width="600px">Note</th><th>Date</th><th>Added By</th></tr>
</thead>
<tbody>
{% for note in user.notes.all %}
<tr><td>{{ note.note|linebreaks }}</td><td>{{ note.date_created|date:"Y/m/d H:i:s" }}</td><td><a href="{% url sso-viewuser note.created_by %}">{{ note.created_by }}</a></td></tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if services %}
<section id="services">
<h2>Service Accounts</h2>