Skip to content

Commit

Permalink
Add forgot password template and language.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianaHoJo committed Jul 22, 2021
1 parent 6e5ab1c commit d2fb47a
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 4 deletions.
40 changes: 38 additions & 2 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v0.1.1
## 07/22/2021

1. [](#feature)
* Overwrite forgot password page with info text instead of forgot password form
* add language.yaml

# v0.1.0
## 04/13/2021

Expand Down
17 changes: 17 additions & 0 deletions admin/themes/grav/templates/forgot.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% embed 'partials/login.html.twig' with {title:'Grav Forgot Password'} %}

{% block form %}
{% for field in form.fields %}
{% if field.type %}
<div>
{{ 'PLUGIN_TECART_JIRA_LOGIN.TEXT_FORGOT_PAGE'|tu }}<br /><br />
</div>
{% endif %}
{% endfor %}
<div class="form-actions primary-accent">
<a class="button secondary" href="{{ admin_route('/login') }}"><i class="fa fa-sign-in"></i> {{ 'PLUGIN_ADMIN.LOGIN_BTN'|tu }}</a>
</div>
{% endblock %}

{% endembed %}

6 changes: 6 additions & 0 deletions languages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
de:
PLUGIN_TECART_JIRA_LOGIN:
TEXT_FORGOT_PAGE: Bitte wenden Sie sich an einen unserer Jira Administratoren.
en:
PLUGIN_TECART_JIRA_LOGIN:
TEXT_FORGOT_PAGE: Bitte wenden Sie sich an einen unserer Jira Administratoren.
11 changes: 9 additions & 2 deletions tecart-jira-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ class TecartJiraLoginPlugin extends Plugin
public static function getSubscribedEvents(){
return [
'onPluginsInitialized' => [
['onPluginsInitialized', 0]
['onPluginsInitialized', 10]
],
'onUserLoginAuthenticate' => ['userLoginAuthenticate', 1000],
'onUserLoginFailure' => ['userLoginFailure', 0],
'onUserLogin' => ['userLogin', 0],
'onUserLogout' => ['userLogout', 0],
'onAdminTwigTemplatePaths' => ['onAdminTwigTemplatePaths', 0]
];
}

Expand All @@ -35,6 +36,12 @@ public function onPluginsInitialized(){
}
}

public function onAdminTwigTemplatePaths($event) {
$paths = $event['paths'];
$paths[] = __DIR__ . '/admin/themes/grav/templates';
$event['paths'] = $paths;
}

public function userLoginAuthenticate(UserLoginEvent $event){

// event is called when login button is pressed
Expand Down Expand Up @@ -190,4 +197,4 @@ protected function setGravUser($username) {

return $grav_user;
}
}
}

0 comments on commit d2fb47a

Please sign in to comment.