mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-21 23:42:14 +00:00
Merge branch 'ui-changes'
This commit is contained in:
@@ -9,6 +9,7 @@ from django.utils.encoding import python_2_unicode_compatible
|
|||||||
import reversion
|
import reversion
|
||||||
import string
|
import string
|
||||||
import random
|
import random
|
||||||
|
from collections import Counter
|
||||||
from django.core.urlresolvers import reverse_lazy
|
from django.core.urlresolvers import reverse_lazy
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
@@ -92,9 +93,13 @@ class Person(models.Model, RevisionMixin):
|
|||||||
def organisations(self):
|
def organisations(self):
|
||||||
o = []
|
o = []
|
||||||
for e in Event.objects.filter(person=self).select_related('organisation'):
|
for e in Event.objects.filter(person=self).select_related('organisation'):
|
||||||
if e.organisation and e.organisation not in o:
|
if e.organisation:
|
||||||
o.append(e.organisation)
|
o.append(e.organisation)
|
||||||
return o
|
|
||||||
|
#Count up occurances and put them in descending order
|
||||||
|
c = Counter(o)
|
||||||
|
stats = c.most_common()
|
||||||
|
return stats
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def latest_events(self):
|
def latest_events(self):
|
||||||
@@ -132,9 +137,13 @@ class Organisation(models.Model, RevisionMixin):
|
|||||||
def persons(self):
|
def persons(self):
|
||||||
p = []
|
p = []
|
||||||
for e in Event.objects.filter(organisation=self).select_related('person'):
|
for e in Event.objects.filter(organisation=self).select_related('person'):
|
||||||
if e.person and e.person not in p:
|
if e.person:
|
||||||
p.append(e.person)
|
p.append(e.person)
|
||||||
return p
|
|
||||||
|
#Count up occurances and put them in descending order
|
||||||
|
c = Counter(p)
|
||||||
|
stats = c.most_common()
|
||||||
|
return stats
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def latest_events(self):
|
def latest_events(self):
|
||||||
|
|||||||
@@ -1,82 +1,109 @@
|
|||||||
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
||||||
{% load widget_tweaks %}
|
{% load widget_tweaks %}
|
||||||
|
|
||||||
{% block title %}{{ object.name }}{% endblock %}
|
{% block title %}Organisation | {{ object.name }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if not request.is_ajax %}
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<h3>{{ object.name }}<br/>
|
|
||||||
<span class="small"><a href="{% url 'organisation_history' object.pk %}" title="View Revision History">
|
|
||||||
Last edited at {{ object.last_edited_at|date:"d/m/Y H:i" }} by {{ object.last_edited_by.name }}
|
|
||||||
</a></span>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<div class="pull-right">
|
|
||||||
<a href="{% url 'organisation_update' object.pk %}" class="btn btn-primary">Edit <span
|
|
||||||
class="glyphicon glyphicon-pencil"></span></a>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
{% if not request.is_ajax %}
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<h1>Organisation | {{ object.name }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-12 text-right">
|
||||||
|
<div class="btn-group btn-page">
|
||||||
|
<a href="{% url 'organisation_update' object.pk %}" class="btn btn-default"><span
|
||||||
|
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h4>Details</h4>
|
<div class="panel panel-info">
|
||||||
<dl class="dl-horizontal">
|
<div class="panel-heading">Organisation Details</div>
|
||||||
<dt>Name</dt>
|
<div class="panel-body">
|
||||||
<dd>{{ object.name }}</dd>
|
<dl class="dl-horizontal">
|
||||||
|
<dt>Name</dt>
|
||||||
|
<dd>{{ object.name }}</dd>
|
||||||
|
|
||||||
<dt>Phone</dt>
|
<dt>Phone</dt>
|
||||||
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
||||||
|
|
||||||
<dt>Email</dt>
|
<dt>Email</dt>
|
||||||
<dd><a href="mailto:{{ object.email }}">{{ object.email }}</a></dd>
|
<dd><a href="mailto:{{ object.email }}"><span class="overflow-ellipsis">{{ object.email }}</span></a></dd>
|
||||||
|
|
||||||
<dt>Address</dt>
|
<dt>Address</dt>
|
||||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||||
|
|
||||||
<dt>Notes</dt>
|
<dt>Notes</dt>
|
||||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||||
|
|
||||||
<dt>Union Account</dt>
|
<dt>Union Account</dt>
|
||||||
<dd>{{ object.union_account|yesno|capfirst }}</dd>
|
<dd>{{ object.union_account|yesno|capfirst }}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h4>People</h4>
|
<div class="panel panel-default">
|
||||||
<ul class="list-unstyled">
|
<div class="panel-heading">Associated People</div>
|
||||||
{% for person in object.persons %}
|
<div class="panel-body">
|
||||||
<li><a href="{% url 'person_detail' person.pk %}">{{ person.name }}</a></li>
|
<div class="list-group">
|
||||||
{% endfor %}
|
{% for person,count in object.persons %}
|
||||||
</ul>
|
<a class="list-group-item" href="{% url 'person_detail' person.pk %}">{{ person.pk|stringformat:"05d" }} | {{ person.name }} <span class="badge" title="{{count}} events with {{person.name}} for {{object.name}}">{{count}}</span></a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<h4>Events</h4>
|
<div class="panel panel-default">
|
||||||
{% with object.latest_events as events %}
|
<div class="panel-heading">Associated Events</div>
|
||||||
{% include 'RIGS/event_table.html' %}
|
<div class="panel-body">
|
||||||
{% endwith %}
|
{% with object.latest_events as events %}
|
||||||
|
{% include 'RIGS/event_table.html' %}
|
||||||
|
{% endwith %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% if not request.is_ajax %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 text-right">
|
||||||
|
<div class="btn-group btn-page">
|
||||||
|
<a href="{% url 'organisation_update' object.pk %}" class="btn btn-default"><span
|
||||||
|
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="{% url 'organisation_history' object.pk %}" title="View Revision History">
|
||||||
|
Last edited {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% if request.is_ajax %}
|
{% if request.is_ajax %}
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-10 align-left">
|
<div class="col-sm-12 text-right">
|
||||||
<a href="{% url 'organisation_history' object.pk %}" title="View Revision History">
|
<div class="btn-group btn-page">
|
||||||
Last edited at {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
|
<a href="{% url 'organisation_detail' object.pk %}" class="btn btn-default"><span
|
||||||
</a>
|
class="glyphicon glyphicon-eye-open"></span> Open Page</a>
|
||||||
</div>
|
<a href="{% url 'organisation_update' object.pk %}" class="btn btn-default"><span
|
||||||
<div class="col-sm-2">
|
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||||
<div class="pull-right">
|
</div>
|
||||||
<a href="{% url 'organisation_update' object.pk %}" class="btn btn-primary">Edit <span
|
<div>
|
||||||
class="glyphicon glyphicon-pencil"></span></a>
|
<a href="{% url 'organisation_history' object.pk %}" title="View Revision History">
|
||||||
|
Last edited {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% extends request.is_ajax|yesno:'base_ajax.html,base.html' %}
|
{% extends request.is_ajax|yesno:'base_ajax.html,base.html' %}
|
||||||
{% load widget_tweaks %}
|
{% load widget_tweaks %}
|
||||||
|
|
||||||
{% block title %}{% if object.pk %}Edit {{ object.name }}{% else %}Add Person{% endif %}{% endblock %}
|
{% block title %}{% if object.pk %}Edit {{ object.name }}{% else %}Add Organisation{% endif %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-sm-offset-1 col-sm-10">
|
<div class="col-sm-offset-1 col-sm-10">
|
||||||
|
|||||||
@@ -1,74 +1,106 @@
|
|||||||
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
||||||
{% load widget_tweaks %}
|
{% load widget_tweaks %}
|
||||||
|
|
||||||
{% block title %}{{ object.name }}{% endblock %}
|
{% block title %}Person | {{ object.name }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
{% if not request.is_ajax %}
|
||||||
<h4>Details</h4>
|
<div class="col-sm-12">
|
||||||
{% if not request.is_ajax %}
|
<h1>Person | {{ object.name }}</h1>
|
||||||
<h3>{{ object.name }}<br/>
|
</div>
|
||||||
<span class="small"><a href="{% url 'person_history' object.pk %}" title="View Revision History">
|
|
||||||
Last edited at {{ object.last_edited_at|date:"d/m/Y H:i" }} by {{ object.last_edited_by.name }}
|
<div class="col-sm-12 text-right">
|
||||||
</a></span>
|
<div class="btn-group btn-page">
|
||||||
</h3>
|
<a href="{% url 'person_update' object.pk %}" class="btn btn-default"><span
|
||||||
<div class="pull-right">
|
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||||
<a href="{% url 'person_update' object.pk %}" class="btn btn-primary">Edit <span
|
|
||||||
class="glyphicon glyphicon-pencil"></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
</div>
|
||||||
<div class="">
|
{% endif %}
|
||||||
<dl class="dl-horizontal">
|
<div class="col-sm-6">
|
||||||
<dt>Name</dt>
|
<div class="panel panel-info">
|
||||||
<dd>{{ object.name }}</dd>
|
<div class="panel-heading">Person Details</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt>Name</dt>
|
||||||
|
<dd>{{ object.name }}</dd>
|
||||||
|
|
||||||
<dt>Phone</dt>
|
<dt>Phone</dt>
|
||||||
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
||||||
|
|
||||||
<dt>Email</dt>
|
<dt>Email</dt>
|
||||||
<dd><a href="mailto:{{ object.email }}">{{ object.email }}</a></dd>
|
<dd><a href="mailto:{{ object.email }}"><span class="overflow-ellipsis">{{ object.email }}</span></a></dd>
|
||||||
|
|
||||||
<dt>Address</dt>
|
<dt>Address</dt>
|
||||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||||
|
|
||||||
<dt>Notes</dt>
|
<dt>Notes</dt>
|
||||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h4>Organisations</h4>
|
<div class="panel panel-default">
|
||||||
<ul class="list-unstyled">
|
<div class="panel-heading">Associated Organisations</div>
|
||||||
{% for organisation in object.organisations %}
|
<div class="panel-body">
|
||||||
<li><a href="{% url 'organisation_detail' organisation.pk %}">{{ organisation.name }}</a></li>
|
<div class="list-group">
|
||||||
{% endfor %}
|
{% for organisation,count in object.organisations %}
|
||||||
</ul>
|
<a class="list-group-item" href="{% url 'organisation_detail' organisation.pk %}">{{ organisation.pk|stringformat:"05d" }} | {{ organisation.name }} <span class="badge" title="{{count}} events with {{object.name}} for {{organisation.name}}">{{count}}</span></a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<h4>Events</h4>
|
<div class="panel panel-default">
|
||||||
{% with object.latest_events as events %}
|
<div class="panel-heading">Associated Events</div>
|
||||||
{% include 'RIGS/event_table.html' %}
|
<div class="panel-body">
|
||||||
{% endwith %}
|
{% with object.latest_events as events %}
|
||||||
|
{% include 'RIGS/event_table.html' %}
|
||||||
|
{% endwith %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% if not request.is_ajax %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 text-right">
|
||||||
|
<div class="btn-group btn-page">
|
||||||
|
<a href="{% url 'person_update' object.pk %}" class="btn btn-default"><span
|
||||||
|
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="{% url 'person_history' object.pk %}" title="View Revision History">
|
||||||
|
Last edited {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% if request.is_ajax %}
|
{% if request.is_ajax %}
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-10 align-left">
|
<div class="col-sm-12 text-right">
|
||||||
<a href="{% url 'person_history' object.pk %}" title="View Revision History">
|
<div class="btn-group btn-page">
|
||||||
Last edited at {{ object.last_edited_at|date:"d/m/Y H:i" }} by {{ object.last_edited_by.name }}
|
<a href="{% url 'person_detail' object.pk %}" class="btn btn-default"><span
|
||||||
</a>
|
class="glyphicon glyphicon-eye-open"></span> Open Page</a>
|
||||||
</div>
|
<a href="{% url 'person_update' object.pk %}" class="btn btn-default"><span
|
||||||
<div class="col-sm-2">
|
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||||
<div class="pull-right">
|
</div>
|
||||||
<a href="{% url 'person_update' object.pk %}" class="btn btn-primary">Edit <span
|
<div>
|
||||||
class="glyphicon glyphicon-pencil"></span></a>
|
<a href="{% url 'person_history' object.pk %}" title="View Revision History">
|
||||||
|
Last edited {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,64 +1,96 @@
|
|||||||
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
||||||
{% load widget_tweaks %}
|
{% load widget_tweaks %}
|
||||||
|
|
||||||
{% block title %}{{ object.name }}{% endblock %}
|
{% block title %}Venue | {{ object.name }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-10 col-sm-offset-1">
|
{% if not request.is_ajax %}
|
||||||
{% if not request.is_ajax %}
|
<div class="col-sm-12">
|
||||||
<h3>{{ object.name }}<br/>
|
<h1>Venue | {{ object.name }}</h1>
|
||||||
<span class="small"><a href="{% url 'venue_history' object.pk %}" title="View Revision History">
|
</div>
|
||||||
Last edited at {{ object.last_edited_at|date:"d/m/Y H:i" }} by {{ object.last_edited_by.name }}
|
|
||||||
</a></span>
|
<div class="col-sm-12 text-right">
|
||||||
</h3>
|
<div class="btn-group btn-page">
|
||||||
<div class="pull-right">
|
<a href="{% url 'venue_update' object.pk %}" class="btn btn-default"><span
|
||||||
<a href="{% url 'venue_update' object.pk %}" class="btn btn-primary">Edit <span
|
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||||
class="glyphicon glyphicon-pencil"></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
</div>
|
||||||
<div class="">
|
{% endif %}
|
||||||
<dl class="dl-horizontal">
|
<div class="col-sm-12">
|
||||||
<dt>Name</dt>
|
<div class="panel panel-info">
|
||||||
<dd>{{ object.name }}</dd>
|
<div class="panel-heading">Venue Details</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt>Name</dt>
|
||||||
|
<dd>{{ object.name }}</dd>
|
||||||
|
|
||||||
<dt>Phone</dt>
|
<dt>Phone</dt>
|
||||||
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
||||||
|
|
||||||
<dt>Email</dt>
|
<dt>Email</dt>
|
||||||
<dd><a href="mailto:{{ object.email }}">{{ object.email }}</a></dd>
|
<dd><a href="mailto:{{ object.email }}"><span class="overflow-ellipsis">{{ object.email }}</span></a></dd>
|
||||||
|
|
||||||
<dt>Address</dt>
|
<dt>Address</dt>
|
||||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||||
|
|
||||||
<dt>Notes</dt>
|
<dt>Notes</dt>
|
||||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||||
</dl>
|
|
||||||
|
<dt>Three Phase Available</dt>
|
||||||
|
<dd>{{ object.three_phase_available|yesno|capfirst }}</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
{% with object.latest_events as events %}
|
<div class="panel panel-default">
|
||||||
{% include 'RIGS/event_table.html' %}
|
<div class="panel-heading">Associated Events</div>
|
||||||
{% endwith %}
|
<div class="panel-body">
|
||||||
|
{% with object.latest_events as events %}
|
||||||
|
{% include 'RIGS/event_table.html' %}
|
||||||
|
{% endwith %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if not request.is_ajax %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 text-right">
|
||||||
|
<div class="btn-group btn-page">
|
||||||
|
<a href="{% url 'venue_update' object.pk %}" class="btn btn-default"><span
|
||||||
|
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="{% url 'venue_history' object.pk %}" title="View Revision History">
|
||||||
|
Last edited {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% if request.is_ajax %}
|
{% if request.is_ajax %}
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-10 align-left">
|
<div class="col-sm-12 text-right">
|
||||||
<a href="{% url 'venue_history' object.pk %}" title="View Revision History">
|
<div class="btn-group btn-page">
|
||||||
Last edited at {{ object.last_edited_at|date:"d/m/Y H:i" }} by {{ object.last_edited_by.name }}
|
<a href="{% url 'venue_detail' object.pk %}" class="btn btn-default"><span
|
||||||
</a>
|
class="glyphicon glyphicon-eye-open"></span> Open Page</a>
|
||||||
</div>
|
<a href="{% url 'venue_update' object.pk %}" class="btn btn-default"><span
|
||||||
<div class="col-sm-2">
|
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||||
<div class="pull-right">
|
</div>
|
||||||
<a href="{% url 'venue_update' object.pk %}" class="btn btn-primary">Edit <span
|
<div>
|
||||||
class="glyphicon glyphicon-pencil"></span></a>
|
<a href="{% url 'venue_history' object.pk %}" title="View Revision History">
|
||||||
|
Last edited {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -58,7 +58,21 @@
|
|||||||
{% render_field form.notes class+="form-control" placeholder=form.notes.label %}
|
{% render_field form.notes class+="form-control" placeholder=form.notes.label %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-10 col-sm-offset-2">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
{% render_field form.three_phase_available %} {{ form.three_phase_available.label }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="btn btn-primary pull-right" type="submit"/>
|
<input class="btn btn-primary pull-right" type="submit"/>
|
||||||
|
|||||||
@@ -144,16 +144,16 @@ class EventTestCase(TestCase):
|
|||||||
events = models.Event.objects.all()
|
events = models.Event.objects.all()
|
||||||
|
|
||||||
# Check person's organisations
|
# Check person's organisations
|
||||||
self.assertIn(o1, p1.organisations)
|
self.assertIn((o1,2), p1.organisations)
|
||||||
self.assertIn(o2, p1.organisations)
|
self.assertIn((o2,1), p1.organisations)
|
||||||
self.assertIn(o1, p2.organisations)
|
self.assertIn((o1,2), p2.organisations)
|
||||||
self.assertNotIn(o2, p2.organisations)
|
self.assertEqual(len(p2.organisations), 1)
|
||||||
|
|
||||||
# Check organisation's persons
|
# Check organisation's persons
|
||||||
self.assertIn(p1, o1.persons)
|
self.assertIn((p1,2), o1.persons)
|
||||||
self.assertIn(p2, o1.persons)
|
self.assertIn((p2,2), o1.persons)
|
||||||
self.assertIn(p1, o2.persons)
|
self.assertIn((p1,1), o2.persons)
|
||||||
self.assertNotIn(p2, o2.persons)
|
self.assertEqual(len(o2.persons),1)
|
||||||
|
|
||||||
def test_cancelled_property(self):
|
def test_cancelled_property(self):
|
||||||
event = models.Event.objects.all()[0]
|
event = models.Event.objects.all()[0]
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ class VenueDetail(generic.DetailView):
|
|||||||
|
|
||||||
class VenueCreate(generic.CreateView):
|
class VenueCreate(generic.CreateView):
|
||||||
model = models.Venue
|
model = models.Venue
|
||||||
fields = ['name','phone','email','address','notes']
|
fields = ['name','phone','email','address','notes','three_phase_available']
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
if self.request.is_ajax():
|
if self.request.is_ajax():
|
||||||
@@ -193,7 +193,7 @@ class VenueCreate(generic.CreateView):
|
|||||||
|
|
||||||
class VenueUpdate(generic.UpdateView):
|
class VenueUpdate(generic.UpdateView):
|
||||||
model = models.Venue
|
model = models.Venue
|
||||||
fields = ['name','phone','email','address','notes']
|
fields = ['name','phone','email','address','notes','three_phase_available']
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
if self.request.is_ajax():
|
if self.request.is_ajax():
|
||||||
|
|||||||
Reference in New Issue
Block a user