mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Asset list table improvements
This commit is contained in:
@@ -214,7 +214,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div id='calendar'>
|
||||
<div id='calendar'></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -88,12 +88,9 @@
|
||||
<div class="card-header">Event Details</div>
|
||||
<div class="card-body">
|
||||
{% if perms.RIGS.view_event %}
|
||||
<div class="card bg-secondary">
|
||||
<div class="card-header">Notes</div>
|
||||
<div class="card-body">
|
||||
<p class="dont-break-out">{{ event.notes|linebreaksbr }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<h4>Notes</h4>
|
||||
<hr>
|
||||
<p class="dont-break-out">{{ event.notes|linebreaksbr }}</p>
|
||||
{% endif %}
|
||||
<br>
|
||||
{% include 'item_table.html' %}
|
||||
|
||||
@@ -33,12 +33,12 @@
|
||||
|
||||
<blockTableStyle id="eventSpecifics">
|
||||
<blockValign value="top"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="LightGrey" start="0,0" stop="1,0" thickness="1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="LightGrey" start="0,0" stop="1,0" thickness="1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="headLayout">
|
||||
<blockValign value="top"/>
|
||||
|
||||
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="eventDetails">
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
{# logo positioned 42 from left, 33 from top #}
|
||||
<image file="RIGS/static/imgs/paperwork/tec-logo.jpg" x="42" y="719" height="90" width="84"/>
|
||||
|
||||
|
||||
<setFont name="OpenSans-Bold" size="22.5" leading="10"/>
|
||||
<drawString x="137" y="780">TEC PA & Lighting</drawString>
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<drawString x="265" y="746">info@nottinghamtec.co.uk</drawString>
|
||||
<drawString x="137" y="732">Phone: (0115) 846 8720</drawString>
|
||||
|
||||
|
||||
|
||||
|
||||
<setFont name="OpenSans" size="10" />
|
||||
<drawCenteredString x="302.5" y="38">[Page <pageNumber/> of <getName id="lastPage" default="0" />]</drawCenteredString>
|
||||
@@ -106,7 +106,7 @@
|
||||
[Paperwork generated{% if current_user %} by {{current_user.name}} |{% endif %} {% now "d/m/Y H:i" %} | {{object.current_version_id}}]
|
||||
</drawCenteredString>
|
||||
</pageGraphics>
|
||||
|
||||
|
||||
<frame id="main" x1="50" y1="65" width="495" height="645"/>
|
||||
</pageTemplate>
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<pageGraphics>
|
||||
<image file="RIGS/static/imgs/paperwork/corner-tr.jpg" x="395" y="642" height="200" width="200"/>
|
||||
<image file="RIGS/static/imgs/paperwork/corner-bl.jpg" x="0" y="0" height="200" width="200"/>
|
||||
|
||||
|
||||
<setFont name="OpenSans" size="10"/>
|
||||
<drawCenteredString x="302.5" y="38">[Page <pageNumber/> of <getName id="lastPage" default="0" />]</drawCenteredString>
|
||||
<setFont name="OpenSans" size="7" />
|
||||
@@ -127,7 +127,7 @@
|
||||
</template>
|
||||
|
||||
<story firstPageTemplate="Headed">
|
||||
{% include 'event_print_page.xml" %}
|
||||
{% include "event_print_page.xml" %}
|
||||
</story>
|
||||
|
||||
</document>
|
||||
|
||||
@@ -4,75 +4,75 @@
|
||||
{% 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>
|
||||
<div class="row my-3">
|
||||
{% 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 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 %}
|
||||
|
||||
@@ -42,22 +42,7 @@
|
||||
|
||||
<a href="{% url 'asset_create' %}" class="btn btn-success float-right my-3">New <i class="fas fa-plus"></i></a>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Asset ID</th>
|
||||
<th scope="col" class="w-25">Description</th>
|
||||
<th scope="col">Category</th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col" class="d-none d-sm-block">Quick Links</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="asset_table_body">
|
||||
{% include 'partials/asset_list_table_body.html' %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% include 'partials/asset_list_table.html' %}
|
||||
|
||||
{% if is_paginated %}
|
||||
<div class="text-center">
|
||||
|
||||
36
assets/templates/partials/asset_list_table.html
Normal file
36
assets/templates/partials/asset_list_table.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Asset ID</th>
|
||||
<th scope="col" class="w-25">Description</th>
|
||||
<th scope="col">Category</th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col" class="d-none d-sm-table-cell">Quick Links</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="asset_table_body">
|
||||
{% for item in object_list %}
|
||||
<tr class="{{ item.status.display_class|default:'' }} assetRow">
|
||||
<th scope="row"><a class="assetID" href="{% url 'asset_detail' item.asset_id %}">{{ item.asset_id }}</a></th>
|
||||
<td class="assetDesc w-25 text-truncate">{{ item.description }}</td>
|
||||
<td class="assetCategory">{{ item.category }}</td>
|
||||
<td class="assetStatus">{{ item.status }}</td>
|
||||
<td class="d-none d-sm-table-cell">
|
||||
<div class="btn-group" role="group">
|
||||
<a type="button" class="btn btn-primary btn-sm" href="{% url 'asset_detail' item.asset_id %}"><i class="fas fa-eye fa-fw"></i><span class="d-none d-sm-inline"> View</span></a>
|
||||
{% if perms.assets.change_asset %}
|
||||
<a type="button" class="btn btn-warning btn-sm" href="{% url 'asset_update' item.asset_id %}"><i class="fas fa-edit fa-fw"></i><span class="d-none d-sm-inline"> Edit</span></a>
|
||||
<a type="button" class="btn btn-secondary btn-sm" href="{% url 'asset_duplicate' item.asset_id %}"><i class="fas fa-clone fa-fw"></i><span class="d-none d-sm-inline"> Duplicate</span></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="6">Nothing found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1,22 +0,0 @@
|
||||
{% for item in object_list %}
|
||||
<tr class="{{ item.status.display_class|default:'' }} assetRow">
|
||||
<th scope="row"><a class="assetID" href="{% url 'asset_detail' item.asset_id %}">{{ item.asset_id }}</a></th>
|
||||
<td class="assetDesc w-25">{{ item.description }}</td>
|
||||
<td class="assetCategory">{{ item.category }}</td>
|
||||
<td class="assetStatus">{{ item.status }}</td>
|
||||
<td class="d-none d-sm-block">
|
||||
<div class="btn-group d-flex" role="group">
|
||||
<a type="button" class="btn btn-primary btn-sm flex-nowrap" href="{% url 'asset_detail' item.asset_id %}"><span class="fas fa-eye fa-fw text-nowrap"></span><span class="d-none d-md-block text-nowrap"> View</span></a>
|
||||
{% if perms.assets.change_asset %}
|
||||
<a type="button" style="display: inline !important; white-space: no-wrap !important;" class="btn btn-warning btn-sm text-nowrap flex-nowrap" href="{% url 'asset_update' item.asset_id %}"><span class="fas fa-edit fa-fw" style="display: inline !important;"></span><span class="d-none d-md-block"> Edit</span></a>
|
||||
<a type="button" class="btn btn-secondary btn-sm text-nowrap" href="{% url 'asset_duplicate' item.asset_id %}"><span class="fas fa-clone fa-fw"></span><span class="d-none d-md-block"> Duplicate</span></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="5">Nothing found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@@ -1,73 +1,75 @@
|
||||
{% extends 'base_assets.html' %}
|
||||
{% extends request.is_ajax|yesno:'base_ajax.html,base_assets.html' %}
|
||||
{% block title %}Supplier | {{ object.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12">
|
||||
<h1>Supplier | {{ object.name }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url 'supplier_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="panel panel-info">
|
||||
<div class="panel-heading">Supplier Details</div>
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Name</dt>
|
||||
<dd>{{ object.name }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Associated Assets</div>
|
||||
<div class="panel-body">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Asset ID</th>
|
||||
<th>Description</th>
|
||||
<th>Category</th>
|
||||
<th>Status</th>
|
||||
<th class="hidden-xs">Quick Links</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="asset_table_body">
|
||||
{% with object.assets.all as object_list %}
|
||||
{% include 'partials/asset_list_table_body.html' %}
|
||||
{% endwith %}
|
||||
</tbody>
|
||||
</table>
|
||||
</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 'supplier_update' object.pk %}" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'supplier_update' object.pk %}" title="View Revision History">
|
||||
Last edited {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<h1>Supplier | {{ object.name }}</h1>
|
||||
</div>
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url 'supplier_update' object.pk %}" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col pb-3">
|
||||
<div class="card">
|
||||
<div class="card-header">Supplier 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>{% if object.phone %}<a href="tel:{{ object.phone }}">{% endif %}{{ object.phone }}{% if object.phone %}</a>{% endif %}</dd>
|
||||
|
||||
<dt class="col-6">Email</dt>
|
||||
<dd>{% if object.email %}<a href="mailto:{{ object.email }}">{% endif %}<span class="overflow-ellipsis">{{ object.email }}</span>{% if object.email %}</a>{% endif %}</dd>
|
||||
|
||||
<dt class="col-12">Address</dt>
|
||||
<dd class="col-12">{{ 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-12">
|
||||
<div class="card">
|
||||
<div class="card-header">Associated Assets</div>
|
||||
{% with object.assets.all as object_list %}
|
||||
{% include 'partials/asset_list_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 'supplier_update' object.pk %}" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-pencil"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target="supplier_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 'supplier_detail' object.pk %}" class="btn btn-primary"><span
|
||||
class="fas fa-eye"></span> Open Page</a>
|
||||
<a href="{% url 'supplier_update' object.pk %}" class="btn btn-light"><span
|
||||
class="fas fa-edit"></span> Edit</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target="supplier_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user