mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-29 11:22:15 +00:00
More UI improvements
This commit is contained in:
@@ -185,6 +185,7 @@ USE_TZ = True
|
|||||||
DATETIME_INPUT_FORMATS = ('%Y-%m-%dT%H:%M','%Y-%m-%dT%H:%M:%S')
|
DATETIME_INPUT_FORMATS = ('%Y-%m-%dT%H:%M','%Y-%m-%dT%H:%M:%S')
|
||||||
|
|
||||||
RIGS_DATETIME_FORMAT = ('d/m/Y H:i')
|
RIGS_DATETIME_FORMAT = ('d/m/Y H:i')
|
||||||
|
RIGS_DATE_FORMAT = ('d/m/Y')
|
||||||
|
|
||||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||||
"django.contrib.auth.context_processors.auth",
|
"django.contrib.auth.context_processors.auth",
|
||||||
|
|||||||
@@ -9,7 +9,11 @@
|
|||||||
<script src="{% static "js/moment.min.js" %}"></script>
|
<script src="{% static "js/moment.min.js" %}"></script>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('[data-toggle="popover"]').popover();
|
$('[data-toggle="popover"]').popover().click(function(){
|
||||||
|
if($(this).attr('href')){
|
||||||
|
window.location.href = $(this).attr('href');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// This keeps timeago values correct, but uses an insane amount of resources
|
// This keeps timeago values correct, but uses an insane amount of resources
|
||||||
// $(function () {
|
// $(function () {
|
||||||
@@ -52,15 +56,18 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for version in object_list %}
|
{% for version in object_list %}
|
||||||
{% if version.item_changes or version.field_changes %}
|
{% if version.item_changes or version.field_changes or version.old == None%}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ version.revision.date_created|date:"RIGS_DATETIME_FORMAT" }}</td>
|
<td>{{ version.revision.date_created|date:"RIGS_DATETIME_FORMAT" }}</td>
|
||||||
<td><a href="{% url 'event_detail' version.new.pk %}">N{{ version.new.pk|stringformat:"05d" }}</a></td>
|
<td><a href="{% url 'event_detail' version.new.pk %}">N{{ version.new.pk|stringformat:"05d" }}</a></td>
|
||||||
<td>{{ version.version.pk }}|{{ version.revision.pk }}</td>
|
<td>{{ version.version.pk }}|{{ version.revision.pk }}</td>
|
||||||
<td>{{ version.revision.user.name }}</td>
|
<td>{{ version.revision.user.name }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if version.old == None %}
|
||||||
|
Event Created
|
||||||
|
{% else %}
|
||||||
{% include 'RIGS/event_version_changes.html' %}
|
{% include 'RIGS/event_version_changes.html' %}
|
||||||
</td>
|
{% endif %} </td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -76,13 +83,16 @@
|
|||||||
<h2>Rigboard Activity Stream - Stream View</h2>
|
<h2>Rigboard Activity Stream - Stream View</h2>
|
||||||
<br>
|
<br>
|
||||||
{% for version in object_list %}
|
{% for version in object_list %}
|
||||||
{% if version.item_changes or version.field_changes %}
|
{% if version.item_changes or version.field_changes or version.old == None %}
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<button title="title" type="button" class="btn btn-default btn-xs">{{ version.revision.user.first_name|default_if_none:"(unknown)" }}</button> changed
|
{% include 'RIGS/profile_button.html' with profile=version.revision.user %}
|
||||||
|
|
||||||
{% include 'RIGS/event_version_changes.html' %}
|
{% if version.old == None %}
|
||||||
|
created
|
||||||
in <button title="title" type="button" class="btn btn-default btn-xs">N{{ version.new.pk|stringformat:"05d" }}</button> <small>(<span data-date='{{ version.revision.date_created|date:"Y-m-d H:i:s" }}' class="date">{{ version.revision.date_created|date:"RIGS_DATETIME_FORMAT" }}</span>)</small>
|
{% else %}
|
||||||
|
changed {% include 'RIGS/event_version_changes.html' %} in
|
||||||
|
{% endif %}
|
||||||
|
{% include 'RIGS/event_button.html' with event=version.current %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
18
RIGS/templates/RIGS/event_button.html
Normal file
18
RIGS/templates/RIGS/event_button.html
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{# pass in variable "event" to this template #}
|
||||||
|
|
||||||
|
<button title="N{{ event.pk|stringformat:"05d" }} | {{event.name}}" type="button" href="{% url 'event_detail' event.pk %}" class="btn btn-default btn-xs" data-container="body" data-html="true" data-trigger='hover' data-toggle="popover" data-content='
|
||||||
|
<dl class="dl-vertical">
|
||||||
|
<dt>Date</dt>
|
||||||
|
<dd>{{event.start_date|date:"RIGS_DATE_FORMAT"}}</dd>
|
||||||
|
|
||||||
|
<dt>Status</dt>
|
||||||
|
<dd>{{event.get_status_display}}</dd>
|
||||||
|
|
||||||
|
<dt>MIC</dt>
|
||||||
|
<dd>{{event.mic.name}}</dd>
|
||||||
|
|
||||||
|
<dt>Venue</dt>
|
||||||
|
<dd>{{event.venue}}</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
'>N{{ event.pk|stringformat:"05d" }}</button>
|
||||||
@@ -27,13 +27,17 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for version in object_list %}
|
{% for version in object_list %}
|
||||||
{% if version.item_changes or version.field_changes %}
|
{% if version.item_changes or version.field_changes or version.old == None %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ version.version.pk }}|{{ version.revision.pk }}</td>
|
<td>{{ version.version.pk }}|{{ version.revision.pk }}</td>
|
||||||
<td>{{ version.revision.date_created|date:"d/m/Y H:i" }}</td>
|
<td>{{ version.revision.date_created|date:"RIGS_DATETIME_FORMAT" }}</td>
|
||||||
<td>{{ version.revision.user.name }}</td>
|
<td>{{ version.revision.user.name }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% include 'RIGS/event_version_changes.html' %}
|
{% if version.old == None %}
|
||||||
|
Event Created
|
||||||
|
{% else %}
|
||||||
|
{% include 'RIGS/event_version_changes.html' %}
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
12
RIGS/templates/RIGS/profile_button.html
Normal file
12
RIGS/templates/RIGS/profile_button.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{# pass in variable "profile" to this template #}
|
||||||
|
|
||||||
|
<button title="{{profile.name}}" type="button" class="btn btn-default btn-xs" data-container="body" data-html="true" data-trigger='hover focus' data-toggle="popover" data-content='
|
||||||
|
<img src="{{profile.profile_picture}}" class="img-responsive img-rounded center-block" style="max-width:4em" />
|
||||||
|
<dl class="dl-vertical">
|
||||||
|
<dt>Email</dt>
|
||||||
|
<dd>{{profile.email}}</dd>
|
||||||
|
|
||||||
|
<dt>Phone</dt>
|
||||||
|
<dd>{{profile.phone}}</dd>
|
||||||
|
</dl>
|
||||||
|
'>{{profile.first_name}}</button>
|
||||||
@@ -122,6 +122,7 @@ def get_changes_for_version(newVersion, oldVersion=None):
|
|||||||
compare = {}
|
compare = {}
|
||||||
compare['revision'] = newVersion.revision
|
compare['revision'] = newVersion.revision
|
||||||
compare['new'] = newVersion.object_version.object
|
compare['new'] = newVersion.object_version.object
|
||||||
|
compare['current'] = models.Event.objects.get(pk=compare['new'].pk)
|
||||||
compare['version'] = newVersion
|
compare['version'] = newVersion
|
||||||
|
|
||||||
if oldVersion:
|
if oldVersion:
|
||||||
|
|||||||
Reference in New Issue
Block a user