<commit_before>{% extends 'AppBundle:Layouts:application_new.html.twig'%}

{% import 'AppBundle:Macros:macros.html.twig' as macros %}

{% set translationDomain = "report-visits-care" %}
{% trans_default_domain translationDomain %}

{% block htmlTitle %}{{ 'stepPage.htmlTitle' | trans }}{% endblock %}
{% block pageTitle %}{{ 'stepPage.pageSectionTitle' | trans }}{% endblock %}
{% block pageTitleClass %}heading-large{% endblock %}

{% block linkBack %}
    {{ macros.linkBackStep(backLink, 'stepPage.backLink' | trans) }}
{% endblock %}

{% block pageContent %}

    {{ form_start(form, {attr: {novalidate: 'novalidate' }}) }}

    {% if step == 1 %}
        <div class="form-section push--bottom">

            <div id="form-group-visits_care_doYouLiveWithClient" class="form-group form-group__checkbox-group   flush--bottom">
                <fieldset class="inline">
                    <legend class="form-label-bold">Do you live with Libby?</legend>
                    <p class="form-hint text"></p>
                    <label class="block-label selection-button-radio" for="visits_care_doYouLiveWithClient_2">
                        <input type="radio" id="visits_care_doYouLiveWithClient_2" name="visits_care[doYouLiveWithClient]" required="required" class="" value="yes">Yes
                    </label>
                    <label class="block-label selection-button-radio" for="visits_care_doYouLiveWithClient_3" data-target="extra">
                        <input type="radio" id="visits_care_doYouLiveWithClient_3" name="visits_care[doYouLiveWithClient]" required="required" class="" value="no">No
                    </label>
                    <div class="panel panel-border-narrow js-hidden" id="extra">
                        {{ form_input(form.howOftenDoYouContactClient, 'form.howOftenDoYouContactClient', {
                            'labelClass': 'text required',
                            'labelParameters': { '%client%': report.client.firstname },
                            'inputClass': 'expanding'
                        }) }}
                    </div>
                </fieldset>
            </div>
        </div>



        <div class="form-section push--bottom">

            {{ form_checkbox_group(form.doYouLiveWithClient, 'form.doYouLiveWithClient', {
                'fieldSetClass' : 'inline do-you-live-radio',
                'legendClass' : 'form-label-bold',
                'legendText' : 'form.doYouLiveWithClient.label' | trans({'%client%': report.client.firstname}, translationDomain),
                'items': [
                    {'labelClass': 'block-label' },
                    {'labelClass': 'block-label' }
                ],
                'formGroupClass': 'flush--bottom'
            }) }}
            <div id="visit-questions">
                <div class="panel panel-border-narrow">
                    {{ form_input(form.howOftenDoYouContactClient, 'form.howOftenDoYouContactClient', {
                        'labelClass': 'text required',
                        'labelParameters': { '%client%': report.client.firstname },
                        'inputClass': 'expanding'
                    }) }}
                </div>
            </div>
        </div>
    {% endif %}

    {% if step == 2 %}
        <div class="form-section push--bottom">

            {{ form_checkbox_group(form.doesClientReceivePaidCare, 'form.doesClientReceivePaidCare', {
                'fieldSetClass' : 'inline does-client-receive-care',
                'legendClass' : 'form-label-bold',
                'legendText' : 'form.doesClientReceivePaidCare.label' | trans({'%client%': report.client.firstname}, translationDomain),
                'items': [
                    {'labelClass': 'block-label'},
                    {'labelClass': 'block-label'}
                ],
                'formGroupClass': 'flush--bottom'
            }) }}

            <div id="care-questions">
                <div class="panel panel-border-narrow">
                    {{ form_checkbox_group(form.howIsCareFunded, 'form.howIsCareFunded', {
                        'legendClass' : 'form-label-bold',
                        'items': [
                        {'labelClass': 'block-label'},
                        {'labelClass': 'block-label'},
                        {'labelClass': 'block-label'}
                        ]
                    }) }}
                </div>
            </div>
        </div>
    {% endif %}

    {% if step == 3 %}
        <div class="form-section push--bottom">
            {{ form_input(form.whoIsDoingTheCaring,'form.whoIsDoingTheCaring', {
                'labelClass': 'form-label-bold',
                'inputClass': 'expanding',
                'formGroupClass': 'flush--bottom'
            }) }}
        </div>
    {% endif %}

    {% if step == 4 %}
        <div class="form-section push--bottom">
            {{ form_checkbox_group(form.doesClientHaveACarePlan, 'form.doesClientHaveACarePlan', {
                'fieldSetClass' : 'inline care-plan',
                'legendClass' : 'form-label-bold',
                'legendText' : 'form.doesClientHaveACarePlan.label' | trans({'%client%': report.client.firstname}, translationDomain),
                'items': [
                    {'labelClass': 'block-label'},
                    {'labelClass': 'block-label'}
                ],
                'formGroupClass': 'flush--bottom'
            }) }}

            <div id="care-plan-questions">
                <div class="panel panel-border-narrow">
                    {# legendClass is-not-working #}
                    {{ form_known_date(form.whenWasCarePlanLastReviewed, 'form.whenWasCarePlanLastReviewed', {
                        'legendClass' : 'form-label-bold',
                        'showDay': 'false'
                    }) }}
                </div>
            </div>
        </div>
    {% endif %}

    {{ form_submit(form.save, '', {'labelText': 'stepPage.saveAndContinue' | trans({}, 'common')}) }}

    {% if skipLink %}
        <a href="{{ skipLink }}" class="button-link">{{ 'stepPage.skipLink' | trans({}, 'common') }}</a>
    {% endif %}

    {{ form_end(form) }}

    <script type="text/javascript">
        $(document).ready(function () {
            new GOVUK.SelectionButtons('.form-group__checkbox-group :radio');
            new opg.RadioHide({
                radio: '.do-you-live-radio input[type=radio]',
                content: '#visit-questions',
                hideOnYes: true
            });
            new opg.RadioHide({
                radio: '.does-client-receive-care input[type=radio]',
                content: '#care-questions',
                hideOnYes: false
            });
            new opg.RadioHide({
                radio: '.care-plan input[type=radio]',
                content: '#care-plan-questions',
                hideOnYes: false
            });

            // Where .block-label uses the data-target attribute
            // to toggle hidden content
            var showHideContent = new GOVUK.ShowHideContent()
            showHideContent.init()
        });
    </script>

{% endblock %}
<commit_msg>ddpb-517-radio-hide visits care uses GOVUK ShowHideContent<commit_after>{% extends 'AppBundle:Layouts:application_new.html.twig'%}

{% import 'AppBundle:Macros:macros.html.twig' as macros %}

{% set translationDomain = "report-visits-care" %}
{% trans_default_domain translationDomain %}

{% block htmlTitle %}{{ 'stepPage.htmlTitle' | trans }}{% endblock %}
{% block pageTitle %}{{ 'stepPage.pageSectionTitle' | trans }}{% endblock %}
{% block pageTitleClass %}heading-large{% endblock %}

{% block linkBack %}
    {{ macros.linkBackStep(backLink, 'stepPage.backLink' | trans) }}
{% endblock %}

{% block pageContent %}

    {{ form_start(form, {attr: {novalidate: 'novalidate' }}) }}

    {% if step == 1 %}
        <div class="form-section push--bottom">

            {{ form_checkbox_group(form.doYouLiveWithClient, 'form.doYouLiveWithClient', {
                'fieldSetClass' : 'inline',
                'legendClass' : 'form-label-bold',
                'legendText' : 'form.doYouLiveWithClient.label' | trans({'%client%': report.client.firstname}, translationDomain),
                'items': [
                    {'labelClass': 'block-label' },
                    {'labelClass': 'block-label', 'dataTarget': 'how-often-contact-client-wrapper' }
                ],
                'formGroupClass': 'flush--bottom'
            }) }}
            <div id="how-often-contact-client-wrapper" class="panel panel-border-narrow js-hidden">
                {{ form_input(form.howOftenDoYouContactClient, 'form.howOftenDoYouContactClient', {
                    'labelClass': 'text required',
                    'labelParameters': { '%client%': report.client.firstname },
                    'inputClass': 'expanding'
                }) }}
            </div>
        </div>
    {% endif %}

    {% if step == 2 %}
        <div class="form-section push--bottom">

            {{ form_checkbox_group(form.doesClientReceivePaidCare, 'form.doesClientReceivePaidCare', {
                'fieldSetClass' : 'inline',
                'legendClass' : 'form-label-bold',
                'legendText' : 'form.doesClientReceivePaidCare.label' | trans({'%client%': report.client.firstname}, translationDomain),
                'items': [
                    {'labelClass': 'block-label', 'dataTarget': 'how-care-funded-wrapper' },
                    {'labelClass': 'block-label'}
                ],
                'formGroupClass': 'flush--bottom'
            }) }}

            <div id="how-care-funded-wrapper" class="panel panel-border-narrow js-hidden">
                {{ form_checkbox_group(form.howIsCareFunded, 'form.howIsCareFunded', {
                    'legendClass' : 'form-label-bold',
                    'items': [
                    {'labelClass': 'block-label'},
                    {'labelClass': 'block-label'},
                    {'labelClass': 'block-label'}
                    ]
                }) }}
            </div>
        </div>
    {% endif %}

    {% if step == 3 %}
        <div class="form-section push--bottom">
            {{ form_input(form.whoIsDoingTheCaring,'form.whoIsDoingTheCaring', {
                'labelClass': 'form-label-bold',
                'inputClass': 'expanding',
                'formGroupClass': 'flush--bottom'
            }) }}
        </div>
    {% endif %}

    {% if step == 4 %}
        <div class="form-section push--bottom">
            {{ form_checkbox_group(form.doesClientHaveACarePlan, 'form.doesClientHaveACarePlan', {
                'fieldSetClass' : 'inline',
                'legendClass' : 'form-label-bold',
                'legendText' : 'form.doesClientHaveACarePlan.label' | trans({'%client%': report.client.firstname}, translationDomain),
                'items': [
                    {'labelClass': 'block-label', 'dataTarget': 'when-care-plan-last-reviewed-wrapper'},
                    {'labelClass': 'block-label'}
                ],
                'formGroupClass': 'flush--bottom'
            }) }}

            <div id="when-care-plan-last-reviewed-wrapper" class="panel panel-border-narrow  js-hidden">
                {# legendClass is-not-working #}
                {{ form_known_date(form.whenWasCarePlanLastReviewed, 'form.whenWasCarePlanLastReviewed', {
                    'legendClass' : 'form-label-bold',
                    'showDay': 'false'
                }) }}
            </div>
        </div>
    {% endif %}

    {{ form_submit(form.save, '', {'labelText': 'stepPage.saveAndContinue' | trans({}, 'common')}) }}

    {% if skipLink %}
        <a href="{{ skipLink }}" class="button-link">{{ 'stepPage.skipLink' | trans({}, 'common') }}</a>
    {% endif %}

    {{ form_end(form) }}

    <script type="text/javascript">
        $(document).ready(function () {
            new GOVUK.SelectionButtons('.form-group__checkbox-group :radio');
            var showHideContent = new GOVUK.ShowHideContent();
            showHideContent.init();
        });
    </script>

{% endblock %}

{'fraction_non_alphanumeric': 0.15132772554840837, 'fraction_numerical': 0.0012370113805047005, 'mean_word_length': 1.8393818777803792, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6438889', 'n_tokens_mistral': 3564, 'n_tokens_neox': 3247, 'n_words': 533}