11
11
{% block content %}
12
12
{% csrf_token %}
13
13
< br >
14
- < h2 class ="title "> Welcome back!</ h2 >
15
- < table id ="collection_table " class ="table table-striped " style ="width:100% " >
16
- < thead class ="tableHeader ">
17
- < tr >
18
- < th class ="text-center noBorder " style ="padding-right:25px !important "> Name</ th >
19
- < th class ="text-center noBorder url-th " style ="padding-right:25px !important "> Url</ th >
20
- < th class ="text-center noBorder " style ="padding-right:25px !important "> Division</ th >
21
- < th class ="text-center noBorder " style ="padding-right:25px !important "> Delta Urls</ th >
22
- < th class ="text-center noBorder " style ="padding-right:25px !important "> Workflow Status</ th >
23
- < th class ="text-center noBorder " style ="padding-right:25px !important "> Curator</ th >
24
- < th class ="text-center noBorder " style ="padding-right:25px !important "> Connector Type</ th >
25
- < th class ="text-center noBorder " style ="padding-right:25px !important "> Reindexing Status</ th >
26
- < th class ="hideDisplay "> </ th >
27
- < th class ="hideDisplay "> </ th >
28
- < th class ="hideDisplay "> </ th >
29
- </ tr >
30
- < tr >
31
- < td class ="filterRowBottom " > < input class ="table_filter_row_input textBoxStyling " type ="text " id ="nameFilter " placeholder ="Name " /> </ td >
32
- < td class ="filterRowBottom url-td "> < input class ="table_filter_row_input textBoxStyling " type ="text " id ="urlFilter " placeholder ="URL " /> </ td >
33
- < td class ="filterRowBottom "> < input class ="table_filter_row_input textBoxStyling " type ="text " id ="divisionFilter " placeholder ="Division " /> </ td >
34
- < td class ="filterRowBottom "> </ td >
35
- < td class ="filterRowBottom "> < select id ="collection-dropdown-4 " class ="select-dropdown selectStyling ">
14
+ <!-- Page Title -->
15
+ < h2 class ="title "> Welcome back!</ h2 >
16
+
17
+ <!-- Main Collections Table -->
18
+ < table id ="collection_table " class ="table table-striped " style ="width:100% ">
19
+ < thead class ="tableHeader ">
20
+ <!-- Column Headers Row -->
21
+ < tr >
22
+ <!-- Visible Columns -->
23
+ < th class ="text-center noBorder " style ="padding-right:25px !important "> Name</ th >
24
+ < th class ="text-center noBorder url-th " style ="padding-right:25px !important "> Url</ th >
25
+ < th class ="text-center noBorder " style ="padding-right:25px !important "> Division</ th >
26
+ < th class ="text-center noBorder " style ="padding-right:25px !important "> Delta Urls</ th >
27
+ < th class ="text-center noBorder " style ="padding-right:25px !important "> Workflow Status</ th >
28
+ < th class ="text-center noBorder " style ="padding-right:25px !important "> Curator</ th >
29
+ < th class ="text-center noBorder " style ="padding-right:25px !important "> Connector Type</ th >
30
+ < th class ="text-center noBorder " style ="padding-right:25px !important "> Reindexing Status</ th >
31
+
32
+ <!-- Hidden Columns - Used for internal data storage -->
33
+ < th class ="hideDisplay "> </ th >
34
+ < th class ="hideDisplay "> </ th >
35
+ < th class ="hideDisplay "> </ th >
36
+ </ tr >
37
+
38
+ <!-- Filter Row - Contains inputs and dropdowns for filtering table data -->
39
+ < tr >
40
+ <!-- Text input filter for Name -->
41
+ < td class ="filterRowBottom ">
42
+ < input class ="table_filter_row_input textBoxStyling "
43
+ type ="text "
44
+ id ="nameFilter "
45
+ placeholder ="Name " />
46
+ </ td >
47
+
48
+ <!-- Text input filter for URL -->
49
+ < td class ="filterRowBottom url-td ">
50
+ < input class ="table_filter_row_input textBoxStyling "
51
+ type ="text "
52
+ id ="urlFilter "
53
+ placeholder ="URL " />
54
+ </ td >
55
+
56
+ <!-- Text input filter for Division -->
57
+ < td class ="filterRowBottom ">
58
+ < input class ="table_filter_row_input textBoxStyling "
59
+ type ="text "
60
+ id ="divisionFilter "
61
+ placeholder ="Division " />
62
+ </ td >
63
+
64
+ <!-- Empty cell for Delta Urls (no filter) -->
65
+ < td class ="filterRowBottom "> </ td >
66
+
67
+ <!-- Dropdown filter for Workflow Status -->
68
+ < td class ="filterRowBottom ">
69
+ < select id ="collection-dropdown-4 " class ="select-dropdown selectStyling ">
36
70
< option value =""> SELECT</ option >
37
- {% for choice in workflow_status_choices %}
38
- < option value ="{{ choice }} " data-collection-id ={{ collection.id }} > {{ choice.label }}</ option >
39
- {% endfor %}
40
- </ select > </ td >
41
- < td class ="filterRowBottom "> < select id ="collection-dropdown-5 " class ="select-dropdown selectStyling ">
71
+ {% for choice in workflow_status_choices %}
72
+ < option value ="{{ choice }} "
73
+ data-collection-id ={{ collection.id }} > {{ choice.label }}</ option >
74
+ {% endfor %}
75
+ </ select >
76
+ </ td >
77
+
78
+ <!-- Dropdown filter for Curator -->
79
+ < td class ="filterRowBottom ">
80
+ < select id ="collection-dropdown-5 " class ="select-dropdown selectStyling ">
42
81
< option value =""> SELECT</ option >
43
82
{% for curator in curators %}
44
- < option value ="{{ curator.pk }} " data-collection-id ={{ collection.id }} > {{ curator.username }}</ option >
45
- {% endfor %}
46
- </ select > </ td >
47
- < td class ="filterRowBottom "> < input class ="table_filter_row_input textBoxStyling " type ="text " id ="connectorTypeFilter " placeholder ="Connector Type " /> </ td >
48
- < td class ="filterRowBottom "> < select id ="collection-dropdown-6 " class ="select-dropdown selectStyling ">
83
+ < option value ="{{ curator.pk }} "
84
+ data-collection-id ={{ collection.id }} > {{ curator.username }}</ option >
85
+ {% endfor %}
86
+ </ select >
87
+ </ td >
88
+
89
+ <!-- Text input filter for Connector Type -->
90
+ < td class ="filterRowBottom ">
91
+ < input class ="table_filter_row_input textBoxStyling "
92
+ type ="text "
93
+ id ="connectorTypeFilter "
94
+ placeholder ="Connector Type " />
95
+ </ td >
96
+
97
+ <!-- Dropdown filter for Reindexing Status -->
98
+ < td class ="filterRowBottom ">
99
+ < select id ="collection-dropdown-6 " class ="select-dropdown selectStyling ">
49
100
< option value =""> SELECT</ option >
50
101
{% for choice in reindexing_status_choices %}
51
- < option value ="{{ choice }} " data-collection-id ={{ collection.id }} > {{ choice.label }}</ option >
102
+ < option value ="{{ choice }} "
103
+ data-collection-id ={{ collection.id }} > {{ choice.label }}</ option >
52
104
{% endfor %}
53
- </ select > </ td >
54
- < td class ="hideDisplay "> </ td >
55
- < td class ="hideDisplay "> </ td >
56
- < th class ="hideDisplay "> </ th >
57
- </ tr >
58
- </ thead >
105
+ </ select >
106
+ </ td >
59
107
108
+ <!-- Hidden cells corresponding to hidden columns -->
109
+ < td class ="hideDisplay "> </ td > <!-- Stores raw workflow_status value (number) -->
110
+ < td class ="hideDisplay "> </ td > <!-- Stores raw curated_by_id value -->
111
+ < td class ="hideDisplay "> </ td > <!-- Stores raw reindexing_status value (number) -->
112
+ </ tr >
113
+ </ thead >
60
114
< tbody >
115
+ <!-- Universal search bar above the table -->
61
116
< div class ="search-container ">
62
117
< label for ="collectionSearch "> Universal Search</ label >
63
118
< input type ="text " id ="collectionSearch " placeholder ="Type to search... " class ="table_filter_row_input textBoxStyling ">
64
119
</ div >
120
+
121
+ <!-- Iterate through each collection to create table rows -->
65
122
{% for collection in collections %}
66
123
< tr id ="{{ collection.id }} " data-config-folder ="{{ collection.config_folder }} ">
124
+ <!-- Name Column with Link -->
67
125
< td class ="noBorder ">
68
- < a class ="nameStyling " href ="{% url 'sde_collections:detail' collection.pk %} "> {{ collection.name }} < i class ="material-icons "> chevron_right</ i > </ a >
126
+ < a class ="nameStyling " href ="{% url 'sde_collections:detail' collection.pk %} ">
127
+ {{ collection.name }}
128
+ < i class ="material-icons "> chevron_right</ i >
129
+ </ a >
69
130
</ td >
131
+
132
+ <!-- URL Column with External Link -->
70
133
< td class ="url-td whiteText noBorder ">
71
134
{% if collection.url %}
72
135
< div class ="url-cell ">
136
+ <!-- URL text with tooltip -->
73
137
< span class ="url " title ="{{collection.url}} "> {{ collection.url }}</ span >
74
- < a class ="url-link " target ="_blank " href =" {{ collection.url }} "> < i class ="material-icons urlIcon "> open_in_new</ i > </ a > </ div >
138
+ <!-- External link icon -->
139
+ < a class ="url-link " target ="_blank " href =" {{ collection.url }} ">
140
+ < i class ="material-icons urlIcon "> open_in_new</ i >
141
+ </ a >
142
+ </ div >
75
143
{% endif %}
76
144
</ td >
145
+
146
+ <!-- Division Column -->
77
147
< td class ="whiteText noBorder "> {{ collection.get_division_display }}</ td >
148
+
149
+ <!-- Delta URLs Column - Shows count and links if > 0 -->
78
150
< td class ="noBorder centerAlign ">
79
151
< a href =" {% if collection.num_delta_urls > 0 %} {% url 'sde_collections:delta_urls' collection.pk %} {% endif %} "
80
152
class ="btn btn-sm {% if collection.num_delta_urls > 0 %}btn-primary {% else %}disabled{% endif %}candidateCount "
81
153
role ="button "> {{ collection.num_delta_urls|intcomma }}</ a >
82
154
</ td >
155
+
156
+ <!-- Workflow Status Dropdown -->
83
157
< td class ="noBorder ">
84
158
< div class ="dropdown workflow_status_dropdown "
85
159
data-match-pattern
86
160
remove_protocol
87
161
row
88
162
url >
163
+ <!-- Workflow status button with dynamic color -->
89
164
< button class ="btn {{ collection.workflow_status_button_color }} btn-sm dropdown-toggle "
90
165
type ="button "
91
166
id ="workflow-status-button-{{ collection.id }} "
92
167
data-toggle ="dropdown "
93
168
aria-haspopup ="true "
94
169
aria-expanded ="false "> {{ collection.get_workflow_status_display }}</ button >
170
+ <!-- Dropdown menu with all possible workflow statuses -->
95
171
< div class ="dropdown-menu "
96
172
aria-labelledby ="workflow-status-button-{{ collection.id }} ">
97
173
{% for choice in workflow_status_choices %}
98
- < a class ="dropdown-item workflow_status_select " value ="{{ choice }} " data-collection-id ={{ collection.id }} > {{ choice.label }}</ a >
174
+ < a class ="dropdown-item workflow_status_select "
175
+ value ="{{ choice }} "
176
+ data-collection-id ={{ collection.id }} > {{ choice.label }}</ a >
99
177
{% endfor %}
100
178
</ div >
101
179
</ div >
102
180
</ td >
181
+
182
+ <!-- Curator Dropdown -->
103
183
< td class ="noBorder ">
104
184
< div class ="dropdown curator_dropdown "
105
185
data-match-pattern
106
186
remove_protocol
107
187
row
108
188
url >
189
+ <!-- Curator button - green if assigned, dark if not -->
109
190
< button class ="btn {% if collection.curated_by %} btn-success {% else %} btn-dark {% endif %} btn-sm dropdown-toggle "
110
191
type ="button "
111
192
id ="curator-button-{{ collection.id }} "
112
193
data-toggle ="dropdown "
113
194
aria-haspopup ="true "
114
195
aria-expanded ="false "> {{ collection.curated_by }}</ button >
196
+ <!-- Dropdown menu with all possible curators -->
115
197
< div class ="dropdown-menu "
116
198
aria-labelledby ="curator-button-{{ collection.id }} ">
117
199
{% for curator in curators %}
118
- < a key ="{{ curator.pk }} " class ="dropdown-item curator_select " value ="{{ curator.pk }} " data-collection-id ={{ collection.id }}
119
- > {{ curator.username }}</ a >
200
+ < a key ="{{ curator.pk }} "
201
+ class ="dropdown-item curator_select "
202
+ value ="{{ curator.pk }} "
203
+ data-collection-id ={{ collection.id }} > {{ curator.username }}</ a >
120
204
{% endfor %}
121
205
</ div >
122
206
</ div >
123
207
</ td >
208
+
209
+ <!-- Connector Type Column -->
124
210
< td class ="whiteText noBorder "> {{ collection.get_connector_display }}</ td >
211
+
212
+ <!-- Reindexing Status Dropdown -->
125
213
< td class ="noBorder ">
126
214
< div class ="dropdown reindexing_status_dropdown "
127
215
data-match-pattern
128
216
remove_protocol
129
217
row
130
218
url >
219
+ <!-- Reindexing status button with dynamic color -->
131
220
< button class ="btn {{ collection.reindexing_status_button_color }} btn-sm dropdown-toggle "
132
221
type ="button "
133
222
id ="reindexing-status-button-{{ collection.id }} "
134
223
data-toggle ="dropdown "
135
224
aria-haspopup ="true "
136
225
aria-expanded ="false "> {{ collection.get_reindexing_status_display }}</ button >
226
+ <!-- Dropdown menu with all possible reindexing statuses -->
137
227
< div class ="dropdown-menu "
138
228
aria-labelledby ="reindexing-status-button-{{ collection.id }} ">
139
229
{% for choice in reindexing_status_choices %}
140
- < a class ="dropdown-item reindexing_status_select " value ="{{ choice }} " data-collection-id ={{ collection.id }} > {{ choice.label }}</ a >
230
+ < a class ="dropdown-item reindexing_status_select "
231
+ value ="{{ choice }} "
232
+ data-collection-id ={{ collection.id }} > {{ choice.label }}</ a >
141
233
{% endfor %}
142
234
</ div >
143
235
</ div >
144
236
</ td >
237
+
238
+ <!-- Hidden columns for internal use -->
145
239
< td class ="hideDisplay "> {{ collection.workflow_status }}</ td >
146
240
< td class ="hideDisplay "> {{ collection.curated_by_id }}</ td >
147
241
< td class ="hideDisplay "> {{ collection.reindexing_status }}</ td >
@@ -150,15 +244,19 @@ <h2 class="title">Welcome back!</h2>
150
244
</ tbody >
151
245
</ table >
152
246
247
+ <!-- Column Customization Modal -->
153
248
< div id ="hideShowColumnsModal " class ="modal pr-4 pl-4 pt-4 customizeColumnContainer ">
154
249
< div class ="modalDialog ">
155
250
< div class ="modalContent ">
251
+ <!-- Modal Header -->
156
252
< div class ="modalHeader ">
157
253
< h5 class ="modalTitle whiteText " id ="hideShowColumnsModalTitle "> Customize Columns</ h5 >
158
254
< p id ="subTitle " class ="whiteText "> Attributes marked with a checkbox will be displayed in the table.</ p >
159
255
</ div >
256
+ <!-- Modal Form -->
160
257
< form id ="hide_show_columns_form ">
161
258
< div class ="modalBody whiteText " id ="modalBody ">
259
+ <!-- Checkboxes are dynamically inserted here by JavaScript -->
162
260
</ div >
163
261
< div class ="modalFooter customizeColumnContainer ">
164
262
< div type ="submit " class ="btn-prime hideShowSubmitButton " id ="hideShowSubmitButton "> Confirm</ div >
0 commit comments