hr-design-system-handlebars 1.114.5 → 1.114.6

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 (30) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/assets/index.css +3 -3
  3. package/dist/views/components/voting/voting.hbs +18 -16
  4. package/dist/views/components/voting/voting_result.hbs +17 -18
  5. package/dist/views/components/voting/voting_result_2F.hbs +1 -1
  6. package/dist/views_static/components/voting/voting.hbs +18 -16
  7. package/dist/views_static/components/voting/voting_result.hbs +17 -18
  8. package/dist/views_static/components/voting/voting_result_2F.hbs +1 -1
  9. package/package.json +1 -1
  10. package/src/assets/fixtures/voting/voting_email.json +4 -44
  11. package/src/stories/views/components/voting/fixtures/voting_email.json +1 -1
  12. package/src/stories/views/components/voting/voting.hbs +18 -16
  13. package/src/stories/views/components/voting/voting.stories.js +2 -2
  14. package/src/stories/views/components/voting/voting_result.hbs +17 -18
  15. package/src/stories/views/components/voting/{voting_success.stories.js → voting_result.stories.js} +8 -2
  16. package/src/stories/views/components/voting/voting_result_2F.hbs +1 -1
  17. package/dist/views/components/voting/voting_error.hbs +0 -10
  18. package/dist/views/components/voting/voting_success.hbs +0 -27
  19. package/dist/views/components/voting/voting_success_2F.hbs +0 -7
  20. package/dist/views_static/components/voting/voting_error.hbs +0 -10
  21. package/dist/views_static/components/voting/voting_success.hbs +0 -27
  22. package/dist/views_static/components/voting/voting_success_2F.hbs +0 -7
  23. package/src/stories/views/components/voting/js/voteValidatorDs.js +0 -195
  24. package/src/stories/views/components/voting/js/votingCookieCheckerDs.js +0 -31
  25. package/src/stories/views/components/voting/js/votingDs.js +0 -198
  26. package/src/stories/views/components/voting/voting_error.hbs +0 -10
  27. package/src/stories/views/components/voting/voting_error.stories.js +0 -35
  28. package/src/stories/views/components/voting/voting_success.hbs +0 -27
  29. package/src/stories/views/components/voting/voting_success_2F.hbs +0 -7
  30. package/src/stories/views/components/voting/voting_success_2F.stories.js +0 -35
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v1.114.6 (Mon Nov 11 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Dpe 1781 2 [#1154](https://github.com/mumprod/hr-design-system-handlebars/pull/1154) ([@hanswurstsalat](https://github.com/hanswurstsalat))
6
+
7
+ #### Authors: 1
8
+
9
+ - Geraldo ([@hanswurstsalat](https://github.com/hanswurstsalat))
10
+
11
+ ---
12
+
1
13
  # v1.114.5 (Fri Nov 08 2024)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -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: cnt1731098508753;
3690
+ counter-reset: cnt1731349218923;
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: cnt1731098508753 1;
4104
+ counter-increment: cnt1731349218923 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(cnt1731098508753);
4122
+ content: counter(cnt1731349218923);
4123
4123
  }
4124
4124
  /*! ****************************/
4125
4125
  /*! DataPolicy stuff */
@@ -58,30 +58,32 @@
58
58
  </div>
59
59
  <script type="text/html" class="js-successMessage">
60
60
  {{#if this.is2FSecured}}
61
- {{{include "components/voting/voting_success_2F" _isInline=true _statusDone=true _title=../this.title _topline=../this.topline}}}
61
+ {{> components/voting/voting_result_2F ../this
62
+ _isInline=true _statusDone=true
63
+ _resultBoxMessageTitle=(loca "votingform2F_title_success")
64
+ _resultBoxMessageText=(loca "votingform2F_text_success")
65
+ }}
62
66
  {{else}}
63
- {{{include "components/voting/voting_success" _isInline=true _voteResults=../this.votingResult _statusDone=true _title=../this.title _topline=../this.topline}}}
67
+ {{> components/voting/voting_result ../this
68
+ _isInline=true
69
+ _statusDone=true
70
+ _hideVotingResult=this.hideVotingResult
71
+ _resultBoxMessageTitle=(loca "votingform_title_success")
72
+ _resultBoxMessageText=../this.votingSuccessText.richtext
73
+ }}
64
74
  {{/if}}
65
75
  </script>
66
- <script type="text/html" class="js-errorMessage">
67
- {{#if this.is2FSecured}}
68
- {{{include "components/voting/voting_error" _isInline=true _statusDone=error _title=../this.title _topline=../this.topline}}}
69
- {{else}}
70
- {{{include "components/voting/voting_error" _isInline=true _statusDone=false _title=../this.title _topline=../this.topline}}}
71
- {{/if}}
76
+ <script type="text/html" class="js-errorMessage">
77
+ {{> components/voting/voting_result ../this _isInline=true _statusDone=false _hideVotingResult=true _showBackButton=true _resultBoxMessageTitle=(loca "votingform_title_error") _resultBoxMessageText=(loca "votingform_text_error")}}
72
78
  </script>
73
79
  {{#unless this.hideVotingResult}}
74
80
  <script type="text/html" class="js-result">
75
81
  {{#unless this.is2FSecured}}
76
- {{> components/voting/voting_result
77
- _resultBoxMessageText=(loca "votingform_already_voted_cookie_hint")
78
- _voteResults=../this.votingResult
79
- _isResultOnRedirectPage=_isResultOnRedirectPage
80
- _isSimpleSecured=../this.isSimpleSecured
82
+ {{> components/voting/voting_result ../this
83
+ _resultBoxMessageText=(loca "votingform_already_voted_cookie_hint")
81
84
  _statusDone=true
82
85
  _addClass=../_addClass
83
- _hideVotingResult=this.hideVotingResult
84
- _isVotingOver=this.isVotingOver
86
+ _hideVotingResult=this.hideVotingResult
85
87
  }}
86
88
  {{/unless}}
87
89
  </script>
@@ -90,7 +92,7 @@
90
92
  </div>
91
93
  </div>
92
94
  {{else}}
93
- {{> components/voting/voting_result _isVotingOver=true _title=../this.title _topline=../this.topline}}
95
+ {{> components/voting/voting_result ../this _hideVotingResult=this.hideVotingResult}}
94
96
  {{/unless}}
95
97
  {{/with}}
96
98
  {{/components/forms/components/backgroundBox }}
@@ -1,26 +1,27 @@
1
1
  <div class="{{#if this.isSimpleSecured}}js-load{{/if}}{{#if _addClass}} {{_addClass}}{{/if}}"
2
- {{#unless _isVotingOver}}
2
+ {{#unless this.form.isVotingOver}}
3
3
  {{#if this.isSimpleSecured}}
4
4
  data-hr-voting-result-cookie-ds='{"cookieLifetime":"{{this.cookieLifetime}}","votingId":"{{this.sophoraId}}"}'
5
5
  {{/if}}
6
6
  {{/unless}}
7
7
  >
8
8
 
9
- {{#unless _isResultOnRedirectPage}}
10
- {{> components/voting/components/voting_header _title=_title _topline=_topline}}
9
+ {{#unless this.hasRedirect}}
10
+ {{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
11
11
  {{/unless}}
12
12
 
13
13
  {{#if _hideVotingResult}}
14
- {{#if _isVotingOver}}
15
- <p class="mt-6 ml-8 text-base font-bold sm:ml-9 sm:text-xl font-heading sm:mt-12">{{{_resultBoxMessageText}}}</p>
14
+ {{#if this.form.isVotingOver}}
15
+ <p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12">{{loca "votingform_voting_finished"}}</p>
16
16
  {{else}}
17
17
  {{~> components/base/image/icon _icon=(if _statusDone "status-done" "status-error") _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")}}
18
18
  <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>
19
19
  {{/if}}
20
20
  {{else}}
21
- <p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12">{{{_resultBoxMessageText}}}</p>
22
21
 
23
- {{#each _voteResults}}
22
+ <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>
23
+
24
+ {{#each this.votingResult}}
24
25
  <div class="flex">
25
26
  <div class="grow">
26
27
  <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>
@@ -53,18 +54,16 @@
53
54
  {{/if}}
54
55
  {{/if}}
55
56
 
56
- {{#if _isVotingOver}}
57
- <p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12 dark:text-text-dark">{{loca "votingform_voting_finished"}}</p>
58
- {{/if}}
59
-
60
- {{#unless _isResultOnRedirectPage}}
57
+ {{#unless this.hasRedirect}}
61
58
  {{#unless this.isSimpleSecured}}
62
- {{#unless _isVotingOver}}
63
- <div class="mt-6 sm:mt-12">
64
- {{#> components/button/link_button _size="lg" _css="float-right"}}
65
- {{> components/button/components/button_label _label=(loca "votingform_form_back")}}
66
- {{/components/button/link_button}}
67
- </div>
59
+ {{#unless this.form.isVotingOver}}
60
+ {{#if _showBackButton}}
61
+ <div class="mt-6 sm:mt-12">
62
+ {{#> components/button/link_button _size="lg" _css="float-right"}}
63
+ {{> components/button/components/button_label _label=(loca "votingform_form_back")}}
64
+ {{/components/button/link_button}}
65
+ </div>
66
+ {{/if}}
68
67
  {{/unless}}
69
68
  {{/unless}}
70
69
  {{/unless}}
@@ -1,4 +1,4 @@
1
- {{> components/voting/components/voting_header _title=_title _topline=_topline}}
1
+ {{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
2
2
 
3
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
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>
@@ -58,30 +58,32 @@
58
58
  </div>
59
59
  <script type="text/html" class="js-successMessage">
60
60
  {{#if this.is2FSecured}}
61
- {{{include "components/voting/voting_success_2F" _isInline=true _statusDone=true _title=../this.title _topline=../this.topline}}}
61
+ {{> components/voting/voting_result_2F ../this
62
+ _isInline=true _statusDone=true
63
+ _resultBoxMessageTitle=(loca "votingform2F_title_success")
64
+ _resultBoxMessageText=(loca "votingform2F_text_success")
65
+ }}
62
66
  {{else}}
63
- {{{include "components/voting/voting_success" _isInline=true _voteResults=../this.votingResult _statusDone=true _title=../this.title _topline=../this.topline}}}
67
+ {{> components/voting/voting_result ../this
68
+ _isInline=true
69
+ _statusDone=true
70
+ _hideVotingResult=this.hideVotingResult
71
+ _resultBoxMessageTitle=(loca "votingform_title_success")
72
+ _resultBoxMessageText=../this.votingSuccessText.richtext
73
+ }}
64
74
  {{/if}}
65
75
  </script>
66
- <script type="text/html" class="js-errorMessage">
67
- {{#if this.is2FSecured}}
68
- {{{include "components/voting/voting_error" _isInline=true _statusDone=error _title=../this.title _topline=../this.topline}}}
69
- {{else}}
70
- {{{include "components/voting/voting_error" _isInline=true _statusDone=false _title=../this.title _topline=../this.topline}}}
71
- {{/if}}
76
+ <script type="text/html" class="js-errorMessage">
77
+ {{> components/voting/voting_result ../this _isInline=true _statusDone=false _hideVotingResult=true _showBackButton=true _resultBoxMessageTitle=(loca "votingform_title_error") _resultBoxMessageText=(loca "votingform_text_error")}}
72
78
  </script>
73
79
  {{#unless this.hideVotingResult}}
74
80
  <script type="text/html" class="js-result">
75
81
  {{#unless this.is2FSecured}}
76
- {{> components/voting/voting_result
77
- _resultBoxMessageText=(loca "votingform_already_voted_cookie_hint")
78
- _voteResults=../this.votingResult
79
- _isResultOnRedirectPage=_isResultOnRedirectPage
80
- _isSimpleSecured=../this.isSimpleSecured
82
+ {{> components/voting/voting_result ../this
83
+ _resultBoxMessageText=(loca "votingform_already_voted_cookie_hint")
81
84
  _statusDone=true
82
85
  _addClass=../_addClass
83
- _hideVotingResult=this.hideVotingResult
84
- _isVotingOver=this.isVotingOver
86
+ _hideVotingResult=this.hideVotingResult
85
87
  }}
86
88
  {{/unless}}
87
89
  </script>
@@ -90,7 +92,7 @@
90
92
  </div>
91
93
  </div>
92
94
  {{else}}
93
- {{> components/voting/voting_result _isVotingOver=true _title=../this.title _topline=../this.topline}}
95
+ {{> components/voting/voting_result ../this _hideVotingResult=this.hideVotingResult}}
94
96
  {{/unless}}
95
97
  {{/with}}
96
98
  {{/components/forms/components/backgroundBox }}
@@ -1,26 +1,27 @@
1
1
  <div class="{{#if this.isSimpleSecured}}js-load{{/if}}{{#if _addClass}} {{_addClass}}{{/if}}"
2
- {{#unless _isVotingOver}}
2
+ {{#unless this.form.isVotingOver}}
3
3
  {{#if this.isSimpleSecured}}
4
4
  data-hr-voting-result-cookie-ds='{"cookieLifetime":"{{this.cookieLifetime}}","votingId":"{{this.sophoraId}}"}'
5
5
  {{/if}}
6
6
  {{/unless}}
7
7
  >
8
8
 
9
- {{#unless _isResultOnRedirectPage}}
10
- {{> components/voting/components/voting_header _title=_title _topline=_topline}}
9
+ {{#unless this.hasRedirect}}
10
+ {{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
11
11
  {{/unless}}
12
12
 
13
13
  {{#if _hideVotingResult}}
14
- {{#if _isVotingOver}}
15
- <p class="mt-6 ml-8 text-base font-bold sm:ml-9 sm:text-xl font-heading sm:mt-12">{{{_resultBoxMessageText}}}</p>
14
+ {{#if this.form.isVotingOver}}
15
+ <p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12">{{loca "votingform_voting_finished"}}</p>
16
16
  {{else}}
17
17
  {{~> components/base/image/icon _icon=(if _statusDone "status-done" "status-error") _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")}}
18
18
  <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>
19
19
  {{/if}}
20
20
  {{else}}
21
- <p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12">{{{_resultBoxMessageText}}}</p>
22
21
 
23
- {{#each _voteResults}}
22
+ <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>
23
+
24
+ {{#each this.votingResult}}
24
25
  <div class="flex">
25
26
  <div class="grow">
26
27
  <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>
@@ -53,18 +54,16 @@
53
54
  {{/if}}
54
55
  {{/if}}
55
56
 
56
- {{#if _isVotingOver}}
57
- <p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12 dark:text-text-dark">{{loca "votingform_voting_finished"}}</p>
58
- {{/if}}
59
-
60
- {{#unless _isResultOnRedirectPage}}
57
+ {{#unless this.hasRedirect}}
61
58
  {{#unless this.isSimpleSecured}}
62
- {{#unless _isVotingOver}}
63
- <div class="mt-6 sm:mt-12">
64
- {{#> components/button/link_button _size="lg" _css="float-right"}}
65
- {{> components/button/components/button_label _label=(loca "votingform_form_back")}}
66
- {{/components/button/link_button}}
67
- </div>
59
+ {{#unless this.form.isVotingOver}}
60
+ {{#if _showBackButton}}
61
+ <div class="mt-6 sm:mt-12">
62
+ {{#> components/button/link_button _size="lg" _css="float-right"}}
63
+ {{> components/button/components/button_label _label=(loca "votingform_form_back")}}
64
+ {{/components/button/link_button}}
65
+ </div>
66
+ {{/if}}
68
67
  {{/unless}}
69
68
  {{/unless}}
70
69
  {{/unless}}
@@ -1,4 +1,4 @@
1
- {{> components/voting/components/voting_header _title=_title _topline=_topline}}
1
+ {{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
2
2
 
3
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
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>
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.5",
9
+ "version": "1.114.6",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "storybook dev -p 6006 public",
@@ -22,62 +22,22 @@
22
22
  {
23
23
  "value": "1",
24
24
  "label": "Gut, beste website ever",
25
- "title": "Voting-Answer 1",
26
- "mediaItem": {
27
- "@->jsoninclude": "teaser/teaser_images.inc.json",
28
- "@->contentpath": "copytext_image_50",
29
- "@->replaceToken": [
30
- {
31
- "@->token": "image",
32
- "@->value": "rueckkehr-nach-abschiebung-102"
33
- }
34
- ]
35
- }
25
+ "title": "Voting-Answer 1"
36
26
  },
37
27
  {
38
28
  "value": "2",
39
29
  "label": "Super, allerbeste website ever",
40
- "title": "Voting-Answer 2",
41
- "mediaItem": {
42
- "@->jsoninclude": "teaser/teaser_images.inc.json",
43
- "@->contentpath": "copytext_image_50",
44
- "@->replaceToken": [
45
- {
46
- "@->token": "image",
47
- "@->value": "buchmesse-fahnen-102"
48
- }
49
- ]
50
- }
30
+ "title": "Voting-Answer 2"
51
31
  },
52
32
  {
53
33
  "value": "3",
54
34
  "label": "Mega, allerallerbeste website ever",
55
- "title": "Voting-Answer 3",
56
- "mediaItem": {
57
- "@->jsoninclude": "teaser/teaser_images.inc.json",
58
- "@->contentpath": "copytext_image_50",
59
- "@->replaceToken": [
60
- {
61
- "@->token": "image",
62
- "@->value": "lehrerin-ukraine-104"
63
- }
64
- ]
65
- }
35
+ "title": "Voting-Answer 3"
66
36
  },
67
37
  {
68
38
  "value": "4",
69
39
  "label": "Hammer, allerallerbesteste website ever",
70
- "title": "Voting-Answer 4",
71
- "mediaItem": {
72
- "@->jsoninclude": "teaser/teaser_images.inc.json",
73
- "@->contentpath": "copytext_image_50",
74
- "@->replaceToken": [
75
- {
76
- "@->token": "image",
77
- "@->value": "connichi-106"
78
- }
79
- ]
80
- }
40
+ "title": "Voting-Answer 4"
81
41
  }
82
42
  ]
83
43
  },
@@ -1 +1 @@
1
- {"teasersize":100,"realTeasersize":100,"topline":"Voting-Topline","toplineSize":"h3","title":"Wie finden Sie hessenschau.de?","backlink":"backlink-url","uuid":"UUID","headingSize":"h2","isVoting":true,"isMultiVote":true,"hasRedirect":false,"isMultipleChoice":false,"maxAnswerCount":1,"votingSuccessText":{"richtext":"Danke für Ihre Abstimmung!"},"isSimpleSecured":false,"cookieLifetime":"12","sophoraId":"Sophora-Id","hasBarchart":true,"showAbsoluteResult":false,"showVoteResult":true,"summarizedResult":"666","votingResult":[{"label":"Gut, beste website ever","count":"27","percentageCount":"4,1","roundedPercentageCount":"4.0"},{"label":"Super, allerbeste website ever","count":"117","percentageCount":"17,6","roundedPercentageCount":"18.0"},{"label":"Mega, allerallerbeste website ever","count":"242","percentageCount":"36,3","roundedPercentageCount":"36.0"},{"label":"Hammer, allerallerbesteste website ever","count":"280","percentageCount":"42,0","roundedPercentageCount":"42.0","isWinner":true}],"form":{"shorttext":"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.","isVotingOver":false,"is2FSecured":true,"jsonUrl":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","errorMessages":"{\"form_error_required\":\"Pflichtfeld\",\"form_error_max\":\"Zu viele Zeichen\",\"form_error_validurl\":\"Ungültige URL\",\"form_error_empty\":\"Darf nicht ausgefüllt werden\",\"form_error_constants_or_null\":\"Ungültiger Wert\",\"form_error_constants\":\"Ungültiger Wert\",\"form_error_max_multivalue\":\"Die maximale Anzahl an Antwortmöglichkeiten wurde überschritten\",\"vote_error_identity_already_used\":\"Unter dieser E-Mail-Adresse wurde bereits abgestimmt. Eine weitere Abstimmung ist nicht möglich.\",\"vote_error_token_request_count_exceeded\":\"Die maximale Anzahl an Bestätigungs-E-Mails wurde bereits verschickt.\",\"form_error_email\":\"Ungültige E-Mail-Adresse\"}","isSimpleSecured":false,"url":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","isHorizontalLayout":false,"hideVotingResult":false,"sophoraId":"Sophora-Id","fields":[{"type":{"isGroup":false,"isChoice":true,"asString":"radio"},"name":"multivoting","isGrouped":true,"isRequired":false,"options":[{"value":"1","label":"Gut, beste website ever","title":"Voting-Answer 1","mediaItem":{"isImage":true,"showFullSize":{"isTrue":false},"showPortrait":{"isTrue":false},"caption":"Zum Glück ragt Hessens höchster Berg, die Wasserkuppe, gelegentlich aus der derzeitigen Nebelsuppe heraus, und so gelang mit dem Sternenteleskop ein Blick auf den magischen Rosetten-Nebel, einer Himmelsregion, in der gerade neue Sterne geboren werden. - Diese spektakuläre Momentaufnahme hat uns hessenschau.de-Nutzer Michael Keusgen zukommen lassen","copyrightWithLinks":"Karsten Hufer","imageJson":"Beispiel JSON","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"images/rueckkehr-nach-abschiebung-102_v-16to9__medium.jpg","sources":[{"sizes":"(min-width: 1024px) 960px, (min-width: 640px) calc(100vw - 4rem), 100vw","srcset":"images/rueckkehr-nach-abschiebung-102_v-16to9__small.jpg 320w, images/rueckkehr-nach-abschiebung-102_v-16to9__medium.jpg 480w, images/rueckkehr-nach-abschiebung-102_v-16to9__medium__extended.jpg 640w, images/rueckkehr-nach-abschiebung-102_v-16to9.jpg 960w, images/rueckkehr-nach-abschiebung-102_v-16to9__retina.jpg 1920w"}]}}},{"value":"2","label":"Super, allerbeste website ever","title":"Voting-Answer 2","mediaItem":{"isImage":true,"showFullSize":{"isTrue":false},"showPortrait":{"isTrue":false},"caption":"Zum Glück ragt Hessens höchster Berg, die Wasserkuppe, gelegentlich aus der derzeitigen Nebelsuppe heraus, und so gelang mit dem Sternenteleskop ein Blick auf den magischen Rosetten-Nebel, einer Himmelsregion, in der gerade neue Sterne geboren werden. - Diese spektakuläre Momentaufnahme hat uns hessenschau.de-Nutzer Michael Keusgen zukommen lassen","copyrightWithLinks":"Karsten Hufer","imageJson":"Beispiel JSON","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"images/buchmesse-fahnen-102_v-16to9__medium.jpg","sources":[{"sizes":"(min-width: 1024px) 960px, (min-width: 640px) calc(100vw - 4rem), 100vw","srcset":"images/buchmesse-fahnen-102_v-16to9__small.jpg 320w, images/buchmesse-fahnen-102_v-16to9__medium.jpg 480w, images/buchmesse-fahnen-102_v-16to9__medium__extended.jpg 640w, images/buchmesse-fahnen-102_v-16to9.jpg 960w, images/buchmesse-fahnen-102_v-16to9__retina.jpg 1920w"}]}}},{"value":"3","label":"Mega, allerallerbeste website ever","title":"Voting-Answer 3","mediaItem":{"isImage":true,"showFullSize":{"isTrue":false},"showPortrait":{"isTrue":false},"caption":"Zum Glück ragt Hessens höchster Berg, die Wasserkuppe, gelegentlich aus der derzeitigen Nebelsuppe heraus, und so gelang mit dem Sternenteleskop ein Blick auf den magischen Rosetten-Nebel, einer Himmelsregion, in der gerade neue Sterne geboren werden. - Diese spektakuläre Momentaufnahme hat uns hessenschau.de-Nutzer Michael Keusgen zukommen lassen","copyrightWithLinks":"Karsten Hufer","imageJson":"Beispiel JSON","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"images/lehrerin-ukraine-104_v-16to9__medium.jpg","sources":[{"sizes":"(min-width: 1024px) 960px, (min-width: 640px) calc(100vw - 4rem), 100vw","srcset":"images/lehrerin-ukraine-104_v-16to9__small.jpg 320w, images/lehrerin-ukraine-104_v-16to9__medium.jpg 480w, images/lehrerin-ukraine-104_v-16to9__medium__extended.jpg 640w, images/lehrerin-ukraine-104_v-16to9.jpg 960w, images/lehrerin-ukraine-104_v-16to9__retina.jpg 1920w"}]}}},{"value":"4","label":"Hammer, allerallerbesteste website ever","title":"Voting-Answer 4","mediaItem":{"isImage":true,"showFullSize":{"isTrue":false},"showPortrait":{"isTrue":false},"caption":"Zum Glück ragt Hessens höchster Berg, die Wasserkuppe, gelegentlich aus der derzeitigen Nebelsuppe heraus, und so gelang mit dem Sternenteleskop ein Blick auf den magischen Rosetten-Nebel, einer Himmelsregion, in der gerade neue Sterne geboren werden. - Diese spektakuläre Momentaufnahme hat uns hessenschau.de-Nutzer Michael Keusgen zukommen lassen","copyrightWithLinks":"Karsten Hufer","imageJson":"Beispiel JSON","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"images/connichi-106_v-16to9__medium.jpg","sources":[{"sizes":"(min-width: 1024px) 960px, (min-width: 640px) calc(100vw - 4rem), 100vw","srcset":"images/connichi-106_v-16to9__small.jpg 320w, images/connichi-106_v-16to9__medium.jpg 480w, images/connichi-106_v-16to9__medium__extended.jpg 640w, images/connichi-106_v-16to9.jpg 960w, images/connichi-106_v-16to9__retina.jpg 1920w"}]}}}]},{"type":{"isText":true,"isEmail":true,"asString":"email"},"name":"email","label":"Email","description":"","defaultValue":"","isHidden":false,"isRequired":true,"maxLength":"140"},{"isGrouped":false,"type":{"isChoice":true,"asString":"checkbox"},"name":"checkbox","label":"Ich stimme der Verarbeitung meiner E-Mail-Adresse zum Zweck der Teilnahme sowie der <a href=\"https://hr.de/datenschutz\" class=\"link whitespace-nowrap\" target=\"_blank\"><span class=\"text-link dark:text-link-dark ds-link hover:underline\">Datenschutzerklärung<svg class=\"sb-icon inline -mt-0.5 w-5 h-5 text-link dark:text-link-dark fill-current ml-1 \" viewBox=\"0 0 30.4 28.1\" preserveAspectRatio=\"xMidYMid meet\" role=\"presentation\" aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><path d=\"M21.6 14.8v4.6c0 .5-.4 1-1 1H7.3c-.5 0-1-.4-1-1l-.1-8.9c0-.5.4-1 1-1h9.6l.1-2H5.8c-.8 0-1.5.7-1.5 1.5v11.9c0 .8.7 1.5 1.5 1.5h16.4c.8 0 1.5-.7 1.5-1.5v-6.1h-2.1z\"/><path d=\"M17.7 6.3c0 .6.4 1 1 1h3.5c.2 0 .3 0 .5.1l-6.1 5.9c-.4.4-.4 1 0 1.4.4.4 1 .4 1.4 0l6-5.8c.1.2.1.4.1.6V13c0 .6.4 1 1 1h.1c.6 0 1-.4 1-1l.1-4.5c0-1.7-1.3-3-3-3l-4.5-.1c-.7-.1-1.1.4-1.1.9z\"/></svg></a> des hr zu.","isMeta":false,"description":"","isRequired":true}]}}
1
+ {"teasersize":100,"realTeasersize":100,"topline":"Voting-Topline","toplineSize":"h3","title":"Wie finden Sie hessenschau.de?","backlink":"backlink-url","uuid":"UUID","headingSize":"h2","isVoting":true,"isMultiVote":true,"hasRedirect":false,"isMultipleChoice":false,"maxAnswerCount":1,"votingSuccessText":{"richtext":"Danke für Ihre Abstimmung!"},"isSimpleSecured":false,"cookieLifetime":"12","sophoraId":"Sophora-Id","hasBarchart":true,"showAbsoluteResult":false,"showVoteResult":true,"summarizedResult":"666","votingResult":[{"label":"Gut, beste website ever","count":"27","percentageCount":"4,1","roundedPercentageCount":"4.0"},{"label":"Super, allerbeste website ever","count":"117","percentageCount":"17,6","roundedPercentageCount":"18.0"},{"label":"Mega, allerallerbeste website ever","count":"242","percentageCount":"36,3","roundedPercentageCount":"36.0"},{"label":"Hammer, allerallerbesteste website ever","count":"280","percentageCount":"42,0","roundedPercentageCount":"42.0","isWinner":true}],"form":{"shorttext":"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.","isVotingOver":false,"is2FSecured":true,"jsonUrl":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","errorMessages":"{\"form_error_required\":\"Pflichtfeld\",\"form_error_max\":\"Zu viele Zeichen\",\"form_error_validurl\":\"Ungültige URL\",\"form_error_empty\":\"Darf nicht ausgefüllt werden\",\"form_error_constants_or_null\":\"Ungültiger Wert\",\"form_error_constants\":\"Ungültiger Wert\",\"form_error_max_multivalue\":\"Die maximale Anzahl an Antwortmöglichkeiten wurde überschritten\",\"vote_error_identity_already_used\":\"Unter dieser E-Mail-Adresse wurde bereits abgestimmt. Eine weitere Abstimmung ist nicht möglich.\",\"vote_error_token_request_count_exceeded\":\"Die maximale Anzahl an Bestätigungs-E-Mails wurde bereits verschickt.\",\"form_error_email\":\"Ungültige E-Mail-Adresse\"}","isSimpleSecured":false,"url":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","isHorizontalLayout":false,"hideVotingResult":false,"sophoraId":"Sophora-Id","fields":[{"type":{"isGroup":false,"isChoice":true,"asString":"radio"},"name":"multivoting","isGrouped":true,"isRequired":false,"options":[{"value":"1","label":"Gut, beste website ever","title":"Voting-Answer 1"},{"value":"2","label":"Super, allerbeste website ever","title":"Voting-Answer 2"},{"value":"3","label":"Mega, allerallerbeste website ever","title":"Voting-Answer 3"},{"value":"4","label":"Hammer, allerallerbesteste website ever","title":"Voting-Answer 4"}]},{"type":{"isText":true,"isEmail":true,"asString":"email"},"name":"email","label":"Email","description":"","defaultValue":"","isHidden":false,"isRequired":true,"maxLength":"140"},{"isGrouped":false,"type":{"isChoice":true,"asString":"checkbox"},"name":"checkbox","label":"Ich stimme der Verarbeitung meiner E-Mail-Adresse zum Zweck der Teilnahme sowie der <a href=\"https://hr.de/datenschutz\" class=\"link whitespace-nowrap\" target=\"_blank\"><span class=\"text-link dark:text-link-dark ds-link hover:underline\">Datenschutzerklärung<svg class=\"sb-icon inline -mt-0.5 w-5 h-5 text-link dark:text-link-dark fill-current ml-1 \" viewBox=\"0 0 30.4 28.1\" preserveAspectRatio=\"xMidYMid meet\" role=\"presentation\" aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><path d=\"M21.6 14.8v4.6c0 .5-.4 1-1 1H7.3c-.5 0-1-.4-1-1l-.1-8.9c0-.5.4-1 1-1h9.6l.1-2H5.8c-.8 0-1.5.7-1.5 1.5v11.9c0 .8.7 1.5 1.5 1.5h16.4c.8 0 1.5-.7 1.5-1.5v-6.1h-2.1z\"/><path d=\"M17.7 6.3c0 .6.4 1 1 1h3.5c.2 0 .3 0 .5.1l-6.1 5.9c-.4.4-.4 1 0 1.4.4.4 1 .4 1.4 0l6-5.8c.1.2.1.4.1.6V13c0 .6.4 1 1 1h.1c.6 0 1-.4 1-1l.1-4.5c0-1.7-1.3-3-3-3l-4.5-.1c-.7-.1-1.1.4-1.1.9z\"/></svg></a> des hr zu.","isMeta":false,"description":"","isRequired":true}]}}
@@ -58,30 +58,32 @@
58
58
  </div>
59
59
  <script type="text/html" class="js-successMessage">
60
60
  {{#if this.is2FSecured}}
61
- {{{include "components/voting/voting_success_2F" _isInline=true _statusDone=true _title=../this.title _topline=../this.topline}}}
61
+ {{> components/voting/voting_result_2F ../this
62
+ _isInline=true _statusDone=true
63
+ _resultBoxMessageTitle=(loca "votingform2F_title_success")
64
+ _resultBoxMessageText=(loca "votingform2F_text_success")
65
+ }}
62
66
  {{else}}
63
- {{{include "components/voting/voting_success" _isInline=true _voteResults=../this.votingResult _statusDone=true _title=../this.title _topline=../this.topline}}}
67
+ {{> components/voting/voting_result ../this
68
+ _isInline=true
69
+ _statusDone=true
70
+ _hideVotingResult=this.hideVotingResult
71
+ _resultBoxMessageTitle=(loca "votingform_title_success")
72
+ _resultBoxMessageText=../this.votingSuccessText.richtext
73
+ }}
64
74
  {{/if}}
65
75
  </script>
66
- <script type="text/html" class="js-errorMessage">
67
- {{#if this.is2FSecured}}
68
- {{{include "components/voting/voting_error" _isInline=true _statusDone=error _title=../this.title _topline=../this.topline}}}
69
- {{else}}
70
- {{{include "components/voting/voting_error" _isInline=true _statusDone=false _title=../this.title _topline=../this.topline}}}
71
- {{/if}}
76
+ <script type="text/html" class="js-errorMessage">
77
+ {{> components/voting/voting_result ../this _isInline=true _statusDone=false _hideVotingResult=true _showBackButton=true _resultBoxMessageTitle=(loca "votingform_title_error") _resultBoxMessageText=(loca "votingform_text_error")}}
72
78
  </script>
73
79
  {{#unless this.hideVotingResult}}
74
80
  <script type="text/html" class="js-result">
75
81
  {{#unless this.is2FSecured}}
76
- {{> components/voting/voting_result
77
- _resultBoxMessageText=(loca "votingform_already_voted_cookie_hint")
78
- _voteResults=../this.votingResult
79
- _isResultOnRedirectPage=_isResultOnRedirectPage
80
- _isSimpleSecured=../this.isSimpleSecured
82
+ {{> components/voting/voting_result ../this
83
+ _resultBoxMessageText=(loca "votingform_already_voted_cookie_hint")
81
84
  _statusDone=true
82
85
  _addClass=../_addClass
83
- _hideVotingResult=this.hideVotingResult
84
- _isVotingOver=this.isVotingOver
86
+ _hideVotingResult=this.hideVotingResult
85
87
  }}
86
88
  {{/unless}}
87
89
  </script>
@@ -90,7 +92,7 @@
90
92
  </div>
91
93
  </div>
92
94
  {{else}}
93
- {{> components/voting/voting_result _isVotingOver=true _title=../this.title _topline=../this.topline}}
95
+ {{> components/voting/voting_result ../this _hideVotingResult=this.hideVotingResult}}
94
96
  {{/unless}}
95
97
  {{/with}}
96
98
  {{/components/forms/components/backgroundBox }}
@@ -58,7 +58,7 @@ export const Default = {
58
58
 
59
59
  export const Voting_Email = {
60
60
  render: Template.bind({}),
61
- name: 'Einfachauswahl mit E-Mail',
61
+ name: 'Einfachauswahl mit E-Mail und Successmeldung',
62
62
  args: votingEmailJson,
63
63
  parameters: {
64
64
  mockData: [
@@ -94,7 +94,7 @@ export const Voting_Media = {
94
94
 
95
95
  export const Voting_Multiple_Choice = {
96
96
  render: Template.bind({}),
97
- name: 'Mehrfachauswahl',
97
+ name: 'Mehrfachauswahl mit Fehlermeldung',
98
98
  args: votingMultipleChoiceJson,
99
99
  }
100
100
 
@@ -1,26 +1,27 @@
1
1
  <div class="{{#if this.isSimpleSecured}}js-load{{/if}}{{#if _addClass}} {{_addClass}}{{/if}}"
2
- {{#unless _isVotingOver}}
2
+ {{#unless this.form.isVotingOver}}
3
3
  {{#if this.isSimpleSecured}}
4
4
  data-hr-voting-result-cookie-ds='{"cookieLifetime":"{{this.cookieLifetime}}","votingId":"{{this.sophoraId}}"}'
5
5
  {{/if}}
6
6
  {{/unless}}
7
7
  >
8
8
 
9
- {{#unless _isResultOnRedirectPage}}
10
- {{> components/voting/components/voting_header _title=_title _topline=_topline}}
9
+ {{#unless this.hasRedirect}}
10
+ {{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
11
11
  {{/unless}}
12
12
 
13
13
  {{#if _hideVotingResult}}
14
- {{#if _isVotingOver}}
15
- <p class="mt-6 ml-8 text-base font-bold sm:ml-9 sm:text-xl font-heading sm:mt-12">{{{_resultBoxMessageText}}}</p>
14
+ {{#if this.form.isVotingOver}}
15
+ <p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12">{{loca "votingform_voting_finished"}}</p>
16
16
  {{else}}
17
17
  {{~> components/base/image/icon _icon=(if _statusDone "status-done" "status-error") _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")}}
18
18
  <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>
19
19
  {{/if}}
20
20
  {{else}}
21
- <p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12">{{{_resultBoxMessageText}}}</p>
22
21
 
23
- {{#each _voteResults}}
22
+ <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>
23
+
24
+ {{#each this.votingResult}}
24
25
  <div class="flex">
25
26
  <div class="grow">
26
27
  <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>
@@ -53,18 +54,16 @@
53
54
  {{/if}}
54
55
  {{/if}}
55
56
 
56
- {{#if _isVotingOver}}
57
- <p class="mt-6 text-base font-bold sm:text-xl font-heading sm:mt-12 dark:text-text-dark">{{loca "votingform_voting_finished"}}</p>
58
- {{/if}}
59
-
60
- {{#unless _isResultOnRedirectPage}}
57
+ {{#unless this.hasRedirect}}
61
58
  {{#unless this.isSimpleSecured}}
62
- {{#unless _isVotingOver}}
63
- <div class="mt-6 sm:mt-12">
64
- {{#> components/button/link_button _size="lg" _css="float-right"}}
65
- {{> components/button/components/button_label _label=(loca "votingform_form_back")}}
66
- {{/components/button/link_button}}
67
- </div>
59
+ {{#unless this.form.isVotingOver}}
60
+ {{#if _showBackButton}}
61
+ <div class="mt-6 sm:mt-12">
62
+ {{#> components/button/link_button _size="lg" _css="float-right"}}
63
+ {{> components/button/components/button_label _label=(loca "votingform_form_back")}}
64
+ {{/components/button/link_button}}
65
+ </div>
66
+ {{/if}}
68
67
  {{/unless}}
69
68
  {{/unless}}
70
69
  {{/unless}}
@@ -23,13 +23,19 @@ export default {
23
23
  const Template = (args) => {
24
24
  let hbsTemplate = handlebars.compile(`
25
25
  {{#>components/forms/components/backgroundBox }}
26
- {{> components/voting/voting_success _title=this.title _topline=this.topline _voteResults=this.votingResult}}
26
+ {{> components/voting/voting_result this
27
+ _isInline=true
28
+ _statusDone=true
29
+ _hideVotingResult=this.form.hideVotingResult
30
+ _resultBoxMessageTitle="Danke für ihre Teilnahme!"
31
+ _resultBoxMessageText=this.votingSuccessText.richtext
32
+ }}
27
33
  {{/components/forms/components/backgroundBox }}
28
34
  `)
29
35
  return hbsTemplate({ ...args })
30
36
  }
31
37
 
32
- export const Voting_Success = {
38
+ export const Voting_Result = {
33
39
  render: Template.bind({}),
34
40
  name: 'Ergebnis Barchart prozentual',
35
41
  args: votingJson,
@@ -1,4 +1,4 @@
1
- {{> components/voting/components/voting_header _title=_title _topline=_topline}}
1
+ {{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
2
2
 
3
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
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,10 +0,0 @@
1
- {{> components/voting/voting_result
2
- _title=_title
3
- _topline=_topline
4
- _resultBoxMessageTitle=(loca "votingform_title_error")
5
- _resultBoxMessageText=(loca "votingform_text_error")
6
- _locaKeyText="votingform_text_error"
7
- _isInline=_isInline
8
- _hideVotingResult=true
9
- _statusDone=false
10
- }}
@@ -1,27 +0,0 @@
1
- {{#if this.votingSuccessText}}
2
- {{> components/voting/voting_result
3
- _title=_title
4
- _topline=_topline
5
- _resultBoxMessageTitle=(loca "votingform_title_success")
6
- _resultBoxMessageText=this.votingSuccessText.richtext
7
- _isInline=_isInline
8
- _voteResults=_voteResults
9
- _isResultOnRedirectPage=_isResultOnRedirectPage
10
- _hideVotingResult=this.hideVotingResult
11
- _statusDone=_statusDone
12
-
13
- }}
14
- {{else}}
15
- {{> components/voting/voting_result
16
- _title=_title
17
- _topline=_topline
18
- _resultBoxMessageTitle=(loca "votingform_title_success")
19
- _resultBoxMessageText=(loca "votingform_text_success")
20
- _isInline=_isInline
21
- _voteResults=_voteResults
22
- _isResultOnRedirectPage=_isResultOnRedirectPage
23
- _hideVotingResult=this.hideVotingResult
24
- _statusDone=_statusDone
25
- }}
26
- {{/if}}
27
-
@@ -1,7 +0,0 @@
1
- {{> components/voting/voting_result_2F
2
- _title=_title
3
- _topline=_topline
4
- _resultBoxMessageTitle=(loca "votingform2F_title_success")
5
- _resultBoxMessageText=(loca "votingform2F_text_success")
6
- _isInline=_isInline
7
- }}
@@ -1,10 +0,0 @@
1
- {{> components/voting/voting_result
2
- _title=_title
3
- _topline=_topline
4
- _resultBoxMessageTitle=(loca "votingform_title_error")
5
- _resultBoxMessageText=(loca "votingform_text_error")
6
- _locaKeyText="votingform_text_error"
7
- _isInline=_isInline
8
- _hideVotingResult=true
9
- _statusDone=false
10
- }}
@@ -1,27 +0,0 @@
1
- {{#if this.votingSuccessText}}
2
- {{> components/voting/voting_result
3
- _title=_title
4
- _topline=_topline
5
- _resultBoxMessageTitle=(loca "votingform_title_success")
6
- _resultBoxMessageText=this.votingSuccessText.richtext
7
- _isInline=_isInline
8
- _voteResults=_voteResults
9
- _isResultOnRedirectPage=_isResultOnRedirectPage
10
- _hideVotingResult=this.hideVotingResult
11
- _statusDone=_statusDone
12
-
13
- }}
14
- {{else}}
15
- {{> components/voting/voting_result
16
- _title=_title
17
- _topline=_topline
18
- _resultBoxMessageTitle=(loca "votingform_title_success")
19
- _resultBoxMessageText=(loca "votingform_text_success")
20
- _isInline=_isInline
21
- _voteResults=_voteResults
22
- _isResultOnRedirectPage=_isResultOnRedirectPage
23
- _hideVotingResult=this.hideVotingResult
24
- _statusDone=_statusDone
25
- }}
26
- {{/if}}
27
-
@@ -1,7 +0,0 @@
1
- {{> components/voting/voting_result_2F
2
- _title=_title
3
- _topline=_topline
4
- _resultBoxMessageTitle=(loca "votingform2F_title_success")
5
- _resultBoxMessageText=(loca "votingform2F_text_success")
6
- _isInline=_isInline
7
- }}
@@ -1,195 +0,0 @@
1
- var VoteValidator =
2
- VoteValidator ||
3
- function (options) {
4
- 'use strict'
5
-
6
- // Production steps of ECMA-262, Edition 6, 22.1.2.1
7
- if (!Array.from) {
8
- Array.from = (function () {
9
- var toStr = Object.prototype.toString
10
- var isCallable = function (fn) {
11
- return typeof fn === 'function' || toStr.call(fn) === '[object Function]'
12
- }
13
- var toInteger = function (value) {
14
- var number = Number(value)
15
- if (isNaN(number)) {
16
- return 0
17
- }
18
- if (number === 0 || !isFinite(number)) {
19
- return number
20
- }
21
- return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number))
22
- }
23
- var maxSafeInteger = Math.pow(2, 53) - 1
24
- var toLength = function (value) {
25
- var len = toInteger(value)
26
- return Math.min(Math.max(len, 0), maxSafeInteger)
27
- }
28
-
29
- // The length property of the from method is 1.
30
- return function from(arrayLike /*, mapFn, thisArg */) {
31
- // 1. Let C be the this value.
32
- var C = this
33
-
34
- // 2. Let items be ToObject(arrayLike).
35
- var items = Object(arrayLike)
36
-
37
- // 3. ReturnIfAbrupt(items).
38
- if (arrayLike == null) {
39
- throw new TypeError(
40
- 'Array.from requires an array-like object - not null or undefined'
41
- )
42
- }
43
-
44
- // 4. If mapfn is undefined, then let mapping be false.
45
- var mapFn = arguments.length > 1 ? arguments[1] : void undefined
46
- var T
47
- if (typeof mapFn !== 'undefined') {
48
- // 5. else
49
- // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
50
- if (!isCallable(mapFn)) {
51
- throw new TypeError(
52
- 'Array.from: when provided, the second argument must be a function'
53
- )
54
- }
55
-
56
- // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
57
- if (arguments.length > 2) {
58
- T = arguments[2]
59
- }
60
- }
61
-
62
- // 10. Let lenValue be Get(items, "length").
63
- // 11. Let len be ToLength(lenValue).
64
- var len = toLength(items.length)
65
-
66
- // 13. If IsConstructor(C) is true, then
67
- // 13. a. Let A be the result of calling the [[Construct]] internal method
68
- // of C with an argument list containing the single item len.
69
- // 14. a. Else, Let A be ArrayCreate(len).
70
- var A = isCallable(C) ? Object(new C(len)) : new Array(len)
71
-
72
- // 16. Let k be 0.
73
- var k = 0
74
- // 17. Repeat, while k < len… (also steps a - h)
75
- var kValue
76
- while (k < len) {
77
- kValue = items[k]
78
- if (mapFn) {
79
- A[k] =
80
- typeof T === 'undefined'
81
- ? mapFn(kValue, k)
82
- : mapFn.call(T, kValue, k)
83
- } else {
84
- A[k] = kValue
85
- }
86
- k += 1
87
- }
88
- // 18. Let putStatus be Put(A, "length", len, true).
89
- A.length = len
90
- // 20. Return A.
91
- return A
92
- }
93
- })()
94
- }
95
-
96
- var element = hr$(options.selector)[0],
97
- settings = options.data ? JSON.parse(options.data) : {},
98
- minAnswerCount = settings.minAnswerCount,
99
- maxAnswerCount = settings.maxAnswerCount,
100
- isMultipleChoice = settings.isMultipleChoice || false,
101
- selectedCheckboxes = 0,
102
- votingOptions = Array.from(hr$('input[name=multivoting]', element)),
103
- counter = hr$('.js-voting-counter', element),
104
- submit = hr$('input[type=submit]', element)[0],
105
- submitLabel = hr$('.js-voting-submit-button', element)[0],
106
- countSelectedCheckboxes = function (event) {
107
- console.log(submitLabel)
108
- if (countCheckedCheckboxes() != 0) {
109
- submit.disabled = false
110
- submitLabel.classList.remove('-inactive')
111
- } else {
112
- submit.disabled = true
113
- submitLabel.classList.add('-inactive')
114
- }
115
-
116
- if (selectedCheckboxes < maxAnswerCount) {
117
- countSelectedCheckBoxesIfMaxHasNotReached(event)
118
-
119
- if (selectedCheckboxes == maxAnswerCount) {
120
- disableCheckboxesIfMaxHasReached()
121
- }
122
- } else {
123
- enableCheckboxesIfMaxHasUndershot()
124
- }
125
- },
126
- isUnchecked = function (checkbox) {
127
- return checkbox.checked == false
128
- },
129
- isDisabled = function (checkbox) {
130
- return checkbox.disabled == true
131
- },
132
- isChecked = function (checkbox) {
133
- return checkbox.checked == true
134
- }
135
-
136
- function countCheckedCheckboxes() {
137
- var checkedOptions = votingOptions.filter(isChecked)
138
- return checkedOptions.length
139
- }
140
-
141
- function countSelectedCheckBoxesIfMaxHasNotReached(event) {
142
- if (event.target.checked == false) {
143
- selectedCheckboxes = selectedCheckboxes - 1
144
- counter.innerHTML = selectedCheckboxes + '/' + maxAnswerCount
145
- } else {
146
- selectedCheckboxes = selectedCheckboxes + 1
147
- counter.innerHTML = selectedCheckboxes + '/' + maxAnswerCount
148
- }
149
- }
150
-
151
- function disableCheckboxesIfMaxHasReached() {
152
- var uncheckedOptions = votingOptions.filter(isUnchecked)
153
- uncheckedOptions.map(function (uncheckedOptions) {
154
- uncheckedOptions.disabled = true
155
- var label = hr$('label[for=' + uncheckedOptions.id + ']')
156
- label = label.item(0)
157
- label.classList.add('-inactive')
158
- })
159
- }
160
-
161
- function enableCheckboxesIfMaxHasUndershot() {
162
- selectedCheckboxes = selectedCheckboxes - 1
163
- counter.innerHTML = selectedCheckboxes + '/' + maxAnswerCount
164
- var disabledCheckboxes = votingOptions.filter(isDisabled)
165
- disabledCheckboxes.map(function (disabledCheckboxes) {
166
- disabledCheckboxes.disabled = false
167
- var label = hr$('label[for=' + disabledCheckboxes.id + ']')
168
- label = label.item(0)
169
- label.classList.remove('-inactive')
170
- })
171
- }
172
-
173
- function initVotingValidation() {
174
- if (isMultipleChoice) {
175
- counter = counter.item(0)
176
- submit.disabled = true
177
-
178
- // Uncheck all checkboxes if User was faster than JS loading
179
- for (var i = 0; i < votingOptions.length; i++) {
180
- votingOptions[i].checked = false
181
- }
182
-
183
- for (var i = 0; i < votingOptions.length; i++) {
184
- votingOptions[i].disabled = false
185
- hr$.listen('click', countSelectedCheckboxes, votingOptions[i])
186
- }
187
- }
188
- }
189
-
190
- initVotingValidation()
191
- }
192
-
193
- hrScriptLoad.load('voteValidator', ['hrQueryOld'], function (options) {
194
- new VoteValidator(options)
195
- })
@@ -1,31 +0,0 @@
1
- var VotingCookieChecker =
2
- VotingCookieChecker ||
3
- function (options) {
4
- 'use strict'
5
-
6
- var settings = JSON.parse(options.data),
7
- element = hr$(options.selector)[0],
8
- votingId = settings.votingId,
9
- cookie = '',
10
- votingWrapper = hr$('.js-voting-wrapper', element)[0],
11
- hideVotingResult = settings.hideVotingResult,
12
- alreadyVotedTmpl = '<p>' + settings.alreadyVotedHintText + '<p>',
13
- checkForVotingCookie = function () {
14
- cookie = hr$.getJSONCookie(votingId)
15
- if (cookie) {
16
- var voting = hr$('#' + votingId)[0]
17
- var votingText = voting.querySelector('.c-voting-form__bottomWrapper')
18
- hideVotingResult
19
- ? hr$.replaceAnimated(votingText, alreadyVotedTmpl, true)
20
- : hr$.replaceAnimated(
21
- votingWrapper,
22
- hr$('.js-result', element)[0].innerHTML,
23
- true
24
- )
25
- }
26
- }
27
- checkForVotingCookie()
28
- }
29
- hrScriptLoad.load('votingCookieChecker', ['hrQueryOld'], function (options) {
30
- new VotingCookieChecker(options)
31
- })
@@ -1,198 +0,0 @@
1
- var Voting =
2
- Voting ||
3
- function (options) {
4
- 'use strict'
5
-
6
- var element = hr$(options.selector)[0],
7
- settings = options.data ? JSON.parse(options.data) : {},
8
- jsonURL = settings.jsonURL,
9
- votingWrapper = hr$('.js-voting-wrapper', element)[0],
10
- votingTmpl = votingWrapper.innerHTML,
11
- votingForm = hr$('.js-votingForm', element)[0],
12
- actionUrl = votingForm && votingForm.getAttribute('action'),
13
- ajaxOptions,
14
- ajaxTimeout = 60 * 1000,
15
- responseFormatParam = 'rf=inline',
16
- isPosting = false,
17
- preloadIcon,
18
- loadingIcon,
19
- validationErrors,
20
- responseStatus,
21
- checkForJsonURL = function () {
22
- if (jsonURL) {
23
- actionUrl = jsonURL
24
- }
25
- },
26
- handleSubmit = function (event) {
27
- event.preventDefault()
28
-
29
- if (isPosting) {
30
- return
31
- } else {
32
- isPosting = true
33
- }
34
-
35
- //jedes mal neu holen,
36
- //da das DOM mit innerHTML ersetzt wird
37
- votingForm = hr$('.js-votingForm', element)[0]
38
-
39
- // preloadIcon = hr$('.js-preloadIcon', formWrapper)[0];
40
- // loadingIcon = hr$('.js-loadingIcon', formWrapper)[0];
41
- //
42
- // preloadIcon.classList.add('-isHidden');
43
- // loadingIcon.classList.remove('-isHidden');
44
-
45
- console.log('DATA: ' + $(votingForm).serialize())
46
- ajaxOptions = {}
47
- ajaxOptions.timeout = ajaxTimeout
48
-
49
- ajaxOptions.type = 'POST'
50
- ajaxOptions.url = actionUrl + '?' + responseFormatParam
51
- ajaxOptions.data = $(votingForm).serialize()
52
- ajaxOptions.contentType = 'application/x-www-form-urlencoded; charset=UTF-8'
53
- ajaxOptions.dataType = ''
54
-
55
- $.ajax(ajaxOptions)
56
-
57
- //Add handlers to be called when the Deferred object is resolved.
58
- .done(function (data, status, xhr) {
59
- console.log('Done')
60
- console.log(data)
61
-
62
- if (settings.jsonURL) {
63
- responseStatus = JSON.parse(data).status
64
- switch (responseStatus) {
65
- case 'VALIDATION_ERROR':
66
- console.log('Validation Error')
67
- validationErrors = JSON.parse(data).errors
68
- handleValidationErrors(validationErrors)
69
- break
70
- case 'SERVER_ERROR':
71
- hr$.replaceAnimated(
72
- votingWrapper,
73
- hr$('.js-errorMessage', element)[0].innerHTML,
74
- true,
75
- scrollIntoVoting()
76
- )
77
- break
78
- case 'OK':
79
- hr$.replaceAnimated(
80
- votingWrapper,
81
- hr$('.js-successMessage', element)[0].innerHTML,
82
- true,
83
- scrollIntoVoting()
84
- )
85
- break
86
- default:
87
- hr$.replaceAnimated(
88
- votingWrapper,
89
- hr$('.js-errorMessage', element)[0].innerHTML,
90
- true,
91
- scrollIntoVoting()
92
- )
93
- break
94
- }
95
- } else {
96
- hr$.replaceAnimated(formWrapper, data, true)
97
- scrollIntoVoting()
98
- }
99
- })
100
-
101
- //Add handlers to be called when the Deferred object is rejected.
102
- .fail(function (xhr, errorType, error) {
103
- //anzeige irgendetwas hat nicht geklappt
104
- console.log('Fail ' + errorType)
105
- hr$.replaceAnimated(
106
- votingWrapper,
107
- hr$('.js-errorMessage', element)[0].innerHTML,
108
- true,
109
- setTimeout(function () {
110
- scrollIntoVoting()
111
- }, 850)
112
- )
113
- })
114
-
115
- //Add handlers to be called when the Deferred object is either resolved or rejected.
116
- .always(function () {
117
- //aufräumen wenn bedarf besteht.
118
- console.log('Always')
119
-
120
- isPosting = false
121
- })
122
- },
123
- scrollIntoVoting = function (vertical) {
124
- setTimeout(function () {
125
- element.scrollIntoView({
126
- behavior: 'smooth',
127
- block: 'center',
128
- })
129
- }, 850)
130
- },
131
- handleFormReload = function (event) {
132
- event.preventDefault()
133
- hr$.replaceAnimated(votingWrapper, votingTmpl, false, reinitiateVotingForm)
134
- scrollIntoVoting()
135
- //hr$.ux('forms', 'formReload');
136
- },
137
- setValidationErrors = function (errors) {
138
- var wrapperElement, errorElement, prop, InvalidFields
139
-
140
- for (prop in errors) {
141
- wrapperElement = element.getElementsByClassName('js-wrapper-' + prop)[0]
142
- errorElement = document.createElement('p')
143
-
144
- InvalidFields = document.getElementsByName(prop)
145
- for (var i = 0; i < InvalidFields.length; i++) {
146
- if (wrapperElement.contains(InvalidFields[i])) {
147
- InvalidFields[i].classList.add('is-invalid')
148
- }
149
- }
150
-
151
- errorElement.innerHTML = settings.errorMessages[errors[prop]]
152
- errorElement.classList.add('c-form__errorMessage')
153
-
154
- wrapperElement.insertBefore(errorElement, wrapperElement.firstChild)
155
- }
156
- },
157
- resetValidationErrors = function () {
158
- var oldInvalidFields = hr$('.is-invalid', element),
159
- oldErrorMessages = hr$('.c-form__errorMessage', element)
160
-
161
- for (var i = 0; i < oldInvalidFields.length; i++) {
162
- oldInvalidFields[i].classList.remove('is-invalid')
163
- oldErrorMessages[i].parentNode.removeChild(oldErrorMessages[i])
164
- }
165
- },
166
- handleValidationErrors = function (errors) {
167
- resetValidationErrors()
168
- setValidationErrors(errors)
169
- },
170
- isFormAvailable = function () {
171
- return !!votingForm
172
- },
173
- reinitiateVotingForm = function () {
174
- hrScriptLoad.rescanForModulesAndVariants(element.parentElement)
175
- }
176
-
177
- if (!isFormAvailable()) {
178
- //skip code execution
179
- return
180
- }
181
-
182
- //init
183
- votingWrapper.style.WebkitTransition = 'opacity 0.8s ease-in-out'
184
- votingWrapper.style.MozTransition = 'opacity 0.8s ease-in-out'
185
- votingWrapper.style.transition = 'opacity 0.8s ease-in-out'
186
-
187
- checkForJsonURL()
188
-
189
- $(element).on('submit', '.js-votingForm', handleSubmit)
190
- $(element).on('click', '.js-formReload', handleFormReload)
191
- $(element).on('keydown', '.js-form-email', function (e) {
192
- e.stopPropagation()
193
- })
194
- }
195
-
196
- hrScriptLoad.load('voting', ['hrQueryOld', 'zepto'], function (options) {
197
- new Voting(options)
198
- })
@@ -1,10 +0,0 @@
1
- {{> components/voting/voting_result
2
- _title=_title
3
- _topline=_topline
4
- _resultBoxMessageTitle=(loca "votingform_title_error")
5
- _resultBoxMessageText=(loca "votingform_text_error")
6
- _locaKeyText="votingform_text_error"
7
- _isInline=_isInline
8
- _hideVotingResult=true
9
- _statusDone=false
10
- }}
@@ -1,35 +0,0 @@
1
- import votingErrorJson from './fixtures/voting_error.json'
2
-
3
- const handlebars = require('hrHandlebars')
4
-
5
- export default {
6
- title: 'Komponenten/Voting',
7
- decorators: [
8
- (Story) => {
9
- return `<div class="grid grid-page">
10
- <div class="grid bg-white grid-article">
11
- ${Story()}
12
- </div>
13
- </div>`
14
- },
15
- ],
16
- parameters: {
17
- layout: 'fullscreen',
18
- chromatic: { disableSnapshot: true }
19
- }
20
- }
21
-
22
- const Template = (args) => {
23
- let hbsTemplate = handlebars.compile(`
24
- {{#>components/forms/components/backgroundBox }}
25
- {{> components/voting/voting_error _title=this.title _topline=this.topline}}
26
- {{/components/forms/components/backgroundBox }}
27
- `)
28
- return hbsTemplate({ ...args })
29
- }
30
-
31
- export const Voting_Error = {
32
- render: Template.bind({}),
33
- name: 'Fehlermeldung',
34
- args: votingErrorJson,
35
- }
@@ -1,27 +0,0 @@
1
- {{#if this.votingSuccessText}}
2
- {{> components/voting/voting_result
3
- _title=_title
4
- _topline=_topline
5
- _resultBoxMessageTitle=(loca "votingform_title_success")
6
- _resultBoxMessageText=this.votingSuccessText.richtext
7
- _isInline=_isInline
8
- _voteResults=_voteResults
9
- _isResultOnRedirectPage=_isResultOnRedirectPage
10
- _hideVotingResult=this.hideVotingResult
11
- _statusDone=_statusDone
12
-
13
- }}
14
- {{else}}
15
- {{> components/voting/voting_result
16
- _title=_title
17
- _topline=_topline
18
- _resultBoxMessageTitle=(loca "votingform_title_success")
19
- _resultBoxMessageText=(loca "votingform_text_success")
20
- _isInline=_isInline
21
- _voteResults=_voteResults
22
- _isResultOnRedirectPage=_isResultOnRedirectPage
23
- _hideVotingResult=this.hideVotingResult
24
- _statusDone=_statusDone
25
- }}
26
- {{/if}}
27
-
@@ -1,7 +0,0 @@
1
- {{> components/voting/voting_result_2F
2
- _title=_title
3
- _topline=_topline
4
- _resultBoxMessageTitle=(loca "votingform2F_title_success")
5
- _resultBoxMessageText=(loca "votingform2F_text_success")
6
- _isInline=_isInline
7
- }}
@@ -1,35 +0,0 @@
1
- import votingJson from './fixtures/voting.json'
2
-
3
- const handlebars = require('hrHandlebars')
4
-
5
- export default {
6
- title: 'Komponenten/Voting',
7
- decorators: [
8
- (Story) => {
9
- return `<div class="grid grid-page">
10
- <div class="grid bg-white grid-article">
11
- ${Story()}
12
- </div>
13
- </div>`
14
- },
15
- ],
16
- parameters: {
17
- layout: 'fullscreen',
18
- chromatic: { disableSnapshot: true }
19
- }
20
- }
21
-
22
- const Template = (args) => {
23
- let hbsTemplate = handlebars.compile(`
24
- {{#>components/forms/components/backgroundBox }}
25
- {{> components/voting/voting_success_2F _title=this.title _topline=this.topline}}
26
- {{/components/forms/components/backgroundBox }}
27
- `)
28
- return hbsTemplate({ ...args })
29
- }
30
-
31
- export const Voting_Success_2F = {
32
- render: Template.bind({}),
33
- name: 'Successmeldung',
34
- args: votingJson,
35
- }