-
-
Notifications
You must be signed in to change notification settings - Fork 213
/
ko_import_history.html
124 lines (123 loc) · 4.86 KB
/
ko_import_history.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{% load i18n %}
{% load hq_shared_tags %}
<!--ko if: state() == states.SUCCESS && !_.isEmpty(case_uploads())-->
<table class="table table-striped">
<tr>
<th class="col-md-1">{% trans "Status" %}</th>
<th class="col-md-1">{% trans "Time" %}</th>
<th class="col-md-1">{% trans "Case Type" %}</th>
<th class="col-md-4">{% trans "Details" %}</th>
<th class="col-md-3">{% trans "Comment" %}</th>
<th class="col-md-2">{% trans "File" %}</th>
{% if request|toggle_enabled:"SUPPORT" %}
<th>Form IDs</th>
<th>Case IDs</th>
{% endif %}
</tr>
<!--ko foreach: case_uploads-->
<tr>
<td class="col-md-1">
<!--ko if: task_status().state == $root.states.SUCCESS && task_status().result-->
<!--ko if: _.isEmpty(task_status().result.errors)-->
<span class="label label-success">{% trans "Success" %}</span>
<!--/ko-->
<!--ko if: !_.isEmpty(task_status().result.errors)-->
<span class="label label-warning">{% trans "Success with warnings" %}</span>
<!--/ko-->
<!--/ko-->
{# The following failed state is necessary to handle legacy errors #}
<!--ko if: task_status().state == $root.states.SUCCESS && !task_status().result-->
<span class="label label-danger">{% trans "Failed" %}</span>
<!--/ko-->
<!--ko if: task_status().state == $root.states.MISSING && isExpiredUpload() || task_status().state == $root.states.FAILED-->
<span class="label label-danger">{% trans "Failed" %}</span>
<!--/ko-->
<!--ko if: task_status().state == $root.states.MISSING && !isExpiredUpload() || task_status().state == $root.states.NOT_STARTED-->
{% trans "Waiting to start" %}
<!--/ko-->
<!--ko if: task_status().state == $root.states.STARTED-->
<div class="progress">
<div class="progress-bar progress-bar-info"
role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
data-bind="attr: {style: 'width: ' + task_status().progress.percent + '%;'}">
<span><span data-bind="text: task_status().progress.percent"></span>%
{% trans "Complete" %}</span>
</div>
</div>
<!--/ko-->
</td>
<td class="col-md-1" data-bind="text: created_display"></td>
<td class="col-md-1" data-bind="text: case_type">
</td>
<td class="col-md-4" data-bind="with: task_status()">
{% include 'case_importer/partials/ko_import_status.html' %}
</td>
<td class="col-md-3">
<strong data-bind="text: user_name"></strong>
<!--ko if: upload_comment_edit_allowed-->
<inline-edit data-apply-bindings="false" params="
value: comment,
url: commentUrl(),
rows: 1,
placeholder: '{% trans "(Click here to add a comment)"|escapejs %}',
saveValueName: 'comment',
errorMessage: '{% trans "Error updating comment. Please try again."|escapejs %}'
"></inline-edit>
<!--/ko-->
<!--ko if: !upload_comment_edit_allowed-->
<span data-bind="text: comment"></span>
<!--/ko-->
</td>
<td class="col-md-2">
<!--ko if: upload_file_name-->
<!--ko if: !upload_file_download_allowed-->
<a style="cursor: pointer" data-bind="
text: upload_file_name,
popover: {
title: '{% trans_html_attr 'You may not download this file yourself' %}',
content: '{% trans_html_attr 'Please ask an administrator or the user who uploaded the file for their help' %}',
placement: 'top'
}
"></a>
<!--/ko-->
<!--ko if: upload_file_download_allowed-->
<i class="fa fa-download"></i>
<a data-bind="attr: {href: downloadUrl()}">
<span data-bind="text: upload_file_name"></span>
</a>
<!--/ko-->
<!--/ko-->
</td>
{% if request|toggle_enabled:"SUPPORT" %}
<td>
<a data-bind="attr: {href: formIdsUrl()}" target="_blank">
<i class="fa fa-download"></i>
</a>
</td>
<td>
<a data-bind="attr: {href: caseIdsUrl()}" target="_blank">
<i class="fa fa-download"></i>
</a>
</td>
{% endif %}
</tr>
<!--/ko-->
</table>
<pagination data-apply-bindings="false"
params="goToPage: goToPage,
slug: 'case-import',
perPage: itemsPerPage,
totalItems: totalItems,
showSpinner: showPaginationSpinner"></pagination>
<!--/ko-->
<!--ko if: state() === states.SUCCESS && _.isEmpty(case_uploads())-->
<div class="alert alert-info">
You have no recent uploads.
</div>
<!--/ko-->
<!--ko if: state() === states.STARTED -->
<i class="fa fa-spinner fa-spin"></i>
<!--/ko-->
<!--ko if: state() === states.FAILED -->
<i class="fa fa-warning"></i>
<!--/ko-->