Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved all templates up the project and replace @template with attributes
Browse files Browse the repository at this point in the history
parijke committed Nov 28, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent a7dd607 commit a6ccb90
Showing 42 changed files with 95 additions and 106 deletions.
Original file line number Diff line number Diff line change
@@ -31,9 +31,7 @@

class SmsController extends Controller
{
/**
* @Template
*/
#[Template('registration/sms/send_challenge.html.twig')]
#[Route(
path: '/registration/sms/send-challenge',
name: 'ss_registration_sms_send_challenge',
@@ -78,9 +76,9 @@ public function sendChallenge(Request $request): array|\Symfony\Component\HttpFo
}

/**
* @Template
* @return array|\Symfony\Component\HttpFoundation\RedirectResponse
*/
#[Template('registration/sms/prove_possession.html.twig')]
#[Route(
path: '/registration/sms/prove-possession',
name: 'ss_registration_sms_prove_possession',
Original file line number Diff line number Diff line change
@@ -29,9 +29,7 @@

class YubikeyController extends Controller
{
/**
* @Template
*/
#[Template('registration/yubikey/prove_possession.html.twig')]
#[Route(
path: '/registration/yubikey/prove-possession',
name: 'ss_registration_yubikey_prove_possession',
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@
use Surfnet\StepupSelfService\SelfServiceBundle\Service\VettingTypeService;
use Surfnet\StepupSelfService\SelfServiceBundle\Value\AvailableTokenCollection;
use Surfnet\StepupSelfService\SelfServiceBundle\Value\VettingType\VettingTypeInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
@@ -37,18 +38,17 @@

class RegistrationController extends Controller
{
public function __construct(private \Surfnet\StepupSelfService\SelfServiceBundle\Service\VettingTypeService $vettingTypeService)
public function __construct(private VettingTypeService $vettingTypeService)
{
}
/**
* @Template
*/

#[Template('registration/display_vetting_types.html.twig')]
#[Route(
path: '/registration/select-token',
name: 'ss_registration_display_types',
methods: ['GET'],
)]
public function displaySecondFactorTypes(): \Symfony\Component\HttpFoundation\Response|array
public function displaySecondFactorTypes(): Response|array
{
$institution = $this->getIdentity()->institution;
$institutionConfigurationOptions = $this->get('self_service.service.institution_configuration_options')
@@ -97,9 +97,7 @@ public function displaySecondFactorTypes(): \Symfony\Component\HttpFoundation\Re
];
}

/**
* @Template
*/
#[Template('registration/display_second_factor_types.html.twig')]
#[Route(
path: '/second-factor/{secondFactorId}/vetting-types',
name: 'ss_second_factor_vetting_types',
@@ -164,9 +162,7 @@ public function displayVettingTypes(Request $request, string $secondFactorId): a
];
}

/**
* @Template
*/
#[Template('registration/email_verification_email_sent.html.twig')]
#[Route(
path: '/registration/{secondFactorId}/email-verification-email-sent',
name: 'ss_registration_email_verification_email_sent',
@@ -177,17 +173,14 @@ public function emailVerificationEmailSent(): array
return ['email' => $this->getIdentity()->email];
}

/**
* @Template
*
* @return array|\Symfony\Component\HttpFoundation\RedirectResponse
*/

#[Template('registration/verify_email.html.twig')]
#[Route(
path: '/verify-email',
name: 'ss_registration_verify_email',
methods: ['GET'],
)]
public function verifyEmail(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array
public function verifyEmail(Request $request): RedirectResponse|array
{
$nonce = $request->query->get('n', '');
$identityId = $this->getIdentity()->id;
@@ -222,7 +215,7 @@ public function verifyEmail(Request $request): \Symfony\Component\HttpFoundation
methods: ['GET'],
)]

public function sendRegistrationEmail(string $secondFactorId): \Symfony\Component\HttpFoundation\RedirectResponse
public function sendRegistrationEmail(string $secondFactorId): RedirectResponse
{
// Send the registration email
$this->get('self_service.service.ra')
@@ -242,7 +235,7 @@ public function sendRegistrationEmail(string $secondFactorId): \Symfony\Componen
name: 'ss_registration_registration_email_sent',
methods: ['GET'],
)]
public function registrationEmailSent($secondFactorId): \Symfony\Component\HttpFoundation\Response
public function registrationEmailSent($secondFactorId): Response
{
$parameters = $this->buildRegistrationActionParameters($secondFactorId);
// Report that it was sent
@@ -261,7 +254,7 @@ public function registrationEmailSent($secondFactorId): \Symfony\Component\HttpF
name: 'ss_registration_registration_pdf',
methods: ['GET'],
)]
public function registrationPdf($secondFactorId): \Symfony\Component\HttpFoundation\Response
public function registrationPdf($secondFactorId): Response
{
$parameters = $this->buildRegistrationActionParameters($secondFactorId);

Original file line number Diff line number Diff line change
@@ -33,12 +33,14 @@

class SecondFactorController extends Controller
{
public function __construct(private \Surfnet\StepupSelfService\SelfServiceBundle\Service\SelfAssertedTokens\RecoveryTokenService $recoveryTokenService, private \Surfnet\StepupSelfService\SelfServiceBundle\Service\AuthorizationService $authorizationService, private \Surfnet\StepupBundle\Service\SecondFactorTypeService $secondFactorTypeService)
public function __construct(
private readonly RecoveryTokenService $recoveryTokenService,
private readonly AuthorizationService $authorizationService,
private readonly SecondFactorTypeService $secondFactorTypeService,
)
{
}
/**
* @Template
*/
#[Template('second_factor/list.html.twig')]
#[Route(path: '/overview', name: 'ss_second_factor_list', methods: ['GET'])]
public function list(): array
{
@@ -89,9 +91,7 @@ public function list(): array
];
}

/**
* @Template
*/
#[Template('second_factor/revoke.html.twig')]
#[Route(
path: '/second-factor/{state}/{secondFactorId}/revoke',
name: 'ss_second_factor_revoke',

This file was deleted.

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
{% block page_header %}
{{ parent() }}

{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress': 1, 'step': 1, verifyEmail: verifyEmail} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 1, 'step': 1, verifyEmail: verifyEmail} only %}
{% endblock %}

{% block content %}
@@ -14,7 +14,7 @@
<div class="row second-factors">
{% for type, secondFactor in availableSecondFactors.data %}
{% if secondFactor.isGssp %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle::registration/partial/generic_second_factor.html.twig' with {
{% include 'registration/partial/generic_second_factor.html.twig' with {
'type': type,
'security': secondFactor.loaLevel,
'url': path(secondFactor.route, secondFactor.routeParams),
@@ -23,7 +23,7 @@
'secondFactor': secondFactor.viewConfig
} only %}
{% else %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle::registration/partial/second_factor.html.twig' with {
{% include 'registration/partial/second_factor.html.twig' with {
'type': type,
'security': secondFactor.loaLevel,
'url': path(secondFactor.route),
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
{{ parent() }}

{% if verifyEmail %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress':75, 'step': 4, verifyEmail: true} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress':75, 'step': 4, verifyEmail: true} only %}
{% else %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress': 65, 'step': 3, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 65, 'step': 3, verifyEmail: false} only %}
{% endif %}
{% endblock %}

Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
{% block page_header %}
{{ parent() }}

{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress': 50, 'step': 3, verifyEmail: true} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 50, 'step': 3, verifyEmail: true} only %}
{% endblock %}

{% block content %}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ secondFactorConfig.getInitiateTitle() }}{% endblock %}

{% block page_header %}
{{ parent() }}

{% if verifyEmail %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress': 25, 'step': 2, verifyEmail: true} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 25, 'step': 2, verifyEmail: true} only %}
{% else %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress': 35, 'step': 2, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 35, 'step': 2, verifyEmail: false} only %}
{% endif %}
{% endblock %}

Original file line number Diff line number Diff line change
@@ -6,15 +6,15 @@
{{ parent() }}

{% if verifyEmail %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress':75, 'step': 4, verifyEmail: true} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress':75, 'step': 4, verifyEmail: true} only %}
{% else %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress': 65, 'step': 3, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 65, 'step': 3, verifyEmail: false} only %}
{% endif %}
{% endblock %}

{% block content %}
<h2>{{ block('page_title') }}</h2>
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:registration_email_sent.html.twig' %}
{% include 'registration/partial:registration_email_sent.html.twig' %}
{% endblock %}

{% block body_end %}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% extends "pdf.html.twig" %}
{% extends "../pdf.html.twig" %}

{% block page_title %}{{ 'ss.registration.registration_email_sent.title'|trans }}{% endblock %}

{% block content %}
<h2>{{ block('page_title') }}</h2>
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:registration_email_sent.html.twig' %}
{% include 'registration/partial:registration_email_sent.html.twig' %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.recovery_token.safe-store.authentication.title'|trans }}{% endblock %}

{% block page_header %}
{{ parent() }}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress':90, 'step': 5, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress':90, 'step': 5, verifyEmail: false} only %}
{% endblock %}

{% block content %}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.registration.recovery_token.safe-store.promise_possession_title'|trans }}{% endblock %}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.recovery_token.sms.send_challenge_title'|trans }}{% endblock %}

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.registration.self_asserted.new_recovery_token.title'|trans }}{% endblock %}

{% block page_header %}
{{ parent() }}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress':80, 'step': 5, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress':80, 'step': 5, verifyEmail: false} only %}
{% endblock %}

{% block content %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.registration.recovery_token.safe-store.promise_possession_title'|trans }}{% endblock %}

{% block page_header %}
{{ parent() }}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress':82, 'step': 5, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress':82, 'step': 5, verifyEmail: false} only %}
{% endblock %}

{% block content %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.registration.recovery_token.sms.prove_posession_title'|trans }}{% endblock %}

{% block page_header %}
{{ parent() }}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress':82, 'step': 5, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress':82, 'step': 5, verifyEmail: false} only %}
{% endblock %}

{% block content %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.registration.self_asserted.recovery_token.title'|trans }}{% endblock %}

{% block page_header %}
{{ parent() }}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress':85, 'step': 5, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress':85, 'step': 5, verifyEmail: false} only %}
{% endblock %}

{% block content %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.recovery_token.sms.prove_possession_title'|trans }}{% endblock %}

{% block page_header %}
{{ parent() }}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress':85, 'step': 5, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress':85, 'step': 5, verifyEmail: false} only %}
{% endblock %}

{% block content %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.registration.self_asserted.choose_recovery_token.title'|trans }}{% endblock %}

{% block page_header %}
{{ parent() }}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress':87, 'step': 5, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress':87, 'step': 5, verifyEmail: false} only %}

{% endblock %}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.registration.self_asserted.new_recovery_token.title'|trans }}{% endblock %}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "base.html.twig" %}
{% extends "../../base.html.twig" %}

{% block page_title %}{{ 'ss.recovery_token.sms.prove_possession_title'|trans }}{% endblock %}

17 changes: 17 additions & 0 deletions templates/registration/sms/prove_possession.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "base.html.twig" %}

{% block page_title %}{{ 'ss.registration.sms.prove_possession.title.page'|trans }}{% endblock %}

{% block page_header %}
{{ parent() }}

{% if verifyEmail %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 35, 'step': 2, verifyEmail: true} only %}
{% else %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 50, 'step': 2, verifyEmail: false} only %}
{% endif %}
{% endblock %}

{% block content %}
{% include 'registration/partial/sms_prove_possession.html.twig' with { 'pageTitle': block('page_title') } %}
{% endblock %}
17 changes: 17 additions & 0 deletions templates/registration/sms/send_challenge.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "base.html.twig" %}

{% block page_title %}{{ 'ss.registration.sms.send_challenge.title.page'|trans }}{% endblock %}

{% block page_header %}
{{ parent() }}

{% if verifyEmail %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 25, 'step': 2, verifyEmail: true} only %}
{% else %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 35, 'step': 2, verifyEmail: false} only %}
{% endif %}
{% endblock %}

{% block content %}
{% include 'registration/partial/sms_send_challenge.html.twig' with { pageTitle: block('page_title') } %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
{% block page_header %}
{{ parent() }}

{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress': 75, 'step': 4, verifyEmail: true} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 75, 'step': 4, verifyEmail: true} only %}
{% endblock %}

{% block content %}
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
{{ parent() }}

{% if verifyEmail %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress': 25, 'step': 2, verifyEmail: true} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 25, 'step': 2, verifyEmail: true} only %}
{% else %}
{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:progress_bar.html.twig' with {'progress': 35, 'step': 2, verifyEmail: false} only %}
{% include 'registration/partial:progress_bar.html.twig' with {'progress': 35, 'step': 2, verifyEmail: false} only %}
{% endif %}
{% endblock %}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'base.html.twig' %}
{% extends '../base.html.twig' %}

{% block content %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
{% endif %}
</div>

{% include 'SurfnetStepupSelfServiceSelfServiceBundle:registration/partial:crud_list.html.twig' %}
{% include 'registration/partial:crud_list.html.twig' %}

{% endblock %}

@@ -71,7 +71,7 @@
{% endif %}
{% if state == 'vetted' %}
<td>
{% include '@SurfnetStepupSelfServiceSelfService/second_factor/loa-stars.html.twig' with { level: secondFactor.loaLevel } %}
{% include 'second_factor/loa-stars.html.twig' with { level: secondFactor.loaLevel } %}
</td>
{% endif %}
<td>
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a6ccb90

Please sign in to comment.