From b838d25cc29008adb2d6fe2bd3cd01ad2cfa4572 Mon Sep 17 00:00:00 2001 From: Tom Price Date: Tue, 5 Jan 2016 00:07:22 +0000 Subject: [PATCH] Refactor training status table down to the simplest elements so they can be included as needed. --- .../templates/training/profile_detail.html | 56 +------------------ .../training/profile_detail_table.html | 7 +++ .../training/trainingcategory_item_table.html | 20 +++++++ .../training/trainingitem_detail_row.html | 31 ++++++++++ 4 files changed, 59 insertions(+), 55 deletions(-) create mode 100644 training/templates/training/profile_detail_table.html create mode 100644 training/templates/training/trainingcategory_item_table.html create mode 100644 training/templates/training/trainingitem_detail_row.html diff --git a/training/templates/training/profile_detail.html b/training/templates/training/profile_detail.html index be120a88..39b28631 100644 --- a/training/templates/training/profile_detail.html +++ b/training/templates/training/profile_detail.html @@ -1,63 +1,9 @@ {% extends 'base.html' %} -{% load training_extras %} {% block title %}{{ profile }} Training{% endblock %} {% block content %}

Training Profile for {{ profile }}

- {% for category in categories %} -
-
-

{{ category }}

- - - - - - - - - - - {% for item in category.trainingitem_set.all %} - {% with record=item|item_record:request.user %} - - - - - - - {% endwith %} - {% endfor %} - -
ItemStartedCompleteAssessed
{{ record.training_item }} - {{ record.started_date|default_if_none:"No" }} {{ record.started_trainer|default_if_none:"" }} - {% if record.started_notes %} -
{{ record.started_notes }}
- {% endif %} -
- {{ record.completed_date|default_if_none:"No" }} {{ record.completed_trainer|default_if_none:"" }} - {% if record.completed_notes %} -
{{ record.completed_notes }}
- {% endif %} -
- {{ record.assessed_date|default_if_none:"No" }} {{ record.assessed_trainer|default_if_none:"" }} - {% if record.assessed_notes %} -
{{ record.assessed_notes }}
- {% endif %} -
-
-
- {% endfor %} + {% include "training/profile_detail_table.html" %} {% endblock %} \ No newline at end of file diff --git a/training/templates/training/profile_detail_table.html b/training/templates/training/profile_detail_table.html new file mode 100644 index 00000000..8854791e --- /dev/null +++ b/training/templates/training/profile_detail_table.html @@ -0,0 +1,7 @@ +{% for category in categories %} +
+
+ {% include "training/trainingcategory_item_table.html" %} +
+
+{% endfor %} \ No newline at end of file diff --git a/training/templates/training/trainingcategory_item_table.html b/training/templates/training/trainingcategory_item_table.html new file mode 100644 index 00000000..b14f501b --- /dev/null +++ b/training/templates/training/trainingcategory_item_table.html @@ -0,0 +1,20 @@ +{% load training_extras %} + +

{{ category }}

+ + + + + + + + + + + {% for item in category.trainingitem_set.all %} + {% with record=item|item_record:request.user %} + {% include "training/trainingitem_detail_row.html" %} + {% endwith %} + {% endfor %} + +
ItemStartedCompleteAssessed
\ No newline at end of file diff --git a/training/templates/training/trainingitem_detail_row.html b/training/templates/training/trainingitem_detail_row.html new file mode 100644 index 00000000..41c1af71 --- /dev/null +++ b/training/templates/training/trainingitem_detail_row.html @@ -0,0 +1,31 @@ + + {{ record.training_item }} + + {{ record.started_date|default_if_none:"No" }} {{ record.started_trainer|default_if_none:"" }} + {% if record.started_notes %} +
{{ record.started_notes }}
+ {% endif %} + + + {{ record.completed_date|default_if_none:"No" }} {{ record.completed_trainer|default_if_none:"" }} + {% if record.completed_notes %} +
{{ record.completed_notes }}
+ {% endif %} + + + {{ record.assessed_date|default_if_none:"No" }} {{ record.assessed_trainer|default_if_none:"" }} + {% if record.assessed_notes %} +
{{ record.assessed_notes }}
+ {% endif %} + + \ No newline at end of file