@gov-cy/govcy-frontend-renderer 1.14.2 → 1.15.0
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.
- package/README.md +9 -0
- package/dist/govcyCompiledTemplates.browser.js +1392 -1258
- package/package.json +1 -1
- package/src/njk/elements/backLink.njk +2 -2
- package/src/njk/elements/checkboxes.njk +3 -3
- package/src/njk/elements/dateInput.njk +16 -16
- package/src/njk/elements/errorMessage.njk +2 -2
- package/src/njk/elements/errorSummary.njk +2 -2
- package/src/njk/elements/fileView.njk +3 -3
- package/src/njk/elements/progressList.njk +5 -5
- package/src/njk/elements/radios.njk +4 -4
- package/src/njk/elements/stepByStepStatic.njk +4 -4
- package/src/njk/elements/summaryList.njk +3 -3
- package/src/njk/elements/taskList.njk +2 -2
- package/src/njk/elements/textArea.njk +5 -5
- package/src/njk/elements/userName.njk +3 -3
- package/src/njk/layouts/govcyBase.njk +20 -1
- package/src/njk/utilities/govcyUtilities.njk +56 -0
package/package.json
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
#}
|
|
8
8
|
{% macro backLink(params) -%}
|
|
9
9
|
{#- Import localizer from utilities -#}
|
|
10
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
10
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
11
11
|
{# set default values #}
|
|
12
|
-
{%- set text = govcyLocalizeContent(params.text, params.lang) if params.text else
|
|
12
|
+
{%- set text = govcyLocalizeContent(params.text, params.lang) if params.text else govcyGetContent('backLink_back', params.lang) -%}
|
|
13
13
|
{%- set href = params.href | default('javascript:history.back()') -%}
|
|
14
14
|
<a class="govcy-back-link{% if params.classes %} {{ params.classes }}{% endif %}" href="{{ href }}"{{ govcyLangAttribute(params.lang) }}>{{ text}}</a>
|
|
15
15
|
{%- endmacro %}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
{#- Normalize value as array -#}
|
|
24
24
|
{%- set checkboxValues = [] if params.value is not defined else (params.value if params.value is iterable else [params.value]) -%}
|
|
25
25
|
{#- Import localizer from utilities -#}
|
|
26
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
26
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
27
27
|
{%- from "./hint.njk" import hint -%}
|
|
28
28
|
{%- from "./label.njk" import label -%}
|
|
29
29
|
{#- set language labels -#}
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
{%- if item.altOrText -%}
|
|
32
32
|
{%- set orText -%} {{- govcyLocalizeContent(item.altOrText, lang) -}}{%- endset -%}
|
|
33
33
|
{%- else -%}
|
|
34
|
-
{%- set orText -%} {{-
|
|
34
|
+
{%- set orText -%} {{- govcyGetContent('common_or', lang) -}}{%- endset -%}
|
|
35
35
|
{%- endif -%}
|
|
36
36
|
{#- set 'and' labels -#}
|
|
37
37
|
{%- if item.altAndText -%}
|
|
38
38
|
{%- set andText -%} {{- govcyLocalizeContent(item.altAndText, lang) -}}{%- endset -%}
|
|
39
39
|
{%- else -%}
|
|
40
|
-
{%- set andText -%} {{-
|
|
40
|
+
{%- set andText -%} {{- govcyGetContent('common_and', lang) -}}{%- endset -%}
|
|
41
41
|
{%- endif -%}
|
|
42
42
|
{#- set option id -#}
|
|
43
43
|
{% set optionId = params.id ~ '-option-' ~ index %}
|
|
@@ -26,28 +26,28 @@
|
|
|
26
26
|
{#- legend, id and name are mandatory -#}
|
|
27
27
|
{%- if params.legend and params.id and params.name -%}
|
|
28
28
|
{#- Import localizer from utilities -#}
|
|
29
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
29
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
30
30
|
{%- from "./fieldset.njk" import fieldset -%}
|
|
31
31
|
{%- from "./hint.njk" import hint -%}
|
|
32
32
|
{%- from "./legend.njk" import legend -%}
|
|
33
33
|
{%- from "./errorMessage.njk" import errorMessage -%}
|
|
34
34
|
{%- from "./formControl.njk" import formControl -%}
|
|
35
35
|
{#- set localizations -#}
|
|
36
|
-
{%- set dayLabel =
|
|
37
|
-
{%- set monthLabel =
|
|
38
|
-
{%- set yearLabel =
|
|
39
|
-
{%- set monthValue1 =
|
|
40
|
-
{%- set monthValue2 =
|
|
41
|
-
{%- set monthValue3 =
|
|
42
|
-
{%- set monthValue4 =
|
|
43
|
-
{%- set monthValue5 =
|
|
44
|
-
{%- set monthValue6 =
|
|
45
|
-
{%- set monthValue7 =
|
|
46
|
-
{%- set monthValue8 =
|
|
47
|
-
{%- set monthValue9 =
|
|
48
|
-
{%- set monthValue10 =
|
|
49
|
-
{%- set monthValue11 =
|
|
50
|
-
{%- set monthValue12 =
|
|
36
|
+
{%- set dayLabel = govcyGetContent('dateInput_dayLabel' , params.lang) -%}
|
|
37
|
+
{%- set monthLabel = govcyGetContent('dateInput_monthLabel' , params.lang) -%}
|
|
38
|
+
{%- set yearLabel = govcyGetContent('dateInput_yearLabel' , params.lang) -%}
|
|
39
|
+
{%- set monthValue1 = govcyGetContent('dateInput_monthValue1' , params.lang) -%}
|
|
40
|
+
{%- set monthValue2 = govcyGetContent('dateInput_monthValue2' , params.lang) -%}
|
|
41
|
+
{%- set monthValue3 = govcyGetContent('dateInput_monthValue3' , params.lang) -%}
|
|
42
|
+
{%- set monthValue4 = govcyGetContent('dateInput_monthValue4' , params.lang) -%}
|
|
43
|
+
{%- set monthValue5 = govcyGetContent('dateInput_monthValue5' , params.lang) -%}
|
|
44
|
+
{%- set monthValue6 = govcyGetContent('dateInput_monthValue6' , params.lang) -%}
|
|
45
|
+
{%- set monthValue7 = govcyGetContent('dateInput_monthValue7' , params.lang) -%}
|
|
46
|
+
{%- set monthValue8 = govcyGetContent('dateInput_monthValue8' , params.lang) -%}
|
|
47
|
+
{%- set monthValue9 = govcyGetContent('dateInput_monthValue9' , params.lang) -%}
|
|
48
|
+
{%- set monthValue10 = govcyGetContent('dateInput_monthValue10' , params.lang) -%}
|
|
49
|
+
{%- set monthValue11 = govcyGetContent('dateInput_monthValue11' , params.lang) -%}
|
|
50
|
+
{%- set monthValue12 = govcyGetContent('dateInput_monthValue12' , params.lang) -%}
|
|
51
51
|
{#- set hint id -#}
|
|
52
52
|
{%- if params.hint -%}
|
|
53
53
|
{%- set hintId = [params.id, "-hint"] | join -%}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
#}
|
|
8
8
|
{% macro errorMessage(params) -%}
|
|
9
9
|
{#- Import localizer from utilities -#}
|
|
10
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
10
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
11
11
|
{#- set default values -#}
|
|
12
12
|
{%- set hiddenError -%}
|
|
13
|
-
{{-
|
|
13
|
+
{{- govcyGetContent('errorMessage_hiddenError', params.lang) -}}
|
|
14
14
|
{%- endset -%}
|
|
15
15
|
{%- if params.message -%}
|
|
16
16
|
<p {% if params.id %}id="{{ params.id }}"{% endif %} class="govcy-input-error-msg{% if params.classes %} {{ params.classes }}{% endif %}"{{ govcyLangAttribute(params.lang) }}>
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
#}
|
|
25
25
|
{% macro errorSummary(params) -%}
|
|
26
26
|
{#- Import localizer from utilities -#}
|
|
27
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
27
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
28
28
|
{#- set 'or' labels -#}
|
|
29
29
|
{%- if params.header -%}
|
|
30
30
|
{%- set header -%} {{- govcyLocalizeContent(params.header, params.lang) -}}{%- endset -%}
|
|
31
31
|
{%- else -%}
|
|
32
|
-
{%- set header -%} {{-
|
|
32
|
+
{%- set header -%} {{- govcyGetContent('errorSummary_header', params.lang) -}}{%- endset -%}
|
|
33
33
|
{%- endif -%}
|
|
34
34
|
{#- id and errors are mandatory -#}
|
|
35
35
|
{%- if params.id and params.errors %}
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
#}
|
|
12
12
|
{% macro fileView(params) -%}
|
|
13
13
|
{#- Import localizer from utilities -#}
|
|
14
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
14
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
15
15
|
{%- from "./formControl.njk" import formControl -%}
|
|
16
16
|
{%- from "./hint.njk" import hint -%}
|
|
17
17
|
{#- set language labels -#}
|
|
18
|
-
{%- set viewLabel -%} {{-
|
|
19
|
-
{%- set deleteLabel -%} {{-
|
|
18
|
+
{%- set viewLabel -%} {{- govcyGetContent('fileView_view', params.lang) -}}{%- endset -%}
|
|
19
|
+
{%- set deleteLabel -%} {{- govcyGetContent('fileView_delete', params.lang) -}}{%- endset -%}
|
|
20
20
|
{#- label, viewHref and deleteHref are mandatory -#}
|
|
21
21
|
{%- if params.label and params.viewHref and params.deleteHref -%}
|
|
22
22
|
<div class="govcy-form">
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
#}
|
|
22
22
|
{% macro progressList(params) -%}
|
|
23
23
|
{#- Import localizer from utilities -#}
|
|
24
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
24
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
25
25
|
{#- set default values -#}
|
|
26
26
|
{%- set showSteps = params.showSteps | default(false) -%}
|
|
27
27
|
{%- set current = params.current | int -%}
|
|
@@ -30,25 +30,25 @@
|
|
|
30
30
|
{%- if params.completedLabel -%}
|
|
31
31
|
{%- set completedLabel -%} {{- govcyLocalizeContent(params.completedLabel, params.lang) -}}{%- endset -%}
|
|
32
32
|
{%- else -%}
|
|
33
|
-
{%- set completedLabel -%} {{-
|
|
33
|
+
{%- set completedLabel -%} {{- govcyGetContent('progressList_completedLabel', params.lang) -}}{%- endset -%}
|
|
34
34
|
{%- endif -%}
|
|
35
35
|
{#- set not completed label -#}
|
|
36
36
|
{%- if params.notCompletedLabel -%}
|
|
37
37
|
{%- set notCompletedLabel -%} {{- govcyLocalizeContent(params.notCompletedLabel, params.lang) -}}{%- endset -%}
|
|
38
38
|
{%- else -%}
|
|
39
|
-
{%- set notCompletedLabel -%} {{-
|
|
39
|
+
{%- set notCompletedLabel -%} {{- govcyGetContent('progressList_notCompletedLabel', params.lang) -}}{%- endset -%}
|
|
40
40
|
{%- endif -%}
|
|
41
41
|
{#- set step label -#}
|
|
42
42
|
{%- if params.stepLabel -%}
|
|
43
43
|
{%- set stepLabel -%} {{- govcyLocalizeContent(params.stepLabel, params.lang) -}}{%- endset -%}
|
|
44
44
|
{%- else -%}
|
|
45
|
-
{%- set stepLabel -%} {{-
|
|
45
|
+
{%- set stepLabel -%} {{- govcyGetContent('progressList_stepLabel', params.lang) -}}{%- endset -%}
|
|
46
46
|
{%- endif -%}
|
|
47
47
|
{#- set of label -#}
|
|
48
48
|
{%- if params.ofLabel -%}
|
|
49
49
|
{%- set ofLabel -%} {{- govcyLocalizeContent(params.ofLabel, params.lang) -}}{%- endset -%}
|
|
50
50
|
{%- else -%}
|
|
51
|
-
{%- set ofLabel -%} {{-
|
|
51
|
+
{%- set ofLabel -%} {{- govcyGetContent('progressList_ofLabel', params.lang) -}}{%- endset -%}
|
|
52
52
|
{%- endif -%}
|
|
53
53
|
{#- current and total are mandatory -#}
|
|
54
54
|
{%- if current and total %}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
#}
|
|
29
29
|
{%- macro _radioItem(params, item, isInline, index, lang) %}
|
|
30
30
|
{#- Import localizer from utilities -#}
|
|
31
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyElementsFromArray -%}
|
|
31
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyElementsFromArray, govcyGetContent -%}
|
|
32
32
|
{%- from "./hint.njk" import hint -%}
|
|
33
33
|
{%- from "./label.njk" import label -%}
|
|
34
34
|
{#- set default values -#}
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
{%- if item.altOrText -%}
|
|
39
39
|
{%- set orText -%} {{- govcyLocalizeContent(item.altOrText, lang) -}}{%- endset -%}
|
|
40
40
|
{%- else -%}
|
|
41
|
-
{%- set orText -%} {{-
|
|
41
|
+
{%- set orText -%} {{- govcyGetContent('common_or', lang) -}}{%- endset -%}
|
|
42
42
|
{%- endif -%}
|
|
43
43
|
{#- set 'and' labels -#}
|
|
44
44
|
{%- if item.altAndText -%}
|
|
45
45
|
{%- set andText -%} {{- govcyLocalizeContent(item.altAndText, lang) -}}{%- endset -%}
|
|
46
46
|
{%- else -%}
|
|
47
|
-
{%- set andText -%} {{-
|
|
47
|
+
{%- set andText -%} {{- govcyGetContent('common_and', lang) -}}{%- endset -%}
|
|
48
48
|
{%- endif -%}
|
|
49
49
|
{#- set option id -#}
|
|
50
50
|
{% set optionId = params.id ~ '-option-' ~ index %}
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
{#- set conditional id -#}
|
|
58
58
|
{%- if item.conditionalElements -%}
|
|
59
59
|
{%- set conditionalElementsId = [optionId, "-conditional"] | join -%}
|
|
60
|
-
{%- set conditionalLabel =
|
|
60
|
+
{%- set conditionalLabel = govcyGetContent('radios_conditionalLabel', lang) -%}
|
|
61
61
|
{%- else -%}
|
|
62
62
|
{%- set conditionalElementsId = '' -%}
|
|
63
63
|
{%- set conditionalLabel = '' -%}
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
#}
|
|
37
37
|
{% macro stepByStepStatic(params) -%}
|
|
38
38
|
{#- Import localizer from utilities -#}
|
|
39
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyElementsFromArray -%}
|
|
39
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyElementsFromArray, govcyGetContent -%}
|
|
40
40
|
{#- set default values -#}
|
|
41
|
-
{%- set orText -%} {{-
|
|
42
|
-
{%- set andText -%} {{-
|
|
43
|
-
{%- set stepText -%} {{-
|
|
41
|
+
{%- set orText -%} {{- govcyGetContent('common_or', params.lang) -}}{%- endset -%}
|
|
42
|
+
{%- set andText -%} {{- govcyGetContent('common_and', params.lang) -}}{%- endset -%}
|
|
43
|
+
{%- set stepText -%} {{- govcyGetContent('stepByStepStatic_step', params.lang) -}}{%- endset -%}
|
|
44
44
|
{#- items are mandatory -#}
|
|
45
45
|
{%- if params.items %}
|
|
46
46
|
<div class="govcy-accordion govcy-accordion-steps govcy-mb-0{% if params.classes %} {{ params.classes }}{% endif %}"{% if params.id %} id="{{ params.id }}"{% endif %}{{ govcyLangAttribute(params.lang) }}>
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
#}
|
|
48
48
|
{% macro summaryList(params) -%}
|
|
49
49
|
{#- Import localizer from utilities -#}
|
|
50
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyElementsFromArray -%}
|
|
50
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyElementsFromArray, govcyGetContent -%}
|
|
51
51
|
<dl {% if params.id %}id="{{ params.id }}" {% endif %}class="{% if not params.isInnerList %}govcy-summary-list{% else %}govcy-summary-list-row-internal{% endif %}{% if params.classes %} {{ params.classes }}{% endif %}"{{ govcyLangAttribute(params.lang) }}>
|
|
52
52
|
{#- Render visually hidden text for screen readers the entry number -#}
|
|
53
53
|
{%- if params.entryCount -%}
|
|
54
|
-
{%- set entryText =
|
|
54
|
+
{%- set entryText = govcyGetContent('common_entry', params.lang) -%}
|
|
55
55
|
<dt><span class="govcy-visually-hidden">{{ entryText }} {{ params.entryCount}}</span></dt>
|
|
56
56
|
{%- endif -%}
|
|
57
57
|
{%- for item in params.items %}
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
{%- set totalCount = totalCount + 1 -%}
|
|
144
144
|
{%- endif -%}
|
|
145
145
|
{%- endfor -%}
|
|
146
|
-
{%- set entriesText =
|
|
146
|
+
{%- set entriesText = govcyGetContent('common_entries', lang) -%}
|
|
147
147
|
{%- if totalCount > 0 %}<span class="govcy-visually-hidden">{{ totalCount }} {{ entriesText }}</span>{% endif -%}
|
|
148
148
|
{%- endmacro %}
|
|
149
149
|
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
{#- legend, id and name are mandatory -#}
|
|
35
35
|
{%- if params.items -%}
|
|
36
36
|
{#- Import localizer from utilities -#}
|
|
37
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
37
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
38
38
|
{#- set localizations -#}
|
|
39
39
|
{%- if params.visuallyHiddenStatus -%}
|
|
40
40
|
{%- set visuallyHiddenStatus -%} {{- govcyLocalizeContent(params.visuallyHiddenStatus, params.lang) -}}{%- endset -%}
|
|
41
41
|
{%- else -%}
|
|
42
|
-
{%- set visuallyHiddenStatus -%} {{-
|
|
42
|
+
{%- set visuallyHiddenStatus -%} {{- govcyGetContent('taskList_withStatus' , params.lang) -}}{%- endset -%}
|
|
43
43
|
{%- endif %}
|
|
44
44
|
<table class="govcy-table{% if params.classes %} {{ params.classes }}{% endif %}"{% if params.id %} id="{{ params.id }}"{% endif %}{{ govcyLangAttribute(params.lang) }}>
|
|
45
45
|
<tbody>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
#}
|
|
21
21
|
{% macro textArea(params) -%}
|
|
22
22
|
{#- Import localizer from utilities -#}
|
|
23
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
23
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
24
24
|
{%- from "./formControl.njk" import formControl -%}
|
|
25
25
|
{%- from "./hint.njk" import hint -%}
|
|
26
26
|
{%- from "./label.njk" import label -%}
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
{%- set charactercountType = params.characterCount.type | default('char') -%}
|
|
65
65
|
{%- set charactercountMax = params.characterCount.max | default(100) -%}
|
|
66
66
|
{#- set language labels -#}
|
|
67
|
-
{%- set charRemaining =
|
|
68
|
-
{%- set charExceeding =
|
|
69
|
-
{%- set wordRemaining =
|
|
70
|
-
{%- set wordsExceeding =
|
|
67
|
+
{%- set charRemaining = govcyGetContent('textArea_charRemaining', params.lang, true) -%}
|
|
68
|
+
{%- set charExceeding = govcyGetContent('textArea_charExceeding', params.lang, true) -%}
|
|
69
|
+
{%- set wordRemaining = govcyGetContent('textArea_wordRemaining', params.lang, true) -%}
|
|
70
|
+
{%- set wordsExceeding = govcyGetContent('textArea_wordsExceeding', params.lang, true) -%}
|
|
71
71
|
<div id="{{ charactercountId }}" class="govcy-character-count" {%- if charactercountType=='word' -%} data-maxwords{%- else -%} data-maxchars{%- endif -%}="{{ charactercountMax }}">
|
|
72
72
|
<div class="govcy-character-remaining-counter">{%- if charactercountType=='word' -%}{{ wordRemaining | safe }}{%- else -%}{{ charRemaining | safe }}{%- endif -%}</div>
|
|
73
73
|
<div class="govcy-character-more-counter">{%- if charactercountType=='word' -%}{{ wordsExceeding | safe }}{%- else -%}{{ charExceeding | safe }}{%- endif -%}</div>
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
#}
|
|
9
9
|
{% macro userName(params) -%}
|
|
10
10
|
{#- Import localizer from utilities -#}
|
|
11
|
-
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute -%}
|
|
11
|
+
{%- from "../utilities/govcyUtilities.njk" import govcyLocalizeContent, govcyLangAttribute, govcyGetContent -%}
|
|
12
12
|
{#- set localizations -#}
|
|
13
|
-
{%- set signOut =
|
|
14
|
-
{%- set userVisuallyHidden =
|
|
13
|
+
{%- set signOut = govcyGetContent('userName_signOut' , params.lang) -%}
|
|
14
|
+
{%- set userVisuallyHidden = govcyGetContent('userName_fromUser' , params.lang) -%}
|
|
15
15
|
{%- if params.name and params.signOutLink %}
|
|
16
16
|
<div {% if params.id %}id="{{ params.id }}" {% endif %}class="govcy-header-top-area{% if params.classes %} {{ params.classes }}{% endif %}"{{ govcyLangAttribute(params.lang) }}>
|
|
17
17
|
<div class="govcy-container">
|
|
@@ -22,6 +22,10 @@ To use this template you need to pass the following data:
|
|
|
22
22
|
"description" : {"en":"Service description", "el":"Περιγραφή υπηρεσίας"},
|
|
23
23
|
"isTesting" : true,
|
|
24
24
|
"url": "https://gov.cy",
|
|
25
|
+
"matomo": {
|
|
26
|
+
"url": "//wp.matomo.dits.dmrid.gov.cy/",
|
|
27
|
+
"siteId": 1234
|
|
28
|
+
},
|
|
25
29
|
"cdn": {
|
|
26
30
|
"dist": "https://cdn.jsdelivr.net/gh/gov-cy/govcy-design-system@3.0.0/dist",
|
|
27
31
|
"cssIntegrity": 'sha384-1zLHWOtnS0hOIz5mVEPZp0UH5gUE6eo0CQcCGA3sF2TyYhHyKOd3Ni8Iy/NjEASU",
|
|
@@ -76,7 +80,22 @@ To use this template you need to pass the following data:
|
|
|
76
80
|
|
|
77
81
|
<title>{% if pageData.title %}{{ govcyLocalizeContent(pageData.title, site.lang) }} - {% endif %}{% if site.title %}{{ govcyLocalizeContent(site.title, site.lang) }} - {% endif %}gov.cy</title>
|
|
78
82
|
<meta name="description" content="{{ govcyLocalizeContent(site.description, site.lang) }}">
|
|
79
|
-
|
|
83
|
+
{% if site.matomo and site.matomo.url and site.matomo.siteId %}
|
|
84
|
+
<!-- Matomo -->
|
|
85
|
+
<script>
|
|
86
|
+
var _paq = window._paq = window._paq || [];
|
|
87
|
+
_paq.push(['trackPageView']);
|
|
88
|
+
_paq.push(['enableLinkTracking']);
|
|
89
|
+
(function() {
|
|
90
|
+
var u="{{ site.matomo.url | safe }}";
|
|
91
|
+
_paq.push(['setTrackerUrl', u + '/matomo.php']);
|
|
92
|
+
_paq.push(['setSiteId', '{{ site.matomo.siteId | safe }}']);
|
|
93
|
+
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
|
|
94
|
+
g.async = true; g.src = u + '/matomo.js'; s.parentNode.insertBefore(g, s);
|
|
95
|
+
})();
|
|
96
|
+
</script>
|
|
97
|
+
<!-- End Matomo Code -->
|
|
98
|
+
{% endif %}
|
|
80
99
|
</head>
|
|
81
100
|
<body>
|
|
82
101
|
<!--bodyStart-->
|
|
@@ -33,4 +33,60 @@
|
|
|
33
33
|
{%- endif -%}
|
|
34
34
|
{%- call govcyElement(element.element, params) %}{% endcall -%}
|
|
35
35
|
{%- endfor -%}
|
|
36
|
+
{%- endmacro %}
|
|
37
|
+
{#- --------------------------------------- -#}
|
|
38
|
+
{#- Get localized content directly -#}
|
|
39
|
+
{% macro govcyGetContent(key, lang, isHTML) -%}
|
|
40
|
+
{# Centralized multilingual content storage #}
|
|
41
|
+
{%- set govcyContent = {
|
|
42
|
+
backLink_back: {el: "Πίσω", en: "Back"},
|
|
43
|
+
common_or: {el: "Ή", en: "Or"},
|
|
44
|
+
common_and: {el: "Και", en: "And"},
|
|
45
|
+
common_entry: {en:"Entry",el:"Καταχώρηση"},
|
|
46
|
+
common_entries: {en:"Entries",el:"Καταχωρήσεις"},
|
|
47
|
+
dateInput_dayLabel: {el: "Μέρα", en: "Day"},
|
|
48
|
+
dateInput_monthLabel: {el: "Μήνας", en: "Month"},
|
|
49
|
+
dateInput_yearLabel: {el: "Χρόνος", en: "Year"},
|
|
50
|
+
dateInput_monthValue1: {en:'January',el:'Ιανουάριος'},
|
|
51
|
+
dateInput_monthValue2: {en:'February',el:'Φεβρουάριος'},
|
|
52
|
+
dateInput_monthValue3: {en:'March',el:'Μάρτιος'},
|
|
53
|
+
dateInput_monthValue4: {en:'April',el:'Απρίλιος'},
|
|
54
|
+
dateInput_monthValue5: {en:'May',el:'Μάϊος'},
|
|
55
|
+
dateInput_monthValue6: {en:'June',el:'Ιούνιος'},
|
|
56
|
+
dateInput_monthValue7: {en:'July',el:'Ιούλιος'},
|
|
57
|
+
dateInput_monthValue8: {en:'August',el:'Αύγουστος'},
|
|
58
|
+
dateInput_monthValue9: {en:'September',el:'Σεπτέμβριος'},
|
|
59
|
+
dateInput_monthValue10: {en:'October',el:'Οκτώβριος'},
|
|
60
|
+
dateInput_monthValue11: {en:'November',el:'Νοέμβριος'},
|
|
61
|
+
dateInput_monthValue12: {en:'December',el:'Δεκέμβριος'},
|
|
62
|
+
errorMessage_hiddenError: {en:'Error',el:'Σφάλμα'},
|
|
63
|
+
errorSummary_header: {en:"There is a problem",el:"Υπάρχει πρόβλημα"},
|
|
64
|
+
fileView_view: {en:'View',el:'Προβολή'},
|
|
65
|
+
fileView_delete: {en:'Delete',el:'Διαγραφή'},
|
|
66
|
+
progressList_completedLabel: {en:"Completed",el:"Ολοκληρώθηκε"},
|
|
67
|
+
progressList_notCompletedLabel: {en:"Not completed",el:"Δεν ολοκληρώθηκε"},
|
|
68
|
+
progressList_stepLabel: {en:"Step",el:"Βήμα"},
|
|
69
|
+
progressList_ofLabel: {en:"of",el:"από"},
|
|
70
|
+
radios_conditionalLabel: {en:"This option expands and has more questions,",el:"Αυτή η επιλογή επεκτείνεται και έχει περισσότερες ερωτήσεις,"},
|
|
71
|
+
stepByStepStatic_step: {en:"Step",el:"Βήμα"},
|
|
72
|
+
taskList_withStatus: {en:"with status ",el:"με κατάσταση "},
|
|
73
|
+
textArea_charRemaining: {en:"You have <span></span> characters remaining",el:"Έχετε <span></span> χαρακτήρες που απομένουν"},
|
|
74
|
+
textArea_charExceeding: {en:"You have entered <span></span> characters more",el:"Έχετε περάσει <span></span> χαρακτήρες περισσότερους"},
|
|
75
|
+
textArea_wordRemaining: {en:"You have <span></span> words remaining",el:"Έχετε <span></span> λέξεις που απομένουν"},
|
|
76
|
+
textArea_wordsExceeding: {en:"You have entered <span></span> words more",el:"Έχετε περάσει <span></span> λέξεις περισσότερες"},
|
|
77
|
+
userName_signOut: {en:'Sign out',el:'Αποσύνδεση'},
|
|
78
|
+
userName_fromUser: {en:'from user',el:'από το χρήστη'}
|
|
79
|
+
} -%}
|
|
80
|
+
{# Set default values #}
|
|
81
|
+
{#- Set the language with priority: lang > globalData.site.lang > 'el' -#}
|
|
82
|
+
{%- set inLang = lang | default(globalData.site.lang) | default('el') -%}
|
|
83
|
+
{%- set inIsHTML = isHTML | default(false) -%}
|
|
84
|
+
{# Fetch the content for the given key and language #}
|
|
85
|
+
{%- if govcyContent[key] and govcyContent[key][inLang] -%}
|
|
86
|
+
{%- if inIsHTML -%}
|
|
87
|
+
{{ govcyContent[key][inLang] | safe }}
|
|
88
|
+
{%- else -%}
|
|
89
|
+
{{ govcyContent[key][inLang] }}
|
|
90
|
+
{%- endif -%}
|
|
91
|
+
{%- endif -%}
|
|
36
92
|
{%- endmacro %}
|