mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Improvements to generic lists
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<table class="table mb-0">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
{% block title %}RIGS{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>R<small class="text-muted">ig</small> I<small class="text-muted">nformation</small class="text-muted"> G<small class="text-muted">athering</small> S<small class="text-muted">ystem</small></h1>
|
||||
<h4 class="list-group-item-heading">Welcome back {{ user.get_full_name }}, there are {{ rig_count }} rigs coming up.</h4>
|
||||
<div class="row">
|
||||
<h1 class="col-sm-12 pb-3">R<small class="text-muted">ig</small> I<small class="text-muted">nformation</small class="text-muted"> G<small class="text-muted">athering</small> S<small class="text-muted">ystem</small></h1>
|
||||
<h4 class="col-sm-12 pb-3">Welcome back {{ user.get_full_name }}, there are {{ rig_count }} rigs coming up.</h4>
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
||||
@@ -4,10 +4,8 @@
|
||||
{% block title %}Organisations{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<h3>Organisations</h3>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'partials/generic_list.html' with edit="organisation_update" detail="organisation_detail" create="organisation_create" union_account=True %}
|
||||
<div class="row">
|
||||
<h3>Organisations</h3>
|
||||
</div>
|
||||
{% include 'partials/generic_list.html' with edit="organisation_update" detail="organisation_detail" create="organisation_create" union_account=True %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -18,52 +18,47 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-sm">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">Person Details</div>
|
||||
<div class="card border-info">
|
||||
<div class="card-header bg-info">Person Details</div>
|
||||
<div class="card-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Name</dt>
|
||||
<dl class="row">
|
||||
<dt class="col-6">Name</dt>
|
||||
<dd>{{ object.name }}</dd>
|
||||
|
||||
<dt>Phone</dt>
|
||||
<dt class="col-6">Phone</dt>
|
||||
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
|
||||
|
||||
<dt>Email</dt>
|
||||
<dt class="col-6">Email</dt>
|
||||
<dd><a href="mailto:{{ object.email }}"><span class="overflow-ellipsis">{{ object.email }}</span></a></dd>
|
||||
|
||||
<dt>Address</dt>
|
||||
<dt class="col-6">Address</dt>
|
||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||
|
||||
<dt>Notes</dt>
|
||||
<dd>{{ object.notes|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 card-default">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Organisations</div>
|
||||
<div class="card-body">
|
||||
<div class="list-group">
|
||||
{% for organisation,count in object.organisations %}
|
||||
<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>
|
||||
<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 card-default">
|
||||
<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>
|
||||
{% with object.latest_events as events %}
|
||||
{% include 'event_table.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,16 +77,16 @@
|
||||
|
||||
{% 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 '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 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 %}
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %}
|
||||
{% load widget_tweaks %}
|
||||
{% load paginator from filters %}
|
||||
{% load url_replace from filters %}
|
||||
{% load orderby from filters %}
|
||||
|
||||
{% block title %}People{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<h3>People</h3>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'partials/generic_list.html' with edit="person_update" detail="person_detail" create="person_create" %}
|
||||
<div class="row">
|
||||
<h3>People</h3>
|
||||
</div>
|
||||
{% include 'partials/generic_list.html' with edit="person_update" detail="person_detail" create="person_create" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
{% block title %}Rigboard{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Rigboard</h1>
|
||||
{% if perms.RIGS.add_event %}
|
||||
<a href="{% url 'event_create' %}" class="btn btn-success my-3 float-right">New <i class="fas fa-plus"></i></a>
|
||||
{% endif %}
|
||||
<div class="d-none d-md-block">
|
||||
{% include 'event_table.html' %}
|
||||
</div>
|
||||
<div class="d-xs-block d-sm-block d-md-none">
|
||||
{% include 'event_table_mobile.html' %}
|
||||
</div>
|
||||
<h1>Rigboard</h1>
|
||||
{% if perms.RIGS.add_event %}
|
||||
<a href="{% url 'event_create' %}" class="btn btn-success my-3 float-right">New <i class="fas fa-plus"></i></a>
|
||||
{% endif %}
|
||||
<div class="d-none d-md-block">
|
||||
{% include 'event_table.html' %}
|
||||
</div>
|
||||
<div class="d-xs-block d-sm-block d-md-none">
|
||||
{% include 'event_table_mobile.html' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %}
|
||||
{% load widget_tweaks %}
|
||||
{% load paginator from filters %}
|
||||
{% load url_replace from filters %}
|
||||
{% load orderby from filters %}
|
||||
|
||||
{% block title %}Venues{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<h3>Venues</h3>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'partials/generic_list.html' with edit="venue_update" detail="venue_detail" create="venue_create" %}
|
||||
<div class="row">
|
||||
<h3>Venues</h3>
|
||||
</div>
|
||||
{% include 'partials/generic_list.html' with edit="venue_update" detail="venue_detail" create="venue_create" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -106,7 +106,7 @@ urlpatterns = [
|
||||
path('invoice/<int:pk>/delete/', permission_required_with_403('RIGS.change_invoice')(finance.InvoiceDelete.as_view()),
|
||||
name='invoice_delete'),
|
||||
path('invoice/(<int:pk>/history/', permission_required_with_403('RIGS.view_invoice')(versioning.VersionHistory.as_view()),
|
||||
name='invoice_history', kwargs={'model': models.Invoice}),
|
||||
name='invoice_history', kwargs={'model': models.Invoice}),
|
||||
|
||||
path('payment/create/', permission_required_with_403('RIGS.add_payment')(finance.PaymentCreate.as_view()),
|
||||
name='payment_create'),
|
||||
|
||||
@@ -104,6 +104,7 @@ class PersonDetail(generic.DetailView):
|
||||
|
||||
|
||||
class PersonCreate(generic.CreateView):
|
||||
template_name = 'person_form.html'
|
||||
model = models.Person
|
||||
fields = ['name', 'phone', 'email', 'address', 'notes']
|
||||
|
||||
@@ -121,6 +122,7 @@ class PersonCreate(generic.CreateView):
|
||||
|
||||
|
||||
class PersonUpdate(generic.UpdateView):
|
||||
template_name = 'person_form.html'
|
||||
model = models.Person
|
||||
fields = ['name', 'phone', 'email', 'address', 'notes']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user