Skip to content

Commit

Permalink
convert send-manager-mfa template to Twig
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Jun 20, 2024
1 parent db988e9 commit 416ea2e
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 71 deletions.
69 changes: 0 additions & 69 deletions modules/material/themes/material/mfa/send-manager-mfa.php

This file was deleted.

63 changes: 63 additions & 0 deletions modules/material/themes/material/mfa/send-manager-mfa.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="{{ currentLanguage }}">
<head>
<title>{{ '{mfa:title}'|trans }}</title>

{% include 'header.twig' %}
</head>
<body class="gradient-bg">
<div class="mdl-layout mdl-layout--fixed-header fill-viewport">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">
{{ '{mfa:header}'|trans }}
</span>
</div>
</header>
<main class="mdl-layout__content" layout-children="column">
<form layout-children="column" method="post" autocomplete="off">
<div class="mdl-card mdl-shadow--8dp">
<div class="mdl-card__media white-bg margin" layout-children="column">
<img src="mfa-manager.svg" class="icon" alt="{{ '{mfa:manager_icon}'|trans }}">
</div>

<div class="mdl-card__title center">
<h1 class="mdl-card__title-text">
{{ '{mfa:manager_header}'|trans }}
</h1>
</div>

<div class="mdl-card__title center">
<p class="mdl-card__subtitle-text">
{{ '{mfa:manager_info}'|trans({'%managerEmail%':managerEmail})|raw }}
</p>
</div>

{% if not errorMessage is empty %}
<div class="mdl-card__supporting-text" layout-children="column">
<p class="mdl-color-text--red error">
<i class="material-icons">error</i>

<span class="mdl-typography--caption">
{{ errorMessage|e }}
</span>
</p>
</div>
{% endif %}}

<div class="mdl-card__actions" layout-children="row">
<button name="cancel" class="mdl-button mdl-button--primary">
{{ '{mfa:button_cancel}'|trans }}
</button>
<span flex></span>

<button name="send" class="mdl-button mdl-button--raised mdl-button--primary">
{{ '{mfa:button_send}'|trans }}
</button>
</div>
</div>
</form>
</main>
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions modules/mfa/public/send-manager-mfa.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@

$globalConfig = Configuration::getInstance();

$t = new Template($globalConfig, 'mfa:send-manager-mfa.php');
$t = new Template($globalConfig, 'mfa:send-manager-mfa');
$t->data['stateId'] = $stateId;
$t->data['managerEmail'] = $state['managerEmail'];
$t->data['errorMessage'] = $errorMessage ?? null;
$t->show();
$t->send();

$logger->info(json_encode([
'event' => 'offer to send manager code',
Expand Down

0 comments on commit 416ea2e

Please sign in to comment.