Commit e6914e0d authored by Chris Shantz's avatar Chris Shantz
Browse files

Merge branch '1.0.x' into prod/1.0.x

parents 0e566dc7 b75248fb
# Ignore compiled files.
source
js
# Ignore directories
images/images
......
!function(l,i){i.behaviors.uwFdsuThemeRespUserLogin={attach:function(i,n){l("#edit-simplesamlphp-auth-login-link").length&&(l("#user-login-form").css("display","none"),l("#user-login-form").after('<button id="adfs-login-link" class="button--primary">Log in via ADFS</button> &nbsp; <button id="local-login-link" class="button--medium">Log in locally</button>'),l("#edit-submit").val("Log in locally"),l("#local-login-link").click(function(){l("#user-login-form").css("display","block"),l("#local-login-link").css("display","none"),l("#adfs-login-link").css("display","none"),l("#edit-name").focus()}),l("#adfs-login-link").click(function(){l("#edit-simplesamlphp-auth-login-link")[0].click()}))}}}(jQuery,Drupal);
(function ($, Drupal) {
Drupal.behaviors.uwFdsuThemeRespUserLogin = {
attach: function (context, settings) {
// Don't do anything if SimpleSAML isn't enabled.
if ($('#edit-simplesamlphp-auth-login-link').length)
{
// Hide the normal login form.
$('#user-login-form').css('display', 'none');
// Add buttons (using JS because they don't work without JS)
$('#user-login-form').after('<button id="adfs-login-link" class="button--primary">Log in via ADFS</button> &nbsp; <button id="local-login-link" class="button--medium">Log in locally</button>');
// Update the existing login form's link text.
$('#edit-submit').val('Log in locally');
// If the local login link is clicked, show the normal login form and hide the buttons.
// Be nice to the user, and put focus on the name field so they can just start typing.
$('#local-login-link').click(function () {
$('#user-login-form').css('display', 'block');
$('#local-login-link').css('display', 'none');
$('#adfs-login-link').css('display', 'none');
$('#edit-name').focus();
});
// If the ADFS login link is clicked, click on the original log in with ADFS link.
$('#adfs-login-link').click(function () {
$('#edit-simplesamlphp-auth-login-link')[0].click();
});
}
}
};
})(jQuery, Drupal);
......@@ -39,8 +39,8 @@
{% if footer_data %}
<div class="layout uw-contained-width">
{% include '@components/card/card--teaser/card--teaser.twig' with {
'teaser': footer_data,
{% include '@components/card/card--node/card--node.twig' with {
'node': footer_data,
'type': 'footer',
} %}
</div>
......
......@@ -4,7 +4,8 @@ description: Theme based on <a href="http://github.com/forumone/gesso">Gesso</a>
base theme: seven
core_version_requirement: ^8 || ^9
dependencies:
- content_moderation
- content_moderation:content_moderation
- uw_wcms_gesso:uw_wcms_gesso
# Libraries (These are loaded on every page. Use https://www.drupal.org/developing/api/8/assets#twig whenever possible.)
libraries:
......@@ -33,7 +34,8 @@ regions:
footer: Footer
# Remove unwanted system stylesheets
# stylesheets-remove:
stylesheets-remove:
- 'core/themes/seven/css/base/elements.css'
# - '@stable/css/system/components/align.module.css'
# - '@stable/css/system/components/fieldgroup.module.css'
# - '@stable/css/system/components/container-inline.module.css'
......
global:
css:
theme:
../../modules/custom/uw_wcms_gesso/css/styles.css: {}
../../modules/custom/uw_wcms_gesso/css/styles.min.css: {}
https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css: {}
https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css: {}
js:
......@@ -20,4 +20,7 @@ global-message:
uw_dashboards:
css:
theme:
../../modules/custom/uw_wcms_gesso/css/uw-dashboards.css: {}
../../modules/custom/uw_wcms_gesso/css/uw-dashboards.min.css: {}
user.login:
js:
js/user-login-min.js: {}
......@@ -9,6 +9,7 @@ use Drupal\Core\Url;
use Drupal\file\Plugin\Field\FieldType\FileFieldItemList;
use Drupal\image\Plugin\Field\FieldType\ImageItem;
use Drupal\Core\Form\FormStateInterface;
use Drupal\node\Entity\Node;
/**
* @file
......@@ -35,6 +36,12 @@ 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 the user login page.
$route_name = \Drupal::routeMatch()->getRouteName();
if ($route_name == 'user.login') {
$variables['#attached']['library'][] = 'uw_fdsu_theme_resp/user.login';
}
}
/**
......@@ -65,6 +72,9 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) {
// Get the region from variables.
$region = $variables['elements']['#region'];
// Variables that we want to have access to regardless of region.
$variables['branding_level'] = theme_get_setting('wcms_branding_level', 'uw_fdsu_theme_resp') ? theme_get_setting('wcms_branding_level', 'uw_fdsu_theme_resp') : 'full';
// If we are on the header, add the correct header classes
// TO DO: Store the colour scheme used for the theme
// (i.e. faculty colour and get the correct class here).
......@@ -392,6 +402,14 @@ function uw_fdsu_theme_resp_preprocess_block(&$variables) {
// Load the node.
$node = \Drupal::routeMatch()->getParameter('node');
// ISTWCMS-4943: ensure that we get a node object.
// If node is not object by this point, probably on
// a revision page where node is an integer, so load
// the node.
if ($node && !is_object($node)) {
$node = Node::load($node);
}
// If there is a node, check that it has a featured image.
if ($node) {
......
Supports Markdown
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