Skip to content

Commit

Permalink
Add Fluid templates for EXT:felogin
Browse files Browse the repository at this point in the history
  • Loading branch information
Hawkeye1909 authored and benjaminkott committed Apr 25, 2023
1 parent 51be719 commit f942881
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 179 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# FRONTEND LOGIN
styles.content.loginform {
templateFile = EXT:bootstrap_package/Resources/Private/Templates/Felogin/FrontendLogin.html
}
########################
#### FRONTEND LOGIN ####
########################

@import 'EXT:felogin/Configuration/TypoScript/constants.typoscript'
37 changes: 21 additions & 16 deletions Configuration/TypoScript/Extension/Felogin/setup.typoscript
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# FRONTEND LOGIN
plugin.tx_felogin_pi1 {
wrapContentInBaseClass = 0
welcomeMessage_stdWrap.wrap = <p>|</p>
logoutMessage_stdWrap.wrap = <p>|</p>
errorMessage_stdWrap.wrap = <p class="text-danger">|</p>
successMessage_stdWrap.wrap = <p class="text-success">|</p>
cookieWarning_stdWrap.wrap = <p class="text-warning">|</p>
forgotMessage_stdWrap.wrap = <p>|</p>
forgotErrorMessage_stdWrap.wrap = <p class="text-danger">|</p>
forgotResetMessageEmailSentMessage_stdWrap.wrap = <p class="text-success">|</p>
changePasswordNotValidMessage_stdWrap.wrap = <p class="text-danger">|</p>
changePasswordTooShortMessage_stdWrap.wrap = <p class="text-danger">|</p>
changePasswordNotEqualMessage_stdWrap.wrap = <p class="text-danger">|</p>
changePasswordMessage_stdWrap.wrap = <p>|</p>
changePasswordDoneMessage_stdWrap.wrap = <p class="text-success">|</p>
########################
#### FRONTEND LOGIN ####
########################

@import 'EXT:felogin/Configuration/TypoScript/setup.typoscript'

plugin.tx_felogin_login {
view {
templateRootPaths {
20 = EXT:bootstrap_package/Resources/Private/Templates/Felogin/
21 = {$plugin.bootstrap_package.view.templateRootPath}Felogin/
}
partialRootPaths {
20 = EXT:bootstrap_package/Resources/Private/Partials/Felogin/
21 = {$plugin.bootstrap_package.view.partialRootPath}Felogin/
}
layoutRootPaths {
20 = EXT:bootstrap_package/Resources/Private/Layouts/Felogin/
21 = {$plugin.bootstrap_package.view.layoutRootPath}Felogin/
}
}
}
5 changes: 5 additions & 0 deletions Resources/Private/Partials/Felogin/CookieWarning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">

<p class="text-warning"><f:translate key="cookie_warning" /></p>

</html>
159 changes: 0 additions & 159 deletions Resources/Private/Templates/Felogin/FrontendLogin.html

This file was deleted.

91 changes: 91 additions & 0 deletions Resources/Private/Templates/Felogin/Login/Login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">

<f:flashMessages />
<f:if condition="{cookieWarning}">
<f:render partial="CookieWarning" />
</f:if>

<f:if condition="{messageKey}">
<h3>
<f:render partial="RenderLabelOrMessage" arguments="{key: '{messageKey}_header'}" />
</h3>
<p{f:if(condition: '{messageKey} == "error"', then: ' class="text-danger"')}>
<f:render partial="RenderLabelOrMessage" arguments="{key: '{messageKey}_message'}" />
</p>
</f:if>
<f:if condition="{onSubmit}">
<f:then>
<f:form target="_top" fieldNamePrefix="" action="login" onsubmit="{onSubmit}">
<f:render section="content" arguments="{_all}" />
</f:form>
</f:then>
<f:else>
<f:form target="_top" fieldNamePrefix="" action="login">
<f:render section="content" arguments="{_all}" />
</f:form>
</f:else>
</f:if>

<f:if condition="{settings.showForgotPassword}">
<f:link.action action="recovery" controller="PasswordRecovery">
<f:render partial="RenderLabelOrMessage" arguments="{key: 'forgot_header'}" />
</f:link.action>
</f:if>

<f:section name="content">
<fieldset>
<legend><f:translate key="login" /></legend>
<div class="form-group">
<label class="form-label" for="user"><f:translate key="username" /></label>
<f:form.textfield name="user" class="form-control" required="true" additionalAttributes="{autocomplete: 'username'}" />
</div>
<div class="form-group">
<label class="form-label" for="pass"><f:translate key="password" /></label>
<f:form.password name="pass" class="form-control" data="{rsa-encryption: ''}" additionalAttributes="{required: 'required', autocomplete: 'current-password'}" />
</div>

<f:if condition="{permaloginStatus} > -1">
<div class="form-group">
<div class="form-check">
<f:if condition="{permaloginStatus} == 1">
<f:then>
<f:form.hidden name="permalogin" value="0" additionalAttributes="{disabled: 'disabled'}" />
<f:form.checkbox class="form-check-input" name="permalogin" id="permalogin" value="1" checked="checked" />
</f:then>
<f:else>
<f:form.hidden name="permalogin" value="0" />
<f:form.checkbox class="form-check-input" name="permalogin" id="permalogin" value="1" />
</f:else>
</f:if>
<label class="form-check-label" for="permalogin">
<f:translate id="permalogin" />
</label>
</div>
</div>
</f:if>

<div class="form-group">
<f:form.submit name="submit" class="btn btn-primary" value="{f:translate(key: 'login')}" />
</div>

<div class="felogin-hidden">
<f:form.hidden name="logintype" value="login" />
<f:form.hidden name="pid" value="{storagePid}" />
<f:if condition="{redirectURL}!=''">
<f:form.hidden name="redirect_url" value="{redirectURL}" />
</f:if>
<f:if condition="{referer}!=''">
<f:form.hidden name="referer" value="{referer}" />
</f:if>
<f:if condition="{redirectReferrer}!=''">
<f:form.hidden name="redirectReferrer" value="off" />
</f:if>
<f:if condition="{noRedirect}!=''">
<f:form.hidden name="noredirect" value="1" />
</f:if>

{extraHidden}
</div>
</fieldset>
</f:section>
</html>
31 changes: 31 additions & 0 deletions Resources/Private/Templates/Felogin/Login/Logout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">

<f:if condition="{cookieWarning}">
<f:render partial="CookieWarning" />
</f:if>

<h3>
<f:render partial="RenderLabelOrMessage" arguments="{key: 'status_header'}" />
</h3>
<p>
<f:render partial="RenderLabelOrMessage" arguments="{key: 'status_message'}" />
</p>

<f:form action="login" actionUri="{actionUri}" target="_top" fieldNamePrefix="">
<fieldset>
<legend><f:translate key="logout" /></legend>
<dl>
<dt><f:translate key="username" /></dt>
<dd>{user.username}</dd>
</dl>
<div class="form-group">
<f:form.submit name="submit" class="btn btn-primary" value="{f:translate(key: 'logout')}" />
</div>

<div class="felogin-hidden">
<f:form.hidden name="logintype" value="logout" />
<f:form.hidden name="pid" value="{storagePid}" />
</div>
</fieldset>
</f:form>
</html>
29 changes: 29 additions & 0 deletions Resources/Private/Templates/Felogin/PasswordRecovery/Recovery.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<h3>
<f:render partial="RenderLabelOrMessage" arguments="{key: 'forgot_header'}" />
</h3>
<p>
<f:render partial="RenderLabelOrMessage" arguments="{key: 'forgot_reset_message'}" />
</p>

<f:render partial="ValidationErrors" />

<f:form action="recovery" method="post">
<fieldset>
<legend><f:render partial="RenderLabelOrMessage" arguments="{key: 'reset_password'}" /></legend>
<div class="form-group">
<label class="form-label" for="userIdentifier"><f:translate key="enter_your_data" /></label>
<f:form.textfield name="userIdentifier" class="form-control" />
</div>
<div class="form-group">
<f:form.submit class="btn btn-primary" value="{f:translate(key: 'reset_password')}" />
</div>
</fieldset>
</f:form>

<p>
<f:link.action action="login" controller="Login">
<f:translate key="forgot_header_backToLogin" />
</f:link.action>
</p>
</html>
Loading

0 comments on commit f942881

Please sign in to comment.