Commit 448ab9d8 authored by Nicolas Widart's avatar Nicolas Widart

Publishing new module config files and theme assets

parent 0a01064c
...@@ -32,6 +32,16 @@ return [ ...@@ -32,6 +32,16 @@ return [
*/ */
'skin' => 'skin-blue', 'skin' => 'skin-blue',
/*
|--------------------------------------------------------------------------
| Custom CKeditor configuration file
|--------------------------------------------------------------------------
| Define a custom CKeditor configuration file to instead of the one
| provided by default. This is useful if you wish to customise
| the toolbar and other possible options.
*/
'ckeditor-config-file-path' => '/assets/config_custom.js',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Middleware | Middleware
...@@ -95,7 +105,6 @@ return [ ...@@ -95,7 +105,6 @@ return [
'gridstack.js' => ['module' => 'dashboard:gridstack/gridstack.min.js'], 'gridstack.js' => ['module' => 'dashboard:gridstack/gridstack.min.js'],
'daterangepicker.js' => ['theme' => 'vendor/admin-lte/plugins/daterangepicker/daterangepicker.js'], 'daterangepicker.js' => ['theme' => 'vendor/admin-lte/plugins/daterangepicker/daterangepicker.js'],
'selectize.js' => ['module' => 'core:vendor/selectize/dist/js/standalone/selectize.min.js'], 'selectize.js' => ['module' => 'core:vendor/selectize/dist/js/standalone/selectize.min.js'],
'sisyphus.js' => ['theme' => 'vendor/sisyphus/sisyphus.min.js'],
'main.js' => ['theme' => 'js/main.js'], 'main.js' => ['theme' => 'js/main.js'],
'chart.js' => ['theme' => 'vendor/admin-lte/plugins/chartjs/Chart.js'], 'chart.js' => ['theme' => 'vendor/admin-lte/plugins/chartjs/Chart.js'],
'pace.js' => ['theme' => 'vendor/admin-lte/plugins/pace/pace.min.js'], 'pace.js' => ['theme' => 'vendor/admin-lte/plugins/pace/pace.min.js'],
...@@ -135,7 +144,6 @@ return [ ...@@ -135,7 +144,6 @@ return [
'app.js', 'app.js',
'pace.js', 'pace.js',
'main.js', 'main.js',
'sisyphus.js',
], ],
], ],
]; ];
<?php <?php
return [ return [
'dashboard' => [ 'dashboard' => [
'index', 'index' => 'dashboard::dashboard.list resource',
'update', 'update' => 'dashboard::dashboard.edit resource',
'reset', 'reset' => 'dashboard::dashboard.reset resource',
], ],
]; ];
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
return [ return [
'media.medias' => [ 'media.medias' => [
'index', 'index' => 'media::media.list resource',
'create', 'create' => 'media::media.create resource',
'edit', 'edit' => 'media::media.edit resource',
'destroy', 'destroy' => 'media::media.destroy resource',
], ],
]; ];
<?php <?php
return [ return [
'menu.menus' => [ 'menu.menus' => [
'index', 'index' => 'menu::menu.list resource',
'create', 'create' => 'menu::menu.create resource',
'edit', 'edit' => 'menu::menu.edit resource',
'destroy', 'destroy' => 'menu::menu.destroy resource',
], ],
'menu.menuitems' => [ 'menu.menuitems' => [
'index', 'index' => 'menu::menu-items.list resource',
'create', 'create' => 'menu::menu-items.create resource',
'edit', 'edit' => 'menu::menu-items.edit resource',
'destroy', 'destroy' => 'menu::menu-items.destroy resource',
], ],
]; ];
<?php <?php
return [ return [
'page.pages' => [ 'page.pages' => [
'index', 'index' => 'page::pages.list resource',
'create', 'create' => 'page::pages.create resource',
'edit', 'edit' => 'page::pages.edit resource',
'destroy', 'destroy' => 'page::pages.destroy resource',
], ],
]; ];
<?php <?php
return [ return [
'setting.settings' => [ 'setting.settings' => [
'index', 'index' => 'setting::settings.list resource',
'edit', 'edit' => 'setting::settings.edit resource',
], ],
]; ];
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
return [ return [
'translation.translations' => [ 'translation.translations' => [
'index', 'index' => 'translation::translations.list resource',
'edit', 'edit' => 'translation::translations.edit resource',
'export', 'import' => 'translation::translations.import resource',
'import', 'export' => 'translation::translations.export resource',
], ],
]; ];
<?php <?php
return [ return [
'user.users' => [ 'user.users' => [
'index', 'index' => 'user::users.list user',
'create', 'create' => 'user::users.create user',
'edit', 'edit' => 'user::users.edit user',
'destroy', 'destroy' => 'user::users.destroy user',
], ],
'user.roles' => [ 'user.roles' => [
'index', 'index' => 'user::roles.list resource',
'create', 'create' => 'user::roles.create resource',
'edit', 'edit' => 'user::roles.edit resource',
'destroy', 'destroy' => 'user::roles.destroy resource',
], ],
'account.api-keys' => [ 'account.api-keys' => [
'index', 'index' => 'user::users.list api key',
'create', 'create' => 'user::users.create api key',
'destroy', 'destroy' => 'user::users.destroy api key',
], ],
]; ];
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
return [ return [
'workshop.modules' => [ 'workshop.modules' => [
'index', 'index' => 'workshop::modules.list resource',
'show', 'show' => 'workshop::modules.show resource',
'update', 'update' => 'workshop::modules.update resource',
'disable', 'disable' => 'workshop::modules.disable resource',
'enable', 'enable' => 'workshop::modules.enable resource',
], ],
'workshop.themes' => [ 'workshop.themes' => [
'index', 'index' => 'workshop::themes.list resource',
'show', 'show' => 'workshop::themes.show resource',
], ],
]; ];
$(document).ready(function () { $(document).ready(function () {
$("form").sisyphus({locationBased: true, excludeFields: $('input[name="_token"]')});
$('[data-slug="source"]').each(function(){ $('[data-slug="source"]').each(function(){
$(this).slug(); $(this).slug();
}); });
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
@extends('layouts.master')
@section('content-header')
<h1 class="pull-left">
{{ trans('dashboard::dashboard.name') }}
</h1>
<div class="btn-group pull-right">
<a class="btn btn-default" id="edit-grid" data-mode="0" href="#">{{ trans('dashboard::dashboard.edit grid') }}</a>
<a class="btn btn-default" id="reset-grid" href="{{ route('dashboard.grid.reset') }}">{{ trans('dashboard::dashboard.reset grid') }}</a>
<a class="btn btn-default hidden" id="add-widget" data-toggle="modal" data-target="#myModal">{{ trans('dashboard::dashboard.add widget') }}</a>
</div>
<div class="clearfix"></div>
@stop
@section('styles')
<style>
.grid-stack-item {
padding-right: 20px !important;
}
</style>
@stop
@section('content')
<div class="row">
<div class="col-md-12">
<div class="grid-stack">
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{ trans('dashboard::dashboard.add widget to dashboard') }}</h4>
</div>
<div class="modal-body">
<div class="row">
</div>
</div>
</div>
</div>
</div>
@stop
@section('scripts')
@parent
<script type="text/javascript">
$(document).ready(function () {
var options = {
vertical_margin: 10,
float: true,
animate: true
};
$('.grid-stack').gridstack(options);
/** savey crap */
new function () {
this.defaultWidgets = {!! json_encode($widgets) !!};
this.serialized_data = {!! $customWidgets !== 'null' ? $customWidgets : json_encode($widgets) !!};
//console.log(this.defaultWidgets.PostsWidget);
this.grid = jQuery('.grid-stack').data('gridstack');
this.load_grid = function () {
this.grid.remove_all();
var items = GridStackUI.Utils.sort(this.serialized_data);
_.each(items, function (node) {
this.spawn_widget(node);
jQuery(jQuery.find('option[value="'+node.id+'"]')[0]).hide();
}, this);
}.bind(this);
this.save_grid = function () {
this.serialized_data = _.map($('.grid-stack > .grid-stack-item:visible'), function (el) {
el = jQuery(el);
var node = el.data('_gridstack_node');
return {
id: el.attr('id'),
x: node.x,
y: node.y,
width: node.width,
height: node.height
};
}, this);
$.ajax({
type: 'POST',
url: '{{ route('dashboard.grid.save') }}',
data: {
_token: '<?= csrf_token() ?>',
grid: JSON.stringify(this.serialized_data)
},
success: function(data) {
console.log(data);
}
});
}.bind(this);
this.clear_grid = function () {
this.grid.remove_all();
jQuery(jQuery.find('option:hidden')).show();
}.bind(this);
this.edit_grid = function () {
mode = jQuery('#edit-grid').data('mode');
if (mode == 0) {
// enable all the grid editing
_.map(jQuery('.grid-stack > .grid-stack-item:visible'), function (el) {
this.grid.movable(el, true);
jQuery(el).on('dblclick', function (e) {
this.grid.resizable(el, true);
}.bind(this));
}, this);
jQuery('#edit-grid').data('mode', 1).text('{{ trans('dashboard::dashboard.save grid') }}');
} else {
// disable all the grid editing
_.map(jQuery('.grid-stack > .grid-stack-item:visible'), function (el) {
this.grid.movable(el, false);
this.grid.resizable(el, false);
jQuery(el).off('dblclick');
}, this);
jQuery('#edit-grid').data('mode', 0).text('{{ trans('dashboard::dashboard.edit grid') }}');
// run the save mech
this.save_grid();
}
}.bind(this);
this.spawn_widget = function (node) {
var html = node.html === undefined ? this.defaultWidgets[node.id].html : node.html,
element = jQuery('<div><div class="grid-stack-item-content" />' + html + '<div/>'),
x = node.options === undefined ? node.x : node.options.x,
y = node.options === undefined ? node.y : node.options.y,
width = node.options === undefined ? node.width : node.options.width,
height = node.options === undefined ? node.height : node.options.height;
this.grid.add_widget(element, x, y, width, height);
element.attr({id: node.id});
this.grid.resizable(element, false);
this.grid.movable(element, false);
return element;
}.bind(this);
jQuery('#edit-grid').on('click', this.edit_grid);
jQuery('#myModal').on('hidden.bs.modal', function (e) {
value = jQuery('select[name=widget]').val();
if (value == 'x') {
return;
}
element = this.spawn_widget({
auto_position: true,
width: 2,
height: 2,
id: value
});
this.grid.resizable(element, true);
this.grid.movable(element, true);
}.bind(this));
this.load_grid();
};
});
</script>
@stop
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment