Skip to content

Commit

Permalink
Merge pull request #40 from m-vo/feature/misc
Browse files Browse the repository at this point in the history
Small tweaks (1)
  • Loading branch information
m-vo authored Mar 9, 2021
2 parents 75153f4 + 2764e59 commit 7bddc3e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Resources/translations/MvoContaoSurveyBundle.de.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
form:
button:
clear_current: ''
clear_current_title: 'Diesen Schritt zurücksetzen'
clear_current_title: 'Diese Frage zurücksetzen'
next: 'Weiter'
previous: 'Zurück'
submit: 'Absenden'
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/translations/MvoContaoSurveyBundle.en.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
form:
button:
clear_current: ''
clear_current_title: 'Reset this step'
clear_current_title: 'Reset this question'
next: 'Next'
previous: 'Previous'
submit: 'Submit'
Expand Down
25 changes: 14 additions & 11 deletions src/Resources/views/Form/Matrix.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
{% extends '@MvoContaoSurvey/Form/Question.html.twig' %}

{% block form_row %}
<div class="{% block answer_classes %}survey_answer survey_answer--matrix{% endblock %}" x-data>
<table>
<div class="{% block answer_classes %}survey_answer survey_answer--matrix{% endblock %}"
x-data x-init="checkSize=()=>{$refs.scroll.classList.toggle('hidden',$el.scrollWidth<=$el.clientWidth)}; (new ResizeObserver(checkSize)).observe($el); checkSize()">
<table class="hyphenate">
<thead>
<tr>
<td><span class="note_scroll hidden">{{ 'element.scroll_note'|trans() }}</span></td>
{% for option in form.vars.matrix_columns %}
<td class="option" data-option="{{ loop.index0 }}"
@click="$el.querySelectorAll('[data-option=\'{{ loop.index0 }}\'] input').forEach(i => {i.checked = true})">
{{ option|raw }}
</td>
{% endfor %}
</tr>
<tr>
<td>
<div class="note_scroll hidden text-sm italic text-gray-500" x-ref="scroll">{{ 'element.scroll_note'|trans() }}</div>
</td>
{% for option in form.vars.matrix_columns %}
<td class="option" data-option="{{ loop.index0 }}"
@click="$el.querySelectorAll('[data-option=\'{{ loop.index0 }}\'] input').forEach(i => {i.checked = true})">
{{ option|raw }}
</td>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in form.children %}
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/Form/Select.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% else %}
{% set placeholder = 'element.user_option_placeholder'|trans() %}
{% set user_option_labels = form.vars.data.question.userOptionLabels %}
<div class="inline-flex flex-row user_option{% if form.user_option.vars.errors|length > 0 %} error{% endif %}"
<div class="inline-flex flex-row items-baseline user_option{% if form.user_option.vars.errors|length > 0 %} error{% endif %}"
@click="$refs.s_{{ loop.index0 }}.querySelector('input').checked=true">
{% if user_option_labels[0] -%}
<span class="mr-2 user_option--prefix">{{ user_option_labels[0] }}</span>
Expand Down

0 comments on commit 7bddc3e

Please sign in to comment.