diff --git a/app/Http/Controllers/Admin/Contents/EditContent.php b/app/Http/Controllers/Admin/Contents/EditContent.php index fda4f63e..d1cf7a3e 100644 --- a/app/Http/Controllers/Admin/Contents/EditContent.php +++ b/app/Http/Controllers/Admin/Contents/EditContent.php @@ -147,7 +147,11 @@ class EditContent extends Controller $request->url = Str::slug($request->url); $request->parentPage = $request->parentPage ? $request->parentPage : null; - $request->titlePhotoFilename = $file ? $file['filename'] : null; + if (!$file) { + $request->titlePhotoFilename = empty($request->existingTitlePhoto) ? null : $request->existingTitlePhoto; + } else { + $request->titlePhotoFilename = $file['filename']; + } // array of fields in database and fields from request $fields = [ diff --git a/resources/assets/admin/js/app.js b/resources/assets/admin/js/app.js index 4b10be8d..5ef8ea0d 100644 --- a/resources/assets/admin/js/app.js +++ b/resources/assets/admin/js/app.js @@ -152,179 +152,179 @@ $ (function () { $el.addClass ('visible'); }, 1000); -}) -//LoginForm validation -$ (function () { - if (!$ ('#login-form').length) { - return false; - } - - var loginValidationSettings = { - rules: { - username: { - required: true, - email: true - }, - password: "required", - agree: "required" - }, - messages: { - username: { - required: "Please enter username", - email: "Please enter a valid email address" - }, - password: "Please enter password", - agree: "Please accept our policy" - }, - invalidHandler: function () { - animate ({ - name: 'shake', - selector: '.auth-container > .card' - }); - } - } - - $.extend (loginValidationSettings, config.validations); - - $ ('#login-form').validate (loginValidationSettings); -}) -//LoginForm validation -$ (function () { - if (!$ ('#reset-form').length) { - return false; - } - - var resetValidationSettings = { - rules: { - email1: { - required: true, - email: true - } - }, - messages: { - email1: { - required: "Please enter email address", - email: "Please enter a valid email address" - } - }, - invalidHandler: function () { - animate ({ - name: 'shake', - selector: '.auth-container > .card' - }); - } - } - - $.extend (resetValidationSettings, config.validations); - - $ ('#reset-form').validate (resetValidationSettings); -}) -//LoginForm validation -$ (function () { - if (!$ ('#signup-form').length) { - return false; - } - - var signupValidationSettings = { - rules: { - firstname: { - required: true, - }, - lastname: { - required: true, - }, - email: { - required: true, - email: true - }, - password: { - required: true, - minlength: 8 - }, - retype_password: { - required: true, - minlength: 8, - equalTo: "#password" - }, - agree: { - required: true, - } - }, - groups: { - name: "firstname lastname", - pass: "password retype_password", - }, - errorPlacement: function (error, element) { - if ( - element.attr ("name") == "firstname" || - element.attr ("name") == "lastname" - ) { - error.insertAfter ($ ("#lastname").closest ('.row')); - element.parents ("div.form-group") - .addClass ('has-error'); - } - else if ( - element.attr ("name") == "password" || - element.attr ("name") == "retype_password" - ) { - error.insertAfter ($ ("#retype_password").closest ('.row')); - element.parents ("div.form-group") - .addClass ('has-error'); - } - else if (element.attr ("name") == "agree") { - error.insertAfter ("#agree-text"); - } - else { - error.insertAfter (element); - } - }, - messages: { - firstname: "Please enter firstname and lastname", - lastname: "Please enter firstname and lastname", - email: { - required: "Please enter email", - email: "Please enter a valid email address" - }, - password: { - required: "Please enter password fields.", - minlength: "Passwords should be at least 8 characters." - }, - retype_password: { - required: "Please enter password fields.", - minlength: "Passwords should be at least 8 characters." - }, - agree: "Please accept our policy" - }, - invalidHandler: function () { - animate ({ - name: 'shake', - selector: '.auth-container > .card' - }); - } - } - - $.extend (signupValidationSettings, config.validations); - - $ ('#signup-form').validate (signupValidationSettings); -}); -$ (function () { - - $ (".wyswyg").each (function () { - - var $toolbar = $ (this).find (".toolbar"); - var $editor = $ (this).find (".editor"); - - var editor = new Quill ($editor.get (0), { - theme: 'snow' - }); - - editor.addModule ('toolbar', { - container: $toolbar.get (0) // Selector for toolbar container - }); - - }); - }); +// //LoginForm validation +// $ (function () { +// if (!$ ('#login-form').length) { +// return false; +// } +// +// var loginValidationSettings = { +// rules: { +// username: { +// required: true, +// email: true +// }, +// password: "required", +// agree: "required" +// }, +// messages: { +// username: { +// required: "Please enter username", +// email: "Please enter a valid email address" +// }, +// password: "Please enter password", +// agree: "Please accept our policy" +// }, +// invalidHandler: function () { +// animate ({ +// name: 'shake', +// selector: '.auth-container > .card' +// }); +// } +// }; +// +// $.extend (loginValidationSettings, config.validations); +// +// $ ('#login-form').validate (loginValidationSettings); +// }) +// //LoginForm validation +// $ (function () { +// if (!$ ('#reset-form').length) { +// return false; +// } +// +// var resetValidationSettings = { +// rules: { +// email1: { +// required: true, +// email: true +// } +// }, +// messages: { +// email1: { +// required: "Please enter email address", +// email: "Please enter a valid email address" +// } +// }, +// invalidHandler: function () { +// animate ({ +// name: 'shake', +// selector: '.auth-container > .card' +// }); +// } +// } +// +// $.extend (resetValidationSettings, config.validations); +// +// $ ('#reset-form').validate (resetValidationSettings); +// }) +// //LoginForm validation +// $ (function () { +// if (!$ ('#signup-form').length) { +// return false; +// } +// +// var signupValidationSettings = { +// rules: { +// firstname: { +// required: true, +// }, +// lastname: { +// required: true, +// }, +// email: { +// required: true, +// email: true +// }, +// password: { +// required: true, +// minlength: 8 +// }, +// retype_password: { +// required: true, +// minlength: 8, +// equalTo: "#password" +// }, +// agree: { +// required: true, +// } +// }, +// groups: { +// name: "firstname lastname", +// pass: "password retype_password", +// }, +// errorPlacement: function (error, element) { +// if ( +// element.attr ("name") == "firstname" || +// element.attr ("name") == "lastname" +// ) { +// error.insertAfter ($ ("#lastname").closest ('.row')); +// element.parents ("div.form-group") +// .addClass ('has-error'); +// } +// else if ( +// element.attr ("name") == "password" || +// element.attr ("name") == "retype_password" +// ) { +// error.insertAfter ($ ("#retype_password").closest ('.row')); +// element.parents ("div.form-group") +// .addClass ('has-error'); +// } +// else if (element.attr ("name") == "agree") { +// error.insertAfter ("#agree-text"); +// } +// else { +// error.insertAfter (element); +// } +// }, +// messages: { +// firstname: "Please enter firstname and lastname", +// lastname: "Please enter firstname and lastname", +// email: { +// required: "Please enter email", +// email: "Please enter a valid email address" +// }, +// password: { +// required: "Please enter password fields.", +// minlength: "Passwords should be at least 8 characters." +// }, +// retype_password: { +// required: "Please enter password fields.", +// minlength: "Passwords should be at least 8 characters." +// }, +// agree: "Please accept our policy" +// }, +// invalidHandler: function () { +// animate ({ +// name: 'shake', +// selector: '.auth-container > .card' +// }); +// } +// } +// +// $.extend (signupValidationSettings, config.validations); +// +// $ ('#signup-form').validate (signupValidationSettings); +// }); +// $ (function () { +// +// $ (".wyswyg").each (function () { +// +// var $toolbar = $ (this).find (".toolbar"); +// var $editor = $ (this).find (".editor"); +// +// var editor = new Quill ($editor.get (0), { +// theme: 'snow' +// }); +// +// editor.addModule ('toolbar', { +// container: $toolbar.get (0) // Selector for toolbar container +// }); +// +// }); +// +// }); $ (function () { $ ('#sidebar-menu, #customize-menu').metisMenu ({ @@ -665,398 +665,398 @@ $ (function () { // }); // // }); -$ (function () { - - if (!$ ('#morris-one-line-chart').length) { - return false; - } - - function drawMorrisCharts() { - - $ ('#morris-one-line-chart').empty (); - - Morris.Line ({ - element: 'morris-one-line-chart', - data: [ - {year: '2008', value: 5}, - {year: '2009', value: 10}, - {year: '2010', value: 8}, - {year: '2011', value: 22}, - {year: '2012', value: 8}, - {year: '2014', value: 10}, - {year: '2015', value: 5} - ], - xkey: 'year', - ykeys: ['value'], - resize: true, - lineWidth: 4, - labels: ['Value'], - lineColors: [config.chart.colorPrimary.toString ()], - pointSize: 5, - }); - - $ ('#morris-area-chart').empty (); - - Morris.Area ({ - element: 'morris-area-chart', - data: [{period: '2010 Q1', iphone: 2666, ipad: null, itouch: 2647}, - {period: '2010 Q2', iphone: 2778, ipad: 2294, itouch: 2441}, - {period: '2010 Q3', iphone: 4912, ipad: 1969, itouch: 2501}, - {period: '2010 Q4', iphone: 3767, ipad: 3597, itouch: 5689}, - {period: '2011 Q1', iphone: 6810, ipad: 1914, itouch: 2293}, - {period: '2011 Q2', iphone: 5670, ipad: 4293, itouch: 1881}, - {period: '2011 Q3', iphone: 4820, ipad: 3795, itouch: 1588}, - {period: '2011 Q4', iphone: 15073, ipad: 5967, itouch: 5175}, - {period: '2012 Q1', iphone: 10687, ipad: 4460, itouch: 2028}, - {period: '2012 Q2', iphone: 8432, ipad: 5713, itouch: 1791}], - xkey: 'period', - ykeys: ['iphone', 'ipad', 'itouch'], - labels: ['iPhone', 'iPad', 'iPod Touch'], - pointSize: 2, - hideHover: 'auto', - resize: true, - lineColors: [ - tinycolor (config.chart.colorPrimary.toString ()).lighten (10).toString (), - tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString (), - config.chart.colorPrimary.toString () - ], - lineWidth: 2, - pointSize: 1, - }); - - $ ('#morris-donut-chart').empty (); - - Morris.Donut ({ - element: 'morris-donut-chart', - data: [{label: "Download Sales", value: 12}, - {label: "In-Store Sales", value: 30}, - {label: "Mail-Order Sales", value: 20}], - resize: true, - colors: [ - tinycolor (config.chart.colorPrimary.toString ()).lighten (10).toString (), - tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString (), - config.chart.colorPrimary.toString () - ], - }); - - $ ('#morris-bar-chart').empty (); - - Morris.Bar ({ - element: 'morris-bar-chart', - data: [{y: '2006', a: 60, b: 50}, - {y: '2007', a: 75, b: 65}, - {y: '2008', a: 50, b: 40}, - {y: '2009', a: 75, b: 65}, - {y: '2010', a: 50, b: 40}, - {y: '2011', a: 75, b: 65}, - {y: '2012', a: 100, b: 90}], - xkey: 'y', - ykeys: ['a', 'b'], - labels: ['Series A', 'Series B'], - hideHover: 'auto', - resize: true, - barColors: [ - config.chart.colorPrimary.toString (), - tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString () - ], - }); - - $ ('#morris-line-chart').empty (); - - Morris.Line ({ - element: 'morris-line-chart', - data: [{y: '2006', a: 100, b: 90}, - {y: '2007', a: 75, b: 65}, - {y: '2008', a: 50, b: 40}, - {y: '2009', a: 75, b: 65}, - {y: '2010', a: 50, b: 40}, - {y: '2011', a: 75, b: 65}, - {y: '2012', a: 100, b: 90}], - xkey: 'y', - ykeys: ['a', 'b'], - labels: ['Series A', 'Series B'], - hideHover: 'auto', - resize: true, - lineColors: [ - config.chart.colorPrimary.toString (), - tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString () - ], - }); - } - - drawMorrisCharts (); - - $ (document).on ("themechange", function () { - drawMorrisCharts (); - }); -}); -$ (function () { - - if (!$ ('#dashboard-visits-chart').length) { - return false; - } - - // drawing visits chart - drawVisitsChart (); - - var el = null; - var item = 'visits'; - - $ ('a[data-toggle="tab"]').on ('shown.bs.tab', function (e) { - - el = e.target; - item = $ (el).attr ('href').replace ('#', ''); - switchHistoryCharts (item); - - }); - - $ (document).on ("themechange", function () { - switchHistoryCharts (item); - }); - - function switchHistoryCharts(item) { - var chartSelector = "#dashboard-" + item + "-chart"; - - if ($ (chartSelector).has ('svg').length) { - $ (chartSelector).empty (); - } - - switch (item) { - case 'visits': - drawVisitsChart (); - break; - case 'downloads': - drawDownloadsChart (); - break; - } - } - - function drawVisitsChart() { - var dataVisits = [ - {x: '2015-09-01', y: 70}, - {x: '2015-09-02', y: 75}, - {x: '2015-09-03', y: 50}, - {x: '2015-09-04', y: 75}, - {x: '2015-09-05', y: 50}, - {x: '2015-09-06', y: 75}, - {x: '2015-09-07', y: 86} - ]; - - Morris.Line ({ - element: 'dashboard-visits-chart', - data: dataVisits, - xkey: 'x', - ykeys: ['y'], - ymin: 'auto 40', - labels: ['Visits'], - xLabels: "day", - hideHover: 'auto', - yLabelFormat: function (y) { - // Only integers - if (y === parseInt (y, 10)) { - return y; - } - else { - return ''; - } - }, - resize: true, - lineColors: [ - config.chart.colorSecondary.toString (), - ], - pointFillColors: [ - config.chart.colorPrimary.toString (), - ] - }); - } - - function drawDownloadsChart() { - - var dataDownloads = [ - { - year: '2006', - downloads: 1300 - }, - { - year: '2007', - downloads: 1526 - }, - { - year: '2008', - downloads: 2000 - }, - { - year: '2009', - downloads: 1800 - }, - { - year: '2010', - downloads: 1650 - }, - { - year: '2011', - downloads: 620 - }, - { - year: '2012', - downloads: 1000 - }, - { - year: '2013', - downloads: 1896 - }, - { - year: '2014', - downloads: 850 - }, - { - year: '2015', - downloads: 1500 - } - ]; - - Morris.Bar ({ - element: 'dashboard-downloads-chart', - data: dataDownloads, - xkey: 'year', - ykeys: ['downloads'], - labels: ['Downloads'], - hideHover: 'auto', - resize: true, - barColors: [ - config.chart.colorPrimary.toString (), - tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString () - ], - }); - } -}); - -$ (function () { - - function drawDashboardItemsListSparklines() { - $ (".dashboard-page .items .sparkline").each (function () { - var type = $ (this).data ('type'); - - // There is predefined data - if ($ (this).data ('data')) { - var data = $ (this).data ('data').split (',').map (function (item) { - if (item.indexOf (":") > 0) { - return item.split (":"); - } - else { - return item; - } - }); - } - // Generate random data - else { - var data = []; - for (var i = 0; i < 17; i++) { - data.push (Math.round (100 * Math.random ())); - } - } - - $ (this).sparkline (data, { - barColor: config.chart.colorPrimary.toString (), - height: $ (this).height (), - type: type - }); - }); - } - - drawDashboardItemsListSparklines (); - - $ (document).on ("themechange", function () { - drawDashboardItemsListSparklines (); - }); -}); -$ (function () { - - var $dashboardSalesBreakdownChart = $ ('#dashboard-sales-breakdown-chart'); - - if (!$dashboardSalesBreakdownChart.length) { - return false; - } - - function drawSalesChart() { - - $dashboardSalesBreakdownChart.empty (); - - Morris.Donut ({ - element: 'dashboard-sales-breakdown-chart', - data: [{label: "Download Sales", value: 12}, - {label: "In-Store Sales", value: 30}, - {label: "Mail-Order Sales", value: 20}], - resize: true, - colors: [ - tinycolor (config.chart.colorPrimary.toString ()).lighten (10).toString (), - tinycolor (config.chart.colorPrimary.toString ()).darken (8).toString (), - config.chart.colorPrimary.toString () - ], - }); - - var $sameheightContainer = $dashboardSalesBreakdownChart.closest (".sameheight-container"); - - setSameHeights ($sameheightContainer); - } - - drawSalesChart (); - - $ (document).on ("themechange", function () { - drawSalesChart (); - }); - -}) -$ (function () { - - var $dashboardSalesMap = $ ('#dashboard-sales-map'); - - if (!$dashboardSalesMap.length) { - return false; - } - - function drawSalesMap() { - - $dashboardSalesMap.empty (); - - var color = config.chart.colorPrimary.toHexString (); - var darkColor = tinycolor (config.chart.colorPrimary.toString ()).darken (40).toHexString (); - var selectedColor = tinycolor (config.chart.colorPrimary.toString ()).darken (10).toHexString (); - - var sales_data = { - us: 2000, - ru: 2000, - gb: 10000, - fr: 10000, - de: 10000, - cn: 10000, - in: 10000, - sa: 10000, - ca: 10000, - br: 5000, - au: 5000 - }; - - $dashboardSalesMap.vectorMap ({ - map: 'world_en', - backgroundColor: 'transparent', - color: '#E5E3E5', - hoverOpacity: 0.7, - selectedColor: selectedColor, - enableZoom: true, - showTooltip: true, - values: sales_data, - scaleColors: [color, darkColor], - normalizeFunction: 'linear' - }); - } - - drawSalesMap (); - - $ (document).on ("themechange", function () { - drawSalesMap (); - }); -}); +// $ (function () { +// +// if (!$ ('#morris-one-line-chart').length) { +// return false; +// } +// +// function drawMorrisCharts() { +// +// $ ('#morris-one-line-chart').empty (); +// +// Morris.Line ({ +// element: 'morris-one-line-chart', +// data: [ +// {year: '2008', value: 5}, +// {year: '2009', value: 10}, +// {year: '2010', value: 8}, +// {year: '2011', value: 22}, +// {year: '2012', value: 8}, +// {year: '2014', value: 10}, +// {year: '2015', value: 5} +// ], +// xkey: 'year', +// ykeys: ['value'], +// resize: true, +// lineWidth: 4, +// labels: ['Value'], +// lineColors: [config.chart.colorPrimary.toString ()], +// pointSize: 5, +// }); +// +// $ ('#morris-area-chart').empty (); +// +// Morris.Area ({ +// element: 'morris-area-chart', +// data: [{period: '2010 Q1', iphone: 2666, ipad: null, itouch: 2647}, +// {period: '2010 Q2', iphone: 2778, ipad: 2294, itouch: 2441}, +// {period: '2010 Q3', iphone: 4912, ipad: 1969, itouch: 2501}, +// {period: '2010 Q4', iphone: 3767, ipad: 3597, itouch: 5689}, +// {period: '2011 Q1', iphone: 6810, ipad: 1914, itouch: 2293}, +// {period: '2011 Q2', iphone: 5670, ipad: 4293, itouch: 1881}, +// {period: '2011 Q3', iphone: 4820, ipad: 3795, itouch: 1588}, +// {period: '2011 Q4', iphone: 15073, ipad: 5967, itouch: 5175}, +// {period: '2012 Q1', iphone: 10687, ipad: 4460, itouch: 2028}, +// {period: '2012 Q2', iphone: 8432, ipad: 5713, itouch: 1791}], +// xkey: 'period', +// ykeys: ['iphone', 'ipad', 'itouch'], +// labels: ['iPhone', 'iPad', 'iPod Touch'], +// pointSize: 2, +// hideHover: 'auto', +// resize: true, +// lineColors: [ +// tinycolor (config.chart.colorPrimary.toString ()).lighten (10).toString (), +// tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString (), +// config.chart.colorPrimary.toString () +// ], +// lineWidth: 2, +// pointSize: 1, +// }); +// +// $ ('#morris-donut-chart').empty (); +// +// Morris.Donut ({ +// element: 'morris-donut-chart', +// data: [{label: "Download Sales", value: 12}, +// {label: "In-Store Sales", value: 30}, +// {label: "Mail-Order Sales", value: 20}], +// resize: true, +// colors: [ +// tinycolor (config.chart.colorPrimary.toString ()).lighten (10).toString (), +// tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString (), +// config.chart.colorPrimary.toString () +// ], +// }); +// +// $ ('#morris-bar-chart').empty (); +// +// Morris.Bar ({ +// element: 'morris-bar-chart', +// data: [{y: '2006', a: 60, b: 50}, +// {y: '2007', a: 75, b: 65}, +// {y: '2008', a: 50, b: 40}, +// {y: '2009', a: 75, b: 65}, +// {y: '2010', a: 50, b: 40}, +// {y: '2011', a: 75, b: 65}, +// {y: '2012', a: 100, b: 90}], +// xkey: 'y', +// ykeys: ['a', 'b'], +// labels: ['Series A', 'Series B'], +// hideHover: 'auto', +// resize: true, +// barColors: [ +// config.chart.colorPrimary.toString (), +// tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString () +// ], +// }); +// +// $ ('#morris-line-chart').empty (); +// +// Morris.Line ({ +// element: 'morris-line-chart', +// data: [{y: '2006', a: 100, b: 90}, +// {y: '2007', a: 75, b: 65}, +// {y: '2008', a: 50, b: 40}, +// {y: '2009', a: 75, b: 65}, +// {y: '2010', a: 50, b: 40}, +// {y: '2011', a: 75, b: 65}, +// {y: '2012', a: 100, b: 90}], +// xkey: 'y', +// ykeys: ['a', 'b'], +// labels: ['Series A', 'Series B'], +// hideHover: 'auto', +// resize: true, +// lineColors: [ +// config.chart.colorPrimary.toString (), +// tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString () +// ], +// }); +// } +// +// drawMorrisCharts (); +// +// $ (document).on ("themechange", function () { +// drawMorrisCharts (); +// }); +// }); +// $ (function () { +// +// if (!$ ('#dashboard-visits-chart').length) { +// return false; +// } +// +// // drawing visits chart +// drawVisitsChart (); +// +// var el = null; +// var item = 'visits'; +// +// $ ('a[data-toggle="tab"]').on ('shown.bs.tab', function (e) { +// +// el = e.target; +// item = $ (el).attr ('href').replace ('#', ''); +// switchHistoryCharts (item); +// +// }); +// +// $ (document).on ("themechange", function () { +// switchHistoryCharts (item); +// }); +// +// function switchHistoryCharts(item) { +// var chartSelector = "#dashboard-" + item + "-chart"; +// +// if ($ (chartSelector).has ('svg').length) { +// $ (chartSelector).empty (); +// } +// +// switch (item) { +// case 'visits': +// drawVisitsChart (); +// break; +// case 'downloads': +// drawDownloadsChart (); +// break; +// } +// } +// +// function drawVisitsChart() { +// var dataVisits = [ +// {x: '2015-09-01', y: 70}, +// {x: '2015-09-02', y: 75}, +// {x: '2015-09-03', y: 50}, +// {x: '2015-09-04', y: 75}, +// {x: '2015-09-05', y: 50}, +// {x: '2015-09-06', y: 75}, +// {x: '2015-09-07', y: 86} +// ]; +// +// Morris.Line ({ +// element: 'dashboard-visits-chart', +// data: dataVisits, +// xkey: 'x', +// ykeys: ['y'], +// ymin: 'auto 40', +// labels: ['Visits'], +// xLabels: "day", +// hideHover: 'auto', +// yLabelFormat: function (y) { +// // Only integers +// if (y === parseInt (y, 10)) { +// return y; +// } +// else { +// return ''; +// } +// }, +// resize: true, +// lineColors: [ +// config.chart.colorSecondary.toString (), +// ], +// pointFillColors: [ +// config.chart.colorPrimary.toString (), +// ] +// }); +// } +// +// function drawDownloadsChart() { +// +// var dataDownloads = [ +// { +// year: '2006', +// downloads: 1300 +// }, +// { +// year: '2007', +// downloads: 1526 +// }, +// { +// year: '2008', +// downloads: 2000 +// }, +// { +// year: '2009', +// downloads: 1800 +// }, +// { +// year: '2010', +// downloads: 1650 +// }, +// { +// year: '2011', +// downloads: 620 +// }, +// { +// year: '2012', +// downloads: 1000 +// }, +// { +// year: '2013', +// downloads: 1896 +// }, +// { +// year: '2014', +// downloads: 850 +// }, +// { +// year: '2015', +// downloads: 1500 +// } +// ]; +// +// Morris.Bar ({ +// element: 'dashboard-downloads-chart', +// data: dataDownloads, +// xkey: 'year', +// ykeys: ['downloads'], +// labels: ['Downloads'], +// hideHover: 'auto', +// resize: true, +// barColors: [ +// config.chart.colorPrimary.toString (), +// tinycolor (config.chart.colorPrimary.toString ()).darken (10).toString () +// ], +// }); +// } +// }); +// +// $ (function () { +// +// function drawDashboardItemsListSparklines() { +// $ (".dashboard-page .items .sparkline").each (function () { +// var type = $ (this).data ('type'); +// +// // There is predefined data +// if ($ (this).data ('data')) { +// var data = $ (this).data ('data').split (',').map (function (item) { +// if (item.indexOf (":") > 0) { +// return item.split (":"); +// } +// else { +// return item; +// } +// }); +// } +// // Generate random data +// else { +// var data = []; +// for (var i = 0; i < 17; i++) { +// data.push (Math.round (100 * Math.random ())); +// } +// } +// +// $ (this).sparkline (data, { +// barColor: config.chart.colorPrimary.toString (), +// height: $ (this).height (), +// type: type +// }); +// }); +// } +// +// drawDashboardItemsListSparklines (); +// +// $ (document).on ("themechange", function () { +// drawDashboardItemsListSparklines (); +// }); +// }); +// $ (function () { +// +// var $dashboardSalesBreakdownChart = $ ('#dashboard-sales-breakdown-chart'); +// +// if (!$dashboardSalesBreakdownChart.length) { +// return false; +// } +// +// function drawSalesChart() { +// +// $dashboardSalesBreakdownChart.empty (); +// +// Morris.Donut ({ +// element: 'dashboard-sales-breakdown-chart', +// data: [{label: "Download Sales", value: 12}, +// {label: "In-Store Sales", value: 30}, +// {label: "Mail-Order Sales", value: 20}], +// resize: true, +// colors: [ +// tinycolor (config.chart.colorPrimary.toString ()).lighten (10).toString (), +// tinycolor (config.chart.colorPrimary.toString ()).darken (8).toString (), +// config.chart.colorPrimary.toString () +// ], +// }); +// +// var $sameheightContainer = $dashboardSalesBreakdownChart.closest (".sameheight-container"); +// +// setSameHeights ($sameheightContainer); +// } +// +// drawSalesChart (); +// +// $ (document).on ("themechange", function () { +// drawSalesChart (); +// }); +// +// }) +// $ (function () { +// +// var $dashboardSalesMap = $ ('#dashboard-sales-map'); +// +// if (!$dashboardSalesMap.length) { +// return false; +// } +// +// function drawSalesMap() { +// +// $dashboardSalesMap.empty (); +// +// var color = config.chart.colorPrimary.toHexString (); +// var darkColor = tinycolor (config.chart.colorPrimary.toString ()).darken (40).toHexString (); +// var selectedColor = tinycolor (config.chart.colorPrimary.toString ()).darken (10).toHexString (); +// +// var sales_data = { +// us: 2000, +// ru: 2000, +// gb: 10000, +// fr: 10000, +// de: 10000, +// cn: 10000, +// in: 10000, +// sa: 10000, +// ca: 10000, +// br: 5000, +// au: 5000 +// }; +// +// $dashboardSalesMap.vectorMap ({ +// map: 'world_en', +// backgroundColor: 'transparent', +// color: '#E5E3E5', +// hoverOpacity: 0.7, +// selectedColor: selectedColor, +// enableZoom: true, +// showTooltip: true, +// values: sales_data, +// scaleColors: [color, darkColor], +// normalizeFunction: 'linear' +// }); +// } +// +// drawSalesMap (); +// +// $ (document).on ("themechange", function () { +// drawSalesMap (); +// }); +// }); $ (function () { $ ('.actions-list > li').on ('click', '.check', function (e) { @@ -1460,6 +1460,11 @@ $ (document).ready (function () { $ ("#" + tabCard.prop ('id') + "-tab").addClass ('tab-with-error'); }); + + $('#removeTitlePhoto').click(function () { + $('#titlePhotoContainer').remove(); + // $('existingTitlePhoto').val(null); + }); }); /*********************************************** diff --git a/resources/lang/en/admin/contents.php b/resources/lang/en/admin/contents.php index ee8093f6..cfd9b505 100644 --- a/resources/lang/en/admin/contents.php +++ b/resources/lang/en/admin/contents.php @@ -53,5 +53,6 @@ return [ 'status' => 'Status', 'moduleName' => 'Module', 'actions' => 'Actions', - 'invalidTemplateSelected' => 'Invalid template selected! This page cannot be rendered!' + 'invalidTemplateSelected' => 'Invalid template selected! This page cannot be rendered!', + 'deleteTitlePhoto' => 'Delete title photo' ]; \ No newline at end of file diff --git a/resources/views/admin/content/formParts/appearance.blade.php b/resources/views/admin/content/formParts/appearance.blade.php index 550e454a..f11c96fc 100644 --- a/resources/views/admin/content/formParts/appearance.blade.php +++ b/resources/views/admin/content/formParts/appearance.blade.php @@ -1,7 +1,14 @@ @if($page->title_photo)
-
- +
+ +

+

+ +

@endif