diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py index 60ce218a..272d1713 100644 --- a/PyRIGS/settings.py +++ b/PyRIGS/settings.py @@ -233,7 +233,7 @@ USE_TZ = True DATETIME_INPUT_FORMATS = ('%Y-%m-%dT%H:%M', '%Y-%m-%dT%H:%M:%S') # Static files (CSS, JavaScript, Images) -STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage' +STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static/') STATIC_DIRS = [ @@ -242,8 +242,6 @@ STATIC_DIRS = [ STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'pipeline/built_assets'), ] -STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' -WHITENOISE_KEEP_ONLY_HASHED_FILES=True TEMPLATES = [ { diff --git a/RIGS/finance.py b/RIGS/finance.py index 81f57c56..f88881fd 100644 --- a/RIGS/finance.py +++ b/RIGS/finance.py @@ -67,12 +67,6 @@ class InvoicePrint(generic.View): context = { 'object': object, - 'fonts': { - 'opensans': { - 'regular': 'RIGS/static/fonts/OPENSANS-REGULAR.TTF', - 'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF', - } - }, 'invoice': invoice, 'current_user': request.user, 'filename': 'Invoice {} for {} {}.pdf'.format(invoice.display_id, object.display_id, re.sub(r'[^a-zA-Z0-9 \n\.]', '', object.name)) diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index 715c38a8..b84ae190 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -60,6 +60,14 @@ class EventDetail(generic.DetailView): template_name = 'event_detail.html' model = models.Event + def get_context_data(self, **kwargs): + context = super(EventDetail, self).get_context_data(**kwargs) + title = "{} | {}".format(self.object.display_id, self.object.name) + if self.object.dry_hire: + title += " Dry Hire" + context['page_title'] = title + return context + class EventEmbed(EventDetail): template_name = 'event_embed.html' @@ -173,15 +181,9 @@ class EventPrint(generic.View): context = { 'object': object, - 'fonts': { - 'opensans': { - 'regular': 'static/fonts/OPENSANS-REGULAR.TTF', - 'bold': 'static/fonts/OPENSANS-BOLD.TTF', - } - }, 'quote': True, 'current_user': request.user, - 'filename': 'Event {} {} {}.pdf'.format(object.display_id, re.sub(r'[^a-zA-Z0-9 \n\.]', '', object.name), object.start_date) + 'filename': 'Event_{}_{}_{}.pdf'.format(object.display_id, re.sub(r'[^a-zA-Z0-9 \n\.]', '', object.name), object.start_date) } rml = template.render(context) diff --git a/RIGS/signals.py b/RIGS/signals.py index 4eb95055..e01deef6 100644 --- a/RIGS/signals.py +++ b/RIGS/signals.py @@ -25,12 +25,6 @@ def send_eventauthorisation_success_email(instance): # Generate PDF first to prevent context conflicts context = { 'object': instance.event, - 'fonts': { - 'opensans': { - 'regular': 'RIGS/static/fonts/OPENSANS-REGULAR.TTF', - 'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF', - } - }, 'receipt': True, 'current_user': False, } diff --git a/RIGS/static/fonts/OPENSANS-BOLDITALIC.TTF b/RIGS/static/fonts/OPENSANS-BOLDITALIC.TTF deleted file mode 100644 index 9bc80095..00000000 Binary files a/RIGS/static/fonts/OPENSANS-BOLDITALIC.TTF and /dev/null differ diff --git a/RIGS/static/fonts/OPENSANS-ITALIC.TTF b/RIGS/static/fonts/OPENSANS-ITALIC.TTF deleted file mode 100644 index c90da48f..00000000 Binary files a/RIGS/static/fonts/OPENSANS-ITALIC.TTF and /dev/null differ diff --git a/RIGS/static/fonts/OPENSANS-BOLD.TTF b/RIGS/static/fonts/OpenSans-Bold.tff similarity index 100% rename from RIGS/static/fonts/OPENSANS-BOLD.TTF rename to RIGS/static/fonts/OpenSans-Bold.tff diff --git a/RIGS/static/fonts/OPENSANS-REGULAR.TTF b/RIGS/static/fonts/OpenSans-Regular.tff similarity index 100% rename from RIGS/static/fonts/OPENSANS-REGULAR.TTF rename to RIGS/static/fonts/OpenSans-Regular.tff diff --git a/RIGS/templates/event_detail.html b/RIGS/templates/event_detail.html index d76e0860..282f7e53 100644 --- a/RIGS/templates/event_detail.html +++ b/RIGS/templates/event_detail.html @@ -2,17 +2,9 @@ {% load linkornone from filters %} {% load namewithnotes from filters %} -{% block title %}{% if object.is_rig %}N{{ object.pk|stringformat:"05d" }}{% else %}{{ object.pk }}{% endif %} | {{object.name}}{% endblock %} - {% block content %}
{% if not request.is_ajax %} -
-

- {% if object.is_rig %}N{{ object.pk|stringformat:"05d" }}{% else %}{{ object.pk }}{% endif %} - | {{ object.name }} {% if event.dry_hire %}Dry Hire{% endif %} -

-
{% if perms.RIGS.view_event %}
{% include 'event_detail_buttons.html' %} diff --git a/RIGS/templates/event_print.xml b/RIGS/templates/event_print.xml index 74ff42a8..8248f95d 100644 --- a/RIGS/templates/event_print.xml +++ b/RIGS/templates/event_print.xml @@ -1,12 +1,10 @@ -{% load multiply from filters %} -{% load static %} - - + + @@ -82,11 +80,11 @@