Modal Base: Energy

See "img upload" in sidebar snet/molecules for variants, or go to info panel and look for it in "references" (@snet-img-upload)

Refer to modal frame found in view tab for complete structure without content.

A modal's default size is 640px

Modifier classes for modals

  • modal-sm: 480px
  • modal-md: 720px (mainly used for modals containing images)
  • modal-lg: 896px
  • modal-xl: 1120px

Content loading

A modal with a content loading component behaves as follows:

  • It has a second body element with the -isLoading class that is hidden by default, and shown only when ...
  • ... the -contentLoading modifier is applied to the modal element ...
  • ... which in turn hides the regular modal body element which into which the content is injected
<div class="sds-modal modal fade -bodySecondary06" id="energyBadgesModal" aria-hidden="true" tabindex="-1">
    <div class="sds-modal__dialog modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
        <div class="sds-modal__content modal-content">

            <div class="sds-modal__header modal-header">

                <div class="sds-modal__title modal-title">Performance énergétique</div>

                <button type="button" class="sds-btn -iconBtn -btnSecondary -ghost sds-modal__close" data-dismiss="modal" aria-label="Close">

                    <span class="sds-icon sds-icon-close"></span>

                </button>

            </div>

            <div class="sds-modal__body modal-body">

                <div class="sds-stackMd">
                    <div class="sds-box -insetLg sds-stackMd">
                        <div class="h4">Veuillez sélectionner la classe énergétique.</div>
                        <div class="row row-xs">

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceAPlus">
                                    <input type="radio" id="radioEnergyPerformanceAPlus" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performAPlus -interactable">A+</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceA">
                                    <input type="radio" id="radioEnergyPerformanceA" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performA -interactable">A</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceB">
                                    <input type="radio" id="radioEnergyPerformanceB" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performB -interactable">B</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceC">
                                    <input type="radio" id="radioEnergyPerformanceC" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performC -interactable">C</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceD">
                                    <input type="radio" id="radioEnergyPerformanceD" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performD -interactable">D</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceE">
                                    <input type="radio" id="radioEnergyPerformanceE" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performE -interactable">E</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceF">
                                    <input type="radio" id="radioEnergyPerformanceF" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performF -interactable">F</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceG">
                                    <input type="radio" id="radioEnergyPerformanceG" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performG -interactable">G</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceH">
                                    <input type="radio" id="radioEnergyPerformanceH" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performH -interactable">H</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <label class="" for="radioEnergyPerformanceI">
                                    <input type="radio" id="radioEnergyPerformanceI" name="energy-class" class="sr-only">
                                    <span class="sds-energyBadge -performI -interactable">I</span>
                                </label>

                            </div>

                            <div class="d-flex align-items-center col-auto">

                                <div class="sds-radio custom-control custom-radio">
                                    <input value="radio-value" type="radio" name="energy-class" class="sr-only custom-control-input " id="radioEnergyPerformanceUnknown"><span class="sds-radioDot  sds-radio__shape" aria-hidden="true"></span>
                                    <label class="custom-control-label" for="radioEnergyPerformanceUnknown">
                                        Je ne sais pas
                                    </label>

                                </div>

                            </div>

                        </div>
                    </div>
                </div>

            </div>

            <div class="sds-modal__footer modal-footer">

                <div class="sds-btnGroup">
                    <button type="button" class="sds-btn -btnPrimary" data-dismiss="modal">

                        <span class="sds-btn__text">Confirmer choix</span>

                    </button>
                </div>

            </div>

        </div>
    </div>
</div>
{% extends "@snet-modal-base-frame" %}
{% block header %}
	<div class="{{ namespace }}modal__title modal-title">{{ title }}</div>
{% endblock %}
{% block body %}
	<div class="{{ namespace }}stackMd">
		<div class="{{ namespace }}box -insetLg {{ namespace }}stackMd">
			<div class="h4">Veuillez sélectionner la classe énergétique.</div>
			<div class="row row-xs">
				{% for key, radioItem in radios %}
					<div class="d-flex align-items-center col-auto">
						{% if radioItem.variant === "--unknown" %}
							{% render "@radio",{
								input: true,
								id: radioItem.id,
								inputName: radioItem.name,
								text: "Je ne sais pas"
							},true %}
						{% else %}
							<label class="" for="{{ radioItem.id }}">
								<input type="radio" id="{{ radioItem.id }}" name="{{ radioItem.name }}" class="sr-only">
								{% render "@energy-badge"+radioItem.variant,{classes: ["-interactable"]},true %}
							</label>
						{% endif %}
					</div>
				{% endfor %}
			</div>
		</div>
	</div>
{% endblock %}
{% block footer %}
	<div class="{{ namespace }}btnGroup">
		{% render "@btn-primary",{
			text: "Confirmer choix",
			attrs: {
				"data-dismiss": "modal"
			}
		},true %}
	</div>
{% endblock %}