visibilty as a view property + missing translations
This commit is contained in:
parent
a4eb466099
commit
533f70b5ee
4 changed files with 49 additions and 31 deletions
|
@ -216,7 +216,7 @@ export default Ember.ObjectController.extend(Ember.Validations.Mixin, {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* have to manually rerun validation when encryption key is present in model
|
* have to manually rerun validation when encryption key is present in model
|
||||||
* otherwise ember-validation is not using correct values for properties in
|
* otherwise ember-validation is not using correct values for properties in
|
||||||
|
|
|
@ -54,6 +54,7 @@ export default {
|
||||||
"index.hoster.text": "You don't have to trust our server. You could easily host croodle yourself. All you need is a web space with PHP and SSL encryption enabled. You find the source code and installation instructions on <a href=\"https://github.com/jelhan/croodle\">GitHub</a>.",
|
"index.hoster.text": "You don't have to trust our server. You could easily host croodle yourself. All you need is a web space with PHP and SSL encryption enabled. You find the source code and installation instructions on <a href=\"https://github.com/jelhan/croodle\">GitHub</a>.",
|
||||||
"poll.created-time": "created on {{creationDate}}",
|
"poll.created-time": "created on {{creationDate}}",
|
||||||
"poll.evaluation.label": "Evaluation",
|
"poll.evaluation.label": "Evaluation",
|
||||||
|
"poll.input.newUserName.placeholder": "Enter your name...",
|
||||||
"poll.save": "save",
|
"poll.save": "save",
|
||||||
"poll.share": "Share the link and invite other people to participate in your poll.",
|
"poll.share": "Share the link and invite other people to participate in your poll.",
|
||||||
"poll.share.notice": "Everyone who knows the link could read the data. If your poll consists private data you may only share the link via encrypted channels like PGP encrypted email or instant messaging with OTR."
|
"poll.share.notice": "Everyone who knows the link could read the data. If your poll consists private data you may only share the link via encrypted channels like PGP encrypted email or instant messaging with OTR."
|
||||||
|
@ -113,6 +114,7 @@ export default {
|
||||||
"index.hoster.text": "Du musst uns nicht vertrauen. Du kannst Croodle einfach auf deinem eigenen Server installieren. Ein Server mit einigen Megabyte Speicherplatz, PHP und SSL-Verschlüsselung ist ausreichend. Den Programmcode und Installationsanweisungen findest du auf <a href=\"https://github.com/jelhan/croodle\">GitHub</a>.",
|
"index.hoster.text": "Du musst uns nicht vertrauen. Du kannst Croodle einfach auf deinem eigenen Server installieren. Ein Server mit einigen Megabyte Speicherplatz, PHP und SSL-Verschlüsselung ist ausreichend. Den Programmcode und Installationsanweisungen findest du auf <a href=\"https://github.com/jelhan/croodle\">GitHub</a>.",
|
||||||
"poll.created-time": "Erstellt am {{creationDate}}.",
|
"poll.created-time": "Erstellt am {{creationDate}}.",
|
||||||
"poll.evaluation.label": "Auswertung",
|
"poll.evaluation.label": "Auswertung",
|
||||||
|
"poll.input.newUserName.placeholder": "de: Enter your name...",
|
||||||
"poll.save": "speichern",
|
"poll.save": "speichern",
|
||||||
"poll.share": "Gib den Link weiter und lade so Andere zu deiner Umfrage ein.",
|
"poll.share": "Gib den Link weiter und lade so Andere zu deiner Umfrage ein.",
|
||||||
"poll.share.notice": "Jeder, der den Link kennt, kann die Daten deiner Umfrage lesen. Falls deine Umfrage private Daten enthält, überlege dir, ob du ihn nur per verschlüsselter Mail oder Chat mit End-to-End-Verschlüsselung weitergeben möchtest."
|
"poll.share.notice": "Jeder, der den Link kennt, kann die Daten deiner Umfrage lesen. Falls deine Umfrage private Daten enthält, überlege dir, ob du ihn nur per verschlüsselter Mail oder Chat mit End-to-End-Verschlüsselung weitergeben möchtest."
|
||||||
|
|
|
@ -45,19 +45,16 @@
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class='newUser'>
|
<tr class='newUser'>
|
||||||
{{! ToDo:
|
|
||||||
should be all together in just one form;
|
|
||||||
not in several forms for each input.
|
|
||||||
This work-around is due to a problem of
|
|
||||||
ember-forms in dealing with propertys of
|
|
||||||
handlebar each helper
|
|
||||||
}}
|
|
||||||
<td>
|
<td>
|
||||||
{{#form-for controller}}
|
{{#form-for controller}}
|
||||||
{{input newUserName
|
{{#input newUserName}}
|
||||||
label=" "
|
{{input-field newUserName
|
||||||
placeholder="Enter your name..."
|
placeholderTranslation="poll.input.newUserName.placeholder"
|
||||||
}}
|
}}
|
||||||
|
{{#if view.showError}}
|
||||||
|
{{error-field newUserName}}
|
||||||
|
{{/if}}
|
||||||
|
{{/input}}
|
||||||
{{/form-for}}
|
{{/form-for}}
|
||||||
</td>
|
</td>
|
||||||
{{#each newUserSelection in controller.newUserSelections}}
|
{{#each newUserSelection in controller.newUserSelections}}
|
||||||
|
@ -112,25 +109,27 @@
|
||||||
{{#unless isFreeText}}
|
{{#unless isFreeText}}
|
||||||
<tr class='evaluation evaluation-header'>
|
<tr class='evaluation evaluation-header'>
|
||||||
<td {{bind-attr colspan=fullRowColspan}}>
|
<td {{bind-attr colspan=fullRowColspan}}>
|
||||||
{{t "poll.evaluation.label"}}
|
{{t "poll.evaluation.label"}} <button {{action "switchEvaluationVisibility" target="view"}} class="btn btn-default"> {{view.showEvaluationLabel}} </button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{{#each answer in evaluation}}
|
{{#if view.showEvaluation}}
|
||||||
<tr class='evaluation'>
|
{{#each answer in evaluation}}
|
||||||
<td>
|
<tr class='evaluation'>
|
||||||
{{answer.label}}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
{{#each option in answer.options}}
|
|
||||||
<td>
|
<td>
|
||||||
{{option}}
|
{{answer.label}}
|
||||||
</td>
|
</td>
|
||||||
{{/each}}
|
|
||||||
|
|
||||||
<td> </td>
|
{{#each option in answer.options}}
|
||||||
</tr>
|
<td>
|
||||||
{{/each}}
|
{{option}}
|
||||||
|
</td>
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
<td> </td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
{{/if}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -1,13 +1,30 @@
|
||||||
export default Ember.View.extend({
|
export default Ember.View.extend({
|
||||||
|
showEvaluation: false,
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
switchEvaluationVisibility: function() {
|
||||||
|
if (this.get('showEvaluation') === true) {
|
||||||
|
this.set('showEvaluation', false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.set('showEvaluation', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
didInsertElement : function(){
|
didInsertElement : function(){
|
||||||
this._super();
|
this._super();
|
||||||
Ember.run.scheduleOnce('afterRender', this, function(){
|
Ember.run.scheduleOnce('afterRender', this, function(){
|
||||||
$('.user-selections-table').floatThead({});
|
$('.user-selections-table').floatThead({});
|
||||||
});
|
});
|
||||||
|
},
|
||||||
$('.evaluation:not(.evaluation-header)').toggle();
|
|
||||||
$('.evaluation-header').click(function(){
|
showEvaluationLabel: function() {
|
||||||
$('.evaluation:not(.evaluation-header)').toggle();
|
if (this.get('showEvaluation')) {
|
||||||
});
|
return "hide";
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return "show";
|
||||||
|
}
|
||||||
|
}.property('showEvaluation')
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue