diff --git a/src/open_inwoner/accounts/templates/django_registration/registration_form.html b/src/open_inwoner/accounts/templates/django_registration/registration_form.html index 140273acf9..3c11591d8f 100644 --- a/src/open_inwoner/accounts/templates/django_registration/registration_form.html +++ b/src/open_inwoner/accounts/templates/django_registration/registration_form.html @@ -3,7 +3,7 @@ {% block content %} -
+

{% trans 'Registreren' %}

{% render_grid %} {% if settings.DIGID_ENABLED and digid_url %} {% render_column start=5 span=5 %} @@ -30,13 +30,12 @@ {% if login_allow_registration %} {% render_column start=5 span=5 %} {% render_card tinted=True %} -

{% trans "Registreren met E-mail" %}


+

{% trans "Registreren met E-mail" %}

{% form form_object=form method="POST" id="registration-form" submit_text=_('Registreren') extra_classes="form__registration" show_required=True %} {% endrender_card %} {% endrender_column %} {% endif %} {% endrender_grid %} -
{% endblock content %} diff --git a/src/open_inwoner/accounts/templates/registration/login.html b/src/open_inwoner/accounts/templates/registration/login.html index 5cbbdbd130..3a4bd61765 100644 --- a/src/open_inwoner/accounts/templates/registration/login.html +++ b/src/open_inwoner/accounts/templates/registration/login.html @@ -1,5 +1,5 @@ {% extends 'master.html' %} -{% load i18n static logo_tags grid_tags card_tags form_tags link_tags button_tags solo_tags cms_tags %} +{% load i18n static logo_tags grid_tags card_tags form_tags link_tags button_tags icon_tags solo_tags cms_tags %} {% block header_image %} @@ -8,91 +8,108 @@ {% block content %} -
- {% render_grid %} - {% render_column start=5 span=5 %} - {% render_card %} -

{% trans 'Welkom' %}

- {% if login_text %}

{{ login_text|linebreaksbr }}

{% endif %} -
- {% if settings.DIGID_ENABLED %} - {% get_solo 'digid_eherkenning_oidc_generics.OpenIDConnectDigiDConfig' as digid_oidc_config %} - {% if digid_oidc_config.enabled %} - {% render_card direction='horizontal' tinted=True %} - - {% url 'digid_oidc:init' as href %} - {% link href=href text=_('Inloggen met DigiD') secondary=True icon='arrow_forward' extra_classes="link--digid" %} - {% endrender_card %} - {% else %} - {% render_card direction='horizontal' tinted=True %} - - {% url 'digid:login' as href %} - {% with href|addnexturl:next as href_with_next %} - {% link href=href_with_next text=_('Inloggen met DigiD') secondary=True icon='arrow_forward' extra_classes="link--digid" %} - {% endwith %} - {% endrender_card %} - {% endif %} - {% endif %} +

{% trans 'Welkom' %}

+ {% if login_text %}

{{ login_text|linebreaksbr }}

{% endif %} - {% if eherkenning_enabled %} - {% get_solo 'digid_eherkenning_oidc_generics.OpenIDConnectEHerkenningConfig' as eherkenning_oidc_config %} - {% if eherkenning_oidc_config.enabled %} - {% render_card direction='horizontal' tinted=True %} - - {% url 'eherkenning_oidc:init' as href %} - {% link href=href text=_('Inloggen met eHerkenning') secondary=True icon='arrow_forward' extra_classes="link--eherkenning" %} - {% endrender_card %} - {% else %} - {% render_card direction='horizontal' tinted=True %} - - {% url 'eherkenning:login' as href %} - {% with href|addnexturl:next as href_with_next %} - {% link href=href_with_next text=_('Inloggen met eHerkenning') secondary=True icon='arrow_forward' extra_classes="link--eherkenning" %} - {% endwith %} - {% endrender_card %} - {% endif %} - {% endif %} + {# Tab panels Start #} +
+
+ + {# Panel 1 #} +
- {% get_solo 'mozilla_django_oidc_db.OpenIDConnectConfig' as oidc_config %} - {% get_solo 'configurations.SiteConfiguration' as site_config %} - {% if oidc_config.enabled and site_config.openid_enabled_for_regular_users %} - {% render_card tinted=True direction='horizontal' %} - {% if site_config.openid_connect_logo %} - - {% else %} -
- {% endif %} - {% url 'oidc_authentication_init' as href %} - {% with href|addnexturl:next as href_with_next %} - {% link text=site_config.openid_connect_login_text href=href_with_next secondary=True icon='arrow_forward' icon_position="after" %} - {% endwith %} - {% endrender_card %} - {% endif %} +
+ {% render_grid %} + {% if settings.DIGID_ENABLED %} + {% render_column start=4 span=5 %} + {% get_solo 'digid_eherkenning_oidc_generics.OpenIDConnectDigiDConfig' as digid_oidc_config %} + {% if digid_oidc_config.enabled %} + {% render_card direction='horizontal' tinted=True %} + + {% url 'digid_oidc:init' as href %} + {% link href=href text=_('Inloggen met DigiD') primary=True icon='arrow_forward' extra_classes="link--digid" %} + {% endrender_card %} + {% else %} + {% render_card direction='horizontal' tinted=True %} + + {% url 'digid:login' as href %} + {% with href|addnexturl:next as href_with_next %} + {% link href=href_with_next text=_('Inloggen met DigiD') primary=True icon='arrow_forward' extra_classes="link--digid" %} + {% endwith %} + {% endrender_card %} + {% endif %} + {% endrender_column %} - {% if login_allow_registration %} - {% render_card tinted=True %} - {% render_form id="login-form" method="POST" form=form show_required=True %} - {% csrf_token %} - - {% input form.username %} - {% input form.password %} - {% button text=_('Wachtwoord vergeten?') href='password_reset' secondary=True transparent=True align='right' %} - {% form_actions primary_text=_("Inloggen") primary_icon="arrow_forward" secondary_href='django_registration_register' secondary_text=_('Registreer') secondary_icon='arrow_forward' single=True %} - {% endrender_form %} - {% endrender_card %} - {% endif %} - {% endrender_card %} - {% endrender_column %} - {% endrender_grid %} -
+ {% get_solo 'mozilla_django_oidc_db.OpenIDConnectConfig' as oidc_config %} + {% get_solo 'configurations.SiteConfiguration' as site_config %} + {% if oidc_config.enabled and site_config.openid_enabled_for_regular_users %} + {% render_column start=4 span=5 %} + {% render_card tinted=True direction='horizontal' %} + {% if site_config.openid_connect_logo %} + + {% else %} +
+ {% endif %} + {% url 'oidc_authentication_init' as href %} + {% with href|addnexturl:next as href_with_next %} + {% link text=site_config.openid_connect_login_text href=href_with_next primary=True icon='arrow_forward' icon_position="after" %} + {% endwith %} + {% endrender_card %} + {% endrender_column %} + {% endif %} + + {% if login_allow_registration %} + {% render_column start=4 span=5 %} + {% render_card direction='horizontal' tinted=True %} + + {% icon icon="login" icon_position="before" outlined=True %} + + {% link href="#email" text=_('Log in met e-mail adres') primary=True icon='arrow_forward' %} + {% endrender_card %} + {% endrender_column %} + + {% render_column start=4 span=5 %} + {% render_card tinted=True %} + {% render_form id="login-form" method="POST" form=form show_required=True %} + {% csrf_token %} + + {% input form.username %} + {% input form.password %} + {% button text=_('Wachtwoord vergeten?') href='password_reset' primary=True transparent=True align='right' %} + {% form_actions primary_text=_("Inloggen") primary_icon="arrow_forward" single=True %} + {% endrender_form %} + {% endrender_card %} + {% endrender_column %} + + {% render_column start=4 span=5 %} +

Of registreer

+ {% render_card direction='horizontal' tinted=True %} + + {% icon icon="account_circle" icon_position="before" outlined=True %} + + {% link href="/accounts/register" text=_('Maak een account aan') primary=True icon='arrow_forward' %} + {% endrender_card %} + {% endrender_column %} + + {% endif %} + + {% endif %} + + {% endrender_grid %} +
+ {# Panel 2 #} + {# Panel 2 End #} +
+
+
+ {# Tab panels End #} {% endblock content %} diff --git a/src/open_inwoner/accounts/templates/registration/login_business.html b/src/open_inwoner/accounts/templates/registration/login_business.html new file mode 100644 index 0000000000..13c31f8f88 --- /dev/null +++ b/src/open_inwoner/accounts/templates/registration/login_business.html @@ -0,0 +1,63 @@ +{% extends 'master.html' %} +{% load i18n static logo_tags grid_tags card_tags form_tags link_tags button_tags solo_tags cms_tags %} + + +{% block header_image %} + {% static_placeholder 'login_banner' %} +{% endblock header_image %} + + +{% block content %} + +

{% trans 'Inloggen' %}

+ {% if login_text %}

{{ login_text|linebreaksbr }}

{% endif %} + + {# Tab panels Start #} +
+
+ + {# Panel 1 #} +
+ + {# Panel 2 #} +
+ + {% render_grid %} + {% render_column start=4 span=5 %} +

Zakelijk

+ {% if eherkenning_enabled %} + {% get_solo 'digid_eherkenning_oidc_generics.OpenIDConnectEHerkenningConfig' as eherkenning_oidc_config %} + {% if eherkenning_oidc_config.enabled %} + {% render_card direction='horizontal' tinted=True %} + + {% url 'eherkenning_oidc:init' as href %} + {% link href=href text=_('Inloggen met eHerkenning') primary=True icon='arrow_forward' extra_classes="link--eherkenning" %} + {% endrender_card %} + {% else %} + {% render_card direction='horizontal' tinted=True %} + + {% url 'eherkenning:login' as href %} + {% with href|addnexturl:next as href_with_next %} + {% link href=href_with_next text=_('Inloggen met eHerkenning') primary=True icon='arrow_forward' extra_classes="link--eherkenning" %} + {% endwith %} + {% endrender_card %} + {% endif %} + {% endif %} + {% endrender_column %} + {% endrender_grid %} + +
+ {# Panel 2 End #} +
+
+
+ {# Tab panels End #} + +{% endblock content %} diff --git a/src/open_inwoner/accounts/views/__init__.py b/src/open_inwoner/accounts/views/__init__.py index 46324f7094..50813713ce 100644 --- a/src/open_inwoner/accounts/views/__init__.py +++ b/src/open_inwoner/accounts/views/__init__.py @@ -29,6 +29,7 @@ from .invite import InviteAcceptView from .login import ( AddPhoneNumberWizardView, + CustomBusinessLoginView, CustomLoginView, ResendTokenView, VerifyTokenView, diff --git a/src/open_inwoner/accounts/views/login.py b/src/open_inwoner/accounts/views/login.py index 8070afc54c..6eed1182aa 100644 --- a/src/open_inwoner/accounts/views/login.py +++ b/src/open_inwoner/accounts/views/login.py @@ -95,6 +95,10 @@ def form_valid(self, form): return redirect(furl(reverse("verify_token")).add(params).url) +class CustomBusinessLoginView(CustomLoginView): + template_name = "registration/login_business.html" + + class VerifyTokenView(ThrottleMixin, FormView): throttle_visits = 3 throttle_period = 60 diff --git a/src/open_inwoner/js/components/index.js b/src/open_inwoner/js/components/index.js index c505e303c0..7a94123f1d 100644 --- a/src/open_inwoner/js/components/index.js +++ b/src/open_inwoner/js/components/index.js @@ -27,6 +27,7 @@ import './preview' import './questionnaire' import './readmore' import './search' +import { TabPanel } from './tab-panels' import './toggle' import { StatusAccordion } from './cases/status_accordion' import './session' @@ -53,6 +54,7 @@ const elementWrappers = [ ], [Notification.selector, (elt) => new Notification(elt)], [AnchorMobile.selector, (elt) => new AnchorMobile(elt)], + [TabPanel.selector, (elt) => new TabPanel(elt)], [StatusAccordion.selector, (elt) => new StatusAccordion(elt)], [FileInput.selector, (elt) => new FileInput(elt)], ] diff --git a/src/open_inwoner/js/components/tab-panels/index.js b/src/open_inwoner/js/components/tab-panels/index.js new file mode 100644 index 0000000000..f058edad69 --- /dev/null +++ b/src/open_inwoner/js/components/tab-panels/index.js @@ -0,0 +1,49 @@ +// export class TabPanel { +// static selector = '.login-tab--container' +// +// constructor(node) { +// this.node = node +// this.tabHeadersRow = node.querySelector('.tabs__headers') +// this.tabHeaders = node.querySelectorAll('.tab__header') +// this.tabContent = node.querySelectorAll('.tab__content') +// +// this.hideContent() +// this.showContent() +// +// this.tabHeadersRow.addEventListener('click', (e) => { +// // To prevent scrolling to the tab +// e.preventDefault() +// const target = e.target +// if (target.classList.contains('tab__header')) { +// console.log('there is a tabheader') +// this.tabHeaders.forEach((item, i) => { +// if (target == item) { +// this.hideContent() +// this.showContent(i) +// } +// }) +// } +// }) +// } +// +// hideContent() { +// console.log('Hide tab...') +// this.tabContent.forEach((item) => { +// item.classList.add('hide') +// item.classList.remove('active') +// }) +// this.tabHeaders.forEach((item) => { +// item.classList.remove('active') +// }) +// } +// +// showContent(i = 0) { +// console.log('Show tab...') +// this.tabContent[i].classList.add('active') +// this.tabContent[i].classList.remove('hide') +// this.tabHeaders[i].classList.add('active') +// } +// } +// +// const tabpanels = document.querySelectorAll(TabPanel.selector) +// ;[...tabpanels].forEach((tabpanel) => new TabPanel(tabpanel)) diff --git a/src/open_inwoner/scss/components/TabPanel/TabPanel.scss b/src/open_inwoner/scss/components/TabPanel/TabPanel.scss index 883f480431..f79ed796f3 100644 --- a/src/open_inwoner/scss/components/TabPanel/TabPanel.scss +++ b/src/open_inwoner/scss/components/TabPanel/TabPanel.scss @@ -4,118 +4,158 @@ display: flex; max-width: 100%; width: 100%; -} -.tabs { - background: #fff; - overflow: initial; - width: 100%; + .tabs { + background: #fff; + overflow: initial; + width: 100%; - @media (min-width: 500px) { - overflow: hidden; + @media (min-width: 500px) { + overflow: hidden; + } } -} - -.list.tabs__headers { - display: block; - align-items: center; - box-sizing: border-box; - width: 100%; - margin: 0; - overflow: hidden; - padding: 0; - position: relative; - &::before { - left: 0; - right: 0; - bottom: 0px; - height: 0; - border-bottom: 2px solid var(--color-gray-light); - content: ''; - top: auto; + .list.tabs__headers { display: block; - position: absolute; + align-items: center; + box-sizing: border-box; + width: 100%; + margin: 0; + overflow: hidden; + padding: 0; + position: relative; + + &::before { + left: 0; + right: 0; + bottom: 0px; + height: 0; + border-bottom: 2px solid var(--color-gray-light); + content: ''; + top: auto; + display: block; + position: absolute; + } + + &::after { + clear: both; + display: block; + content: ''; + } } - &::after { - clear: both; + .list-item.tab__header--item { + max-width: var(--mobile-xs-width); + border: none; display: block; - content: ''; + float: none; + padding: 0; + border: 0; + margin-right: -1px; + position: relative; + + @media (min-width: 360px) { + max-width: 200px; + float: left; + } } -} -.list-item.tab__header--item { - max-width: var(--mobile-xs-width); - border: none; - display: block; - float: none; - padding: 0; - border: 0; - margin-right: -1px; - position: relative; + .link.tab__header { + box-sizing: border-box; + color: var(--color-gray-lighter); + display: inline-block; + cursor: pointer; + width: 100%; + padding: var(--spacing-large); + transition: 0.3s; + + &:target { + scroll-margin-top: 150px; + } + &:target::before { + scroll-margin-top: 150px; + } - @media (min-width: 360px) { - max-width: 200px; - float: left; + &.active { + border-bottom: 2px solid var(--color-primary); + color: var(--font-color-body); + font-weight: bold; + margin: 0; + } } -} -.link.tab__header { - box-sizing: border-box; - color: var(--color-gray-lighter); - display: inline-block; - cursor: pointer; - width: 100%; - padding: var(--spacing-large); - transition: 0.3s; - - &:target { + .tab__content, + .tab__content.active { + margin: 1em; scroll-margin-top: 150px; + + p { + padding: 0; + } } - &:target::before { - scroll-margin-top: 150px; + + .active { + display: block; } - &.active { - border-bottom: 2px solid var(--color-primary); - color: var(--font-color-body); - font-weight: bold; - margin: 0; + .hide { + display: none; } -} -.tabs__body { - padding: 0; + .tabs__body { + padding: 0; + + // Styling for Benefits reports/Mijn uitkeringen + .form { + //max-width: var(--mobile-ms-width); - // Styling for Benefits reports/Mijn uitkeringen - .form { - max-width: var(--mobile-ms-width); + .form__actions { + margin-top: 0; + } - .form__actions { - margin-top: 0; + .form__control [class*='icon'] { + transform: none; + } } + } - .form__control [class*='icon'] { - transform: none; + .form { + /// Make required asterisk visible for this component + .label__label--required { + color: var(--color-red); + padding-left: var(--spacing-tiny); + //make asterisks invisible by default, only make them visible if component has the caption + display: inline; } } } -.tab__content, -.tab__content.active { - margin: 1em; - scroll-margin-top: 150px; +/// Tabs on login page - p { - padding: 0; +.login-tab--container { + .list-item.tab__header--item { + min-width: 180px; } -} -.active { - display: block; -} + .link.tab__header { + font-weight: normal; + padding: var(--spacing-large) var(--spacing-large) var(--spacing-large) 0; -.hide { - display: none; + &.active { + border-bottom: 2px solid var(--color-accent); + color: var(--color-accent); + font-weight: bold; + margin: 0; + } + } + + .tab__content, + .tab__content.active { + margin: var(--spacing-giant) 0 0 0; + scroll-margin-top: 150px; + + p { + padding: 0; + } + } } diff --git a/src/open_inwoner/scss/components/Typography/Link.scss b/src/open_inwoner/scss/components/Typography/Link.scss index 14eee75787..5de5e6f747 100644 --- a/src/open_inwoner/scss/components/Typography/Link.scss +++ b/src/open_inwoner/scss/components/Typography/Link.scss @@ -78,6 +78,17 @@ text-decoration: none; } + &.icon--large { + &:hover { + text-decoration: none; + } + + *[class*='icon'] { + color: var(--color-gray-90); + font-size: 46px; + } + } + *[class*='icon']:first-child, *[class*='Icon']:first-child { transform: scale(1); diff --git a/src/open_inwoner/urls.py b/src/open_inwoner/urls.py index a4fb075084..d12d9fd907 100644 --- a/src/open_inwoner/urls.py +++ b/src/open_inwoner/urls.py @@ -13,6 +13,7 @@ from open_inwoner.accounts.forms import CustomRegistrationForm from open_inwoner.accounts.views import ( AddPhoneNumberWizardView, + CustomBusinessLoginView, CustomDigiDAssertionConsumerServiceMockView, CustomDigiDAssertionConsumerServiceView, CustomeHerkenningAssertionConsumerServiceMockView, @@ -83,6 +84,11 @@ name="password_reset_confirm", ), path("accounts/login/", CustomLoginView.as_view(), name="login"), + path( + "accounts/login-business/", + CustomBusinessLoginView.as_view(), + name="login_business", + ), path("accounts/verify/", VerifyTokenView.as_view(), name="verify_token"), path("accounts/resend-token/", ResendTokenView.as_view(), name="resend_token"), path(