Skip to content

Commit

Permalink
Merge branch '8.x-1.x' into 184-inline-editing
Browse files Browse the repository at this point in the history
  • Loading branch information
mortendk committed Aug 26, 2017
2 parents 213b638 + 6f959d7 commit b4a361b
Show file tree
Hide file tree
Showing 562 changed files with 4,886 additions and 4,307 deletions.
10 changes: 9 additions & 1 deletion README.md
@@ -1,5 +1,7 @@
# eleven: A Drupal 8 administration theme

[![Join the chat at https://gitter.im/eleventheme/Lobby](https://badges.gitter.im/eleventheme/Lobby.svg)](https://gitter.im/eleventheme/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

> this one goes to 11 —mortendk
## Installation
Expand All @@ -9,7 +11,8 @@ Manual
###Drush
```
drush dl eleven
drush config-set system.theme admin eleven
drush en eleven -y
drush config-set system.theme admin eleven -y
```

###Composer
Expand All @@ -25,6 +28,11 @@ Go to the apparence page in your drupal site `/admin/appearance`

Afterwards enable modules as usual.

### Uninstall
```
drush pm-uninstall eleven elevenfeat -y
```

## Demo

Visit [Eleven Theme](http://eleventheme.com/) for the demo and screenshots.
18 changes: 18 additions & 0 deletions bartik11/bartik11.breakpoints.yml
@@ -0,0 +1,18 @@
bartik11.mobile:
label: mobile
mediaQuery: ''
weight: 0
multipliers:
- 1x
bartik11.narrow:
label: narrow
mediaQuery: 'all and (min-width: 560px) and (max-width: 850px)'
weight: 1
multipliers:
- 1x
bartik11.wide:
label: wide
mediaQuery: 'all and (min-width: 851px)'
weight: 2
multipliers:
- 1x
53 changes: 53 additions & 0 deletions bartik11/bartik11.info.yml
@@ -0,0 +1,53 @@
# This theme is marked as @internal. It is intended to evolve and change over
# minor releases.
# Change record https://www.drupal.org/node/2673014.
# As the UI of Drupal improves between minor versions, the mark up and assets
# in the bartik11 theme will change. The bartik11 theme is not backwards
# compatible. If you wish to modify the output or assets of bartik11 you can:
# 1. Copy the whole of bartik11 and rename it as your own theme. You will need to
# manually manage your own updates if you want to stay up to date with bartik11's
# bug fixes and feature support.
#
# 2. Sub-theme bartik11. This is only recommended if you want to make minor
# tweaks and understand that bartik11 could break your modifications as it
# changes.
name: bartik 11
type: theme
base theme: elevenfeat
description: 'A fork of bartik with Eleven theme admin elements'
package: Core
# version: VERSION
# core: 8.x
libraries:
- bartik11/global-styling
ckeditor_stylesheets:
- css/base/elements.css
- css/components/captions.css
- css/components/table.css
- css/components/text-formatted.css
regions:
header: Header
primary_menu: 'Primary menu'
secondary_menu: 'Secondary menu'
page_top: 'Page top'
page_bottom: 'Page bottom'
highlighted: Highlighted
featured_top: 'Featured top'
breadcrumb: Breadcrumb
content: Content
sidebar_first: 'Sidebar first'
sidebar_second: 'Sidebar second'
featured_bottom_first: 'Featured bottom first'
featured_bottom_second: 'Featured bottom second'
featured_bottom_third: 'Featured bottom third'
footer_first: 'Footer first'
footer_second: 'Footer second'
footer_third: 'Footer third'
footer_fourth: 'Footer fourth'
footer_fifth: 'Footer fifth'

# Information added by Drupal.org packaging script on 2017-08-16
version: '8.3.7'
core: '8.x'
project: 'drupal'
datestamp: 1502903957
87 changes: 87 additions & 0 deletions bartik11/bartik11.libraries.yml
@@ -0,0 +1,87 @@
global-styling:
version: VERSION
css:
base:
css/base/elements.css: {}
component:
css/components/block.css: {}
css/components/book.css: {}
css/components/breadcrumb.css: {}
css/components/captions.css: {}
css/components/comments.css: {}
css/components/contextual.css: {}
css/components/demo-block.css: {}
# @see https://www.drupal.org/node/2389735
css/components/dropbutton.component.css: {}
css/components/featured-top.css: {}
css/components/feed-icon.css: {}
css/components/field.css: {}
css/components/form.css: {}
css/components/forum.css: {}
css/components/header.css: {}
css/components/help.css: {}
css/components/highlighted.css: {}
css/components/item-list.css: {}
css/components/list-group.css: {}
css/components/list.css: {}
css/components/main-content.css: {}
css/components/menu.css: {}
css/components/messages.css: {}
css/components/node.css: {}
css/components/node-preview.css: {}
css/components/page-title.css: {}
css/components/pager.css: {}
css/components/panel.css: {}
css/components/primary-menu.css: {}
css/components/search-form.css: {}
css/components/search-results.css: {}
css/components/secondary-menu.css: {}
css/components/shortcut.css: {}
css/components/skip-link.css: {}
css/components/sidebar.css: {}
css/components/site-branding.css: {}
css/components/site-footer.css: {}
css/components/table.css: {}
css/components/tablesort-indicator.css: {}
css/components/tabs.css: {}
css/components/text-formatted.css: {}
css/components/toolbar.css: {}
css/components/featured-bottom.css: {}
css/components/password-suggestions.css: {}
css/components/ui.widget.css: {}
# @see https://www.drupal.org/node/2389735
css/components/vertical-tabs.component.css: {}
css/components/views.css: {}
css/components/buttons.css: {}
css/components/image-button.css: {}
css/components/ui-dialog.css: {}
layout:
css/layout.css: {}
theme:
css/colors.css: {}
css/print.css: { media: print }

messages:
version: VERSION
css:
component:
css/components/messages.css: { preprocess: false }

color.preview:
version: VERSION
css:
theme:
color/preview.css: {}
js:
color/preview.js: {}
dependencies:
- color/drupal.color

maintenance_page:
version: VERSION
css:
theme:
css/maintenance-page.css: {}
dependencies:
- system/maintenance
- bartik11/global-styling
125 changes: 125 additions & 0 deletions bartik11/bartik11.theme
@@ -0,0 +1,125 @@
<?php

/**
* @file
* Functions to support theming in the bartik11 theme.
*/

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Template\Attribute;

/**
* Implements hook_preprocess_HOOK() for HTML document templates.
*
* Adds body classes if certain regions have content.
*/
function bartik11_preprocess_html(&$variables) {
// Add information about the number of sidebars.
if (!empty($variables['page']['sidebar_first']) && !empty($variables['page']['sidebar_second'])) {
$variables['attributes']['class'][] = 'layout-two-sidebars';
}
elseif (!empty($variables['page']['sidebar_first'])) {
$variables['attributes']['class'][] = 'layout-one-sidebar';
$variables['attributes']['class'][] = 'layout-sidebar-first';
}
elseif (!empty($variables['page']['sidebar_second'])) {
$variables['attributes']['class'][] = 'layout-one-sidebar';
$variables['attributes']['class'][] = 'layout-sidebar-second';
}
else {
$variables['attributes']['class'][] = 'layout-no-sidebars';
}

if (!empty($variables['page']['featured_top'])) {
$variables['attributes']['class'][] = 'has-featured-top';
}

}

/**
* Implements hook_preprocess_HOOK() for page templates.
*/
function bartik11_preprocess_page_title(&$variables) {
// Since the title and the shortcut link are both block level elements,
// positioning them next to each other is much simpler with a wrapper div.
if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) {
// Add a wrapper div using the title_prefix and title_suffix render
// elements.
$variables['title_prefix']['shortcut_wrapper'] = [
'#markup' => '<div class="shortcut-wrapper clearfix">',
'#weight' => 100,
];
$variables['title_suffix']['shortcut_wrapper'] = [
'#markup' => '</div>',
'#weight' => -99,
];
// Make sure the shortcut link is the first item in title_suffix.
$variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
}
}

/**
* Implements hook_preprocess_HOOK() for maintenance-page.html.twig.
*/
function bartik11_preprocess_maintenance_page(&$variables) {
// By default, site_name is set to Drupal if no db connection is available
// or during site installation. Setting site_name to an empty string makes
// the site and update pages look cleaner.
// @see template_preprocess_maintenance_page
if (!$variables['db_is_active']) {
$variables['site_name'] = '';
}

// bartik11 has custom styling for the maintenance page.
$variables['#attached']['library'][] = 'bartik11/maintenance_page';
}

/**
* Implements hook_preprocess_HOOK() for node.html.twig.
*/
function bartik11_preprocess_node(&$variables) {
// Remove the "Add new comment" link on teasers or when the comment form is
// displayed on the page.
if ($variables['teaser'] || !empty($variables['content']['comments']['comment_form'])) {
unset($variables['content']['links']['comment']['#links']['comment-add']);
}
}

/**
* Implements hook_preprocess_HOOK() for block.html.twig.
*/
function bartik11_preprocess_block(&$variables) {
// Add a clearfix class to system branding blocks.
if ($variables['plugin_id'] == 'system_branding_block') {
$variables['attributes']['class'][] = 'clearfix';
}
}

/**
* Implements hook_preprocess_HOOK() for menu.html.twig.
*/
function bartik11_preprocess_menu(&$variables) {
$variables['attributes']['class'][] = 'clearfix';
}

/**
* Implements hook_theme_suggestions_HOOK_alter() for form templates.
*/
function bartik11_theme_suggestions_form_alter(array &$suggestions, array $variables) {
if ($variables['element']['#form_id'] == 'search_block_form') {
$suggestions[] = 'form__search_block_form';
}
}

/**
* Implements hook_form_alter() to add classes to the search form.
*/
function bartik11_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if (in_array($form_id, ['search_block_form', 'search_form'])) {
$key = ($form_id == 'search_block_form') ? 'actions' : 'basic';
if (!isset($form[$key]['submit']['#attributes'])) {
$form[$key]['submit']['#attributes'] = new Attribute();
}
$form[$key]['submit']['#attributes']->addClass('search-form__submit');
}
}

0 comments on commit b4a361b

Please sign in to comment.