diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index f6f66cbb..2da0eac7 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -228,9 +228,9 @@ class EventPrint(generic.View): class EventArchive(generic.ListView): + template_name = "event_archive.html" model = models.Event paginate_by = 25 - template_name = "event_archive.html" def get_context_data(self, **kwargs): # get super context diff --git a/RIGS/templates/activity_table.html b/RIGS/templates/activity_table.html index 3873f9ba..07ffc454 100644 --- a/RIGS/templates/activity_table.html +++ b/RIGS/templates/activity_table.html @@ -8,7 +8,7 @@ {% block js %} - + {% endblock %} @@ -47,10 +31,9 @@

Rigboard Activity Stream

-
{% paginator %}
+ {% paginator %}
- @@ -59,12 +42,11 @@ - {% for version in object_list %} - + @@ -75,16 +57,15 @@ {{version.changes.new|to_class_name}} Created {% else %} {% include 'version_changes.html' %} - {% endif %} - + {% endif %} + - - {% endfor %} + {% endfor %}
Version ID User ChangesComment
{{ version.revision.date_created }} {{version.changes.new|to_class_name}} {{ version.changes.new.pk|stringformat:"05d" }}{{ version.changes.revision.comment }}
-
{% paginator %}
+ {% paginator %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/RIGS/templates/event_archive.html b/RIGS/templates/event_archive.html index b4de2381..bb7b6f0a 100644 --- a/RIGS/templates/event_archive.html +++ b/RIGS/templates/event_archive.html @@ -17,15 +17,15 @@
End
-
+
Keyword
-
+
-
+ @@ -34,8 +34,8 @@
{% paginator %}
- {% endif %} - + {% endif %} +
@@ -52,4 +52,4 @@
{% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/RIGS/templates/event_detail.html b/RIGS/templates/event_detail.html index 81f676b0..d0e18d13 100644 --- a/RIGS/templates/event_detail.html +++ b/RIGS/templates/event_detail.html @@ -18,29 +18,27 @@ {% endif %} {% if object.is_rig and perms.RIGS.view_event %} {# only need contact details for a rig #} -
-
+
+
Contact Details
-
-
Person
-
+
Person
+
{{ object.person }} {% endif %}
- -
Email
-
+
Email
+
{{ object.person.email }}
- -
Phone Number
-
{{ object.person.phone }}
+
Phone Number
+
{{ object.person.phone }}
@@ -48,38 +46,36 @@
Organisation
-
-
Organisation
-
+
+
Organisation
+
{% if object.organisation %} {{ object.organisation }} {% endif %}
- -
Phone Number
-
+
Phone Number
+
{{ object.organisation.phone }}
- -
Has SU Account
-
{{ event.organisation.union_account|yesno|capfirst }}
+
Has SU Account
+
{{ event.organisation.union_account|yesno|capfirst }}
{% endif %}
{% endif %} -
+
Event Info
-
-
Event Venue
-
+
+
Event Venue
+
{% if object.venue %} {{ object.venue }} @@ -88,8 +84,8 @@
{% if event.is_rig %} -
Event MIC
-
+
Event MIC
+
{% if event.mic and perms.RIGS.view_profile %} {{ event.mic.name }} @@ -100,35 +96,35 @@
{% endif %} -
Status
-
{{ event.get_status_display }}
+
Status
+
{{ event.get_status_display }}
-
 
+
 
{% if event.is_rig %} -
Crew Meet
-
{{ event.meet_at|date:"D d M Y H:i"|default:"" }}
-
{{ event.meet_info|default:"" }}
+
Crew Meet
+
{{ event.meet_at|date:"D d M Y H:i"|default:"TBC" }}
+ -
Access From
-
{{ event.access_at|date:"D d M Y H:i"|default:"" }}
+
Access From
+
{{ event.access_at|date:"D d M Y H:i"|default:"TBC" }}
{% endif %} -
Event Starts
-
{{ event.start_date|date:"D d M Y" }} {{ event.start_time|date:"H:i" }}
+
Event Starts
+
{{ event.start_date|date:"D d M Y" }} {{ event.start_time|date:"H:i" }}
-
Event Ends
-
{{ event.end_date|date:"D d M Y" }} {{ event.end_time|date:"H:i" }}
+
Event Ends
+
{{ event.end_date|date:"D d M Y" }} {{ event.end_time|date:"H:i" }}
-
 
+
 
-
Event Description
-
{{ event.description|linebreaksbr }}
+
Event Description
+
{{ event.description|linebreaksbr }}
-
 
+
 
-
Based On
-
+
Based On
+
{% if object.based_on %} {% if object.based_on.is_rig %}N{{ object.based_on.pk|stringformat:"05d" }}{% else %} @@ -139,19 +135,19 @@
{% if event.dry_hire %} -
Checked In By
-
{{ object.checked_in_by.name }}
+
Checked In By
+
{{ object.checked_in_by.name }}
{% endif %} {% if event.is_rig %} -
Collected By
-
{{ object.collector }}
+
Collected By
+
{{ object.collector }}
{% endif %} {% if event.is_rig and not event.internal and perms.RIGS.view_event %} -
 
-
PO
-
{{ object.purchase_order }}
+
 
+
PO
+
{{ object.purchase_order }}
{% endif %}
@@ -170,7 +166,7 @@ ">
Client Authorisation
-
+
Authorisation Request
{{ object.auth_request_to|yesno:"Yes,No" }}
@@ -184,7 +180,7 @@
{{ object.auth_request_to }}
 
-
+
Authorised
{{ object.authorised|yesno:"Yes,No" }}
diff --git a/RIGS/templates/event_invoice.html b/RIGS/templates/event_invoice.html index de9af772..a315286f 100644 --- a/RIGS/templates/event_invoice.html +++ b/RIGS/templates/event_invoice.html @@ -75,15 +75,15 @@ {{ object.mic.initials }}
{% else %} - + {% endif %}
- + diff --git a/RIGS/templates/organisation_list.html b/RIGS/templates/organisation_list.html index f58dfa6a..ac4c5401 100644 --- a/RIGS/templates/organisation_list.html +++ b/RIGS/templates/organisation_list.html @@ -1,70 +1,25 @@ {% 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 %}Organisations{% endblock %} {% block content %} -
-
-
-

Organisations

-
-
- New -
-
-
-
- -
-
-
-
{% paginator %}
+
+
+

Organisations

-
- - - - - - - - - - - - - - {% for object in object_list %} - - - - - - - - - - {% empty %} - - - - - {% endfor %} - -
NameEmailPhoneNotesUnion Account
{{ object.pk }}{{ object.name }}{{ object.email }}{{ object.phone }}{{ object.notes|yesno|capfirst }}{{ object.union_account|yesno|capfirst }} - - - - -
No organisations found
+
+ New +
+
+
+
+ +
+
-
{% paginator %}
-{% endblock %} \ No newline at end of file + {% include 'partials/generic_list.html' with edit="organisation_update" detail="organisation_detail" union_account=True %} +{% endblock %} diff --git a/RIGS/templates/partials/generic_list.html b/RIGS/templates/partials/generic_list.html new file mode 100644 index 00000000..002bb027 --- /dev/null +++ b/RIGS/templates/partials/generic_list.html @@ -0,0 +1,48 @@ +{% load url_replace from filters %} +{% load orderby from filters %} +{% load paginator from filters %} +
{% paginator %}
+
+ + + + + + + + + {% if union_account %} {#TODO#} + + {% endif %} + + + + + {% for object in object_list %} + + + + + + + {% if union_account %} + + {% endif %} + + + {% empty %} + + + + + {% endfor %} + +
#NameEmailPhoneNotesUnion AccountQuick Links
{{ object.pk }}{{ object.name }}{{ object.email }}{% if object.phone %}{%endif%}{{ object.phone }}{% if object.phone %}{%endif%}{{ object.notes|yesno|capfirst }}{{ object.union_account|yesno|capfirst }} + + + + +
Nothing found
+
+
{% paginator %}
diff --git a/RIGS/templates/person_list.html b/RIGS/templates/person_list.html index 6d500e31..70cbc605 100644 --- a/RIGS/templates/person_list.html +++ b/RIGS/templates/person_list.html @@ -7,62 +7,22 @@ {% block title %}People{% endblock %} {% block content %} -
-
-
-

People

-
-
- New -
-
-
-
- -
-
-
-
{% paginator %}
+
+
+

People

-
- - - - - - - - - - - - - {% for person in person_list %} - - - - - - - - - {% empty %} - - - - - {% endfor %} - -
NameEmailPhoneNotes
{{ person.pk }}{{ person.name }}{{ person.email }}{{ person.phone }}{{ person.notes|yesno|capfirst }} - - - - -
No people stored
+
+ New +
+
+
+
+ +
+
-
{% paginator %}
+ {% include 'partials/generic_list.html' with edit="person_update" detail="person_detail" %} {% endblock %} diff --git a/RIGS/templates/venue_list.html b/RIGS/templates/venue_list.html index c350df78..694ed36e 100644 --- a/RIGS/templates/venue_list.html +++ b/RIGS/templates/venue_list.html @@ -7,63 +7,22 @@ {% block title %}Venues{% endblock %} {% block content %} -
-
-
-

Venues

-
-
- New -
-
-
-
- -
-
-
-
{% paginator %}
+
+
+

Venues

- -
- - - - - - - - - - - - - {% for object in object_list %} - - - - - - - - - {% empty %} - - - - - {% endfor %} - -
NameEmailPhoneNotes
{{ object.pk }}{{ object.name }}{{ object.email }}{{ object.phone }}{{ object.notes|yesno|capfirst }} - - - - -
No venues found
+
+ New +
+
+
+
+ +
+
-
{% paginator %}
-{% endblock %} \ No newline at end of file + {% include 'partials/generic_list.html' with edit="venue_update" detail="venue_detail" %} +{% endblock %} diff --git a/RIGS/views.py b/RIGS/views.py index 0c7c487e..85208e70 100644 --- a/RIGS/views.py +++ b/RIGS/views.py @@ -202,6 +202,7 @@ class OrganisationUpdate(generic.UpdateView): class VenueList(generic.ListView): + template_name = "venue_list.html" model = models.Venue paginate_by = 20 diff --git a/assets/templates/asset_list.html b/assets/templates/asset_list.html index cbd27b28..1e6aa9e3 100644 --- a/assets/templates/asset_list.html +++ b/assets/templates/asset_list.html @@ -2,9 +2,19 @@ {% block title %}Asset List{% endblock %} {% load paginator from filters %} {% load widget_tweaks %} +{% load static %} + +{% block css %} + + +{% endblock %} + +{% block preload_js %} + + +{% endblock %} {% block content %} - @@ -13,9 +23,8 @@
{% render_field form.query|add_class:'form-control' placeholder='Search by Asset ID/Desc/Serial' style="width: 250px"%} - +
-
@@ -33,11 +42,11 @@ - - - - - + + + + + @@ -52,14 +61,3 @@ {% endif %} {% endblock %} - -{% load static %} -{% block css %} - - -{% endblock %} - -{% block preload_js %} - - -{% endblock %} diff --git a/assets/templates/partials/asset_list_table_body.html b/assets/templates/partials/asset_list_table_body.html index 352d15db..f0f382b5 100644 --- a/assets/templates/partials/asset_list_table_body.html +++ b/assets/templates/partials/asset_list_table_body.html @@ -1,19 +1,22 @@ {% for item in object_list %} - {#
  • {{ item.asset_id }} - {{ item.description }}
  • #} - - + + {% empty %} + + + + {% endfor %} diff --git a/assets/templates/supplier_list.html b/assets/templates/supplier_list.html index 20ed5974..6ba6ba92 100644 --- a/assets/templates/supplier_list.html +++ b/assets/templates/supplier_list.html @@ -18,30 +18,6 @@ -
    Asset IDDescriptionCategoryStatusAsset IDDescriptionCategoryStatus
    {{ item.asset_id }}{{ item.asset_id }} {{ item.description }} {{ item.category }} {{ item.status }}
    Nothing found
    - - - - - - - - {% for item in object_list %} - - - - - {% endfor %} - -
    SupplierQuick Links
    {{ item.name }} - View - Edit -
    - -{% if is_paginated %} -
    - {% paginator %} -
    -{% endif %} +{% include 'partials/generic_list.html' with edit="supplier_update" detail="supplier_detail" %} {% endblock %} diff --git a/gulpfile.js b/gulpfile.js index 5adb0716..9b84b316 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -59,6 +59,7 @@ function scripts() { function browserSync(done) { exec('python manage.py runserver'); + // TODO Pipe errors from django to gulp output // TODO Wait for Django server to come up before browsersync, it seems inconsistent browsersync.init({ notify: true, diff --git a/templates/base_assets.html b/templates/base_assets.html index 978fdf1b..fe27ddb3 100644 --- a/templates/base_assets.html +++ b/templates/base_assets.html @@ -5,35 +5,30 @@ {% endblock %} {% block titleheader %} - RIGS + RIGS Assets {% endblock %} {% block titleelements %} - {# % if perms.assets.view_asset % #} - - {# % endif % #} - {# % if perms.assets.view_supplier % #} - - {# % endif % #} + + {% if perms.assets.view_asset %} -
  • Recent Changes
  • + {% endif %} {% endblock %} diff --git a/templates/base_rigs.html b/templates/base_rigs.html index 36e6936b..f11b05d1 100644 --- a/templates/base_rigs.html +++ b/templates/base_rigs.html @@ -30,7 +30,6 @@ {% endif %}
    -{% endif %} {% if perms.RIGS.view_invoice %}