From efced21cb26a34a00ceea3f8591c9fc050e921d4 Mon Sep 17 00:00:00 2001
From: Aaron Christian <achristian@acromediainc.com>
Date: Mon, 21 Aug 2017 12:01:13 -0700
Subject: [PATCH] Finished up MDC footer.

---
 css/footer.css                | 30 ++++++++++++++++++++++++++++++
 css/layout.css                |  4 ++++
 mdc.info.yml                  |  1 +
 mdc.libraries.yml             |  2 ++
 mdc.theme                     |  9 +++++++++
 templates/page/page.html.twig | 15 +++++++++------
 6 files changed, 55 insertions(+), 6 deletions(-)
 create mode 100644 css/footer.css

diff --git a/css/footer.css b/css/footer.css
new file mode 100644
index 0000000..e9269ad
--- /dev/null
+++ b/css/footer.css
@@ -0,0 +1,30 @@
+footer {
+  margin: 20px 0 0 0;
+  padding: 5px 0 0 0;
+  border-top: 1px solid #E6E6E6;
+  display: flex;
+  color: #9E9E9E;
+  font-size: 1.05em;
+}
+
+footer .mdc-footer__logo {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+footer .mdc-footer__logo:before {
+  content: "";
+  width: 55px;
+  height: 55px;
+  display: inline-block;
+  vertical-align: top;
+  background: url(../../../core/themes/seven/images/icons/cccccc/d8-logo.svg) 50% center no-repeat;
+  background-size: 35px;
+}
+
+footer .mdc-footer__copyright {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
\ No newline at end of file
diff --git a/css/layout.css b/css/layout.css
index 59597d7..18e0eaa 100644
--- a/css/layout.css
+++ b/css/layout.css
@@ -7,6 +7,10 @@
 	padding-bottom: 0;
 }
 
+.page-content {
+	margin-bottom: 2em;
+}
+
 /* ---------- System Modules ----------- */
 .system-modules td {
 	vertical-align: middle;
diff --git a/mdc.info.yml b/mdc.info.yml
index 5e96809..21babc3 100644
--- a/mdc.info.yml
+++ b/mdc.info.yml
@@ -57,5 +57,6 @@ regions:
   page_top: 'Page top'
   page_bottom: 'Page bottom'
   sidebar_first: 'First sidebar'
+  footer: 'Footer'
 regions_hidden:
   - sidebar_first
diff --git a/mdc.libraries.yml b/mdc.libraries.yml
index 2a7b784..0e97dde 100644
--- a/mdc.libraries.yml
+++ b/mdc.libraries.yml
@@ -17,6 +17,8 @@ material-theme:
       css/fields.css: {}
       '//fonts.googleapis.com/css?family=Roboto:300,400,500,700': { type: external, minified: true }
       '//fonts.googleapis.com/icon?family=Material+Icons': { type: external, minified: true }
+      # mdc components
+      css/footer.css: {}
 
 material-color.preview:
   version: VERSION
diff --git a/mdc.theme b/mdc.theme
index 112d214..2f458ff 100644
--- a/mdc.theme
+++ b/mdc.theme
@@ -11,6 +11,15 @@ use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Template\Attribute;
 use Drupal\Core\Render\Element;
 
+function mdc_preprocess_page(&$variables) {
+  // Load the site name out of configuration.
+  $config = \Drupal::config('system.site');
+  $variables['site_name'] = $config->get('name');
+
+  // Find out if the MDC footer is shown or hidden
+  $variables['mdc_footer'] = theme_get_setting('mdc_footer','mdc');
+}
+
 function mdc_preprocess_color_scheme_form(&$variables) {
   $form = &$variables['form'];
 
diff --git a/templates/page/page.html.twig b/templates/page/page.html.twig
index e3d2a5f..52520d4 100644
--- a/templates/page/page.html.twig
+++ b/templates/page/page.html.twig
@@ -44,9 +44,9 @@
 </header>
 
 <div class="mdc-layout-grid">
+
   <div class="mdc-layout-grid__inner">
     <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">
-
       {{ page.pre_content }}
       {{ page.breadcrumb }}
       <main class="page-content clearfix" role="main">
@@ -59,11 +59,14 @@
         {% endif %}
         {{ page.content }}
       </main>
-
     </div>
   </div>
-</div>
 
-<footer class="content-footer clearfix">
-  {{ page.footer }}
-</footer>
\ No newline at end of file
+  {% if mdc_footer %}
+    <footer class="class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">
+      <span class="mdc-footer__logo"></span>
+      <span class="mdc-footer__copyright">&copy; {{ "now"|date("Y") }} {{ site_name }}. {{ 'All rights reserved'|trans }}.</span>
+    </footer>
+  {% endif %}
+
+</div>
\ No newline at end of file
-- 
2.7.4.windows.1

From a804a9103bff0e873a3180213db62fbc1d898a8b Mon Sep 17 00:00:00 2001
From: Aaron Christian <achristian@acromediainc.com>
Date: Sat, 19 Aug 2017 21:38:46 -0700
Subject: [PATCH] Started working on mdc admin footer.

---
 config/install/mdc.settings.yml | 15 +++++++++++++++
 templates/page/page.html.twig   |  6 +++++-
 theme-settings.php              | 24 ++++++++++++++++++++++++
 3 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 config/install/mdc.settings.yml
 create mode 100644 theme-settings.php

diff --git a/config/install/mdc.settings.yml b/config/install/mdc.settings.yml
new file mode 100644
index 0000000..d9cdbb0
--- /dev/null
+++ b/config/install/mdc.settings.yml
@@ -0,0 +1,15 @@
+favicon:
+  mimetype: image/vnd.microsoft.icon
+  path: ''
+  url: ''
+  use_default: true
+features:
+  comment_user_picture: true
+  comment_user_verification: true
+  favicon: true
+  node_user_picture: false
+logo:
+  path: ''
+  url: ''
+  use_default: true
+mdc_footer: true
diff --git a/templates/page/page.html.twig b/templates/page/page.html.twig
index e69bb4a..e3d2a5f 100644
--- a/templates/page/page.html.twig
+++ b/templates/page/page.html.twig
@@ -62,4 +62,8 @@
 
     </div>
   </div>
-</div>
\ No newline at end of file
+</div>
+
+<footer class="content-footer clearfix">
+  {{ page.footer }}
+</footer>
\ No newline at end of file
diff --git a/theme-settings.php b/theme-settings.php
new file mode 100644
index 0000000..7f43bb4
--- /dev/null
+++ b/theme-settings.php
@@ -0,0 +1,24 @@
+<?php
+
+function mdc_form_system_theme_settings_alter(&$form, \Drupal\Core\Form\FormStateInterface &$form_state, $form_id = NULL, $theme = '') {
+
+	// Work-around for a core bug affecting admin themes. See issue #943212.
+	if (isset($form_id)) {
+		return;
+	}
+
+	$form['mdc'] = [
+		'#type' => 'details',
+		'#title' => t('MDC Settings'),
+		'#open' => TRUE,
+		'#weight' => -1,
+	];
+
+	$form['mdc']['mdc_footer'] = [
+		'#type' => 'checkbox',
+		'#title' => t('Show MDC admin footer'),
+		'#default_value' => theme_get_setting('mdc_footer'),
+		'#tree' => FALSE,
+	];
+
+}
\ No newline at end of file
-- 
2.7.4.windows.1

