Skip to content

Commit

Permalink
Move images to root assets folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Apr 24, 2021
1 parent 6add477 commit 8a0c9c5
Show file tree
Hide file tree
Showing 242 changed files with 255 additions and 251 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions docs/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Full Configuration Options
- OWNER
acl_user_manager: null
title: 'Sonata Admin'
title_logo: bundles/sonataadmin/logo_title.png
title_logo: bundles/sonataadmin/images/logo_title.png
search: true
default_controller: 'sonata.admin.controller.crud'
options:
Expand Down Expand Up @@ -179,7 +179,7 @@ Full Configuration Options
stylesheets:
# The default stylesheet list:
- bundles/sonataadmin/dist/app.css
- bundles/sonataadmin/app.css
# stylesheet paths to add to the page in addition to the list above
extra_stylesheets: []
Expand All @@ -190,7 +190,7 @@ Full Configuration Options
javascripts:
# The default javascript list:
- bundles/sonataadmin/dist/app.js
- bundles/sonataadmin/app.js
- bundles/sonataadmin/Admin.js
- bundles/sonataadmin/jquery.confirmExit.js
- bundles/sonataadmin/treeview.js
Expand Down
8 changes: 4 additions & 4 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->end()

->scalarNode('title')->defaultValue('Sonata Admin')->cannotBeEmpty()->end()
->scalarNode('title_logo')->defaultValue('bundles/sonataadmin/logo_title.png')->cannotBeEmpty()->end()
->scalarNode('title_logo')->defaultValue('bundles/sonataadmin/images/logo_title.png')->cannotBeEmpty()->end()
->booleanNode('search')->defaultTrue()->info('Enable/disable the search form in the sidebar')->end()

->arrayNode('global_search')
Expand Down Expand Up @@ -180,7 +180,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->info('Enable locking when editing an object, if the corresponding object manager supports it.')
->end()
->scalarNode('mosaic_background')
->defaultValue('bundles/sonataadmin/default_mosaic_image.png')
->defaultValue('bundles/sonataadmin/images/default_mosaic_image.png')
->info('Background used in mosaic view')
->end()
->end()
Expand Down Expand Up @@ -388,7 +388,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->children()
->arrayNode('stylesheets')
->defaultValue([
'bundles/sonataadmin/dist/app.css',
'bundles/sonataadmin/app.css',
])
->prototype('scalar')->end()
->end()
Expand All @@ -404,7 +404,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->end()
->arrayNode('javascripts')
->defaultValue([
'bundles/sonataadmin/dist/app.js',
'bundles/sonataadmin/app.js',
])
->prototype('scalar')->end()
->end()
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/SonataAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function getNamespace(): string
private function buildStylesheets(array $config): array
{
$config['assets']['stylesheets'][] = sprintf(
'bundles/sonataadmin/dist/admin-lte-skins/%s.min.css',
'bundles/sonataadmin/admin-lte-skins/%s.min.css',
$config['options']['skin']
);

Expand Down
2 changes: 1 addition & 1 deletion src/Object/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class Metadata implements MetadataInterface
/**
* @var string
*/
public const DEFAULT_MOSAIC_BACKGROUND = 'bundles/sonataadmin/default_mosaic_image.png';
public const DEFAULT_MOSAIC_BACKGROUND = 'bundles/sonataadmin/images/default_mosaic_image.png';

/**
* @var string
Expand Down
1 change: 1 addition & 0 deletions src/Resources/public/app.css

Large diffs are not rendered by default.

File renamed without changes.
1 change: 0 additions & 1 deletion src/Resources/public/dist/app.css

This file was deleted.

224 changes: 0 additions & 224 deletions src/Resources/public/dist/manifest.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"entrypoints": {
"app": {
"css": [
"/bundles/sonataadmin/dist/app.css"
"/bundles/sonataadmin/app.css"
],
"js": [
"/bundles/sonataadmin/dist/app.js"
"/bundles/sonataadmin/app.js"
]
}
}
Expand Down
Binary file added src/Resources/public/images/ajax-loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added src/Resources/public/images/logo_title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
227 changes: 227 additions & 0 deletions src/Resources/public/manifest.json

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ This code manages the many-to-[one|many] association field popup
return;
}
jQuery('#field_widget_{{ id }}').html("<span><img src=\"{{ asset('bundles/sonataadmin/ajax-loader.gif') }}\" style=\"vertical-align: middle; margin-right: 10px\"/>{{ 'loading_information'|trans([], 'SonataAdminBundle') }}</span>");
jQuery('#field_widget_{{ id }}').html("<span><img src=\"{{ asset('bundles/sonataadmin/images/ajax-loader.gif') }}\" style=\"vertical-align: middle; margin-right: 10px\"/>{{ 'loading_information'|trans([], 'SonataAdminBundle') }}</span>");
jQuery.ajax({
type: 'GET',
url: '{{ path('sonata_admin_short_object_information', {
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/standard_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ file that was distributed with this source code.
{# localize moment #}
{% set localeForMoment = canonicalize_locale_for_moment() %}
{% if localeForMoment %}
<script src="{{ asset('bundles/sonataadmin/dist/moment-locale/' ~ localeForMoment ~ '.js') }}"></script>
<script src="{{ asset('bundles/sonataadmin/moment-locale/' ~ localeForMoment ~ '.js') }}"></script>
{% endif %}

{# localize select2 #}
{% if sonata_config.getOption('use_select2') %}
{% set localeForSelect2 = canonicalize_locale_for_select2() %}
{% if localeForSelect2 %}
<script src="{{ asset('bundles/sonataadmin/dist/select2-locale/' ~ localeForSelect2 ~ '.js') }}"></script>
<script src="{{ asset('bundles/sonataadmin/select2-locale/' ~ localeForSelect2 ~ '.js') }}"></script>
{% endif %}
{% endif %}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testOptions(): void
$this->assertTrue($config['options']['confirm_exit']);
$this->assertFalse($config['options']['js_debug']);
$this->assertTrue($config['options']['use_icheck']);
$this->assertSame('bundles/sonataadmin/default_mosaic_image.png', $config['options']['mosaic_background']);
$this->assertSame('bundles/sonataadmin/images/default_mosaic_image.png', $config['options']['mosaic_background']);
$this->assertSame('default', $config['options']['default_group']);
$this->assertSame('SonataAdminBundle', $config['options']['default_label_catalogue']);
$this->assertSame('<i class="fa fa-folder"></i>', $config['options']['default_icon']);
Expand Down
14 changes: 7 additions & 7 deletions tests/DependencyInjection/SonataAdminExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ public function testRemoveStylesheetsGetRemoved(): void
{
$this->container->setParameter('kernel.bundles', []);
$removeStylesheets = [
'bundles/sonataadmin/dist/app.css',
'bundles/sonataadmin/dist/admin-lte-skins/skin-black.min.css',
'bundles/sonataadmin/app.css',
'bundles/sonataadmin/admin-lte-skins/skin-black.min.css',
];
$this->load([
'assets' => [
Expand Down Expand Up @@ -165,7 +165,7 @@ public function testRemoveJavascriptsGetRemoved(): void
{
$this->container->setParameter('kernel.bundles', []);
$removeJavascripts = [
'bundles/sonataadmin/dist/app.js',
'bundles/sonataadmin/app.js',
];
$this->load([
'assets' => [
Expand All @@ -189,11 +189,11 @@ public function testAssetsCanBeAddedAndRemoved(): void
$extraStylesheets = ['foo/bar.css', 'bar/quux.css'];
$extraJavascripts = ['foo/bar.js', 'bar/quux.js'];
$removeStylesheets = [
'bundles/sonataadmin/dist/app.css',
'bundles/sonataadmin/dist/admin-lte-skins/skin-black.min.css',
'bundles/sonataadmin/app.css',
'bundles/sonataadmin/admin-lte-skins/skin-black.min.css',
];
$removeJavascripts = [
'bundles/sonataadmin/dist/app.js',
'bundles/sonataadmin/app.js',
];
$this->load([
'assets' => [
Expand Down Expand Up @@ -371,7 +371,7 @@ private function getDefaultStylesheets(?string $skin = 'skin-black'): array

$defaultStylesheets = $this->defaultConfiguration['assets']['stylesheets'];
$defaultStylesheets[] = sprintf(
'bundles/sonataadmin/dist/admin-lte-skins/%s.min.css',
'bundles/sonataadmin/admin-lte-skins/%s.min.css',
$skin
);

Expand Down
2 changes: 1 addition & 1 deletion tests/SonataConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function setUp(): void
'javascripts' => [],
'js_debug' => false,
'lock_protection' => false,
'mosaic_background' => 'bundles/sonataadmin/default_mosaic_image.png',
'mosaic_background' => 'bundles/sonataadmin/images/default_mosaic_image.png',
'pager_links' => null,
'role_admin' => 'ROLE_SONATA_ADMIN',
'role_super_admin' => 'ROLE_SUPER_ADMIN',
Expand Down
7 changes: 4 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ var Encore = require('@symfony/webpack-encore');
const StyleLintPlugin = require('stylelint-webpack-plugin');

Encore
.setOutputPath('./src/Resources/public/dist')
.setPublicPath('/bundles/sonataadmin/dist')
.setManifestKeyPrefix('bundles/sonataadmin/dist')
.setOutputPath('./src/Resources/public')
.setPublicPath('/bundles/sonataadmin')
.setManifestKeyPrefix('bundles/sonataadmin')

.cleanupOutputBeforeBuild()
.enableSassLoader()
Expand Down Expand Up @@ -45,6 +45,7 @@ Encore
})

.copyFiles([
{ from: './assets/images/', pattern: /\.(png|gif)$/, to: 'images/[name].[ext]' },
{ from: './node_modules/admin-lte/dist/css/skins/', pattern: /skin-.*\.min.css/, to: 'admin-lte-skins/[name].[ext]' },
{ from: './node_modules/select2/dist/js/i18n/', pattern: /\.js/, to: 'select2-locale/[name].[ext]' },
{ from: './node_modules/moment/locale/', to: 'moment-locale/[name].[ext]' },
Expand Down

0 comments on commit 8a0c9c5

Please sign in to comment.