Skip to content

Commit

Permalink
Merge pull request #178 from isubit/development
Browse files Browse the repository at this point in the history
Development - 1.7.0
  • Loading branch information
sacarney committed Jul 29, 2021
2 parents e14baae + 3c51f31 commit 856b63c
Show file tree
Hide file tree
Showing 13 changed files with 204 additions and 52 deletions.
33 changes: 24 additions & 9 deletions config/install/iastate_theme.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ iastate_unit_url: ''
iastate_footer_logo_path: themes/contrib/iastate_theme/isu-stacked.svg
iastate_footer_logo_url: 'https://www.iastate.edu/'
iastate_footer_logo_alt: ''
iastate_contact_address: "2221 Wanda Daley Dr\n2nd Floor ASB\nAmes, IA 50011"
iastate_contact_email: 'theme@iastate.edu'
iastate_contact_phone: '515-294-6654'
iastate_contact_address: "2221 Wanda Daley Dr\r\n2nd Floor ASB\r\nAmes, IA 50011"
iastate_contact_email: theme@iastate.edu
iastate_contact_phone: 515-294-6654
iastate_associate1_title: 'Information Technology Services'
iastate_associate1_url: 'https://www.it.iastate.edu/'
iastate_associate2_title: 'Biology Information Technology'
Expand All @@ -24,14 +24,29 @@ iastate_associate5_title: 'University Relations'
iastate_associate5_url: 'http://www.ur.iastate.edu/'
iastate_associate6_title: 'Office of University Marketing'
iastate_associate6_url: 'http://marketing.iastate.edu/'
iastate_social1_title: 'Facebook'
iastate_social1_title: Facebook
iastate_social1_url: 'http://facebook.com/IowaStateU/'
iastate_social2_title: 'Twitter'
iastate_social2_title: Twitter
iastate_social2_url: 'http://twitter.com/iowastateu?lang=en'
iastate_social3_title: 'Instagram'
iastate_social3_title: Instagram
iastate_social3_url: 'http://instagram.com/iowastateu/'
iastate_social4_title: 'YouTube'
iastate_social4_title: YouTube
iastate_social4_url: 'http://youtube.com/user/iowastateu'
iastate_social5_title: 'RSS'
iastate_social5_title: RSS
iastate_social5_url: 'http://www.news.iastate.edu/rss/rss.php'

logo:
use_default: true
path: ''
iastate_logo_url: ''
iastate_logo_width: ''
iastate_logo_height: ''
favicon:
use_default: true
iastate_contact_title: ''
iastate_contact_fax: ''
iastate_social6_title: ''
iastate_social6_url: ''
iastate_social7_title: ''
iastate_social7_url: ''
iastate_footer_logo_width: '180'
iastate_footer_logo_height: '58'
42 changes: 42 additions & 0 deletions config/schema/iastate_theme.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ iastate_theme.settings:
gold_border_hidden:
type: integer
label: 'Show gold border'
iastate_copyright_hidden:
type: integer
label: 'Hide copyright'
features:
type: mapping
label: 'Optional features'
Expand All @@ -21,12 +24,36 @@ iastate_theme.settings:
iastate_unit_url:
type: uri
label: 'Unit url'
iastate_logo_url:
type: string
label: 'Custom logo url'
iastate_logo_alt:
type: string
label: 'Logo alt text'
iastate_logo_width:
type: string
label: 'Logo width in pixels'
iastate_logo_height:
type: string
label: 'Logo height in pixels'
iastate_footer_logo_path:
type: uri
label: 'Path to custom footer logo'
iastate_footer_logo_url:
type: uri
label: 'Custom footer logo url'
iastate_footer_logo_alt:
type: string
label: 'Footer logo alt text'
iastate_footer_logo_width:
type: string
label: 'Footer logo width in pixels'
iastate_footer_logo_height:
type: string
label: 'Footer logo height in pixels'
iastate_contact_title:
type: string
label: 'Contact Title'
iastate_contact_address:
type: text
label: 'Address'
Expand All @@ -36,6 +63,9 @@ iastate_theme.settings:
iastate_contact_phone:
type: string
label: 'Phone'
iastate_contact_fax:
type: string
label: 'Fax'
iastate_associate1_title:
type: string
label: 'Associate 1 Title'
Expand Down Expand Up @@ -102,3 +132,15 @@ iastate_theme.settings:
iastate_social5_url:
type: uri
label: 'Social 5 URL'
iastate_social6_title:
type: string
label: 'Social 6 Title'
iastate_social6_url:
type: uri
label: 'Social 6 URL'
iastate_social7_title:
type: string
label: 'Social 7 Title'
iastate_social7_url:
type: uri
label: 'Social 7 URL'
2 changes: 1 addition & 1 deletion css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ caption {
/* ## IMAGES
/* -------------------------------------- */

img {
img:not(.isu-wordmark-logo_default):not(.isu-wordmark-logo_custom):not(.isu-footer-logo) { /* See theme.css */
max-width: 100%;
height: auto;
}
Expand Down
2 changes: 1 addition & 1 deletion css/isu-navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
/* Dropdown menus
/* -------------------------------------- */

.isu-navbar_dropdown[aria-expanded='false'] .isu-navbar_dropdown-menu {
.isu-navbar_dropdown[data-isu-navbar-expanded='false'] .isu-navbar_dropdown-menu {
display: none;
}
@media (min-width: 992px) {
Expand Down
25 changes: 19 additions & 6 deletions css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,13 @@ body,
.isu-wordmark a:focus {
color: #ffffff;
}
.isu-wordmark-logo {
.isu-wordmark-logo_default {
width: 100%;
max-width: 250px;
max-width: 250px ;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
.isu-wordmark-logo_custom {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
Expand All @@ -200,9 +204,18 @@ body,
border-top: 1px solid rgba(255, 255, 255, 0.5);
}

/* Medium */
@media (max-width: 991px) {
.isu-wordmark-logo_custom {
width: 100%;
max-width: 250px;
height: auto;
}
}

/* Large */
@media screen and (min-width: 992px) {
.isu-wordmark-logo {
.isu-wordmark-logo_default {
width: 100%;
max-width: 400px;
margin-top: 0;
Expand Down Expand Up @@ -1293,9 +1306,9 @@ a.tabledrag-handle .handle {
color: #676767;
background: #f3f3f3;
}
.isu-footer-logo {
width: 100%;
max-width: 180px;
.isu-footer-logo {
max-width: 100%;
height: auto;
}
.isu-sign-off_wrapper {
margin-bottom: -2rem;
Expand Down
1 change: 1 addition & 0 deletions iastate_theme.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description: Drupal 8 theme for Iowa State University websites
type: theme
core: 8.x
core_version_requirement: ^8 || ^9
version: "1.7.0"
base theme: stable
libraries:
- iastate_theme/global-css
Expand Down
12 changes: 8 additions & 4 deletions iastate_theme.theme
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Drupal\node\NodeInterface;
use Drupal\Core\Form\FormStateInterface;

/**
* Implements template_preprocess_html().
Expand Down Expand Up @@ -91,9 +92,6 @@ function iastate_theme_preprocess_links(&$variables) {
*
* Add ISU Theme class to Site Navbar search form
*/

use Drupal\Core\Form\FormStateInterface;

function iastate_theme_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
if( $form_id == 'search_block_form') {
$form['actions']['submit']['#attributes']['class'][] = 'isu-search__search-btn';
Expand Down Expand Up @@ -167,7 +165,11 @@ function iastate_theme_preprocess(&$variables, $hook) {

function iastate_theme_preprocess_block(&$variables) {
$variables['iastate_logo_alt'] = theme_get_setting('iastate_logo_alt');

$variables['iastate_logo_width'] = theme_get_setting('iastate_logo_width');
$variables['iastate_logo_height'] = theme_get_setting('iastate_logo_height');
$variables['iastate_logo_alt'] = theme_get_setting('iastate_logo_alt');
$variables['is_default_logo'] = \Drupal::config('iastate_theme.settings')->get('logo.use_default');
$variables['iastate_logo_url'] = theme_get_setting('iastate_logo_url');
}

/*
Expand All @@ -185,6 +187,8 @@ function iastate_theme_preprocess_page(&$variables) {
$variables['iastate_footer_logo_path'] = theme_get_setting('iastate_footer_logo_path');
$variables['iastate_footer_logo_url'] = theme_get_setting('iastate_footer_logo_url');
$variables['iastate_footer_logo_alt'] = theme_get_setting('iastate_footer_logo_alt');
$variables['iastate_footer_logo_width'] = theme_get_setting('iastate_footer_logo_width');
$variables['iastate_footer_logo_height'] = theme_get_setting('iastate_footer_logo_height');

$variables['iastate_contact_title'] = theme_get_setting('iastate_contact_title');
$variables['iastate_contact_address'] = theme_get_setting('iastate_contact_address');
Expand Down
8 changes: 4 additions & 4 deletions js/isu-navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $(document).ready(function() {
// Add class for styling
dropdownToggle.addClass('has-focus');
// Open menu
dropdownToggle.parents('.isu-navbar_dropdown').attr('aria-expanded', 'true');
dropdownToggle.parents('.isu-navbar_dropdown').attr('data-isu-navbar-expanded', 'true');
// Change focus to first link in the dropdown
$(':focus').next().find('li:first-of-type a').focus();
}
Expand All @@ -76,7 +76,7 @@ $(document).ready(function() {
var dropdownMenuItem = $(this);
if (event.keyCode === 38) { // up
// Close the dropdown
dropdownMenuItem.closest('.isu-navbar_dropdown').attr('aria-expanded', 'false');
dropdownMenuItem.closest('.isu-navbar_dropdown').attr('data-isu-navbar-expanded', 'false');
// Refocus on the parent link
dropdownMenuItem.closest('.isu-navbar_dropdown').find('a').focus();
}
Expand All @@ -87,7 +87,7 @@ $(document).ready(function() {
var dropdownMenuItem = $(this);
if (event.keyCode === 38) { // up
// Close the dropdown
dropdownMenuItem.closest('.isu-navbar_dropdown').attr('aria-expanded', 'false');
dropdownMenuItem.closest('.isu-navbar_dropdown').attr('data-isu-navbar-expanded', 'false');
// Refocus on the parent link.
dropdownMenuItem.closest('.isu-navbar_dropdown').find('a').focus();
}
Expand All @@ -101,7 +101,7 @@ $(document).ready(function() {
// If the dropdown nor its children don't not have focus...
if ( dropdownMenu.siblings('a:focus').length === 0) {
// Close the menu
dropdownMenu.parents('.isu-navbar_dropdown').attr('aria-expanded', 'false');
dropdownMenu.parents('.isu-navbar_dropdown').attr('data-isu-navbar-expanded', 'false');
// And remove styling class
dropdownMenu.parents('.isu-navbar_dropdown').removeClass('has-focus');
}
Expand Down
17 changes: 16 additions & 1 deletion templates/blocks/block--system-branding-block.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,23 @@
{% extends "block.html.twig" %}

{% block content %}

<div class="isu-wordmark">
<img class="isu-wordmark-logo" src="{{ site_logo }}" {% if iastate_logo_alt %} alt="{{ iastate_logo_alt }}" {% else %} alt="Iowa State University logo"{% endif %}>
{% if iastate_logo_url %}
<a href="{{ iastate_logo_url }}">
{% endif %}

{% if site_logo %}
{% if is_default_logo %}
<img class="isu-wordmark-logo isu-wordmark-logo_default" width="400" height="30" src="{{ site_logo }}" {% if iastate_logo_alt %} alt="{{ iastate_logo_alt }}" {% else %} alt="Iowa State University logo"{% endif %}>
{% else %}
<img class="isu-wordmark-logo isu-wordmark-logo_custom" {% if iastate_logo_width %}width="{{ iastate_logo_width }}"{% endif %} {% if iastate_logo_height %} height="{{ iastate_logo_height }}"{% endif %} src="{{ site_logo }}" {% if iastate_logo_alt %} alt="{{ iastate_logo_alt }}" {% else %} alt="Iowa State University logo"{% endif %}>
{% endif %}
{% endif %}

{% if iastate_logo_url %}
</a>
{% endif %}

{% if iastate_unit_name %}

Expand Down
2 changes: 1 addition & 1 deletion templates/parts/footer.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{% if iastate_footer_logo_url %}
<a href="{{ iastate_footer_logo_url }}">
{% endif %}
<img class="isu-footer-logo" src="{{ base_path }}{{ iastate_footer_logo_path }}" class="wordmark-isu" {% if iastate_footer_logo_alt %} alt="{{ iastate_footer_logo_alt }}" {% else %} alt="Iowa State University logo" {% endif %}>
<img class="isu-footer-logo" {% if iastate_footer_logo_width %} width="{{iastate_footer_logo_width }}"{% else %}width="180"{% endif %} {% if iastate_footer_logo_height %} height="{{ iastate_footer_logo_height }}"{% else %}height="58"{% endif %} src="{{ base_path }}{{ iastate_footer_logo_path }}" class="wordmark-isu" {% if iastate_footer_logo_alt %} alt="{{ iastate_footer_logo_alt }}" {% else %} alt="Iowa State University logo" {% endif %}>
{% if iastate_footer_logo_url %}
</a>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions templates/parts/isu-navbar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<nav class="isu-navbar" aria-label="Iowa State University quicklinks">
<ul class="isu-navbar_container" id="isu-navbar">
<li><a href="https://www.iastate.edu" title="Iowa State University Home Page">iastate.edu</a></li>
<li class="isu-navbar_dropdown_alpha isu-navbar_dropdown" aria-expanded="false">
<li class="isu-navbar_dropdown_alpha isu-navbar_dropdown" data-isu-navbar-expanded="false">
<a href="https://www.iastate.edu/index/A" class="isu-navbar_dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false">Index</a>
<ul class="isu-navbar_dropdown-menu isu-navbar_alpha">
<li><a href="https://www.iastate.edu/index/A/">A</a></li>
Expand Down Expand Up @@ -51,7 +51,7 @@
<li><a href="https://info.iastate.edu/">Directory</a></li>
<li><a href="https://www.fpm.iastate.edu/maps/">Maps</a></li>
<li><a href="https://web.iastate.edu/safety/">Safety</a></li>
<li class="isu-navbar_dropdown_signons isu-navbar_dropdown" aria-expanded="false">
<li class="isu-navbar_dropdown_signons isu-navbar_dropdown" data-isu-navbar-expanded="false">
<a href="https://web.iastate.edu/signons" class="isu-navbar_dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false">Sign Ons</a>
<ul class="isu-navbar_dropdown-menu isu-navbar_signons">
<li><a href="https://accessplus.iastate.edu/">AccessPlus</a></li>
Expand Down
4 changes: 3 additions & 1 deletion templates/parts/site-navbar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@

<button class="isu-search_toggler" id="isu-search_toggler">
<span class="fa fa-search isu-search_toggler-icon" aria-hidden="true"></span>
<span class="isu-search_toggler-label">Open search bar</span>
<span class="isu-search_toggler-label">
<span class="sr-only">Open</span> Search <span class="sr-only">Bar</span>
</span>
</button>

<div class="col-lg isu-col-header-second isu-col-header-second_has-search">
Expand Down

0 comments on commit 856b63c

Please sign in to comment.