From 47abd1ab5267e4e1c2e2f72757917de4563eef52 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 21 Nov 2016 15:22:15 +0200 Subject: [PATCH] middle panel styles --- client/res/layout-types/record.tpl | 4 +--- client/src/views/admin/layouts/grid.js | 11 ++++++++-- frontend/less/espo/custom.less | 30 +++++++++++++++++++------- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/client/res/layout-types/record.tpl b/client/res/layout-types/record.tpl index 390a1b3c29..5a5c2e8a30 100644 --- a/client/res/layout-types/record.tpl +++ b/client/res/layout-types/record.tpl @@ -1,6 +1,5 @@ -<% var previousStyle = null;%> <% _.each(layout, function (panel, columnNumber) { %> -
> +
> {{#if "<%= panel.label %>"}}

<%= "{{translate \"" + panel.label + "\" scope=\""+model.name+"\"}}" %>

{{/if}} @@ -37,5 +36,4 @@ <% }); %>
-<% previousStyle = panel.style; %> <% }); %> diff --git a/client/src/views/admin/layouts/grid.js b/client/src/views/admin/layouts/grid.js index 1b7f5020b7..9029aa4008 100644 --- a/client/src/views/admin/layouts/grid.js +++ b/client/src/views/admin/layouts/grid.js @@ -135,13 +135,19 @@ Espo.define('views/admin/layouts/grid', 'views/admin/layouts/base', function (De var style = $header.data('style'); var attributes = { - panelName: panelName + panelName: panelName, + style: style }; - var attributeList = ['panelName']; + var attributeList = ['panelName', 'style']; var attributeDefs = { panelName: { type: 'varchar', + }, + style: { + type: 'enum', + options: ['default', 'success', 'danger', 'primary', 'info', 'warning'], + translation: 'LayoutManager.options.style' } }; @@ -153,6 +159,7 @@ Espo.define('views/admin/layouts/grid', 'views/admin/layouts/base', function (De view.render(); this.listenTo(view, 'after:save', function (attributes) { $label.text(attributes.panelName); + $header.data('style', attributes.style); view.close(); }, this); }, this); diff --git a/frontend/less/espo/custom.less b/frontend/less/espo/custom.less index 61da104d5d..006d4e56d4 100644 --- a/frontend/less/espo/custom.less +++ b/frontend/less/espo/custom.less @@ -882,16 +882,30 @@ body > footer > p a:visited { } .record .middle > .panel { - margin-top: -1 * @line-height-computed - 2; + margin-top: -1 * @line-height-computed; + border-top-width: 0; + .panel-heading { + .btn-group { + top: -6px; + .btn { + border-top-width: 0; + } + } + } } -.bottom > .panel.sticked, -.side > .panel.sticked { - margin-top: -1 * @line-height-computed - 2; -} - -.panel.sticked-2 { - margin-top: -1 * @line-height-computed !important; +.panel.sticked, +.panel.sticked { + margin-top: -1 * @line-height-computed; + border-top-width: 0; + .panel-heading { + .btn-group { + top: -6px; + .btn { + border-top-width: 0; + } + } + } } .stream-head-container {