Skip to content

Commit

Permalink
Merge pull request #103 from droptica/develop
Browse files Browse the repository at this point in the history
Merge to RC version of 1.4
  • Loading branch information
grzegorz-pietrzak-droptica authored Nov 29, 2018
2 parents df9eaf8 + aef3455 commit b5a8559
Show file tree
Hide file tree
Showing 20 changed files with 131 additions and 29 deletions.
55 changes: 40 additions & 15 deletions droopler.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

use Drupal\Core\Config\FileStorage;
use Drupal\Core\Extension\MissingDependencyException;

/**
* Implements hook_install().
Expand Down Expand Up @@ -139,17 +140,26 @@ function droopler_update_8101() {
function droopler_update_8102() {
$values = [];

// Install checklistapi and d_update modules.
/** @var Drupal\Core\Extension\ModuleInstallerInterface $moduleInstaller */
$moduleInstaller = \Drupal::service('module_installer');
$modules = [
'checklistapi',
'd_update'
];
$moduleInstaller->install($modules, TRUE);

// Install checklistapi and d_update modules.
try {
$modules = [
'checklistapi',
'd_update'
];
$result = $moduleInstaller->install($modules, TRUE);
$values['droopler__droopler_update_8102_0'] = $result;
$values['droopler__droopler_update_8102_1'] = $result;
}
catch (MissingDependencyException $e) {
$values['droopler__droopler_update_8102_0'] = FALSE;
$values['droopler__droopler_update_8102_1'] = FALSE;
}

/** @var Drupal\d_update\Updater $updater */
$updater = \Drupal::service('d_update');
$values['droopler__droopler_update_8102_0'] = TRUE;
$values['droopler__droopler_update_8102_1'] = TRUE;

// Install editor role.
$configs = [
Expand All @@ -162,7 +172,8 @@ function droopler_update_8102() {
// Update blog post config.
$configs = [
'd_blog' => [
'core.entity_view_display.node.blog_post.thumbnail' => '3bda6b387de39f3e2acb1ecae6caa4aa',
'core.entity_view_display.node.blog_post.thumbnail' => '',
'core.entity_view_mode.node.thumbnail' => '',
],
];
$values['droopler__droopler_update_8102_3'] = $updater->importConfigs($configs);
Expand Down Expand Up @@ -227,13 +238,27 @@ function droopler_update_8102() {
$values['droopler__droopler_update_8102_4'] = $updater->importConfigs($configs);

// Install geysir and d_geysir modules.
$modules = [
'geysir',
'd_geysir'
try {
$modules = [
'geysir',
'd_geysir'
];
$result = $moduleInstaller->install($modules, TRUE);
$values['droopler__droopler_update_8102_5'] = $result;
$values['droopler__droopler_update_8102_6'] = $result;
}
catch (MissingDependencyException $e) {
$values['droopler__droopler_update_8102_5'] = FALSE;
$values['droopler__droopler_update_8102_6'] = FALSE;
}

// Update blog post metatags.
$configs = [
'd_blog' => [
'metatag.metatag_defaults.node__blog_post' => '',
],
];
$moduleInstaller->install($modules, TRUE);
$values['droopler__droopler_update_8102_5'] = TRUE;
$values['droopler__droopler_update_8102_6'] = TRUE;
$values['droopler__droopler_update_8102_7'] = $updater->importConfigs($configs);

$progress = [
'v1.3' => [],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
id: node__blog_post
label: 'Content: Blog post'
tags:
description: '[node:field_blog_teaser]'
1 change: 1 addition & 0 deletions modules/custom/d_blog/d_blog.features.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bundle: d
required: true
1 change: 1 addition & 0 deletions modules/custom/d_blog/d_blog.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- image
- language
- menu_ui
- metatag
- node
- paragraphs
- path
Expand Down
20 changes: 20 additions & 0 deletions modules/custom/d_blog/d_blog.install
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,23 @@ function d_blog_install() {
->addCustomLink('/some/view/page', ['priority' => 0.5])
->generateSitemap();
}

/**
* Droopler 1.4 Updates.
*/
function d_blog_update_8101() {
// We do not put this into standard Droopler update flow.
try {
d_blog_add_translation('Blog text', 'Blog tekst', 'pl');
d_blog_add_translation('Blog image', 'Blog obraz', 'pl');
d_blog_add_translation('Blog main image', 'Blog główny obraz', 'pl');
d_blog_add_translation('Blog sections', 'Sekcje bloga', 'pl');
d_blog_add_translation('Blog category', 'Kategoria bloga', 'pl');
d_blog_add_translation('Sample category', 'Przykładowa kategoria', 'pl');
d_blog_add_translation('Blog teaser', 'Krótki opis wpisu bloga', 'pl');
d_blog_add_translation('Image is on the width of the text', 'Obraz jest na szerokość tekstu', 'pl');
d_blog_add_translation('Image is on the full width of the screen', 'Obraz jest na całą szerokość ekranu', 'pl');
} catch (\Exception $e) {
watchdog_exception('d_blog', $e);
}
}
3 changes: 3 additions & 0 deletions modules/custom/d_blog/modules/d_blog_init/pages/post_1.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
info:
type: blog_post
title: Example Blog Post 1
uid:
type: number
data: 1
field_blog_main_image:
type: image
data: demo_faces.jpg
Expand Down
3 changes: 3 additions & 0 deletions modules/custom/d_blog/modules/d_blog_init/pages/post_2.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
info:
type: blog_post
title: Example Blog Post 2
uid:
type: number
data: 1
field_blog_main_image:
type: image
data: demo_car_1.jpg
Expand Down
3 changes: 3 additions & 0 deletions modules/custom/d_blog/modules/d_blog_init/pages/post_3.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
info:
type: blog_post
title: Example Blog Post 3
uid:
type: number
data: 1
field_blog_main_image:
type: image
data: demo_event_1.jpg
Expand Down
3 changes: 3 additions & 0 deletions modules/custom/d_blog/modules/d_blog_init/pages/post_4.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
info:
type: blog_post
title: Example Blog Post 4
uid:
type: number
data: 1
field_blog_main_image:
type: image
data: demo_portfolio_1.jpg
Expand Down
3 changes: 3 additions & 0 deletions modules/custom/d_blog/modules/d_blog_init/pages/post_5.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
info:
type: blog_post
title: Example Blog Post 5
uid:
type: number
data: 1
field_blog_main_image:
type: image
data: demo_business_4.jpg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function d_content_init_create_all() {
// Set default structure.
$path = drupal_get_path('module', 'd_content_init') . '/pages';
$structure = [
'homepage' => ['file' => "$path/homepage.yml", 'link' => 'Home', 'weight' => 10],
'homepage' => ['file' => "$path/homepage.yml"],
'examples' => ['file' => "$path/examples.yml", 'link' => 'Examples', 'weight' => 20, 'children' => [
'business' => ['file' => "$path/business.yml", 'link' => 'Local Business Website', 'weight' => 10],
'event' => ['file' => "$path/event.yml", 'link' => 'Event Website', 'weight' => 20],
Expand Down
4 changes: 2 additions & 2 deletions modules/custom/d_p_help/src/Controller/SupportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function render() {
$output .= '<h3>' . t('Support') . '</h3>';
$output .= '<p>' . t('Do You need support with Droopler? - <a href=":link">Droptica.com</a>.', [':link' => 'https://droptica.com']) . '</p>';
$output .= '<h3>' . t('Github') . '</h3>';
$output .= '<p>' . t('<a href=":link">https://github.com/droptica/droopler_project</a> - Boilerplate for new projects based on Droopler. If you wish to use Droopler - fork (or download) this repository. It contains a minimum set of code to start your new website.', [':link' => ' https://github.com/droptica/droopler_project']) . '</p>';
$output .= '<p>' . t('<a href=":link">https://github.com/droptica/droopler</a> - This is Drupal installation profile.', [':link' => ' https://github.com/droptica/droopler_project']) . '</p>';
$output .= '<p>' . t('<a href=":link">https://github.com/droptica/droopler_project</a> - Boilerplate for new projects based on Droopler. If you wish to use Droopler - fork (or download) this repository. It contains a minimum set of code to start your new website.', [':link' => 'https://github.com/droptica/droopler_project']) . '</p>';
$output .= '<p>' . t('<a href=":link">https://github.com/droptica/droopler</a> - This is Drupal installation profile.', [':link' => 'https://github.com/droptica/droopler']) . '</p>';
return [
'#type' => 'markup',
'#markup' => '<div class="container">' . $output . '</div>',
Expand Down
7 changes: 7 additions & 0 deletions modules/custom/d_product/d_product.links.menu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
d_product.products:
title: 'Products'
description: 'List of products'
parent: main
route_name: view.products_list.products_list
menu_name: main
weight: -50
10 changes: 7 additions & 3 deletions modules/custom/d_update/updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ v1.4:
droopler__droopler_update_8102_2:
'#title': 'Create Editor role.'
'#description': '<p>New role that allows to manage content on the site.</p>'
'#description_failed': '<p><strong>Installation failed</strong>, please try to run database update manually.</p>'
'#description_failed': '<p><strong>Installation failed</strong>, please try to import the feature manually.</p>'
droopler__droopler_update_8102_3:
'#title': 'Update blog post display.'
'#description': '<p>Enchantments to blog post display.</p>'
'#description_failed': '<p><strong>Installation failed</strong>, please try to run database update manually.</p>'
'#description_failed': '<p><strong>Installation failed</strong>, please try to import the feature manually.</p>'
droopler__droopler_update_8102_4:
'#title': 'Update fields configuration.'
'#description': '<p>Various improvements to the fields.</p>'
'#description_failed': '<p><strong>Installation failed</strong>, please try to run database update manually.</p>'
'#description_failed': '<p><strong>Installation failed</strong>, please try to import the feature manually.</p>'
droopler__droopler_update_8102_5:
'#title': 'Install "geysir" module.'
'#description': '<p>Adds a nice overlay for editing Paragraphs.</p>'
Expand All @@ -75,3 +75,7 @@ v1.4:
'#description': '<p>Modifies Geysir to work with Droopler.</p>'
'#description_failed': '<p><strong>Installation failed</strong>, visit the extension page and try to enable the module manually.</p>'
extension_page: { '#text': 'Enable "d_geysir" module', '#url': 'internal:/admin/modules' }
droopler__droopler_update_8102_7:
'#title': 'Update blog post metatags.'
'#description': '<p>Now the blog teaser is also a default meta description.</p>'
'#description_failed': '<p><strong>Installation failed</strong>, please try to import the feature manually.</p>'
2 changes: 1 addition & 1 deletion themes/custom/droopler_theme/droopler_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function droopler_theme_preprocess_page(&$variables) {

// Make some exceptions for nodes with paragraphs or pages of given route.
$currentRoute = \Drupal::routeMatch()->getRouteName();
$nodeCheck = !empty($variables['node']) && in_array($variables['node']->getType(), ['content_page', 'blog_post']);
$nodeCheck = !empty($variables['node']) && method_exists($variables['node'], 'getType') && in_array($variables['node']->getType(), ['content_page', 'blog_post']);
$routeCheck = $currentRoute == 'd_p_subscribe_file.downloadfile.checkLink';
if ($nodeCheck || $routeCheck) {
$main_attributes['class'] = ['container-fluid'];
Expand Down
10 changes: 10 additions & 0 deletions themes/custom/droopler_theme/scss/components/_d_blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ $d-blog-block-category-font-size-mobile: 0.625rem !default;
$d-blog-image-margin: 2.1875rem auto !default;
$d-blog-paragraph-text-margin: 1.5625rem auto !default;
$d-blog-text-font-size-desktop: 1.25rem !default;
$d-blog-text-font-size-mobile: 1.07083125rem !default;

$d-blog-text-width-mobile: 85% !default;
$d-blog-header-text-distance-from-bottom: -0.25rem !default;
$d-blog-header-text-distance-from-top-mobile: 40% !default;
Expand Down Expand Up @@ -227,6 +229,8 @@ $d-blog-size-of-large-desktop: 1400px !default;
@include media-breakpoint-down(sm) {
.field--name-field-d-long-text {
width: $d-blog-text-width-mobile;
font-size: $d-blog-text-font-size-mobile;

h2 {
font-size: $d-blog-header-h2-font-size-blog-text-mobile;
}
Expand All @@ -239,6 +243,12 @@ $d-blog-size-of-large-desktop: 1400px !default;
width: 100%;
}
}
.field--name-field-blog-sections {
p {
font-size: $d-blog-text-font-size-mobile;
}

}
}

@include media-breakpoint-up(lg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ $d-p-text-paged-first-margin-top: 2% !default;
.field--name-field-d-long-text {
p {
color: $d-p-text-paged-color;
word-wrap: break-word;
hyphens: auto;
}

&:before {
Expand Down
14 changes: 13 additions & 1 deletion themes/custom/droopler_theme/scss/components/_d_products.scss
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,26 @@ $d-product-filters-group-margin: 3rem;
transition: 0.3s;
}
margin-bottom: 1.875rem;
@include media-breakpoint-up(md) {
@include media-breakpoint-only(md) {
&:nth-child(odd) {
padding-right: 1rem;
}
&:nth-child(even) {
padding-left: 1rem;
}
}
@include media-breakpoint-up(lg) {
&:nth-child(3n+1) {
padding-right: 0.5rem;
}
&:nth-child(3n-1) {
padding-left: calc(#{$grid-gutter-width}/4 + 0.25rem);
padding-right: calc(#{$grid-gutter-width}/4 + 0.25rem);
}
&:nth-child(3n) {
padding-left: 0.5rem;
}
}

.node--view-mode-teaser {
border: $d-product-view-border;
Expand Down
2 changes: 2 additions & 0 deletions themes/custom/droopler_theme/scss/layout/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ $light-gray-background: $color-hector !default;
}
a:not(.btn) {
@include font-links;
word-wrap: break-word;
hyphens: auto;
}
}
.no-padding {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
#}
<div class="row">
{% for row in rows %}
{% if (loop.index0 % 2 == 0) and not loop.first %}
</div>
<div class="row">
{% endif %}
<div class="col-md-6 products-list-teaser">
<span class="col-md-6 col-lg-4 products-list-teaser">
{{ row.content }}
</div>
</span>
{% endfor %}
</div>

0 comments on commit b5a8559

Please sign in to comment.