mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-16 21:12:13 +00:00
Various template changes
This commit is contained in:
@@ -204,7 +204,6 @@ USE_TZ = True
|
||||
DATETIME_INPUT_FORMATS = ('%Y-%m-%dT%H:%M', '%Y-%m-%dT%H:%M:%S')
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/1.7/howto/static-files/
|
||||
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
|
||||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
|
||||
@@ -216,7 +215,7 @@ TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [
|
||||
os.path.join(BASE_DIR, 'templates'),
|
||||
os.path.join(BASE_DIR, 'templates')
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
<div class="card-header">Notes</div>
|
||||
<div class="card-body">
|
||||
<p class="dont-break-out">{{ event.notes|linebreaksbr }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<br>
|
||||
@@ -244,34 +244,17 @@
|
||||
{% endif %}
|
||||
{% if not request.is_ajax and perms.RIGS.view_event %}
|
||||
<div class="col-sm-12 text-right">
|
||||
<div>
|
||||
<a href="{% url 'event_history' object.pk %}" title="View Revision History">
|
||||
Last edited at {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
|
||||
</a>
|
||||
</div>
|
||||
{% include 'partials/last_edited.html' with target="event_history" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% if request.is_ajax %}
|
||||
{% block barter %}
|
||||
<div class="row">
|
||||
{% block footer %}
|
||||
{% if perms.RIGS.view_event %}
|
||||
<div class="col-sm-10 align-left">
|
||||
<a href="{% url 'event_history' object.pk %}" title="View Revision History">
|
||||
Last edited at {{ object.last_edited_at|default:'never' }} by {{ object.last_edited_by.name|default:'nobody' }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
{% else %}
|
||||
<div class="col-sm-12">
|
||||
{% include 'partials/last_edited.html' with target="event_history" %}
|
||||
{% endif %}
|
||||
<div class="pull-right">
|
||||
<a href="{% url 'event_detail' object.pk %}" class="btn btn-primary">Open Event Page <span
|
||||
class="fas fa-eye"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{% url 'event_detail' object.pk %}" class="btn btn-primary">Open Event Page <span class="fas fa-eye"></span></a>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
<td>Event Date</td>
|
||||
<td>Event Timings</td>
|
||||
<td>Event Details</td>
|
||||
<td>Status</td>
|
||||
<td>Authorisation</td>
|
||||
<td>MIC</td>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -15,7 +13,7 @@
|
||||
{% for event in events %}
|
||||
<tr class="
|
||||
{% if event.cancelled %}
|
||||
active text-muted
|
||||
text-muted
|
||||
{% elif not event.is_rig %}
|
||||
info
|
||||
{% endif %}">
|
||||
@@ -65,7 +63,7 @@
|
||||
{% if event.dry_hire %}
|
||||
<span class="badge badge-secondary">Dry Hire</span>
|
||||
{% endif %}
|
||||
|
||||
|
||||
</h4>
|
||||
{% if event.is_rig and not event.cancelled %}
|
||||
<h5>
|
||||
@@ -80,15 +78,12 @@
|
||||
{{ event.description|linebreaksbr }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<!---Status-->
|
||||
<td class="bg-{% if event.confirmed %}success{%else%}warning{%endif%}">
|
||||
<span>{{ event.get_status_display }}</span>
|
||||
</td>
|
||||
<!---Authorisation-->
|
||||
<td>
|
||||
<span class="badge badge-{% if event.confirmed %}success{%else%}warning{%endif%}">{{ event.get_status_display }}</span>
|
||||
{% if event.is_rig and perms.RIGS.view_event and event.authorised %}
|
||||
<span class="fas fa-check"></span>
|
||||
<span class="badge badge-success">Authorised <i class="fas fa-check"></i></span>
|
||||
{% endif %}
|
||||
{% if event.is_rig and perms.RIGS.view_event and event.risk_assessment_edit_url %}
|
||||
<span class="badge badge-success">RA <i class="fas fa-check"></i></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<!---MIC-->
|
||||
@@ -112,4 +107,4 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
|
||||
{% block content %}
|
||||
<h1 class="bd-title">R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
|
||||
<h4 class="list-group-item-heading" style="margin:0;">Welcome back {{ user.get_full_name }}, there are {{ rig_count }} rigs coming up.</h4>
|
||||
<br>
|
||||
<h4 class="list-group-item-heading">Welcome back {{ user.get_full_name }}, there are {{ rig_count }} rigs coming up.</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<dt>Union Account</dt>
|
||||
<dd>{{ object.union_account|yesno|capfirst }}</dd>
|
||||
</dl>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -79,11 +79,7 @@
|
||||
<a href="{% url 'organisation_update' object.pk %}" class="btn btn-default"><span
|
||||
class="fas fa-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>
|
||||
{% include 'partials/last_edited.html' with target="organisation_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -91,7 +87,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% if request.is_ajax %}
|
||||
{% block barter %}
|
||||
{% block footer %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
@@ -100,12 +96,8 @@
|
||||
<a href="{% url 'organisation_update' object.pk %}" class="btn btn-default"><span
|
||||
class="fas fa-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>
|
||||
{% include 'partials/last_edited.html' with target="organisation_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
5
RIGS/templates/partials/last_edited.html
Normal file
5
RIGS/templates/partials/last_edited.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<div>
|
||||
<a href="{% url target object.pk %}" title="View Revision History">
|
||||
Last edited {{ object.last_edited_at|default:'never' }} by {{ object.last_edited_by.name|default:'System' }}
|
||||
</a>
|
||||
</div>
|
||||
@@ -4,7 +4,7 @@
|
||||
{% block title %}Person | {{ object.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="row my-3">
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12">
|
||||
<h1>Person | {{ object.name }}</h1>
|
||||
@@ -12,12 +12,12 @@
|
||||
|
||||
<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="fas fa-pencil"></span> Edit</a>
|
||||
<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-6">
|
||||
<div class="col-sm">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">Person Details</div>
|
||||
<div class="card-body">
|
||||
@@ -36,12 +36,12 @@
|
||||
|
||||
<dt>Notes</dt>
|
||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||
</dl>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm">
|
||||
<div class="card card-default">
|
||||
<div class="card-header">Associated Organisations</div>
|
||||
<div class="card-body">
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="row my-3">
|
||||
<div class="col-sm-12">
|
||||
<div class="card card-default">
|
||||
<div class="card-header">Associated Events</div>
|
||||
@@ -67,42 +67,31 @@
|
||||
</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="fas fa-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>
|
||||
<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 barter %}
|
||||
{% 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-default"><span
|
||||
class="fas fa-eye-open"></span> Open Page</a>
|
||||
<a href="{% url 'person_update' object.pk %}" class="btn btn-default"><span
|
||||
class="fas fa-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>
|
||||
<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 %}
|
||||
{% endif %}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<h3>People</h3>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<a href="{% url 'person_create' %}" class="btn btn-default pull-right">New <span
|
||||
<a href="{% url 'person_create' %}" class="btn btn-primary pull-right">New <span
|
||||
class="fas fa-plus"></span></a>
|
||||
</div>
|
||||
<div class="col-sm-3 col-sm-offset-9">
|
||||
@@ -47,11 +47,11 @@
|
||||
<td><a href="tel:{{ person.phone }}">{{ person.phone }}</a></td>
|
||||
<td>{{ person.notes|yesno|capfirst }}</td>
|
||||
<td>
|
||||
<a href="{% url 'person_detail' person.pk %}" class="btn btn-default modal-href">
|
||||
<span class="fas fa-eye-open"></span>
|
||||
<a href="{% url 'person_detail' person.pk %}" class="btn btn-light modal-href">
|
||||
<span class="fas fa-eye"></span>
|
||||
</a>
|
||||
<a href="{% url 'person_update' person.pk %}" class="btn btn-default"><span
|
||||
class="fas fa-pencil"></span></a>
|
||||
<a href="{% url 'person_update' person.pk %}" class="btn btn-secondary"><span
|
||||
class="fas fa-user-edit"></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
@@ -65,4 +65,4 @@
|
||||
</div>
|
||||
<div class="align-right">{% paginator %}</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<dt>Three Phase Available</dt>
|
||||
<dd>{{ object.three_phase_available|yesno|capfirst }}</dd>
|
||||
</dl>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,11 +65,7 @@
|
||||
<a href="{% url 'venue_update' object.pk %}" class="btn btn-default"><span
|
||||
class="fas fa-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>
|
||||
{% include 'partials/last_edited.html' with target="venue_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -78,7 +74,7 @@
|
||||
|
||||
|
||||
{% if request.is_ajax %}
|
||||
{% block barter %}
|
||||
{% block footer %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
@@ -87,12 +83,8 @@
|
||||
<a href="{% url 'venue_update' object.pk %}" class="btn btn-default"><span
|
||||
class="fas fa-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>
|
||||
{% include 'partials/last_edited.html' with target="venue_history" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
if($(this).attr('href')){
|
||||
window.location.href = $(this).attr('href');
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -25,8 +25,8 @@
|
||||
<div class="col-sm-12">
|
||||
<h3><a href="{{ object.get_absolute_url }}">{{object|to_class_name}} {{ object.pk|stringformat:"05d" }}</a> - Revision History</h3>
|
||||
</div>
|
||||
<div class="text-right col-sm-12">{% paginator %}</div>
|
||||
</div>
|
||||
<div>{% paginator %}</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
@@ -55,6 +55,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="align-right">{% paginator %}</div>
|
||||
<div>{% paginator %}</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -73,6 +73,7 @@ class CloseModal(generic.TemplateView):
|
||||
|
||||
|
||||
class PersonList(generic.ListView):
|
||||
template_name = 'person_list.html'
|
||||
model = models.Person
|
||||
paginate_by = 20
|
||||
|
||||
@@ -98,6 +99,7 @@ class PersonList(generic.ListView):
|
||||
|
||||
|
||||
class PersonDetail(generic.DetailView):
|
||||
template_name = 'person_detail.html'
|
||||
model = models.Person
|
||||
|
||||
|
||||
@@ -136,6 +138,7 @@ class PersonUpdate(generic.UpdateView):
|
||||
|
||||
|
||||
class OrganisationList(generic.ListView):
|
||||
template_name='organisation_list.html'
|
||||
model = models.Organisation
|
||||
paginate_by = 20
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ function browserSyncReload(done) {
|
||||
function watchFiles() {
|
||||
gulp.watch("RIGS/static/scss/**/*", sass);
|
||||
gulp.watch("RIGS/static/js/**/*", scripts);
|
||||
gulp.watch(['templates/**/*.html', 'RIGS/templates/**/*.html', 'assets/templates/**/*.html'], browserSyncReload);
|
||||
gulp.watch(['templates/**/*.html', 'RIGS/templates/**/*.html', 'assets/templates/**/*.html', /*TODO'RIGS/.py'*/], browserSyncReload);
|
||||
}
|
||||
|
||||
exports.watch = gulp.parallel(watchFiles, browserSync);
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container" style="padding-top: 1rem;">
|
||||
<div class="container py-4">
|
||||
{% block content-header %}
|
||||
{% if error %}
|
||||
<div class="error">{{ error }}</div>{% endif %}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title">{% block title %}{% endblock %}</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
{% if perms.RIGS.add_invoice %}
|
||||
<a class="dropdown-item" href="{% url 'invoice_waiting' %}"><span class="fas fa-briefcase text-danger"></span> Waiting</a>
|
||||
{% endif %}
|
||||
<a class="dropdown-item" href="{% url 'invoice_list' %}"><span class="fas fa-gbp text-warning"></span> Outstanding</a>
|
||||
<a class="dropdown-item" href="{% url 'invoice_list' %}"><span class="fas fa-pound-sign text-warning"></span> Outstanding</a>
|
||||
<a class="dropdown-item" href="{% url 'invoice_archive' %}"><span class="fas fa-book"></span> Archive</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user