Skip to content

Commit

Permalink
Merge pull request #485 from colemanw/removeCrmStar
Browse files Browse the repository at this point in the history
Remove crmStar styling, require Bootstrap3
  • Loading branch information
mattwire authored Feb 23, 2022
2 parents cde5359 + ae6ffce commit 1178afb
Show file tree
Hide file tree
Showing 20 changed files with 8 additions and 256 deletions.
13 changes: 3 additions & 10 deletions CRM/Mosaico/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class CRM_Mosaico_Utils {
*/
const MAX_IMAGE_PIXELS = 36000000;

public static function isBootstrap() {
return strpos(CRM_Mosaico_Utils::getLayoutPath(), '/crmstar-') === FALSE;
}

/**
* Get a list of layout options.
*
Expand All @@ -30,7 +26,6 @@ public static function isBootstrap() {
public static function getLayoutOptions() {
return [
'auto' => E::ts('Automatically select a layout'),
'crmstar-single' => E::ts('Single Page (crm-*)'),
'bootstrap-single' => E::ts('Single Page (Bootstrap CSS)'),
'bootstrap-wizard' => E::ts('Wizard (Bootstrap CSS)'),
];
Expand Down Expand Up @@ -136,15 +131,13 @@ public static function getLayoutPath() {
$prefix = '~/crmMosaico/EditMailingCtrl';

$paths = [
'crmstar-single' => "$prefix/crmstar-single.html",
'bootstrap-single' => "$prefix/bootstrap-single.html",
'bootstrap-wizard' => "$prefix/bootstrap-wizard.html",
];

if (empty($layout) || $layout === 'auto') {
$themes = Civi::service('themes');
return $themes->getActiveThemeKey() === 'shoreditch'
? $paths['bootstrap-wizard'] : $paths['crmstar-single'];
// Legacy handling for 'crmstar-single' - treat as 'auto'
if (empty($layout) || $layout === 'auto' || $layout === 'crmstar-single') {
return $paths['bootstrap-wizard'];
}
elseif (isset($paths[$layout])) {
return $paths[$layout];
Expand Down
12 changes: 3 additions & 9 deletions ang/crmMosaico.ang.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
1 => 'ang/crmMosaico/*.js',
2 => 'ang/crmMosaico/*/*.js',
],
'css' => [],
'partials' =>
[
'css' => ['css/mosaico-bootstrap.css'],
'bundles' => ['bootstrap3'],
'partials' => [
'ang/crmMosaico',
CRM_Mosaico_Utils::isBootstrap() ? 'ang/crmMosaico.bootstrap' : 'ang/crmMosaico.crmstar',
],
'settings' =>
[
Expand All @@ -26,12 +25,7 @@
'drupalNav' => '#toolbar',
'joomlaNav' => '.com_civicrm > .navbar',
'leftNav' => '.wp-admin #adminmenu',
'useBootstrap' => CRM_Mosaico_Utils::isBootstrap(),
'variantsPct' => CRM_Mosaico_AbDemux::DEFAULT_AB_PERCENTAGE,
],
];

$result['css'][]= ($result['settings']['useBootstrap']) ? 'css/mosaico-bootstrap.css' : 'css/mosaico-crmstar.css';
$result['bundles']= ($result['settings']['useBootstrap']) ? ['bootstrap3'] : [];

return $result;
26 changes: 0 additions & 26 deletions ang/crmMosaico.crmstar/BlockDesign.html

This file was deleted.

56 changes: 0 additions & 56 deletions ang/crmMosaico.crmstar/BlockPreview.html

This file was deleted.

1 change: 0 additions & 1 deletion ang/crmMosaico.crmstar/Distribution.html

This file was deleted.

57 changes: 0 additions & 57 deletions ang/crmMosaico.crmstar/EditMailingCtrl/crmstar-single.html

This file was deleted.

5 changes: 0 additions & 5 deletions ang/crmMosaico.crmstar/PreviewDialogCtrl.html

This file was deleted.

55 changes: 0 additions & 55 deletions ang/crmMosaico.crmstar/SubjectList.html

This file was deleted.

23 changes: 0 additions & 23 deletions ang/crmMosaico.crmstar/TemplateItem.html

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 2 additions & 5 deletions ang/crmbWizard.ang.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@
2 => 'ang/crmbWizard/*/*.js',
],
// Hmm, shouldn't high-level components have separate CSS files?
'css' => CRM_Mosaico_Utils::isBootstrap() ? ['css/mosaico-bootstrap.css'] : [],
'bundles' => CRM_Mosaico_Utils::isBootstrap() ? ['bootstrap3'] : [],
'css' => ['css/mosaico-bootstrap.css'],
'bundles' => ['bootstrap3'],
'partials' =>
[
0 => 'ang/crmbWizard',
],
'settings' =>
[
],
];
2 changes: 0 additions & 2 deletions css/mosaico-crmstar.css

This file was deleted.

7 changes: 0 additions & 7 deletions sass/mosaico-crmstar.scss

This file was deleted.

0 comments on commit 1178afb

Please sign in to comment.