Commit 86e38630 authored by Tyler Struyk's avatar Tyler Struyk Committed by Kevin Paxman
Browse files

ISTWCMS-3682: modify the login form to mimic wcms2 with adfs

parent f4bcf6ed
{#
/**
* @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>
......@@ -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: {}
......@@ -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';
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment