hr-design-system-handlebars 1.114.7 β 1.114.9
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/CHANGELOG.md +24 -0
- package/dist/assets/index.css +3 -3
- package/dist/assets/js/components/voting/js/votingDs.feature.js +7 -7
- package/dist/assets/js/generic/hrQuery.subfeature.js +5 -1
- package/dist/views/components/voting/voting.hbs +9 -3
- package/dist/views/components/voting/voting_result.hbs +66 -57
- package/dist/views_static/components/voting/voting.hbs +9 -3
- package/dist/views_static/components/voting/voting_result.hbs +66 -57
- package/package.json +1 -1
- package/src/stories/views/components/voting/js/votingDs.feature.js +7 -7
- package/src/stories/views/components/voting/voting.hbs +9 -3
- package/src/stories/views/components/voting/voting_result.hbs +66 -57
- package/src/stories/views/components/voting/voting_result.stories.js +0 -1
- package/src/stories/views/generic/hrQuery.subfeature.js +5 -1
- package/dist/views/components/voting/voting_result_2F.hbs +0 -4
- package/dist/views_static/components/voting/voting_result_2F.hbs +0 -4
- package/src/stories/views/components/voting/voting_result_2F.hbs +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# v1.114.9 (Wed Nov 13 2024)
|
|
2
|
+
|
|
3
|
+
#### π Bug Fix
|
|
4
|
+
|
|
5
|
+
- voting-refactoring [#1157](https://github.com/mumprod/hr-design-system-handlebars/pull/1157) ([@hanswurstsalat](https://github.com/hanswurstsalat))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Geraldo ([@hanswurstsalat](https://github.com/hanswurstsalat))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v1.114.8 (Tue Nov 12 2024)
|
|
14
|
+
|
|
15
|
+
#### π Bug Fix
|
|
16
|
+
|
|
17
|
+
- fix voting-js error 2nd try [#1156](https://github.com/mumprod/hr-design-system-handlebars/pull/1156) ([@hanswurstsalat](https://github.com/hanswurstsalat))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- Geraldo ([@hanswurstsalat](https://github.com/hanswurstsalat))
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
1
25
|
# v1.114.7 (Tue Nov 12 2024)
|
|
2
26
|
|
|
3
27
|
#### π Bug Fix
|
package/dist/assets/index.css
CHANGED
|
@@ -3687,7 +3687,7 @@ article.indexTextDS .indexTextHighlighted .link {
|
|
|
3687
3687
|
border-bottom-color: var(--color-secondary-ds);
|
|
3688
3688
|
}
|
|
3689
3689
|
.counter-reset {
|
|
3690
|
-
counter-reset:
|
|
3690
|
+
counter-reset: cnt1731491038051;
|
|
3691
3691
|
}
|
|
3692
3692
|
.placeholder-text-xs::-webkit-input-placeholder {
|
|
3693
3693
|
font-size: 0.75rem;
|
|
@@ -4101,7 +4101,7 @@ article.indexTextDS .indexTextHighlighted .link {
|
|
|
4101
4101
|
--tw-ring-color: rgba(255, 255, 255, 0.5);
|
|
4102
4102
|
}
|
|
4103
4103
|
.-ordered {
|
|
4104
|
-
counter-increment:
|
|
4104
|
+
counter-increment: cnt1731491038051 1;
|
|
4105
4105
|
}
|
|
4106
4106
|
.-ordered::before {
|
|
4107
4107
|
position: absolute;
|
|
@@ -4119,7 +4119,7 @@ article.indexTextDS .indexTextHighlighted .link {
|
|
|
4119
4119
|
--tw-text-opacity: 1;
|
|
4120
4120
|
color: rgba(0, 0, 0, 1);
|
|
4121
4121
|
color: rgba(0, 0, 0, var(--tw-text-opacity));
|
|
4122
|
-
content: counter(
|
|
4122
|
+
content: counter(cnt1731491038051);
|
|
4123
4123
|
}
|
|
4124
4124
|
/*! ****************************/
|
|
4125
4125
|
/*! DataPolicy stuff */
|
|
@@ -56,7 +56,7 @@ const Voting = (context) => {
|
|
|
56
56
|
if (jsonUrl) {
|
|
57
57
|
try {
|
|
58
58
|
responseStatus = JSON.parse(data).status
|
|
59
|
-
} catch
|
|
59
|
+
} catch {
|
|
60
60
|
//mockData already delivers a json-pbject!
|
|
61
61
|
responseStatus = data.status
|
|
62
62
|
}
|
|
@@ -70,7 +70,7 @@ const Voting = (context) => {
|
|
|
70
70
|
replaceAnimated(
|
|
71
71
|
votingWrapper,
|
|
72
72
|
hr$('.js-errorMessage', rootElement)[0].innerHTML,
|
|
73
|
-
|
|
73
|
+
true,
|
|
74
74
|
scrollIntoVoting
|
|
75
75
|
)
|
|
76
76
|
break
|
|
@@ -78,7 +78,7 @@ const Voting = (context) => {
|
|
|
78
78
|
replaceAnimated(
|
|
79
79
|
votingWrapper,
|
|
80
80
|
hr$('.js-successMessage', rootElement)[0].innerHTML,
|
|
81
|
-
|
|
81
|
+
true,
|
|
82
82
|
scrollIntoVoting
|
|
83
83
|
)
|
|
84
84
|
break
|
|
@@ -86,13 +86,13 @@ const Voting = (context) => {
|
|
|
86
86
|
replaceAnimated(
|
|
87
87
|
votingWrapper,
|
|
88
88
|
hr$('.js-errorMessage', rootElement)[0].innerHTML,
|
|
89
|
-
|
|
89
|
+
true,
|
|
90
90
|
scrollIntoVoting
|
|
91
91
|
)
|
|
92
92
|
break
|
|
93
93
|
}
|
|
94
94
|
} else {
|
|
95
|
-
replaceAnimated(votingWrapper, data,
|
|
95
|
+
replaceAnimated(votingWrapper, data, true, scrollIntoVoting)
|
|
96
96
|
}
|
|
97
97
|
})
|
|
98
98
|
|
|
@@ -103,7 +103,7 @@ const Voting = (context) => {
|
|
|
103
103
|
replaceAnimated(
|
|
104
104
|
votingWrapper,
|
|
105
105
|
hr$('.js-errorMessage', rootElement)[0].innerHTML,
|
|
106
|
-
|
|
106
|
+
true,
|
|
107
107
|
scrollIntoVoting
|
|
108
108
|
)
|
|
109
109
|
})
|
|
@@ -151,7 +151,7 @@ const Voting = (context) => {
|
|
|
151
151
|
|
|
152
152
|
const handleFormReload = function (event) {
|
|
153
153
|
event.preventDefault()
|
|
154
|
-
replaceAnimated(votingWrapper, votingTmpl,
|
|
154
|
+
replaceAnimated(votingWrapper, votingTmpl, true, scrollIntoVoting)
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
const handleKeydown = function (event) {
|
|
@@ -297,7 +297,11 @@ const replaceAnimated = function (
|
|
|
297
297
|
|
|
298
298
|
if (rescan) {
|
|
299
299
|
Initializer.run(elem, loadFeature)
|
|
300
|
-
|
|
300
|
+
try {
|
|
301
|
+
hrScriptLoad.rescanForModulesAndVariants(elem)
|
|
302
|
+
} catch {
|
|
303
|
+
console.log('hrScriptLoad is not defined');
|
|
304
|
+
}
|
|
301
305
|
}
|
|
302
306
|
|
|
303
307
|
if (callback) {
|
|
@@ -58,8 +58,7 @@
|
|
|
58
58
|
</div>
|
|
59
59
|
<script type="text/html" class="js-successMessage">
|
|
60
60
|
{{#if this.is2FSecured}}
|
|
61
|
-
{{> components/voting/
|
|
62
|
-
_isInline=true _statusDone=true
|
|
61
|
+
{{> components/voting/voting_result ../this
|
|
63
62
|
_resultBoxMessageTitle=(loca "votingform2F_title_success")
|
|
64
63
|
_resultBoxMessageText=(loca "votingform2F_text_success")
|
|
65
64
|
}}
|
|
@@ -74,7 +73,14 @@
|
|
|
74
73
|
{{/if}}
|
|
75
74
|
</script>
|
|
76
75
|
<script type="text/html" class="js-errorMessage">
|
|
77
|
-
{{> components/voting/voting_result ../this
|
|
76
|
+
{{> components/voting/voting_result ../this
|
|
77
|
+
_isInline=true
|
|
78
|
+
_statusDone=false
|
|
79
|
+
_hideVotingResult=true
|
|
80
|
+
_showBackButton=true
|
|
81
|
+
_resultBoxMessageTitle=(loca "votingform_title_error")
|
|
82
|
+
_resultBoxMessageText=(loca "votingform_text_error")
|
|
83
|
+
}}
|
|
78
84
|
</script>
|
|
79
85
|
{{#unless this.hideVotingResult}}
|
|
80
86
|
<script type="text/html" class="js-result">
|
|
@@ -1,70 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
{{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{{/
|
|
7
|
-
|
|
1
|
+
{{#if this.form.is2FSecured}}
|
|
2
|
+
{{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
|
|
3
|
+
{{~> components/base/image/icon _icon="status-done" _iconmap="icons" _addClass="float-left w-6 h-6 text-success fill-current mt-6 sm:mt-12"}}
|
|
4
|
+
<p class="mt-6 ml-8 text-base font-bold sm:ml-9 text-success sm:text-lg font-heading sm:mt-12">{{{_resultBoxMessageTitle}}}<br/>{{{_resultBoxMessageText}}}</p>
|
|
5
|
+
{{else}}
|
|
6
|
+
<div class="{{#if this.isSimpleSecured}}js-load{{/if}}{{#if _addClass}} {{_addClass}}{{/if}}"
|
|
7
|
+
{{#unless this.form.isVotingOver}}
|
|
8
|
+
{{#if this.isSimpleSecured}}
|
|
9
|
+
data-hr-voting-result-cookie-ds='{"cookieLifetime":"{{this.cookieLifetime}}","votingId":"{{this.sophoraId}}"}'
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{/unless}}
|
|
12
|
+
>
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
{{#unless this.hasRedirect}}
|
|
15
|
+
{{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
|
|
16
|
+
{{/unless}}
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
{{#if _hideVotingResult}}
|
|
19
|
+
{{#if this.form.isVotingOver}}
|
|
20
|
+
<p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12">{{loca "votingform_voting_finished"}}</p>
|
|
21
|
+
{{else}}
|
|
22
|
+
{{~> components/base/image/icon _icon=(if _statusDone "status-done" "error-ds") _iconmap="icons" _addClass=(if _statusDone "float-left w-6 h-6 text-success dark:text-success-dark fill-current mt-6 sm:mt-12" "float-left w-6 h-6 text-error dark:text-error-dark fill-current mt-6 sm:mt-12")}}
|
|
23
|
+
<p class="{{#if _statusDone}}text-success dark:text-success-dark{{else}}text-error dark:text-error-dark{{/if}} mt-6 ml-8 text-base font-bold sm:ml-9 sm:text-xl font-heading sm:mt-12">{{{_resultBoxMessageText}}}</p>
|
|
24
|
+
{{/if}}
|
|
16
25
|
{{else}}
|
|
17
|
-
|
|
18
|
-
<p class="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<div class="
|
|
29
|
-
<
|
|
26
|
+
|
|
27
|
+
<p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12 dark:text-text-dark">{{#if this.form.isVotingOver}}{{loca "votingform_voting_finished"}}{{else}}{{{_resultBoxMessageText}}}{{/if}}</p>
|
|
28
|
+
|
|
29
|
+
{{#each this.votingResult}}
|
|
30
|
+
<div class="flex">
|
|
31
|
+
<div class="grow">
|
|
32
|
+
<div class="{{#if @first}}mt-7 sm:mt-9{{else}}mt-3 sm:mt-4{{/if}} text-base sm:text-lg font-copy dark:text-text-dark">{{this.label}}</div>
|
|
33
|
+
<div class="mt-0.5 sm:mt-1 w-full bg-gray-alto rounded-full h-2">
|
|
34
|
+
<div class="{{#if this.isWinner}}bg-orange-spicyCarrot-hex{{else}}bg-blue-congress-hex{{/if}} h-2 rounded-full" style="width:{{this.roundedPercentageCount}}%;animation: progressAnimationDS 5s"></div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="self-end flex-none w-16">
|
|
38
|
+
<span class="float-right block mt-2 text-2xl font-bold font-headingSerif {{#if this.isWinner}}text-orange-spicyCarrot-hex{{else}}text-blue-congress-hex{{/if}}" style="animation: percentageAnimationDS 5s">
|
|
39
|
+
{{#if ../this.showAbsoluteResult}}{{this.count}}{{else}}{{this.percentageCount}}%{{/if}}
|
|
40
|
+
</span>
|
|
30
41
|
</div>
|
|
31
42
|
</div>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
{{/each}}
|
|
44
|
+
|
|
45
|
+
{{#if this.isMultipleChoice}}
|
|
46
|
+
{{#unless this.showAbsoluteResult}}
|
|
47
|
+
{{#if this.showVoteResult}}
|
|
48
|
+
<p class="clear-both text-xs pt-7 sm:pt-9 font-headingSerif sm:text-sm text-gray-scorpion dark:text-text-dark">
|
|
49
|
+
{{loca "votingform_vote_result"}}{{this.summarizedResult}}
|
|
50
|
+
</p>
|
|
51
|
+
{{/if}}
|
|
52
|
+
{{/unless}}
|
|
53
|
+
{{else}}
|
|
42
54
|
{{#if this.showVoteResult}}
|
|
43
|
-
<p class="
|
|
55
|
+
<p class="float-left text-xs pt-7 sm:pt-9 font-headingSerif sm:text-sm text-gray-scorpion dark:text-text-dark">
|
|
44
56
|
{{loca "votingform_vote_result"}}{{this.summarizedResult}}
|
|
45
57
|
</p>
|
|
46
58
|
{{/if}}
|
|
47
|
-
{{/unless}}
|
|
48
|
-
{{else}}
|
|
49
|
-
{{#if this.showVoteResult}}
|
|
50
|
-
<p class="clear-both text-xs pt-7 sm:pt-9 font-headingSerif sm:text-sm text-gray-scorpion">
|
|
51
|
-
{{loca "votingform_vote_result"}}{{this.summarizedResult}}
|
|
52
|
-
</p>
|
|
53
59
|
{{/if}}
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
{{!#if this.showAbsoluteResult}}
|
|
61
|
+
<!--p class="float-right text-xs pt-7 sm:pt-9 font-headingSerif text-gray-scorpion dark:text-text-dark">Stimmen</p-->
|
|
62
|
+
{{!/if}}
|
|
63
|
+
{{/if}}
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
{{#unless this.hasRedirect}}
|
|
66
|
+
{{#unless this.isSimpleSecured}}
|
|
67
|
+
{{#unless this.form.isVotingOver}}
|
|
68
|
+
{{#if _showBackButton}}
|
|
69
|
+
<div class="mt-6 sm:mt-12">
|
|
70
|
+
{{#> components/button/link_button _size="lg" _css="float-right"}}
|
|
71
|
+
{{> components/button/components/button_label _label=(loca "votingform_form_back")}}
|
|
72
|
+
{{/components/button/link_button}}
|
|
73
|
+
</div>
|
|
74
|
+
{{/if}}
|
|
75
|
+
{{/unless}}
|
|
67
76
|
{{/unless}}
|
|
68
77
|
{{/unless}}
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
</div>
|
|
79
|
+
{{/if}}
|
|
@@ -58,8 +58,7 @@
|
|
|
58
58
|
</div>
|
|
59
59
|
<script type="text/html" class="js-successMessage">
|
|
60
60
|
{{#if this.is2FSecured}}
|
|
61
|
-
{{> components/voting/
|
|
62
|
-
_isInline=true _statusDone=true
|
|
61
|
+
{{> components/voting/voting_result ../this
|
|
63
62
|
_resultBoxMessageTitle=(loca "votingform2F_title_success")
|
|
64
63
|
_resultBoxMessageText=(loca "votingform2F_text_success")
|
|
65
64
|
}}
|
|
@@ -74,7 +73,14 @@
|
|
|
74
73
|
{{/if}}
|
|
75
74
|
</script>
|
|
76
75
|
<script type="text/html" class="js-errorMessage">
|
|
77
|
-
{{> components/voting/voting_result ../this
|
|
76
|
+
{{> components/voting/voting_result ../this
|
|
77
|
+
_isInline=true
|
|
78
|
+
_statusDone=false
|
|
79
|
+
_hideVotingResult=true
|
|
80
|
+
_showBackButton=true
|
|
81
|
+
_resultBoxMessageTitle=(loca "votingform_title_error")
|
|
82
|
+
_resultBoxMessageText=(loca "votingform_text_error")
|
|
83
|
+
}}
|
|
78
84
|
</script>
|
|
79
85
|
{{#unless this.hideVotingResult}}
|
|
80
86
|
<script type="text/html" class="js-result">
|
|
@@ -1,70 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
{{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{{/
|
|
7
|
-
|
|
1
|
+
{{#if this.form.is2FSecured}}
|
|
2
|
+
{{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
|
|
3
|
+
{{~> components/base/image/icon _icon="status-done" _iconmap="icons" _addClass="float-left w-6 h-6 text-success fill-current mt-6 sm:mt-12"}}
|
|
4
|
+
<p class="mt-6 ml-8 text-base font-bold sm:ml-9 text-success sm:text-lg font-heading sm:mt-12">{{{_resultBoxMessageTitle}}}<br/>{{{_resultBoxMessageText}}}</p>
|
|
5
|
+
{{else}}
|
|
6
|
+
<div class="{{#if this.isSimpleSecured}}js-load{{/if}}{{#if _addClass}} {{_addClass}}{{/if}}"
|
|
7
|
+
{{#unless this.form.isVotingOver}}
|
|
8
|
+
{{#if this.isSimpleSecured}}
|
|
9
|
+
data-hr-voting-result-cookie-ds='{"cookieLifetime":"{{this.cookieLifetime}}","votingId":"{{this.sophoraId}}"}'
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{/unless}}
|
|
12
|
+
>
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
{{#unless this.hasRedirect}}
|
|
15
|
+
{{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
|
|
16
|
+
{{/unless}}
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
{{#if _hideVotingResult}}
|
|
19
|
+
{{#if this.form.isVotingOver}}
|
|
20
|
+
<p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12">{{loca "votingform_voting_finished"}}</p>
|
|
21
|
+
{{else}}
|
|
22
|
+
{{~> components/base/image/icon _icon=(if _statusDone "status-done" "error-ds") _iconmap="icons" _addClass=(if _statusDone "float-left w-6 h-6 text-success dark:text-success-dark fill-current mt-6 sm:mt-12" "float-left w-6 h-6 text-error dark:text-error-dark fill-current mt-6 sm:mt-12")}}
|
|
23
|
+
<p class="{{#if _statusDone}}text-success dark:text-success-dark{{else}}text-error dark:text-error-dark{{/if}} mt-6 ml-8 text-base font-bold sm:ml-9 sm:text-xl font-heading sm:mt-12">{{{_resultBoxMessageText}}}</p>
|
|
24
|
+
{{/if}}
|
|
16
25
|
{{else}}
|
|
17
|
-
|
|
18
|
-
<p class="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<div class="
|
|
29
|
-
<
|
|
26
|
+
|
|
27
|
+
<p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12 dark:text-text-dark">{{#if this.form.isVotingOver}}{{loca "votingform_voting_finished"}}{{else}}{{{_resultBoxMessageText}}}{{/if}}</p>
|
|
28
|
+
|
|
29
|
+
{{#each this.votingResult}}
|
|
30
|
+
<div class="flex">
|
|
31
|
+
<div class="grow">
|
|
32
|
+
<div class="{{#if @first}}mt-7 sm:mt-9{{else}}mt-3 sm:mt-4{{/if}} text-base sm:text-lg font-copy dark:text-text-dark">{{this.label}}</div>
|
|
33
|
+
<div class="mt-0.5 sm:mt-1 w-full bg-gray-alto rounded-full h-2">
|
|
34
|
+
<div class="{{#if this.isWinner}}bg-orange-spicyCarrot-hex{{else}}bg-blue-congress-hex{{/if}} h-2 rounded-full" style="width:{{this.roundedPercentageCount}}%;animation: progressAnimationDS 5s"></div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="self-end flex-none w-16">
|
|
38
|
+
<span class="float-right block mt-2 text-2xl font-bold font-headingSerif {{#if this.isWinner}}text-orange-spicyCarrot-hex{{else}}text-blue-congress-hex{{/if}}" style="animation: percentageAnimationDS 5s">
|
|
39
|
+
{{#if ../this.showAbsoluteResult}}{{this.count}}{{else}}{{this.percentageCount}}%{{/if}}
|
|
40
|
+
</span>
|
|
30
41
|
</div>
|
|
31
42
|
</div>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
{{/each}}
|
|
44
|
+
|
|
45
|
+
{{#if this.isMultipleChoice}}
|
|
46
|
+
{{#unless this.showAbsoluteResult}}
|
|
47
|
+
{{#if this.showVoteResult}}
|
|
48
|
+
<p class="clear-both text-xs pt-7 sm:pt-9 font-headingSerif sm:text-sm text-gray-scorpion dark:text-text-dark">
|
|
49
|
+
{{loca "votingform_vote_result"}}{{this.summarizedResult}}
|
|
50
|
+
</p>
|
|
51
|
+
{{/if}}
|
|
52
|
+
{{/unless}}
|
|
53
|
+
{{else}}
|
|
42
54
|
{{#if this.showVoteResult}}
|
|
43
|
-
<p class="
|
|
55
|
+
<p class="float-left text-xs pt-7 sm:pt-9 font-headingSerif sm:text-sm text-gray-scorpion dark:text-text-dark">
|
|
44
56
|
{{loca "votingform_vote_result"}}{{this.summarizedResult}}
|
|
45
57
|
</p>
|
|
46
58
|
{{/if}}
|
|
47
|
-
{{/unless}}
|
|
48
|
-
{{else}}
|
|
49
|
-
{{#if this.showVoteResult}}
|
|
50
|
-
<p class="clear-both text-xs pt-7 sm:pt-9 font-headingSerif sm:text-sm text-gray-scorpion">
|
|
51
|
-
{{loca "votingform_vote_result"}}{{this.summarizedResult}}
|
|
52
|
-
</p>
|
|
53
59
|
{{/if}}
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
{{!#if this.showAbsoluteResult}}
|
|
61
|
+
<!--p class="float-right text-xs pt-7 sm:pt-9 font-headingSerif text-gray-scorpion dark:text-text-dark">Stimmen</p-->
|
|
62
|
+
{{!/if}}
|
|
63
|
+
{{/if}}
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
{{#unless this.hasRedirect}}
|
|
66
|
+
{{#unless this.isSimpleSecured}}
|
|
67
|
+
{{#unless this.form.isVotingOver}}
|
|
68
|
+
{{#if _showBackButton}}
|
|
69
|
+
<div class="mt-6 sm:mt-12">
|
|
70
|
+
{{#> components/button/link_button _size="lg" _css="float-right"}}
|
|
71
|
+
{{> components/button/components/button_label _label=(loca "votingform_form_back")}}
|
|
72
|
+
{{/components/button/link_button}}
|
|
73
|
+
</div>
|
|
74
|
+
{{/if}}
|
|
75
|
+
{{/unless}}
|
|
67
76
|
{{/unless}}
|
|
68
77
|
{{/unless}}
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
</div>
|
|
79
|
+
{{/if}}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"repository": "https://github.com/szuelch/hr-design-system-handlebars",
|
|
9
|
-
"version": "1.114.
|
|
9
|
+
"version": "1.114.9",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "storybook dev -p 6006 public",
|
|
@@ -56,7 +56,7 @@ const Voting = (context) => {
|
|
|
56
56
|
if (jsonUrl) {
|
|
57
57
|
try {
|
|
58
58
|
responseStatus = JSON.parse(data).status
|
|
59
|
-
} catch
|
|
59
|
+
} catch {
|
|
60
60
|
//mockData already delivers a json-pbject!
|
|
61
61
|
responseStatus = data.status
|
|
62
62
|
}
|
|
@@ -70,7 +70,7 @@ const Voting = (context) => {
|
|
|
70
70
|
replaceAnimated(
|
|
71
71
|
votingWrapper,
|
|
72
72
|
hr$('.js-errorMessage', rootElement)[0].innerHTML,
|
|
73
|
-
|
|
73
|
+
true,
|
|
74
74
|
scrollIntoVoting
|
|
75
75
|
)
|
|
76
76
|
break
|
|
@@ -78,7 +78,7 @@ const Voting = (context) => {
|
|
|
78
78
|
replaceAnimated(
|
|
79
79
|
votingWrapper,
|
|
80
80
|
hr$('.js-successMessage', rootElement)[0].innerHTML,
|
|
81
|
-
|
|
81
|
+
true,
|
|
82
82
|
scrollIntoVoting
|
|
83
83
|
)
|
|
84
84
|
break
|
|
@@ -86,13 +86,13 @@ const Voting = (context) => {
|
|
|
86
86
|
replaceAnimated(
|
|
87
87
|
votingWrapper,
|
|
88
88
|
hr$('.js-errorMessage', rootElement)[0].innerHTML,
|
|
89
|
-
|
|
89
|
+
true,
|
|
90
90
|
scrollIntoVoting
|
|
91
91
|
)
|
|
92
92
|
break
|
|
93
93
|
}
|
|
94
94
|
} else {
|
|
95
|
-
replaceAnimated(votingWrapper, data,
|
|
95
|
+
replaceAnimated(votingWrapper, data, true, scrollIntoVoting)
|
|
96
96
|
}
|
|
97
97
|
})
|
|
98
98
|
|
|
@@ -103,7 +103,7 @@ const Voting = (context) => {
|
|
|
103
103
|
replaceAnimated(
|
|
104
104
|
votingWrapper,
|
|
105
105
|
hr$('.js-errorMessage', rootElement)[0].innerHTML,
|
|
106
|
-
|
|
106
|
+
true,
|
|
107
107
|
scrollIntoVoting
|
|
108
108
|
)
|
|
109
109
|
})
|
|
@@ -151,7 +151,7 @@ const Voting = (context) => {
|
|
|
151
151
|
|
|
152
152
|
const handleFormReload = function (event) {
|
|
153
153
|
event.preventDefault()
|
|
154
|
-
replaceAnimated(votingWrapper, votingTmpl,
|
|
154
|
+
replaceAnimated(votingWrapper, votingTmpl, true, scrollIntoVoting)
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
const handleKeydown = function (event) {
|
|
@@ -58,8 +58,7 @@
|
|
|
58
58
|
</div>
|
|
59
59
|
<script type="text/html" class="js-successMessage">
|
|
60
60
|
{{#if this.is2FSecured}}
|
|
61
|
-
{{> components/voting/
|
|
62
|
-
_isInline=true _statusDone=true
|
|
61
|
+
{{> components/voting/voting_result ../this
|
|
63
62
|
_resultBoxMessageTitle=(loca "votingform2F_title_success")
|
|
64
63
|
_resultBoxMessageText=(loca "votingform2F_text_success")
|
|
65
64
|
}}
|
|
@@ -74,7 +73,14 @@
|
|
|
74
73
|
{{/if}}
|
|
75
74
|
</script>
|
|
76
75
|
<script type="text/html" class="js-errorMessage">
|
|
77
|
-
{{> components/voting/voting_result ../this
|
|
76
|
+
{{> components/voting/voting_result ../this
|
|
77
|
+
_isInline=true
|
|
78
|
+
_statusDone=false
|
|
79
|
+
_hideVotingResult=true
|
|
80
|
+
_showBackButton=true
|
|
81
|
+
_resultBoxMessageTitle=(loca "votingform_title_error")
|
|
82
|
+
_resultBoxMessageText=(loca "votingform_text_error")
|
|
83
|
+
}}
|
|
78
84
|
</script>
|
|
79
85
|
{{#unless this.hideVotingResult}}
|
|
80
86
|
<script type="text/html" class="js-result">
|
|
@@ -1,70 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
{{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{{/
|
|
7
|
-
|
|
1
|
+
{{#if this.form.is2FSecured}}
|
|
2
|
+
{{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
|
|
3
|
+
{{~> components/base/image/icon _icon="status-done" _iconmap="icons" _addClass="float-left w-6 h-6 text-success fill-current mt-6 sm:mt-12"}}
|
|
4
|
+
<p class="mt-6 ml-8 text-base font-bold sm:ml-9 text-success sm:text-lg font-heading sm:mt-12">{{{_resultBoxMessageTitle}}}<br/>{{{_resultBoxMessageText}}}</p>
|
|
5
|
+
{{else}}
|
|
6
|
+
<div class="{{#if this.isSimpleSecured}}js-load{{/if}}{{#if _addClass}} {{_addClass}}{{/if}}"
|
|
7
|
+
{{#unless this.form.isVotingOver}}
|
|
8
|
+
{{#if this.isSimpleSecured}}
|
|
9
|
+
data-hr-voting-result-cookie-ds='{"cookieLifetime":"{{this.cookieLifetime}}","votingId":"{{this.sophoraId}}"}'
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{/unless}}
|
|
12
|
+
>
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
{{#unless this.hasRedirect}}
|
|
15
|
+
{{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
|
|
16
|
+
{{/unless}}
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
{{#if _hideVotingResult}}
|
|
19
|
+
{{#if this.form.isVotingOver}}
|
|
20
|
+
<p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12">{{loca "votingform_voting_finished"}}</p>
|
|
21
|
+
{{else}}
|
|
22
|
+
{{~> components/base/image/icon _icon=(if _statusDone "status-done" "error-ds") _iconmap="icons" _addClass=(if _statusDone "float-left w-6 h-6 text-success dark:text-success-dark fill-current mt-6 sm:mt-12" "float-left w-6 h-6 text-error dark:text-error-dark fill-current mt-6 sm:mt-12")}}
|
|
23
|
+
<p class="{{#if _statusDone}}text-success dark:text-success-dark{{else}}text-error dark:text-error-dark{{/if}} mt-6 ml-8 text-base font-bold sm:ml-9 sm:text-xl font-heading sm:mt-12">{{{_resultBoxMessageText}}}</p>
|
|
24
|
+
{{/if}}
|
|
16
25
|
{{else}}
|
|
17
|
-
|
|
18
|
-
<p class="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<div class="
|
|
29
|
-
<
|
|
26
|
+
|
|
27
|
+
<p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12 dark:text-text-dark">{{#if this.form.isVotingOver}}{{loca "votingform_voting_finished"}}{{else}}{{{_resultBoxMessageText}}}{{/if}}</p>
|
|
28
|
+
|
|
29
|
+
{{#each this.votingResult}}
|
|
30
|
+
<div class="flex">
|
|
31
|
+
<div class="grow">
|
|
32
|
+
<div class="{{#if @first}}mt-7 sm:mt-9{{else}}mt-3 sm:mt-4{{/if}} text-base sm:text-lg font-copy dark:text-text-dark">{{this.label}}</div>
|
|
33
|
+
<div class="mt-0.5 sm:mt-1 w-full bg-gray-alto rounded-full h-2">
|
|
34
|
+
<div class="{{#if this.isWinner}}bg-orange-spicyCarrot-hex{{else}}bg-blue-congress-hex{{/if}} h-2 rounded-full" style="width:{{this.roundedPercentageCount}}%;animation: progressAnimationDS 5s"></div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="self-end flex-none w-16">
|
|
38
|
+
<span class="float-right block mt-2 text-2xl font-bold font-headingSerif {{#if this.isWinner}}text-orange-spicyCarrot-hex{{else}}text-blue-congress-hex{{/if}}" style="animation: percentageAnimationDS 5s">
|
|
39
|
+
{{#if ../this.showAbsoluteResult}}{{this.count}}{{else}}{{this.percentageCount}}%{{/if}}
|
|
40
|
+
</span>
|
|
30
41
|
</div>
|
|
31
42
|
</div>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
{{/each}}
|
|
44
|
+
|
|
45
|
+
{{#if this.isMultipleChoice}}
|
|
46
|
+
{{#unless this.showAbsoluteResult}}
|
|
47
|
+
{{#if this.showVoteResult}}
|
|
48
|
+
<p class="clear-both text-xs pt-7 sm:pt-9 font-headingSerif sm:text-sm text-gray-scorpion dark:text-text-dark">
|
|
49
|
+
{{loca "votingform_vote_result"}}{{this.summarizedResult}}
|
|
50
|
+
</p>
|
|
51
|
+
{{/if}}
|
|
52
|
+
{{/unless}}
|
|
53
|
+
{{else}}
|
|
42
54
|
{{#if this.showVoteResult}}
|
|
43
|
-
<p class="
|
|
55
|
+
<p class="float-left text-xs pt-7 sm:pt-9 font-headingSerif sm:text-sm text-gray-scorpion dark:text-text-dark">
|
|
44
56
|
{{loca "votingform_vote_result"}}{{this.summarizedResult}}
|
|
45
57
|
</p>
|
|
46
58
|
{{/if}}
|
|
47
|
-
{{/unless}}
|
|
48
|
-
{{else}}
|
|
49
|
-
{{#if this.showVoteResult}}
|
|
50
|
-
<p class="clear-both text-xs pt-7 sm:pt-9 font-headingSerif sm:text-sm text-gray-scorpion">
|
|
51
|
-
{{loca "votingform_vote_result"}}{{this.summarizedResult}}
|
|
52
|
-
</p>
|
|
53
59
|
{{/if}}
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
{{!#if this.showAbsoluteResult}}
|
|
61
|
+
<!--p class="float-right text-xs pt-7 sm:pt-9 font-headingSerif text-gray-scorpion dark:text-text-dark">Stimmen</p-->
|
|
62
|
+
{{!/if}}
|
|
63
|
+
{{/if}}
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
{{#unless this.hasRedirect}}
|
|
66
|
+
{{#unless this.isSimpleSecured}}
|
|
67
|
+
{{#unless this.form.isVotingOver}}
|
|
68
|
+
{{#if _showBackButton}}
|
|
69
|
+
<div class="mt-6 sm:mt-12">
|
|
70
|
+
{{#> components/button/link_button _size="lg" _css="float-right"}}
|
|
71
|
+
{{> components/button/components/button_label _label=(loca "votingform_form_back")}}
|
|
72
|
+
{{/components/button/link_button}}
|
|
73
|
+
</div>
|
|
74
|
+
{{/if}}
|
|
75
|
+
{{/unless}}
|
|
67
76
|
{{/unless}}
|
|
68
77
|
{{/unless}}
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
</div>
|
|
79
|
+
{{/if}}
|
|
@@ -27,7 +27,6 @@ const Template = (args) => {
|
|
|
27
27
|
_isInline=true
|
|
28
28
|
_statusDone=true
|
|
29
29
|
_hideVotingResult=this.form.hideVotingResult
|
|
30
|
-
_resultBoxMessageTitle="Danke fΓΌr ihre Teilnahme!"
|
|
31
30
|
_resultBoxMessageText=this.votingSuccessText.richtext
|
|
32
31
|
}}
|
|
33
32
|
{{/components/forms/components/backgroundBox }}
|
|
@@ -297,7 +297,11 @@ const replaceAnimated = function (
|
|
|
297
297
|
|
|
298
298
|
if (rescan) {
|
|
299
299
|
Initializer.run(elem, loadFeature)
|
|
300
|
-
|
|
300
|
+
try {
|
|
301
|
+
hrScriptLoad.rescanForModulesAndVariants(elem)
|
|
302
|
+
} catch {
|
|
303
|
+
console.log('hrScriptLoad is not defined');
|
|
304
|
+
}
|
|
301
305
|
}
|
|
302
306
|
|
|
303
307
|
if (callback) {
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
{{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
|
|
2
|
-
|
|
3
|
-
{{~> components/base/image/icon _icon="status-done" _iconmap="icons" _addClass="float-left w-6 h-6 text-success fill-current mt-6 sm:mt-12"}}
|
|
4
|
-
<p class="mt-6 ml-8 text-base font-bold sm:ml-9 text-success sm:text-lg font-heading sm:mt-12">{{{_resultBoxMessageTitle}}}<br/>{{{_resultBoxMessageText}}}</p>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
{{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
|
|
2
|
-
|
|
3
|
-
{{~> components/base/image/icon _icon="status-done" _iconmap="icons" _addClass="float-left w-6 h-6 text-success fill-current mt-6 sm:mt-12"}}
|
|
4
|
-
<p class="mt-6 ml-8 text-base font-bold sm:ml-9 text-success sm:text-lg font-heading sm:mt-12">{{{_resultBoxMessageTitle}}}<br/>{{{_resultBoxMessageText}}}</p>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
{{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
|
|
2
|
-
|
|
3
|
-
{{~> components/base/image/icon _icon="status-done" _iconmap="icons" _addClass="float-left w-6 h-6 text-success fill-current mt-6 sm:mt-12"}}
|
|
4
|
-
<p class="mt-6 ml-8 text-base font-bold sm:ml-9 text-success sm:text-lg font-heading sm:mt-12">{{{_resultBoxMessageTitle}}}<br/>{{{_resultBoxMessageText}}}</p>
|