Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert about2expire template to Twig #233

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
4 changes: 2 additions & 2 deletions modules/expirychecker/public/about2expire.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@

$globalConfig = Configuration::getInstance();

$t = new Template($globalConfig, 'expirychecker:about2expire.php');
$t = new Template($globalConfig, 'expirychecker:about2expire');
$t->data['formTarget'] = Module::getModuleURL('expirychecker/about2expire.php');
$t->data['formData'] = ['StateId' => $stateId];
$t->data['daysLeft'] = $state['daysLeft'];
$t->data['dayOrDays'] = (intval($state['daysLeft']) === 1 ? 'day' : 'days');
$t->data['expiresAtTimestamp'] = $state['expiresAtTimestamp'];
$t->data['accountName'] = $state['accountName'];
$t->show();
$t->send();

Logger::info('expirychecker - User has been warned that their password will expire soon.');
45 changes: 0 additions & 45 deletions modules/material/dictionaries/about2expire.definition.json

This file was deleted.

27 changes: 0 additions & 27 deletions modules/material/dictionaries/expired.definition.json

This file was deleted.

9 changes: 0 additions & 9 deletions modules/material/dictionaries/footer.definition.json

This file was deleted.

58 changes: 0 additions & 58 deletions modules/material/themes/material/expirychecker/about2expire.php

This file was deleted.

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

{% include 'header.twig' %}
</head>
<body>
<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">
{{ '{about2expire:header}'|trans }}
</span>
</div>
</header>
<main class="mdl-layout__content" layout-children="column">
<form layout-children="column">
{% for name, value in formData %}
<input type="hidden" name="{{ name|e }}" value="{{ value|e }}">
{% endfor %}

<p class="mdl-typography--title margin">
{% if daysLeft < 2 %}
{{ '{about2expire:expiring_in_a_day}'|trans }}
{% else %}
{{ '{about2expire:expiring_soon}'|trans({'%daysLeft%': daysLeft}) }}
{% endif %}
</p>

<p class="mdl-typography--body-1">
{{ '{about2expire:change_now}'|trans }}
</p>

<div class="fill-parent" layout-children="row" child-spacing="space-around">
<button name="continue" class="mdl-button mdl-button--raised">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<button name="continue" class="mdl-button mdl-button--raised">
<button name="continue" type="submit" class="mdl-button mdl-button--raised">

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

{{ '{about2expire:button_continue}'|trans }}
</button>

<button name="changepwd" class="mdl-button mdl-button--raised mdl-button--primary">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<button name="changepwd" class="mdl-button mdl-button--raised mdl-button--primary">
<button name="changepwd" type="submit" class="mdl-button mdl-button--raised mdl-button--primary">

{{ '{about2expire:button_change}'|trans }}
</button>
</div>
</form>
</main>

{% include 'footer.twig' %}
</div>
</body>
</html>