@@ -37,43 +37,49 @@ <h5 class="card-header" id="module{{ module.pk }}">
37
37
</ h5 >
38
38
< div class ="card-body ">
39
39
{% include 'inc/sync_warning.html' with object=module %}
40
- < table class ="table table-hover table-headings reports ">
41
- < thead >
42
- < tr >
43
- < th width ="250 "> Name</ th >
44
- < th > Description</ th >
45
- < th > Last Run</ th >
46
- < th class ="text-end "> Status</ th >
47
- </ tr >
48
- </ thead >
49
- < tbody >
50
- {% with jobs=module.get_latest_jobs %}
51
- {% for script_name, script_class in module.scripts.items %}
52
- < tr >
53
- < td >
54
- < a href ="{% url 'extras:script' module=module.python_name name=script_name %} " name ="script.{{ script_name }} "> {{ script_class.name }}</ a >
55
- </ td >
56
- < td >
57
- {{ script_class.Meta.description|markdown|placeholder }}
58
- </ td >
59
- {% with last_result=jobs|get_key:script_class.name %}
60
- {% if last_result %}
61
- < td >
62
- < a href ="{% url 'extras:script_result' job_pk=last_result.pk %} "> {{ last_result.created|annotated_date }}</ a >
63
- </ td >
64
- < td class ="text-end ">
65
- {% badge last_result.get_status_display last_result.get_status_color %}
66
- </ td >
67
- {% else %}
68
- < td class ="text-muted "> Never</ td >
69
- < td class ="text-end "> {{ ''|placeholder }}</ td >
70
- {% endif %}
71
- {% endwith %}
72
- </ tr >
73
- {% endfor %}
74
- {% endwith %}
75
- </ tbody >
76
- </ table >
40
+ {% if not module.scripts %}
41
+ < div class ="alert alert-warning d-flex align-items-center " role ="alert ">
42
+ < i class ="mdi mdi-alert "> </ i > Script file at: {{module.full_path}} could not be loaded.
43
+ </ div >
44
+ {% else %}
45
+ < table class ="table table-hover table-headings reports ">
46
+ < thead >
47
+ < tr >
48
+ < th width ="250 "> Name</ th >
49
+ < th > Description</ th >
50
+ < th > Last Run</ th >
51
+ < th class ="text-end "> Status</ th >
52
+ </ tr >
53
+ </ thead >
54
+ < tbody >
55
+ {% with jobs=module.get_latest_jobs %}
56
+ {% for script_name, script_class in module.scripts.items %}
57
+ < tr >
58
+ < td >
59
+ < a href ="{% url 'extras:script' module=module.python_name name=script_name %} " name ="script.{{ script_name }} "> {{ script_class.name }}</ a >
60
+ </ td >
61
+ < td >
62
+ {{ script_class.Meta.description|markdown|placeholder }}
63
+ </ td >
64
+ {% with last_result=jobs|get_key:script_class.name %}
65
+ {% if last_result %}
66
+ < td >
67
+ < a href ="{% url 'extras:script_result' job_pk=last_result.pk %} "> {{ last_result.created|annotated_date }}</ a >
68
+ </ td >
69
+ < td class ="text-end ">
70
+ {% badge last_result.get_status_display last_result.get_status_color %}
71
+ </ td >
72
+ {% else %}
73
+ < td class ="text-muted "> Never</ td >
74
+ < td class ="text-end "> {{ ''|placeholder }}</ td >
75
+ {% endif %}
76
+ {% endwith %}
77
+ </ tr >
78
+ {% endfor %}
79
+ {% endwith %}
80
+ </ tbody >
81
+ </ table >
82
+ {% endif %}
77
83
</ div >
78
84
</ div >
79
85
{% empty %}
0 commit comments