ccs-digitalmarketplace-frontend-jinja 4.9.2__py3-none-any.whl → 4.10.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ccs-digitalmarketplace-frontend-jinja
3
- Version: 4.9.2
3
+ Version: 4.10.1
4
4
  Summary: Jinja templates for Digital Marketplace apps.
5
5
  Author: CCS Developers
6
6
  Project-URL: Homepage, https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-frontend-jinja
@@ -15,7 +15,7 @@ Requires-Dist: ccs-govuk-frontend-jinja<2,>=1.5
15
15
  Requires-Dist: ccs-digitalmarketplace-utils>=69.0.0
16
16
  Provides-Extra: dev
17
17
  Requires-Dist: flake8==7.3.0; extra == "dev"
18
- Requires-Dist: mypy==1.16.1; extra == "dev"
18
+ Requires-Dist: mypy==1.17.0; extra == "dev"
19
19
  Requires-Dist: pytest==8.4.1; extra == "dev"
20
20
  Requires-Dist: lxml==6.0.0; extra == "dev"
21
21
  Requires-Dist: xmldiff==2.7.0; extra == "dev"
@@ -41,6 +41,8 @@ The following table shows the version of Digital Marketplace Frontend Jinja that
41
41
 
42
42
  | Digital Marketplace Frontend Jinja Version | Target CCS Digital Marketplace GOV.UK Frontend Version |
43
43
  | ------------------------------------------ | ------------------------------------------------------ |
44
+ | [4.10.1](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-frontend-jinja/releases/tag/4.10.1) | [3.10.1](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-govuk-frontend/releases/tag/v3.10.1) |
45
+ | [4.10.0](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-frontend-jinja/releases/tag/4.10.0) | [3.10.0](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-govuk-frontend/releases/tag/v3.10.0) |
44
46
  | [4.9.2](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-frontend-jinja/releases/tag/4.9.2) | [3.9.2](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-govuk-frontend/releases/tag/v3.9.2) |
45
47
  | [4.9.1](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-frontend-jinja/releases/tag/4.9.1) | [3.9.1](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-govuk-frontend/releases/tag/v3.9.1) |
46
48
  | [4.9.0](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-frontend-jinja/releases/tag/4.9.0) | [3.9.0](https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-govuk-frontend/releases/tag/v3.9.0) |
@@ -1,5 +1,5 @@
1
- ccs_digitalmarketplace_frontend_jinja-4.9.2.dist-info/licenses/LICENCE,sha256=GbPuM26UomDfs5sMy6udIVXYC8grPSN7bSkO29-F5hI,1110
2
- digitalmarketplace_frontend_jinja/__init__.py,sha256=y4Ei3Es_AJyfd9oJGiUhtxfX8HtJs-wcbmr1otB2s4Y,22
1
+ ccs_digitalmarketplace_frontend_jinja-4.10.1.dist-info/licenses/LICENCE,sha256=GbPuM26UomDfs5sMy6udIVXYC8grPSN7bSkO29-F5hI,1110
2
+ digitalmarketplace_frontend_jinja/__init__.py,sha256=N_vHXX8wwID5CJHl5qoHMsnsZYCfNR8Rs54Pw2TEzsY,23
3
3
  digitalmarketplace_frontend_jinja/templates/components/alert/macro.html,sha256=W4hQmVTEOTSON6ypLoV3cJNgBcCYN1akxy-Y1QZH8X0,992
4
4
  digitalmarketplace_frontend_jinja/templates/components/attachment/macro.html,sha256=0Fi8QqqwmPpZ3UBOjCDiUkfSOYxMYyTlBngnPJrZ7Zo,6452
5
5
  digitalmarketplace_frontend_jinja/templates/components/banner/macro.html,sha256=AsPQydTvw-SwcgczVZmbdlGMXT0SoilvhAtKrTskpME,905
@@ -19,7 +19,7 @@ digitalmarketplace_frontend_jinja/templates/components/previous-next-pagination/
19
19
  digitalmarketplace_frontend_jinja/templates/components/question/macro.html,sha256=MY8f4PTxEBb7ifBx-kurXrLivHW_RN-UpcojJdAjHLk,3985
20
20
  digitalmarketplace_frontend_jinja/templates/components/question-boolean/macro.html,sha256=DVxnbPGYfEa_FgYwLPccvYmS2wD-PC_GI1B_fkYGHho,2878
21
21
  digitalmarketplace_frontend_jinja/templates/components/question-character-count/macro.html,sha256=YMOJiATKyLByuPq8SuPsjN4WZfpSp5PIPtKks1lGnT8,1501
22
- digitalmarketplace_frontend_jinja/templates/components/question-checkbox-tree/macro.html,sha256=4Q0U3R_9JqmHYL1hCvtlvTIzYf2ScY2g_wTDLyyNhg8,4657
22
+ digitalmarketplace_frontend_jinja/templates/components/question-checkbox-tree/macro.html,sha256=MV2LC7DwPq_GWf0kG1x3YkVeZTuNCFDfzBQThuULpIQ,4729
23
23
  digitalmarketplace_frontend_jinja/templates/components/question-checkbox-tree-large/macro.html,sha256=FEZisjywePPAqwTfN4L5fHeJXWDkNcuehg6h-8BotNw,3230
24
24
  digitalmarketplace_frontend_jinja/templates/components/question-checkboxes/macro.html,sha256=LZzaZVJ8o1nkUBX4Lf_fjIoDeuxwpXnfJcYaOFYQUXY,2496
25
25
  digitalmarketplace_frontend_jinja/templates/components/question-date/macro.html,sha256=D8UUNZTKuBXoAeWKWL3SLq_IUysOBfkC7Svgl1eYHIM,1948
@@ -42,7 +42,7 @@ digitalmarketplace_frontend_jinja/templates/components/search-box/macro.html,sha
42
42
  digitalmarketplace_frontend_jinja/templates/components/select-country-from-form/macro.html,sha256=AHWNjovdZoLz5LP17l1U4XJlPirFTdVxsvUNLTWw-ik,1117
43
43
  digitalmarketplace_frontend_jinja/templates/components/summary-content/macro.html,sha256=w2__doR4tBr7njI7aM-Q-EPLG9TNGiRVIBtM8wV_UE0,2778
44
44
  digitalmarketplace_frontend_jinja/templates/components/summary-content-boolean/macro.html,sha256=JKMmIt_74HVtThFlvV6JHkmxmHKr7N1Dm9Flarbti6s,517
45
- digitalmarketplace_frontend_jinja/templates/components/summary-content-checkbox-tree/macro.html,sha256=yfSNtr0PIEgAbN-nxHnk3V1sJFdqLWu_q6CgJ8EWHK4,896
45
+ digitalmarketplace_frontend_jinja/templates/components/summary-content-checkbox-tree/macro.html,sha256=IPJBi671LhV8cjP_MtfTsQYHytitaiJ0-9uS-6nWkhg,1013
46
46
  digitalmarketplace_frontend_jinja/templates/components/summary-content-list/macro.html,sha256=whchdQS_dPCoxdjEQ1POpA_cQiN15kuaRAOoft4MNlg,625
47
47
  digitalmarketplace_frontend_jinja/templates/components/summary-content-list-multiquestion/macro.html,sha256=dpvyFTnbXG45CGWmOrGkD3O8BGw5JtsuhBh3Wqh069M,715
48
48
  digitalmarketplace_frontend_jinja/templates/components/summary-content-multiquestion/macro.html,sha256=-E6z6-ttbF3l9jbjHmo4bRU3mILedhMuZjCxKwnL71U,621
@@ -60,7 +60,7 @@ digitalmarketplace_frontend_jinja/templates/errors/410.html,sha256=ub7W3MRbIPQvj
60
60
  digitalmarketplace_frontend_jinja/templates/errors/500.html,sha256=x1Lu8ATSPGGSXvjj1ZHVq-h9eBWLiUK2MxPHwqZCiDQ,408
61
61
  digitalmarketplace_frontend_jinja/templates/layouts/_custom_dimensions.html,sha256=SglUULyYlEWLWYQ7luwKONuI2BnWbOnd5MOIblKZR3E,731
62
62
  digitalmarketplace_frontend_jinja/templates/layouts/_site_verification.html,sha256=6YWaREd5cPw1u5V9zsVaCOWG_uJ9SUMNdZj9fLK2jU8,142
63
- ccs_digitalmarketplace_frontend_jinja-4.9.2.dist-info/METADATA,sha256=PcSHJTNb7d-bo5ItWVSE2Nu2CCbbFc6aN2GjKG6zkY0,16196
64
- ccs_digitalmarketplace_frontend_jinja-4.9.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
- ccs_digitalmarketplace_frontend_jinja-4.9.2.dist-info/top_level.txt,sha256=MeEUNXXhcYp_c2URA_Npkpxj50E3hc3Eir0PWJjNIrw,34
66
- ccs_digitalmarketplace_frontend_jinja-4.9.2.dist-info/RECORD,,
63
+ ccs_digitalmarketplace_frontend_jinja-4.10.1.dist-info/METADATA,sha256=uvHDks8syd4_3RpGyUDJhh0oNU6RCwQRn48V2foG3so,16659
64
+ ccs_digitalmarketplace_frontend_jinja-4.10.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
+ ccs_digitalmarketplace_frontend_jinja-4.10.1.dist-info/top_level.txt,sha256=MeEUNXXhcYp_c2URA_Npkpxj50E3hc3Eir0PWJjNIrw,34
66
+ ccs_digitalmarketplace_frontend_jinja-4.10.1.dist-info/RECORD,,
@@ -1 +1 @@
1
- __version__ = '4.9.2'
1
+ __version__ = '4.10.1'
@@ -4,6 +4,7 @@
4
4
  {%- from "govuk_frontend_jinja/components/hint/macro.html" import govukHint -%}
5
5
  {%- from "govuk_frontend_jinja/components/accordion/macro.html" import govukAccordion -%}
6
6
  {%- from "govuk_frontend_jinja/components/error-message/macro.html" import govukErrorMessage -%}
7
+ {%- from "govuk_frontend_jinja/components/tag/macro.html" import govukTag -%}
7
8
  {%- from "digitalmarketplace_frontend_jinja/components/question-format-hint/macro.html" import digitalmarketplaceQuestionFormatHint -%}
8
9
 
9
10
  {% set name = params.question.id %}
@@ -11,6 +12,53 @@
11
12
  {% set errorMessage = params.errors[name] if params.errors %}
12
13
  {% set values = params.data[name] or [] if params.data else [] %}
13
14
 
15
+ {% macro checkboxTreeCheckboxes(section, index) %}
16
+ {% set checkboxItems = [] %}
17
+
18
+ {% for option in section.options %}
19
+ {% set value = option.value if option.value else option.label %}
20
+ {% set _checkboxItems = checkboxItems.append({
21
+ "text": option.label,
22
+ "value": value,
23
+ "checked": value in values
24
+ }) %}
25
+ {% endfor %}
26
+
27
+ {{ govukCheckboxes({
28
+ "name": name,
29
+ "idPrefix": "input-" + name + '-' + index,
30
+ "items": checkboxItems,
31
+ "classes": "govuk-checkboxes--small"
32
+ }) }}
33
+ {% endmacro %}
34
+
35
+ {% macro checkboxTreeDetail(section, index) %}
36
+ <details id="details-{{ index }}" class="dm-checkbox-tree-details">
37
+ <summary class="dm-checkbox-tree-details__summary">
38
+ <div class="dm-checkbox-tree-details__summary-text">
39
+ <div class="dm-checkbox-tree-details__summary-text-label">
40
+ {{ section.label }}
41
+ </div>
42
+ <div class="dm-checkbox-tree-details__summary-text-count">
43
+ {{ govukTag({
44
+ "html": '<span class="dm-checkbox-tree-details__summary-text-count-selected"></span> selected',
45
+ "classes": 'govuk-tag--green govuk-visually-hidden'
46
+ }) }}
47
+ </div>
48
+ </div>
49
+ </summary>
50
+ <div class="dm-checkbox-tree-details__text">
51
+ {% if section.options[0].options %}
52
+ {% for option in section.options %}
53
+ {{ checkboxTreeDetail(option, index + (loop.index | string)) }}
54
+ {% endfor %}
55
+ {% else %}
56
+ {{ checkboxTreeCheckboxes(section, index) }}
57
+ {% endif %}
58
+ </div>
59
+ </details>
60
+ {% endmacro %}
61
+
14
62
  <div class="govuk-form-group {%- if errorMessage %} govuk-form-group--error{% endif %}">
15
63
  {% call govukFieldset({
16
64
  "legend": {
@@ -22,7 +70,8 @@
22
70
  'data-module': 'dm-question-checkbox-tree',
23
71
  'aria-describedby': "input-" + name if errorMessage,
24
72
  'data-item-name-singular': params.question.item_name.singular if params.question.item_name else "category",
25
- 'data-item-name-plural': params.question.item_name.plural if params.question.item_name else "categories"
73
+ 'data-item-name-plural': params.question.item_name.plural if params.question.item_name else "categories",
74
+ 'data-tier-restriction': params.question.tier_restriction
26
75
  }
27
76
  }) %}
28
77
  {% if params.question.hint or params.question.question_advice %}
@@ -52,61 +101,11 @@
52
101
  </div>
53
102
  <div class="dm-checkbox-tree__options govuk-grid-column-two-thirds">
54
103
  {% if params.question.options[0].options %}
55
- {% set accordionItems = [] %}
56
-
57
- {% for option in params.question.options %}
58
- {% set checkboxItems = [] %}
59
-
60
- {% for label in option.options %}
61
- {% set value = label.value if label.value else label.label %}
62
- {% set _checkboxItems = checkboxItems.append({
63
- "text": label.label,
64
- "value": value,
65
- "checked": value in values
66
- }) %}
67
- {% endfor %}
68
-
69
- {% set summaryHtml %}
70
- {{ option.options | length }} {{ params.question.item_name.plural if params.question.item_name else "categories" }}<span class="dm-checkbox-tree__options-number-selected"></span>
71
- {% endset %}
72
-
73
- {% set _accordionItems = accordionItems.append({
74
- "heading": {
75
- "text": option.label
76
- },
77
- "summary": {
78
- "html": summaryHtml
79
- },
80
- "content": {
81
- "html": govukCheckboxes({
82
- "name": name,
83
- "idPrefix": "input-" + name + '-' + loop.index | string,
84
- "items": checkboxItems
85
- })
86
- }
87
- }) %}
104
+ {% for section in params.question.options %}
105
+ {{ checkboxTreeDetail(section, loop.index | string) }}
88
106
  {% endfor %}
89
-
90
- {{ govukAccordion({
91
- "id": "accordion-" + name,
92
- "items": accordionItems
93
- }) }}
94
107
  {% else %}
95
- {% set checkboxItems = []%}
96
-
97
- {% for option in params.question.options %}
98
- {% set _checkboxItems = checkboxItems.append({
99
- "text": option.label,
100
- "value": option.label,
101
- "checked": option.label in values
102
- }) %}
103
- {% endfor %}
104
-
105
- {{ govukCheckboxes({
106
- "name": name,
107
- "idPrefix": "input-" + name,
108
- "items": checkboxItems
109
- }) }}
108
+ {{ checkboxTreeCheckboxes(params.question, '0') }}
110
109
  {% endif %}
111
110
  </div>
112
111
  </div>
@@ -1,26 +1,36 @@
1
1
  {% macro digitalmarketplaceSummaryContentCheckboxTree(params) %}
2
+ {% macro checkboxTreeList(items) %}
3
+ <ul class="govuk-list govuk-list--bullet govuk-body-s">
4
+ {% for item in items %}
5
+ <li>{{ item.label }}</li>
6
+ {% endfor %}
7
+ </ul>
8
+ {% endmacro %}
9
+
10
+ {% macro checkboxTreeSummary(item) %}
11
+ <li>
12
+ <p class="govuk-!-margin-bottom-1">{{ item.label }}</p>
13
+ {% if item.options[0].options %}
14
+ <ul class="govuk-list">
15
+ {% for sub_item in item.options %}
16
+ {{ checkboxTreeSummary(sub_item) }}
17
+ {% endfor %}
18
+ </ul>
19
+ {% else %}
20
+ {{ checkboxTreeList(item.options) }}
21
+ {% endif %}
22
+ </li>
23
+ {% endmacro %}
24
+
2
25
  {% if params.value -%}
3
26
  {% set no_children = (params.value | selectattr("options") | list |length) == 0 %}
4
27
 
5
28
  {% if no_children %}
6
- <ul class="govuk-list govuk-list--bullet govuk-body-s">
7
- {% for item in params.value %}
8
- <li>{{ item.label }}</li>
9
- {% endfor %}
10
- </ul>
29
+ {{ checkboxTreeList(params.value) }}
11
30
  {% else %}
12
31
  <ul class="govuk-list">
13
- {% for parent_category in params.value %}
14
- <li>
15
- <p class="govuk-!-margin-bottom-1">{{ parent_category.label }}</p>
16
- {% if parent_category.options %}
17
- <ul class="govuk-list govuk-list--bullet govuk-body-s">
18
- {% for item in parent_category.options %}
19
- <li>{{ item.label }}</li>
20
- {% endfor %}
21
- </ul>
22
- {% endif %}
23
- </li>
32
+ {% for item in params.value %}
33
+ {{ checkboxTreeSummary(item) }}
24
34
  {% endfor %}
25
35
  </ul>
26
36
  {% endif %}