mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Genercise detail pages
This commit is contained in:
@@ -1,92 +1 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block title %}Organisation | {{ object.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12">
|
||||
<h1>Organisation | {{ object.name }}</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-sm">
|
||||
<div class="card bg-info">
|
||||
<div class="card-header">Organisation Details</div>
|
||||
<div class="card-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Name</dt>
|
||||
<dd>{{ object.name }}</dd>
|
||||
|
||||
<dt>Phone</dt>
|
||||
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
||||
|
||||
<dt>Email</dt>
|
||||
<dd><a href="mailto:{{ object.email }}"><span class="overflow-ellipsis">{{ object.email }}</span></a></dd>
|
||||
|
||||
<dt>Address</dt>
|
||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||
|
||||
<dt>Notes</dt>
|
||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||
|
||||
<dt>Union Account</dt>
|
||||
<dd>{{ object.union_account|yesno|capfirst }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated People</div>
|
||||
<div class="card-body">
|
||||
<div class="list-group">
|
||||
{% for person,count in object.persons %}
|
||||
<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 class="row my-2">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Events</div>
|
||||
{% with object.latest_events as events %}
|
||||
{% include 'event_table.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% if not request.is_ajax %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group">
|
||||
<a href="{% url 'organisation_update' object.pk %}" class="btn btn-default"><span
|
||||
class="fas fa-edit"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target="organisation_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% if request.is_ajax %}
|
||||
{% block footer %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group">
|
||||
<a href="{% url 'organisation_detail' object.pk %}" class="btn btn-primary"><span
|
||||
class="fas fa-eye"></span> Open Page</a>
|
||||
<a href="{% url 'organisation_update' object.pk %}" class="btn btn-warning"><span
|
||||
class="fas fa-edit"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target="organisation_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% include 'generic_detail.html' with type='Organisation' history_link='organisation_history' detail_link='organisation_detail' update_link='organisation_update' associated='partials/associated_people.html' %}
|
||||
|
||||
10
RIGS/templates/partials/associated_organisations.html
Normal file
10
RIGS/templates/partials/associated_organisations.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Organisations</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for organisation,count in object.organisations %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'organisation_detail' organisation.pk %}">{{ organisation.pk|stringformat:"05d" }} | {{ organisation.name }} <span class="badge badge-secondary" title="{{count}} events with {{object.name}} for {{organisation.name}}">{{count}}</span></a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
12
RIGS/templates/partials/associated_people.html
Normal file
12
RIGS/templates/partials/associated_people.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated People</div>
|
||||
<div class="list-group list-group-flush">
|
||||
{% for person,count in object.persons %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'person_detail' person.pk %}">{{ person.pk|stringformat:"05d" }} | {{ person.name }} <span class="badge badge-secondary" title="{{count}} events with {{person.name}} for {{object.name}}">{{count}}</span></a>
|
||||
{% empty %}
|
||||
<div class="card-body">None</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,92 +1 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block title %}Person | {{ object.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row my-3">
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12">
|
||||
<h1>Person | {{ object.name }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url 'person_update' object.pk %}" class="btn btn-light"><span
|
||||
class="fas fa-edit"></span> Edit</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-sm">
|
||||
<div class="card border-info">
|
||||
<div class="card-header bg-info">Person Details</div>
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-6">Name</dt>
|
||||
<dd>{{ object.name }}</dd>
|
||||
|
||||
<dt class="col-6">Phone</dt>
|
||||
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
||||
|
||||
<dt class="col-6">Email</dt>
|
||||
<dd><a href="mailto:{{ object.email }}"><span class="overflow-ellipsis">{{ object.email }}</span></a></dd>
|
||||
|
||||
<dt class="col-6">Address</dt>
|
||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||
|
||||
<dt class="col-12">Notes</dt>
|
||||
<dd class="col-12">{{ object.notes|linebreaksbr }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Organisations</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for organisation,count in object.organisations %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'organisation_detail' organisation.pk %}">{{ organisation.pk|stringformat:"05d" }} | {{ organisation.name }} <span class="badge badge-secondary" title="{{count}} events with {{object.name}} for {{organisation.name}}">{{count}}</span></a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-3">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Events</div>
|
||||
{% with object.latest_events as events %}
|
||||
{% include 'event_table.html' %}
|
||||
{% endwith %}
|
||||
</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-light"><span
|
||||
class="fas fa-edit"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target="person_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% if request.is_ajax %}
|
||||
{% block footer %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url 'person_detail' object.pk %}" class="btn btn-primary"><span
|
||||
class="fas fa-eye"></span> Open Page</a>
|
||||
<a href="{% url 'person_update' object.pk %}" class="btn btn-light"><span
|
||||
class="fas fa-user-edit"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target="person_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% include 'generic_detail.html' with type='Person' history_link='person_history' detail_link='person_detail' update_link='person_update' associated='partials/associated_organisations.html' %}
|
||||
|
||||
@@ -1,83 +1 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block title %}Venue | {{ object.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12">
|
||||
<h1>Venue | {{ object.name }}</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-sm-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">Venue Details</div>
|
||||
<div class="card-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Name</dt>
|
||||
<dd>{{ object.name }}</dd>
|
||||
|
||||
<dt>Phone</dt>
|
||||
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
||||
|
||||
<dt>Email</dt>
|
||||
<dd><a href="mailto:{{ object.email }}"><span class="overflow-ellipsis">{{ object.email }}</span></a></dd>
|
||||
|
||||
<dt>Address</dt>
|
||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||
|
||||
<dt>Notes</dt>
|
||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||
|
||||
<dt>Three Phase Available</dt>
|
||||
<dd>{{ object.three_phase_available|yesno|capfirst }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 py-3">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Events</div>
|
||||
<div class="card-body">
|
||||
{% with object.latest_events as events %}
|
||||
{% include 'event_table.html' %}
|
||||
{% endwith %}
|
||||
</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-warning"><span
|
||||
class="fas fa-edit"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target="venue_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% if request.is_ajax %}
|
||||
{% block footer %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url 'venue_detail' object.pk %}" class="btn btn-primary"><span
|
||||
class="fas fa-eye"></span> Open Page</a>
|
||||
<a href="{% url 'venue_update' object.pk %}" class="btn btn-warning"><span
|
||||
class="fas fa-edit"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target="venue_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% include 'generic_detail.html' with type='Venue' history_link='venue_history' detail_link='venue_detail' update_link='venue_update' %}
|
||||
|
||||
83
templates/generic_detail.html
Normal file
83
templates/generic_detail.html
Normal file
@@ -0,0 +1,83 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block title %}{{ type }} | {{ object.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12">
|
||||
<h1>{{ type }} | {{ object.name }}</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col">
|
||||
<div class="card border-info">
|
||||
<div class="card-header">{{ type }} Details</div>
|
||||
<div class="card-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Name</dt>
|
||||
<dd>{{ object.name }}</dd>
|
||||
|
||||
<dt>Phone</dt>
|
||||
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
||||
|
||||
<dt>Email</dt>
|
||||
<dd><a href="mailto:{{ object.email }}"><span class="overflow-ellipsis">{{ object.email }}</span></a></dd>
|
||||
|
||||
<dt>Address</dt>
|
||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||
|
||||
<dt>Notes</dt>
|
||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||
|
||||
{% if object.three_phase_available is not None %}
|
||||
<dt>Three Phase Available</dt>
|
||||
<dd>{{ object.three_phase_available|yesno|capfirst }}</dd>
|
||||
{% endif%}
|
||||
|
||||
{% if object.union_account is not None %}
|
||||
<dt>Union Account</dt>
|
||||
<dd>{{ object.union_account|yesno|capfirst }}</dd>
|
||||
{% endif%}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include associated|safe %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 py-3">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Events</div>
|
||||
{% include 'event_table.html' with events=object.latest_events %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not request.is_ajax %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group">
|
||||
<a href="{% url update_link object.pk %}" class="btn btn-warning"><span
|
||||
class="fas fa-edit"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target=history_link %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% if request.is_ajax %}
|
||||
{% block footer %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url detail_link object.pk %}" class="btn btn-primary"><span
|
||||
class="fas fa-eye"></span> Open Page</a>
|
||||
<a href="{% url update_link object.pk %}" class="btn btn-warning"><span
|
||||
class="fas fa-edit"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target=history_link %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
10
templates/partials/associated_organisations.html
Normal file
10
templates/partials/associated_organisations.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Organisations</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for organisation,count in object.organisations %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'organisation_detail' organisation.pk %}">{{ organisation.pk|stringformat:"05d" }} | {{ organisation.name }} <span class="badge badge-secondary" title="{{count}} events with {{object.name}} for {{organisation.name}}">{{count}}</span></a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user