accrete 0.0.10__py3-none-any.whl → 0.0.23__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. accrete/contrib/sequence/forms.py +2 -2
  2. accrete/contrib/sequence/queries.py +3 -4
  3. accrete/contrib/ui/__init__.py +11 -5
  4. accrete/contrib/ui/components.py +49 -0
  5. accrete/contrib/ui/context.py +284 -0
  6. accrete/contrib/ui/filter.py +22 -17
  7. accrete/contrib/ui/querystring.py +93 -0
  8. accrete/contrib/ui/static/bulma/LICENSE +21 -0
  9. accrete/contrib/ui/static/bulma/README.md +139 -0
  10. accrete/contrib/ui/static/bulma/bulma.sass +10 -0
  11. accrete/contrib/ui/static/bulma/css/bulma-rtl.css +11851 -0
  12. accrete/contrib/ui/static/bulma/css/bulma-rtl.css.map +1 -0
  13. accrete/contrib/ui/static/bulma/css/bulma-rtl.min.css +1 -0
  14. accrete/contrib/ui/static/bulma/css/bulma.css +11851 -0
  15. accrete/contrib/ui/static/bulma/css/bulma.css.map +1 -0
  16. accrete/contrib/ui/static/bulma/css/bulma.min.css +1 -0
  17. accrete/contrib/ui/static/bulma/package.json +56 -0
  18. accrete/contrib/ui/static/bulma/sass/base/_all.sass +6 -0
  19. accrete/contrib/ui/static/bulma/sass/base/animations.sass +5 -0
  20. accrete/contrib/ui/static/bulma/sass/base/generic.sass +145 -0
  21. accrete/contrib/ui/static/bulma/sass/base/helpers.sass +1 -0
  22. accrete/contrib/ui/static/bulma/sass/base/minireset.sass +79 -0
  23. accrete/contrib/ui/static/bulma/sass/components/_all.sass +15 -0
  24. accrete/contrib/ui/static/bulma/sass/components/breadcrumb.sass +77 -0
  25. accrete/contrib/ui/static/bulma/sass/components/card.sass +103 -0
  26. accrete/contrib/ui/static/bulma/sass/components/dropdown.sass +83 -0
  27. accrete/contrib/ui/static/bulma/sass/components/level.sass +79 -0
  28. accrete/contrib/ui/static/bulma/sass/components/media.sass +59 -0
  29. accrete/contrib/ui/static/bulma/sass/components/menu.sass +59 -0
  30. accrete/contrib/ui/static/bulma/sass/components/message.sass +101 -0
  31. accrete/contrib/ui/static/bulma/sass/components/modal.sass +117 -0
  32. accrete/contrib/ui/static/bulma/sass/components/navbar.sass +446 -0
  33. accrete/contrib/ui/static/bulma/sass/components/pagination.sass +167 -0
  34. accrete/contrib/ui/static/bulma/sass/components/panel.sass +121 -0
  35. accrete/contrib/ui/static/bulma/sass/components/tabs.sass +176 -0
  36. accrete/contrib/ui/static/bulma/sass/elements/_all.sass +16 -0
  37. accrete/contrib/ui/static/bulma/sass/elements/box.sass +26 -0
  38. accrete/contrib/ui/static/bulma/sass/elements/button.sass +357 -0
  39. accrete/contrib/ui/static/bulma/sass/elements/container.sass +29 -0
  40. accrete/contrib/ui/static/bulma/sass/elements/content.sass +162 -0
  41. accrete/contrib/ui/static/bulma/sass/elements/form.sass +1 -0
  42. accrete/contrib/ui/static/bulma/sass/elements/icon.sass +46 -0
  43. accrete/contrib/ui/static/bulma/sass/elements/image.sass +73 -0
  44. accrete/contrib/ui/static/bulma/sass/elements/notification.sass +52 -0
  45. accrete/contrib/ui/static/bulma/sass/elements/other.sass +31 -0
  46. accrete/contrib/ui/static/bulma/sass/elements/progress.sass +73 -0
  47. accrete/contrib/ui/static/bulma/sass/elements/table.sass +134 -0
  48. accrete/contrib/ui/static/bulma/sass/elements/tag.sass +140 -0
  49. accrete/contrib/ui/static/bulma/sass/elements/title.sass +70 -0
  50. accrete/contrib/ui/static/bulma/sass/form/_all.sass +9 -0
  51. accrete/contrib/ui/static/bulma/sass/form/checkbox-radio.sass +22 -0
  52. accrete/contrib/ui/static/bulma/sass/form/file.sass +184 -0
  53. accrete/contrib/ui/static/bulma/sass/form/input-textarea.sass +66 -0
  54. accrete/contrib/ui/static/bulma/sass/form/select.sass +88 -0
  55. accrete/contrib/ui/static/bulma/sass/form/shared.sass +60 -0
  56. accrete/contrib/ui/static/bulma/sass/form/tools.sass +215 -0
  57. accrete/contrib/ui/static/bulma/sass/grid/_all.sass +5 -0
  58. accrete/contrib/ui/static/bulma/sass/grid/columns.sass +513 -0
  59. accrete/contrib/ui/static/bulma/sass/grid/tiles.sass +36 -0
  60. accrete/contrib/ui/static/bulma/sass/helpers/_all.sass +12 -0
  61. accrete/contrib/ui/static/bulma/sass/helpers/color.sass +39 -0
  62. accrete/contrib/ui/static/bulma/sass/helpers/flexbox.sass +35 -0
  63. accrete/contrib/ui/static/bulma/sass/helpers/float.sass +10 -0
  64. accrete/contrib/ui/static/bulma/sass/helpers/other.sass +14 -0
  65. accrete/contrib/ui/static/bulma/sass/helpers/overflow.sass +2 -0
  66. accrete/contrib/ui/static/bulma/sass/helpers/position.sass +7 -0
  67. accrete/contrib/ui/static/bulma/sass/helpers/spacing.sass +31 -0
  68. accrete/contrib/ui/static/bulma/sass/helpers/typography.sass +103 -0
  69. accrete/contrib/ui/static/bulma/sass/helpers/visibility.sass +122 -0
  70. accrete/contrib/ui/static/bulma/sass/layout/_all.sass +6 -0
  71. accrete/contrib/ui/static/bulma/sass/layout/footer.sass +11 -0
  72. accrete/contrib/ui/static/bulma/sass/layout/hero.sass +153 -0
  73. accrete/contrib/ui/static/bulma/sass/layout/section.sass +17 -0
  74. accrete/contrib/ui/static/bulma/sass/utilities/_all.sass +9 -0
  75. accrete/contrib/ui/static/bulma/sass/utilities/animations.sass +1 -0
  76. accrete/contrib/ui/static/bulma/sass/utilities/controls.sass +49 -0
  77. accrete/contrib/ui/static/bulma/sass/utilities/derived-variables.sass +114 -0
  78. accrete/contrib/ui/static/bulma/sass/utilities/extends.sass +25 -0
  79. accrete/contrib/ui/static/bulma/sass/utilities/functions.sass +135 -0
  80. accrete/contrib/ui/static/bulma/sass/utilities/initial-variables.sass +79 -0
  81. accrete/contrib/ui/static/bulma/sass/utilities/mixins.sass +303 -0
  82. accrete/contrib/ui/static/css/accrete.css +10426 -79
  83. accrete/contrib/ui/static/css/accrete.css.bak +156 -0
  84. accrete/contrib/ui/static/css/accrete.css.map +1 -0
  85. accrete/contrib/ui/static/css/accrete.scss +232 -0
  86. accrete/contrib/ui/static/css/icons.css +9 -0
  87. accrete/contrib/ui/static/js/filter.js +129 -57
  88. accrete/contrib/ui/templates/ui/detail.html +1 -3
  89. accrete/contrib/ui/templates/ui/layout.html +37 -20
  90. accrete/contrib/ui/templates/ui/list.html +3 -3
  91. accrete/contrib/ui/templates/ui/partials/filter.html +10 -5
  92. accrete/contrib/ui/templates/ui/partials/header.html +5 -16
  93. accrete/contrib/ui/templates/ui/partials/pagination_detail.html +7 -11
  94. accrete/contrib/ui/templates/ui/partials/pagination_list.html +8 -10
  95. accrete/contrib/ui/templates/ui/partials/table_field.html +15 -0
  96. accrete/contrib/ui/templates/ui/partials/table_field_float.html +1 -0
  97. accrete/contrib/ui/templates/ui/partials/table_field_monetary.html +4 -0
  98. accrete/contrib/ui/templates/ui/partials/table_field_string.html +1 -0
  99. accrete/contrib/ui/templates/ui/table.html +20 -5
  100. accrete/contrib/ui/templatetags/accrete_ui.py +5 -3
  101. accrete/contrib/user/forms.py +28 -0
  102. accrete/contrib/user/models.py +16 -0
  103. accrete/contrib/user/templates/user/accrete_navbar_end.html +9 -0
  104. accrete/contrib/user/templates/user/user_detail.html +43 -0
  105. accrete/contrib/user/templates/user/user_form.html +56 -0
  106. accrete/contrib/user/urls.py +3 -1
  107. accrete/contrib/user/views.py +35 -3
  108. accrete/queries.py +5 -1
  109. {accrete-0.0.10.dist-info → accrete-0.0.23.dist-info}/METADATA +1 -1
  110. accrete-0.0.23.dist-info/RECORD +194 -0
  111. accrete/contrib/ui/helper.py +0 -417
  112. accrete-0.0.10.dist-info/RECORD +0 -107
  113. {accrete-0.0.10.dist-info → accrete-0.0.23.dist-info}/WHEEL +0 -0
  114. {accrete-0.0.10.dist-info → accrete-0.0.23.dist-info}/licenses/LICENSE +0 -0
@@ -7,18 +7,15 @@ const queryInputApply = document.getElementById('query-input-apply');
7
7
  const queryParamsDropdown = document.getElementById('query-params-dropdown');
8
8
  const queryParamElements = document.querySelectorAll('.query-param');
9
9
  const queryParamsElements = document.querySelectorAll('.query-params');
10
- const applyButton = document.getElementById('apply-filter-button');
11
- const resetButton = document.getElementById('reset-filter-button');
12
10
  const queryTags = document.getElementById('query-tags');
13
11
  const modalFilterButton = document.getElementById('modal-filter-button');
14
12
  const filterPanel = document.getElementById('filter-panel');
15
13
  const filterModal = document.getElementById('filter-modal');
16
14
  const modalContent = document.getElementById('modal-content');
15
+ const queryTextElement = document.getElementById('query-text');
16
+ const queryTextNotificationParameterElement = document.getElementById('query-notification-parameter');
17
17
  let activeInput = queryInput;
18
- let query = new URLSearchParams();
19
18
 
20
- applyButton.addEventListener('click', apply);
21
- resetButton.addEventListener('click', reset);
22
19
  queryInput.addEventListener('focus', showQueryParams);
23
20
  queryInput.addEventListener('keyup', navigateQueryInput);
24
21
  queryInputApply.addEventListener('click', applyQueryInput);
@@ -41,20 +38,44 @@ window.onclick = function(event) {
41
38
  queryParamsElements.forEach((element) => {
42
39
  element.classList.add('is-hidden');
43
40
  })
44
- queryParamsDropdown.classList.add('is-hidden');
41
+ if (!filterModal.classList.contains('is-active')) {
42
+ queryParamsDropdown.classList.add('is-hidden');
43
+ }
45
44
  }
46
45
  }
47
46
 
48
- modalFilterButton.onclick = function (event) {
49
- modalContent.appendChild(filterPanel);
47
+ modalFilterButton.onclick = function () {
48
+ modalContent.appendChild(queryBlock);
50
49
  filterModal.classList.add('is-active');
50
+ queryParamsDropdown.classList.remove('is-hidden');
51
+ activeInput.select()
51
52
  }
52
53
 
53
54
  buildActiveQuery();
55
+ setDefaultTerm();
56
+
57
+
58
+ function closeFilterModal() {
59
+ buildActiveQuery();
60
+ filterModal.classList.remove('is-active');
61
+ filterPanel.appendChild(queryBlock);
62
+ }
63
+
64
+
65
+ function setDefaultTerm() {
66
+ const defaultTerm = queryInput.getAttribute('data-default-term');
67
+ if (defaultTerm) {
68
+ const element = getParamElement(defaultTerm);
69
+ setParam(element);
70
+ } else {
71
+ activeInput.select();
72
+ }
73
+ }
54
74
 
55
75
  function buildActiveQuery() {
56
76
  const url = new URL(window.location.href);
57
77
  const query = url.searchParams.get('q');
78
+ removeQueryTags();
58
79
  if (!query) {
59
80
  return
60
81
  }
@@ -80,6 +101,15 @@ function buildActiveQuery() {
80
101
  }
81
102
  queryTags.appendChild(tagBlock)
82
103
  }
104
+ if (queryTags.firstElementChild) {
105
+ modalFilterButton.classList.add('is-success')
106
+ } else {modalFilterButton.classList.remove('is-success')}
107
+ }
108
+
109
+ function removeQueryTags() {
110
+ while (queryTags.firstElementChild) {
111
+ queryTags.firstElementChild.remove();
112
+ }
83
113
  }
84
114
 
85
115
  function buildActiveQueryTag(param) {
@@ -111,9 +141,9 @@ function buildActiveQueryTag(param) {
111
141
  }
112
142
 
113
143
  function apply() {
114
- const baseURl = window.location.href.split('?')[0];
115
- let completeQuery = [];
116
144
  const tagBlocks = document.querySelectorAll('.query-tag-block');
145
+ let url = new URL(window.location)
146
+ let completeQuery = [];
117
147
  tagBlocks.forEach((tagBlock) => {
118
148
  let query = [];
119
149
  for (let tag of tagBlock.children) {
@@ -144,10 +174,16 @@ function apply() {
144
174
  }
145
175
  completeQuery.push(query);
146
176
  })
147
- window.location.assign(baseURl.concat('?') + 'q='.concat(JSON.stringify(completeQuery)));
177
+ url.searchParams.set('q', JSON.stringify(completeQuery));
178
+ let queryApply = document.getElementById('query-apply');
179
+ let queryApplyEvent = new Event('click');
180
+ queryApply.setAttribute('hx-get', url.toString());
181
+ htmx.process(queryApply);
182
+ queryApply.dispatchEvent(queryApplyEvent);
148
183
  }
149
184
 
150
- function reset() {
185
+
186
+ function resetFilter() {
151
187
  const baseURl = window.location.href.split('?')[0];
152
188
  window.location.assign(baseURl);
153
189
  }
@@ -157,14 +193,24 @@ function applyQueryInput(event) {
157
193
  const text = queryInput.getAttribute('data-text');
158
194
  const param = queryInput.getAttribute('data-param');
159
195
  const value = activeInput.value;
160
- let displayValue = value
196
+ const valid = activeInput.reportValidity();
197
+ if (!valid) {return}
198
+ let displayValue = value;
161
199
  if (activeInput === queryInputSelect) {
162
- displayValue = activeInput.selectedOptions[0].textContent
200
+ displayValue = activeInput.selectedOptions[0].textContent;
163
201
  }
164
202
  if (value && param) {
165
203
  addQueryTag(text, param, value, displayValue);
204
+ setDefaultTerm();
205
+ } else if (value && !param) {
206
+ queryTextElement.classList.add('is-hidden');
207
+ queryTextNotificationParameterElement.classList.remove('is-hidden');
208
+ resetQueryInput();
209
+ } else if (!value && param) {
210
+ activeInput.select();
211
+ } else if (!value && !param) {
212
+ resetQueryInput();
166
213
  }
167
- resetQueryInput();
168
214
  }
169
215
 
170
216
  function showQueryParams() {
@@ -209,30 +255,41 @@ function clickQueryParams(event) {
209
255
  })
210
256
  }
211
257
  if (!queryParam.querySelector('.query-params')) {
212
- const completeParam = getCompleteQueryParam(queryParam);
213
- const dataType = queryParam.getAttribute('data-type');
214
- const text = getCompleteQueryText(queryParam);
215
- resetQueryInput();
216
- setInputType(dataType, completeParam, text,
217
- queryParam.getAttribute('data-step') || null
218
- );
219
- queryInput.select();
220
- if (dataType === 'bool') {
221
- let value = queryParam.getAttribute('data-value');
222
- value = value === 'True';
223
- addQueryTag(text, completeParam, value, queryParam.firstElementChild.text);
224
- setInputType('text', '', '');
225
- }
226
- else if (dataType === 'selection') {
227
- const options = queryParam.querySelector('.param-options');
228
- activeInput = queryInputSelect;
229
- queryInputSelect.innerHTML = options.innerHTML;
230
- queryInputSelectControl.classList.remove('is-hidden');
231
- queryInputControl.classList.add('is-hidden');
232
- queryInput.setAttribute('data-param', completeParam);
233
- queryInput.setAttribute('data-text', text);
234
- document.getElementById('query-text').innerText = text;
235
- }
258
+ setParam(queryParam)
259
+ }
260
+ }
261
+
262
+ function setParam(queryParam) {
263
+ const completeParam = getCompleteQueryParam(queryParam);
264
+ const dataType = queryParam.getAttribute('data-type');
265
+ const text = getCompleteQueryText(queryParam);
266
+ resetQueryInput();
267
+ setInputType(dataType, completeParam, text,
268
+ queryParam.getAttribute('data-step') || null
269
+ );
270
+ queryInput.scrollIntoView({behavior: 'smooth', block: 'end'});
271
+ queryInput.select();
272
+ if (dataType === 'bool') {
273
+ let value = queryParam.getAttribute('data-value');
274
+ value = value === 'True';
275
+ addQueryTag(text, completeParam, value, queryParam.firstElementChild.text);
276
+ setInputType('text', '', '');
277
+ queryTextNotificationParameterElement.classList.add('is-hidden')
278
+ queryTextElement.innerText = '';
279
+ queryTextElement.classList.add('is-hidden')
280
+ }
281
+ else if (dataType === 'selection') {
282
+ const options = queryParam.querySelector('.param-options');
283
+ activeInput = queryInputSelect;
284
+ queryInputSelect.innerHTML = options.innerHTML;
285
+ queryInputSelectControl.classList.remove('is-hidden');
286
+ queryInputControl.classList.add('is-hidden');
287
+ queryInput.setAttribute('data-param', completeParam);
288
+ queryInput.setAttribute('data-text', text);
289
+ queryTextNotificationParameterElement.classList.add('is-hidden')
290
+ queryTextElement.innerText = text;
291
+ queryTextElement.classList.remove('is-hidden')
292
+
236
293
  }
237
294
  }
238
295
 
@@ -298,24 +355,28 @@ function getParamElement(param, value=null) {
298
355
  param = param.slice(1);
299
356
  }
300
357
  const parts = param.split('__');
301
- let selector = '#query-params-dropdown'
302
- for (let i = 0; i < parts.length; i++) {
303
- selector += ` div[data-param="${parts[i]}"]`
304
- }
305
- if (invert) {
306
- selector = selector.trimEnd();
307
- selector += `[data-param-invert="true"]`;
308
- }
309
- if (typeof value == 'boolean') {
310
- if (value) {
311
- selector += `[data-value="True"]`;
312
- } else {
313
- selector += `[data-value="False"]`;
358
+ let paramElement = queryParamsDropdown.querySelector(
359
+ `:scope > div[data-param="${parts[0]}"]`
360
+ );
361
+ for (let i = 1; i < parts.length; i++) {
362
+ let selector = `:scope * div[data-param="${parts[i]}"]`;
363
+ if (i + 1 === parts.length) {
364
+ if (invert) {
365
+ selector += `[data-param-invert="true"]`;
366
+ }
367
+ if (typeof value == 'boolean') {
368
+ if (value) {
369
+ selector += `[data-value="True"]`;
370
+ } else {
371
+ selector += `[data-value="False"]`;
372
+ }
373
+ } else if (value) {
374
+ selector += `[data-value="${value}"]`;
375
+ }
314
376
  }
315
- } else if (value) {
316
- selector += `[data-value="${value}"]`;
377
+ paramElement = paramElement.querySelector(selector);
317
378
  }
318
- return document.querySelector(selector)
379
+ return paramElement
319
380
  }
320
381
 
321
382
  function getQueryTextParts(element) {
@@ -389,6 +450,9 @@ function addQueryTag(text, param, value, displayValue) {
389
450
  queryTags.appendChild(tagBlockLabel);
390
451
  queryTags.appendChild(tagBlock);
391
452
  }
453
+ // if (!filterModal.classList.contains('is-active')) {
454
+ // apply();
455
+ // }
392
456
  apply();
393
457
  }
394
458
 
@@ -401,6 +465,9 @@ function unselectSingleObject(pk) {
401
465
  } else {
402
466
  queryTags.lastElementChild.appendChild(tag);
403
467
  }
468
+ // if (!filterModal.classList.contains('is-active')) {
469
+ // apply();
470
+ // }
404
471
  apply();
405
472
  }
406
473
 
@@ -505,14 +572,19 @@ function deleteTag(event) {
505
572
  }
506
573
  tagGroup.parentElement.removeChild(tagGroup);
507
574
  }
508
- apply();
575
+ // if (!filterModal.classList.contains('is-active')) {
576
+ // apply();
577
+ // }
578
+ apply()
509
579
  }
510
580
 
511
581
  function setInputType(inputType, param, text, step=null) {
512
582
  queryInput.setAttribute('type', inputType);
513
583
  queryInput.setAttribute('data-param', param);
514
584
  queryInput.setAttribute('data-text', text);
515
- document.getElementById('query-text').innerText = text;
585
+ queryTextNotificationParameterElement.classList.add('is-hidden');
586
+ queryTextElement.classList.remove('is-hidden');
587
+ queryTextElement.innerText = text;
516
588
  if (step) {
517
589
  queryInput.step = step
518
590
  }
@@ -5,9 +5,7 @@
5
5
  <div class="columns is-desktop">
6
6
  {% block messages %}{% endblock %}
7
7
  <div class="column p-0 is-8-desktop">
8
- <div>
9
- {% block detail_content %}{% endblock %}
10
- </div>
8
+ {% block detail_content %}{% endblock %}
11
9
  </div>
12
10
  <div class="info-panel column is-4">
13
11
  <nav class="panel">
@@ -10,9 +10,10 @@
10
10
  <meta charset="utf-8">
11
11
  <meta name="viewport" content="width=device-width, initial-scale=1">
12
12
  {% block favicon %}<link rel="icon" type="image/svg" href="{% static 'icons/accrete.svg' %}"/>{% endblock %}
13
- {% block bulma %}<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">{% endblock %}
13
+ {# {% block bulma %}<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">{% endblock %}#}
14
+ {% block bulma %}<link rel="stylesheet" type="text/css" href="{% static "css/accrete.css" %}">{% endblock %}
14
15
  {% block style %}
15
- <link rel="stylesheet" type="text/css" href="{% static "css/accrete.css" %}">
16
+ {# <link rel="stylesheet" type="text/css" href="{% static "css/accrete.css" %}">#}
16
17
  <link rel="stylesheet" type="text/css" href="{% static "css/icons.css" %}">
17
18
  {% endblock %}
18
19
  {% block htmx %}
@@ -55,14 +56,26 @@
55
56
 
56
57
  <div class="navbar-end">
57
58
  {% block navbar_end %}
59
+ <div class="navbar-item has-dropdown is-hoverable">
60
+ <a class="navbar-link is-arrowless {% if request.member.name %}is-size-7 has-text-centered-desktop{% endif %}">
61
+ {% if request.member.name %}
62
+ {{ request.member }}<br>{{ user }}
63
+ {% else %}
64
+ {{ user }}
65
+ {% endif %}
66
+ </a>
67
+ <div id="navbar-end-dropdown" class="navbar-dropdown is-right">
68
+ {% combine_templates 'accrete_navbar_end.html' request=request %}
69
+ </div>
70
+ </div>
58
71
  {% endblock %}
59
72
  </div>
60
73
  </div>
61
74
  </nav>
62
75
  {% endblock %}
63
76
 
64
- <div class="main-columns columns m-0 is-mobile">
65
- <div class="side-panel column is-3-widescreen is-2-fullhd is-hidden-touch is-hidden-desktop-only is-hidden-widescreen-only p-0" style="height: 100%; position: sticky; top: 0">
77
+ <div id="main" class="is-flex is-flex-direction-row">
78
+ <div class="side-panel is-hidden-touch is-hidden-desktop-only is-hidden-widescreen-only p-0">
66
79
  <nav class="panel is-shadowless pb-5" style="height: 100%; overflow-y: auto; position: sticky; top: 0">
67
80
  {% if list_pagination %}
68
81
  <div class="panel-block pb-0">
@@ -94,25 +107,17 @@
94
107
  </div>
95
108
  {% if filter_terms %}
96
109
  <div id="filter-panel" class="mt-2">
97
- <div class="panel-list px-3 has-text-centered">
110
+ <div class="panel-list mx-3 mb-1 has-text-centered" style="border-bottom: 1px #ccc solid">
98
111
  <span>{% translate 'Filter' %}</span>
99
112
  </div>
100
- <div class="panel-block" style="position: sticky">
101
- <button id="reset-filter-button"
102
- class="button is-fullwidth mr-1">{% translate 'Reset' %}
103
- </button>
104
- <button id="apply-filter-button"
105
- class="button is-fullwidth ml-1">{% translate 'Filter' %}
106
- </button>
107
- </div>
108
113
  {% include 'ui/partials/filter.html' %}
109
114
  </div>
110
115
  {% endif %}
111
116
  </nav>
112
117
  </div>
113
118
 
114
- <div class="column" style="overflow-x: auto">
115
- <div class="is-flex is-flex-direction-column" style="height: 100%">
119
+ <div class="is-flex-grow-1" style="overflow-x: auto">
120
+ <div class="is-flex is-flex-direction-column" style="height: 100%; overflow: hidden">
116
121
  <div>
117
122
  {% include 'ui/partials/header.html' %}
118
123
  </div>
@@ -120,27 +125,39 @@
120
125
  {% block messages %}{% endblock %}
121
126
  {% block content %}{% endblock %}
122
127
  </div>
123
- <div style="height: 0"></div>
128
+ <div>
129
+ {% if list_pagination or detail_pagination %}
130
+ <div class="level is-hidden-tablet is-align-self-flex-start m-3">
131
+ <div class="level-item is-align-content-flex-start">
132
+ {% if list_pagination %}
133
+ {% include 'ui/partials/pagination_list.html' %}
134
+ {% elif detail_pagination %}
135
+ {% include 'ui/partials/pagination_detail.html' %}
136
+ {% endif %}
137
+ </div>
138
+ </div>
139
+ {% endif %}
140
+ </div>
124
141
  </div>
125
142
  </div>
126
143
  </div>
127
144
 
128
145
  {% if filter_terms %}
129
146
  <div id="filter-modal" class="modal">
130
- <div class="modal-background filter-modal-close"></div>
147
+ <div class="modal-background filter-modal-close" onclick="closeFilterModal()"></div>
131
148
  <div class="modal-card" style="height: 100%">
132
149
  <header class="modal-card-head">
133
150
  <p class="modal-card-title">
134
151
  {% block search_modal_title %}{% translate 'Filter' %}{% endblock %}</p>
135
- <button class="delete filter-modal-close" aria-label="close"></button>
152
+ <button class="delete filter-modal-close" aria-label="close" onclick="closeFilterModal()"></button>
136
153
  </header>
137
- <section id="modal-content" class="modal-card-body">
154
+ <section id="modal-content" class="modal-card-body px-0">
138
155
  </section>
139
156
  <footer class="modal-card-foot">
140
157
  <button class="button is-fullwidth mr-1"
141
158
  onclick="resetFilter()">{% translate 'Reset' %}</button>
142
159
  <button id="applyFilterFromModalButton"
143
- class="button is-fullwidth is-success ml-1">{% translate 'Filter' %}</button>
160
+ class="button is-fullwidth is-success ml-1" onclick="apply()">{% translate 'Filter' %}</button>
144
161
  </footer>
145
162
  </div>
146
163
  </div>
@@ -10,9 +10,9 @@
10
10
  {% block content %}
11
11
  <div class="columns is-multiline">
12
12
  {% for obj in page %}
13
- <div class="column is-{{ column_width }}">
14
- <div class="box p-2 pb-4 mb-1" style="word-break: break-word; height: 100%; border: solid #ccc 1px">
15
- {% block object_data %}
13
+ <div class="column {% block column_width %}is-4{% endblock %}-fullhd is-12-touch is-12-desktop is-12-widescreen" style="height: {% block column_height %}9rem{% endblock %}">
14
+ <div class="box p-3" style="word-break: break-word; height: 100%; border: solid #ccc 1px; overflow-y: auto">
15
+ {% block data %}
16
16
  {{ obj }}
17
17
  {% endblock %}
18
18
  </div>
@@ -4,9 +4,10 @@
4
4
  {% load accrete_ui %}
5
5
 
6
6
  <div id="query-block" class="panel-block pt-0" style="position: relative; display: inline-block; width: 100%">
7
+ <div id="query-apply" hx-get="" hx-trigger="click" hx-replace-url="true" hx-select-oob="#content,#list-pagination,#panel-actions,#header-actions,#query-apply"></div>
7
8
  <div id="query-tags" class="is-flex-direction-column is-flex-grow-1 is-multiline mb-1" data-or-label="{% translate 'OR' %}"></div>
8
9
 
9
- <div class="field has-addons level">
10
+ <div class="field has-addons level mb-1">
10
11
  <p id="query-operation" class="control">
11
12
  <span class="select">
12
13
  <select id="query-operation-select" aria-label="Select Operation">
@@ -15,7 +16,12 @@
15
16
  </select>
16
17
  </span>
17
18
  </p>
18
- <p id="query-text" class="control is-expanded is-size-7 p-1 ml-1"></p>
19
+ <div id="query-notification" class="control is-expanded is-size-7 p-0 ml-1">
20
+ <div id="query-notification-parameter" class="notification is-warning is-light has-text-centered py-2 m-0 is-hidden">
21
+ <p>{% translate 'Select a parameter' %}</p>
22
+ </div>
23
+ <p id="query-text" class="notification py-2 px-1 m-0 is-hidden" style="word-break: break-word"></p>
24
+ </div>
19
25
  </div>
20
26
 
21
27
  <div id="query-input-fieldset" class="field has-addons pt-1">
@@ -25,6 +31,7 @@
25
31
  aria-label="Query Input"
26
32
  class="input"
27
33
  placeholder="Enter a search term"
34
+ data-default-term="{{ default_filter_term }}"
28
35
  >
29
36
  </p>
30
37
  <p id="query-input-select-control" class="control is-expanded is-hidden">
@@ -37,8 +44,6 @@
37
44
 
38
45
 
39
46
  <div id="query-params-dropdown" class="box mt-1 mx-0 p-1 is-hidden" tabindex="-1" style="z-index: 10; background: white; word-break: break-word; position: inherit">
40
- {% cache 500 filter_params request.path request.GET request.tenant %}
41
- {{ filter_terms|render_query_params|safe }}
42
- {% endcache %}
47
+ {{ filter_terms|render_query_params }}
43
48
  </div>
44
49
  </div>
@@ -1,21 +1,10 @@
1
1
  {% load i18n %}
2
2
 
3
- <div class="pt-3">
4
- {% if list_pagination or detail_pagination %}
5
- <div class="level is-hidden-tablet is-align-self-flex-start mb-3 px-3">
6
- <div class="level-item is-align-content-flex-start">
7
- {% if list_pagination %}
8
- {% include 'ui/partials/pagination_list.html' %}
9
- {% elif detail_pagination %}
10
- {% include 'ui/partials/pagination_detail.html' %}
11
- {% endif %}
12
- </div>
13
- </div>
14
- {% endif %}
3
+ <div id="header" class="pt-4">
15
4
  <div class="level level-is-shrinkable is-flex mb-2 pl-3 {% if detail_pagination %}is-mobile {% endif %}">
16
5
  <div class="level-left">
17
6
  <div class="level-item has-text-weight-bold">
18
- <nav class="breadcrumb" aria-label="breadcrumbs" style="white-space: unset; word-break: break-word">
7
+ <nav id="breadcrumbs" class="breadcrumb" aria-label="breadcrumbs" style="white-space: unset; word-break: break-word">
19
8
  <ul>
20
9
  {% for crumb in breadcrumbs %}
21
10
  <li><a class="is-underlined" href="{{ crumb.url|default_if_none:'#' }}{{ querystring }}" aria-current="page">{{ crumb.name }}</a></li>
@@ -39,7 +28,7 @@
39
28
  </div>
40
29
 
41
30
  <div class="is-flex is-hidden-fullhd is-justify-content-space-between mb-2">
42
- <div class="is-flex py-1 pr-1 pl-3" style="overflow-x: auto">
31
+ <div id="header-actions" class="is-flex py-1 px-1 ml-2" style="overflow-x: auto">
43
32
  {% for action in actions %}
44
33
  {% if action.submit %}
45
34
  <input class="button mr-2 {{ action.class_list|join:' ' }}"
@@ -57,8 +46,8 @@
57
46
  </div>
58
47
  {% if filter_terms %}
59
48
  <div class="is-flex ml-2 py-1 pr-3">
60
- <button id="modal-filter-button" class="button">Filter</button>
49
+ <button id="modal-filter-button" class="button has-icon"><i class="icon-filter"></i></button>
61
50
  </div>
62
51
  {% endif %}
63
52
  </div>
64
- </div>
53
+ </div>
@@ -3,24 +3,20 @@
3
3
  <button class="button"
4
4
  hx-get="{{ previous_object_url }}{{ querystring }}"
5
5
  hx-replace-url="true"
6
- hx-select-oob="#content,#detail-pagination"
6
+ hx-select-oob="#content,#detail-pagination,#panel-actions,#header-actions,#breadcrumbs"
7
7
  ><
8
8
  </button>
9
9
 
10
10
  </p>
11
- {% if total_objects > 99999 %}
12
- <p class="control is-expanded">
13
- <button class="button is-fullwidth px-1"><span class="is-size-7">{{ current_object_idx }}<br>/{{ total_objects }}</span></button>
14
- </p>
15
- {% else %}
16
- <p class="control is-expanded">
17
- <button class="button is-fullwidth px-1">{{ current_object_idx }} / {{ total_objects }}</button>
18
- </p>
19
- {% endif %}
11
+ <p class="control is-expanded">
12
+ <button class="button is-fullwidth px-1" style="white-space: normal">
13
+ <span class="{% if total_objects > 99999 %}is-size-7{% endif %}">{{ current_object_idx }} / {{ total_objects }}</span>
14
+ </button>
15
+ </p>
20
16
  <p class="control">
21
17
  <button class="button" hx-get="{{ next_object_url }}{{ querystring }}"
22
18
  hx-replace-url="true"
23
- hx-select-oob="#content,#detail-pagination"
19
+ hx-select-oob="#content,#detail-pagination,#panel-actions,#header-actions,#breadcrumbs"
24
20
  >>
25
21
  </button>
26
22
  </p>
@@ -4,25 +4,23 @@
4
4
  <button class="button"
5
5
  hx-get="{{ querystring }}&page={% if page.has_previous %}{{ page.previous_page_number }}{% else %}{{ paginator.num_pages }}{% endif %}"
6
6
  hx-replace-url="true"
7
- hx-select-oob="#content,#list-pagination"
7
+ hx-select-oob="#content,#list-pagination,#panel-actions,#header-actions,#breadcrumbs"
8
8
  >
9
9
  <
10
10
  </button>
11
11
  </p>
12
12
  <p class="control is-expanded">
13
- {% if paginator.count > 9999 %}
14
- <button class="button is-fullwidth px-0">
15
- <span class="is-size-7">{{ page.start_index }}-{{ page.end_index }}<br>/{{ paginator.count }}</span>
16
- </button>
17
- {% else %}
18
- <button class="button is-fullwidth">{{ page.start_index }}-{{ page.end_index }}/{{ paginator.count }}</button>
19
- {% endif %}
13
+ <button class="button is-fullwidth px-1" style="white-space: normal">
14
+ <span class="{% if paginator.count > 9999 %}is-size-7{% endif %}" style="display: flex">
15
+ {{ page.start_index }}-<div id="list-pagination-end-index">{{ page.end_index }}</div> / {{ paginator.count }}
16
+ </span>
17
+ </button>
20
18
  </p>
21
19
  <p class="control">
22
- <button class="button"
20
+ <button id="list-pagination-next-button" class="button"
23
21
  hx-get="{{ querystring }}&page={% if page.has_next %}{{ page.next_page_number }}{% else %}1{% endif %}"
24
22
  hx-replace-url="true"
25
- hx-select-oob="#content,#list-pagination"
23
+ hx-select-oob="#content,#list-pagination,#panel-actions,#header-actions,#breadcrumbs"
26
24
  >
27
25
  >
28
26
  </button>
@@ -0,0 +1,15 @@
1
+ {% load accrete_ui %}
2
+
3
+ {% with val=obj|get_attr:field.name|default_if_none:'---' %}
4
+ <td style="text-align: {{ field.alignment.value }}" {% if val|length > field.truncate_after %}title="{{ val }}"{% endif %}>
5
+ {{ field.prefix }}
6
+ {% block td_content %}
7
+ {% if field.truncate_after > 0 %}
8
+ {{ val|truncatechars:field.truncate_after }}
9
+ {% else %}
10
+ {{ val }}
11
+ {% endif %}
12
+ {% endblock %}
13
+ {{ field.suffix }}
14
+ </td>
15
+ {% endwith %}
@@ -0,0 +1 @@
1
+ {% extends 'ui/partials/table_field.html' %}
@@ -0,0 +1,4 @@
1
+ {% extends 'ui/partials/table_field.html' %}
2
+ {% load accrete_ui %}
3
+
4
+ {% block td_content %}{{ obj|get_attr:field.name|default_if_none:0|floatformat:2 }}{% endblock %}
@@ -0,0 +1 @@
1
+ {% extends 'ui/partials/table_field.html' %}