Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
WCMS
uw_fdsu_theme_resp
Commits
86e38630
Commit
86e38630
authored
Jul 19, 2021
by
Tyler Struyk
Committed by
Kevin Paxman
Jul 19, 2021
Browse files
ISTWCMS-3682: modify the login form to mimic wcms2 with adfs
parent
f4bcf6ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-0
templates/form/form--user-login-form.html.twig
templates/form/form--user-login-form.html.twig
+17
-0
uw_fdsu_theme_resp.libraries.yml
uw_fdsu_theme_resp.libraries.yml
+3
-0
uw_fdsu_theme_resp.theme
uw_fdsu_theme_resp.theme
+33
-0
No files found.
templates/form/form--user-login-form.html.twig
0 → 100644
View file @
86e38630
{#
/**
* @file
* Theme override for a 'form' element.
*
* Available variables
* - attributes: A list of HTML attributes for the wrapper element.
* - children: The child elements of the form.
*
* @see template_preprocess_form()
*/
#}
<form
{{
attributes
}}
>
{{
children
}}
</form>
<button
id=
"adfs-login-link"
class=
"button--primary"
onClick=
'ADFSButton_onClick()'
>
Log In Via ADFS
</button>
<button
id=
"local-login-link"
>
Log In Locally
</button>
uw_fdsu_theme_resp.libraries.yml
View file @
86e38630
...
...
@@ -21,3 +21,6 @@ uw_dashboards:
css
:
theme
:
../../modules/custom/uw_wcms_gesso/css/uw-dashboards.min.css
:
{}
user.login
:
js
:
js/user-login.js
:
{}
uw_fdsu_theme_resp.theme
View file @
86e38630
...
...
@@ -24,6 +24,32 @@ require_once dirname(__FILE__) . '/includes/navigation.inc';
require_once
dirname
(
__FILE__
)
.
'/includes/taxonomy.inc'
;
require_once
dirname
(
__FILE__
)
.
'/includes/views.inc'
;
/**
* Implements hook_theme_suggestions_form_alter().
*
* Add suggestion for forms.
*/
function
uw_fdsu_theme_resp_theme_suggestions_form_alter
(
array
&
$suggestions
,
array
$variables
)
{
// form--user-login-form.html.twig.
$suggestions
[]
=
'form__'
.
str_replace
(
'-'
,
'_'
,
$variables
[
'element'
][
'#id'
]);
}
/**
* Implements hook_theme().
*
* Custom twig for forms.
*/
function
uw_fdsu_theme_resp_theme
(
$existing
,
$type
,
$theme
,
$path
)
{
return
[
'form__user-login-form'
=>
[
'#theme'
=>
'form--user-login-form'
,
'render element'
=>
'form'
,
],
];
}
/**
* Implements hook_preprocess_HOOK().
*
...
...
@@ -36,6 +62,13 @@ function uw_fdsu_theme_resp_preprocess_html(&$variables) {
$variables
[
'uw_admin_page'
]
=
\
Drupal
::
service
(
'uw_cfg_common.uw_analytics'
)
->
administrationPage
();
_uw_fdsu_theme_resp_add_favicons
(
$variables
);
// Add Javascript only on user login page
$route_name
=
\
Drupal
::
routeMatch
()
->
getRouteName
();
if
(
$route_name
==
'user.login'
)
{
$variables
[
'#attached'
][
'library'
][]
=
'uw_fdsu_theme_resp/user.login'
;
}
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment