<commit_before>@(currentForm: Form[models.domain.Feedback])(implicit claim: models.domain.Claim, request: Request[AnyContent], flash:Flash, messages: play.api.i18n.Messages)

@import utils.helpers.CarersTemplate._
@import utils.csrf.DwpCSRFFormHelper
@import views.html.helper._
@import utils.helpers.CarersCrypto
@import views.html.feedback.main
@import models.domain.SatisfiedOptions
@import views.html.helper.base.carersInputTextArea

@feedbackOptionsList(implicit lang:Lang) = @{
    Seq(SatisfiedOptions.vs -> messages("feedback.satisfied.vs"),
        SatisfiedOptions.s -> messages("feedback.satisfied.s"),
        SatisfiedOptions.neither -> messages("feedback.satisfied.neither"),
        SatisfiedOptions.d -> messages("feedback.satisfied.d"),
        SatisfiedOptions.vd -> messages("feedback.satisfied.vd")
    )
}

@submitRoute = @{
         request.uri.contains("/circumstances") match{
             case true => controllers.feedback.routes.GFeedback.submit("Circs")
             case false => controllers.feedback.routes.GFeedback.submit("Claim")
         }
}
@main(messages("feedback.legend")) {
    @errorsSummary(currentForm)

    @form(action = submitRoute) {
        @DwpCSRFFormHelper.formField

        <div class="form-wrap">

            <fieldset class="form-elements">
                <legend class="form-label-bold">@Html(messages("satisfiedAnswer"))</legend>
                @standaloneListRadioGroup(currentForm("satisfiedAnswer"),
                    'items -> feedbackOptionsList,
                    'track -> true,
                    'trackLabel -> messages("xxxx"))

                <ul>
                    @yesNoRadioGroup(currentForm("difficultyAndText.answer"),
                        'ignoreOptional -> true,
                        '_label -> messages("feedback.difficulty.label"))

                    @otherDetailPlaceHolder(
                        inputDef = Seq(
                            carersInputTextArea(currentForm("difficultyAndText.text1"),
                                '_label -> messages("feedback.difficulty.text1"),
                                'helperAbove -> messages("feedback.difficulty.helper1"),
                                'textAreaHelper -> Html(messages("3000charsLeft")),
                                'maxLength -> 3000)
                        ),
                        'id -> "difficultyWrap1"
                    )

                    @otherDetailPlaceHolder(
                        inputDef = Seq(
                            carersInputTextArea(currentForm("difficultyAndText.text2"),
                                '_label -> messages("feedback.difficulty.text2"),
                                'textAreaHelper -> Html(messages("3000charsLeft")),
                                'maxLength -> 3000)
                        ),
                        'id -> "difficultyWrap2"
                    )
                </ul>

            </fieldset>
            <button type="submit" id="send" name="send" value="send" class="button">Send</button>
        </div>
    }

    <script type="text/javascript" @views.html.common.nonCachingSrc("javascripts/feedback/feedback.js")></script>
   	<script type="text/javascript" @views.html.common.nonCachingSrc("javascripts/textAreaCounter.js")></script>

    <script type="text/javascript">
    	$(function(){
			window.areaCounter({selector:"@CarersCrypto.encryptAES("difficultyAndText_text1")",maxChars:3000});
			window.areaCounter({selector:"@CarersCrypto.encryptAES("difficultyAndText_text2")",maxChars:3000});
		})

		$(function(){
			window.initEvents(
			"@CarersCrypto.encryptAES("difficultyAndText_answer_yes")",
			"@CarersCrypto.encryptAES("difficultyAndText_answer_no")",
			"@CarersCrypto.encryptAES("difficultyAndText_text1")",
			"@CarersCrypto.encryptAES("difficultyAndText_text2")",
			"@CarersCrypto.encryptAES("difficultyWrap1")",
			"@CarersCrypto.encryptAES("difficultyWrap2")"
			);
			@ga.stagePrompt()
		});
	</script>
}


<commit_msg>CADS-534 : Feedback ui page the foldout not working when fields encrypted because the wrap yes/no fields should be be encrypted.<commit_after>@(currentForm: Form[models.domain.Feedback])(implicit claim: models.domain.Claim, request: Request[AnyContent], flash:Flash, messages: play.api.i18n.Messages)

@import utils.helpers.CarersTemplate._
@import utils.csrf.DwpCSRFFormHelper
@import views.html.helper._
@import utils.helpers.CarersCrypto
@import views.html.feedback.main
@import models.domain.SatisfiedOptions
@import views.html.helper.base.carersInputTextArea

@feedbackOptionsList(implicit lang:Lang) = @{
    Seq(SatisfiedOptions.vs -> messages("feedback.satisfied.vs"),
        SatisfiedOptions.s -> messages("feedback.satisfied.s"),
        SatisfiedOptions.neither -> messages("feedback.satisfied.neither"),
        SatisfiedOptions.d -> messages("feedback.satisfied.d"),
        SatisfiedOptions.vd -> messages("feedback.satisfied.vd")
    )
}

@submitRoute = @{
         request.uri.contains("/circumstances") match{
             case true => controllers.feedback.routes.GFeedback.submit("Circs")
             case false => controllers.feedback.routes.GFeedback.submit("Claim")
         }
}
@main(messages("feedback.legend")) {
    @errorsSummary(currentForm)

    @form(action = submitRoute) {
        @DwpCSRFFormHelper.formField

        <div class="form-wrap">

            <fieldset class="form-elements">
                <legend class="form-label-bold">@Html(messages("satisfiedAnswer"))</legend>
                @standaloneListRadioGroup(currentForm("satisfiedAnswer"),
                    'items -> feedbackOptionsList,
                    'track -> true,
                    'trackLabel -> messages("xxxx"))

                <ul>
                    @yesNoRadioGroup(currentForm("difficultyAndText.answer"),
                        'ignoreOptional -> true,
                        '_label -> messages("feedback.difficulty.label"))

                    @otherDetailPlaceHolder(
                        inputDef = Seq(
                            carersInputTextArea(currentForm("difficultyAndText.text1"),
                                '_label -> messages("feedback.difficulty.text1"),
                                'helperAbove -> messages("feedback.difficulty.helper1"),
                                'textAreaHelper -> Html(messages("3000charsLeft")),
                                'maxLength -> 3000)
                        ),
                        'id -> "difficultyWrap1"
                    )

                    @otherDetailPlaceHolder(
                        inputDef = Seq(
                            carersInputTextArea(currentForm("difficultyAndText.text2"),
                                '_label -> messages("feedback.difficulty.text2"),
                                'textAreaHelper -> Html(messages("3000charsLeft")),
                                'maxLength -> 3000)
                        ),
                        'id -> "difficultyWrap2"
                    )
                </ul>

            </fieldset>
            <button type="submit" id="send" name="send" value="send" class="button">Send</button>
        </div>
    }

    <script type="text/javascript" @views.html.common.nonCachingSrc("javascripts/feedback/feedback.js")></script>
   	<script type="text/javascript" @views.html.common.nonCachingSrc("javascripts/textAreaCounter.js")></script>

    <script type="text/javascript">
    	$(function(){
			window.areaCounter({selector:"@CarersCrypto.encryptAES("difficultyAndText_text1")",maxChars:3000});
			window.areaCounter({selector:"@CarersCrypto.encryptAES("difficultyAndText_text2")",maxChars:3000});
		})

		$(function(){
			window.initEvents(
			"@CarersCrypto.encryptAES("difficultyAndText_answer_yes")",
			"@CarersCrypto.encryptAES("difficultyAndText_answer_no")",
			"@CarersCrypto.encryptAES("difficultyAndText_text1")",
			"@CarersCrypto.encryptAES("difficultyAndText_text2")",
			"difficultyWrap1",
			"difficultyWrap2"
			);
			@ga.stagePrompt()
		});
	</script>
}



{'fraction_non_alphanumeric': 0.1298023125699366, 'fraction_numerical': 0.010070869078701977, 'mean_word_length': 2.2859477124183005, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 77, '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': '4216658', 'n_tokens_mistral': 2440, 'n_tokens_neox': 2146, 'n_words': 267}