Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony/Asset の導入 #2608

Merged
merged 7 commits into from
Nov 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"silex/silex": "^2.2",
"silex/web-profiler": "^2.0",
"swiftmailer/swiftmailer": "^5.4",
"symfony/asset": "^3.3",
"symfony/class-loader": "^3.3",
"symfony/config": "^3.3",
"symfony/console": "^3.3",
Expand Down Expand Up @@ -112,6 +113,8 @@
},
"preferred-install": {
"*": "dist"
}
},
"optimize-autoloader": true,
"sort-packages": true
}
}
94 changes: 75 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions html/template/default/assets/css/style.min.css

Large diffs are not rendered by default.

23 changes: 21 additions & 2 deletions src/Eccube/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@

namespace Eccube;

use Composer\Autoload\ClassLoader;
use Doctrine\DBAL\Types\Type;
use Eccube\Common\Constant;
use Eccube\DI\AutoWiring\EntityEventAutowiring;
use Eccube\DI\AutoWiring\FormExtensionAutoWiring;
use Eccube\DI\AutoWiring\FormTypeAutoWiring;
use Eccube\DI\AutoWiring\QueryExtensionAutoWiring;
use Eccube\DI\AutoWiring\RepositoryAutoWiring;
use Eccube\DI\AutoWiring\RouteAutoWiring;
use Eccube\DI\AutoWiring\ServiceAutoWiring;
use Eccube\DI\DIServiceProvider;
use Eccube\Doctrine\DBAL\Types\UTCDateTimeType;
use Eccube\Doctrine\DBAL\Types\UTCDateTimeTzType;
use Eccube\Doctrine\EventSubscriber\InitSubscriber;
Expand All @@ -41,7 +42,6 @@
use Eccube\Routing\EccubeRouter;
use Eccube\ServiceProvider\CompatRepositoryProvider;
use Eccube\ServiceProvider\CompatServiceProvider;
use Eccube\DI\DIServiceProvider;
use Eccube\ServiceProvider\EntityEventServiceProvider;
use Eccube\ServiceProvider\ForwardOnlyServiceProvider;
use Eccube\ServiceProvider\MobileDetectServiceProvider;
Expand Down Expand Up @@ -208,6 +208,25 @@ public function initialize()
$this->register(new \Silex\Provider\FormServiceProvider());
$this->register(new \Silex\Provider\SerializerServiceProvider());
$this->register(new \Silex\Provider\ValidatorServiceProvider());
$this->register(new \Silex\Provider\AssetServiceProvider(), [
// default package settings
'assets.version' => Constant::VERSION,
'assets.version_format' => '%s?v=%s',
'assets.base_path' => $this['config']['front_urlpath'],
// additional packages settings
'assets.named_packages' => [
'admin' => [
'version' => Constant::VERSION,
'version_format' => '%s?v=%s',
'base_path' => $this['config']['admin_urlpath'],
],
'save_image' => ['base_path' => $this['config']['image_save_urlpath']],
'temp_image' => ['base_path' => $this['config']['image_temp_urlpath']],
'user_data' => ['base_path' => $this['config']['user_data_urlpath']],
'plugin' => ['base_path' => $this['config']['plugin_urlpath']],
],
]);

$this->register(new \Saxulum\Validator\Provider\SaxulumValidatorProvider());
$this->register(new MobileDetectServiceProvider());
$this->register(new TwigLintServiceProvider());
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Resource/template/admin/Content/file.twig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme form 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/file_manager.js"></script>
<script src="{{ asset('assets/js/file_manager.js', 'admin') }}"></script>
<script>
{{ tpl_javascript|raw }}
$(function() {
Expand Down
10 changes: 5 additions & 5 deletions src/Eccube/Resource/template/admin/Content/layout.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme form 'Form/bootstrap_3_layout.html.twig' %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.core.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.widget.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.mouse.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.sortable.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/layout_design.js"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.core.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.widget.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.mouse.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.sortable.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/layout_design.js', 'admin') }}"></script>
<script>
$(function(){
$('#blockModal').on('show.bs.modal', function(event) {
Expand Down
8 changes: 4 additions & 4 deletions src/Eccube/Resource/template/admin/Content/news_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme form 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block stylesheet %}
<link rel="stylesheet" href="{{ app.config.admin_urlpath }}/assets/css/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-datetimepicker.min.css', 'admin') }}">
{% endblock stylesheet %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/moment.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/moment-ja.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/bootstrap-datetimepicker.min.js"></script>
<script src="{{ asset('assets/js/vendor/moment.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/moment-ja.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/bootstrap-datetimepicker.min.js', 'admin') }}"></script>
<script>
$(function() {
var inputDate = document.createElement('input');
Expand Down
8 changes: 4 additions & 4 deletions src/Eccube/Resource/template/admin/Customer/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme searchForm 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block stylesheet %}
<link rel="stylesheet" href="{{ app.config.admin_urlpath }}/assets/css/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-datetimepicker.min.css', 'admin') }}">
{% endblock stylesheet %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/moment.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/moment-ja.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/bootstrap-datetimepicker.min.js"></script>
<script src="{{ asset('assets/js/vendor/moment.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/moment-ja.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/bootstrap-datetimepicker.min.js', 'admin') }}"></script>
<script>
$(function() {

Expand Down
8 changes: 4 additions & 4 deletions src/Eccube/Resource/template/admin/Order/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme searchForm 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block stylesheet %}
<link rel="stylesheet" href="{{ app.config.admin_urlpath }}/assets/css/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-datetimepicker.min.css', 'admin') }}">
{% endblock stylesheet %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/moment.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/moment-ja.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/bootstrap-datetimepicker.min.js"></script>
<script src="{{ asset('assets/js/vendor/moment.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/moment-ja.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/bootstrap-datetimepicker.min.js', 'admin') }}"></script>
<script>
$(function() {

Expand Down
8 changes: 4 additions & 4 deletions src/Eccube/Resource/template/admin/Product/category.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme form 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.core.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.widget.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.mouse.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.sortable.min.js"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.core.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.widget.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.mouse.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.sortable.min.js', 'admin') }}"></script>
<script>
$(function() {
var oldRanks = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme form 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.core.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.widget.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.mouse.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.sortable.min.js"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.core.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.widget.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.mouse.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.sortable.min.js', 'admin') }}"></script>
<script>
$(function() {
var oldRanks = [];
Expand Down
8 changes: 4 additions & 4 deletions src/Eccube/Resource/template/admin/Product/class_name.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme form 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.core.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.widget.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.mouse.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/jquery.ui/jquery.ui.sortable.min.js"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.core.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.widget.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.mouse.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/jquery.ui/jquery.ui.sortable.min.js', 'admin') }}"></script>
<script>
$(function() {
var oldRanks = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme form 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/spin.min.js"></script>
<script src="{{ asset('assets/js/vendor/spin.min.js', 'admin') }}"></script>
<script>
$(function() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme form 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/spin.min.js"></script>
<script src="{{ asset('assets/js/vendor/spin.min.js', 'admin') }}"></script>
<script>
$(function() {

Expand Down
10 changes: 5 additions & 5 deletions src/Eccube/Resource/template/admin/Product/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
{% form_theme searchForm 'Form/bootstrap_3_horizontal_layout.html.twig' %}

{% block stylesheet %}
<link rel="stylesheet" href="{{ app.config.admin_urlpath }}/assets/css/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-datetimepicker.min.css', 'admin') }}">
{% endblock stylesheet %}

{% block javascript %}
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/moment.min.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/moment-ja.js"></script>
<script src="{{ app.config.admin_urlpath }}/assets/js/vendor/bootstrap-datetimepicker.min.js"></script>
<script src="{{ asset('assets/js/vendor/moment.min.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/moment-ja.js', 'admin') }}"></script>
<script src="{{ asset('assets/js/vendor/bootstrap-datetimepicker.min.js', 'admin') }}"></script>
<script>
$(function() {

Expand Down Expand Up @@ -233,7 +233,7 @@ $(function() {
</div>
<div id="result_list__image--{{ Product.id }}" class="item_photo td">
<a href="{{ url('admin_product_product_edit', { id : Product.id }) }}">
<img src="{{ app.config.image_save_urlpath }}/{{ Product.mainFileName|no_image_product }}" />
<img src="{{ asset(Product.mainFileName|no_image_product, 'save_image') }}" />
</a>
</div>
<div id="result_list__name--{{ Product.id }}" class="item_detail td">
Expand Down
Loading