css location change

This commit is contained in:
yuri
2018-01-05 13:12:13 +02:00
parent 21ee02d4ed
commit 3a4220878d
30 changed files with 183 additions and 198 deletions

9
.gitignore vendored
View File

@@ -8,15 +8,6 @@
/node_modules
/test.php
/main.html
/client/css/espo.css
/client/css/espo-vertical.css
/client/css/sakura.css
/client/css/sakura-vertical.css
/client/css/violet.css
/client/css/violet-vertical.css
/client/css/espo-rtl.css
/client/css/hazyblue.css
/client/css/hazyblue-vertical.css
/tests/unit/testData/cache/*
!/tests/unit/testData/cache/.data

View File

@@ -41,6 +41,40 @@ module.exports = function (grunt) {
'client/src/utils.js'
];
var themeList = [
'Espo',
'EspoRtl',
'EspoVertical',
'Hazyblue',
'HazyblueVertical',
'Sakura',
'SakuraVertical',
'Violet',
'VioletVertical'
];
function camelCaseToHyphen (string){
if (string == null) {
return string;
}
return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}
var lessData = {};
themeList.forEach(function (theme) {
var name = camelCaseToHyphen(theme);
var files = {};
files['client/css/espo/'+name+'.css'] = 'frontend/less/'+name+'/main.less';
files['client/css/espo/'+name+'-iframe.css'] = 'frontend/less/'+name+'/iframe/main.less';
var o = {
options: {
yuicompress: true,
},
files: files
};
lessData[theme] = o;
});
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@@ -59,89 +93,7 @@ module.exports = function (grunt) {
start: ['build/*'],
final: ['build/tmp'],
},
less: {
espo: {
options: {
yuicompress: true,
},
files: {
'client/css/espo.css': 'frontend/less/espo/main.less',
}
},
espoVertical: {
options: {
yuicompress: true,
},
files: {
'client/css/espo-vertical.css': 'frontend/less/espo-vertical/main.less',
}
},
espoRtl: {
options: {
yuicompress: true
},
files: {
'client/css/espo-rtl.css': 'frontend/less/espo-rtl/main.less'
}
},
hazyblueVertical: {
options: {
yuicompress: true,
},
files: {
'client/css/hazyblue-vertical.css': 'frontend/less/hazyblue-vertical/main.less',
}
},
hazyblue: {
options: {
yuicompress: true,
},
files: {
'client/css/hazyblue.css': 'frontend/less/hazyblue/main.less',
}
},
sakura: {
options: {
yuicompress: true,
},
files: {
'client/css/sakura.css': 'frontend/less/sakura/main.less',
}
},
sakuraVertical: {
options: {
yuicompress: true,
},
files: {
'client/css/sakura-vertical.css': 'frontend/less/sakura-vertical/main.less',
}
},
violet: {
options: {
yuicompress: true,
},
files: {
'client/css/violet.css': 'frontend/less/violet/main.less',
}
},
violetVertical: {
options: {
yuicompress: true,
},
files: {
'client/css/violet-vertical.css': 'frontend/less/violet-vertical/main.less',
}
}
},
cssmin: {
minify: {
files: {
'build/tmp/client/css/espo.css': [
'client/css/espo.css',
]
}
},
},
less: lessData,
uglify: {
options: {
mangle: false,
@@ -168,10 +120,6 @@ module.exports = function (grunt) {
],
dest: 'build/tmp/client',
},
frontendHtml: {
src: 'frontend/reset.html',
dest: 'build/tmp/reset.html'
},
frontendLib: {
expand: true,
dot: true,
@@ -311,10 +259,8 @@ module.exports = function (grunt) {
'clean:start',
'mkdir:tmp',
'less',
'cssmin',
'uglify',
'copy:frontendFolders',
'copy:frontendHtml',
'copy:frontendLib',
'copy:backend',
'replace',

View File

@@ -1,5 +1,6 @@
{
"stylesheet": "client/css/espo.css",
"stylesheet": "client/css/espo/espo.css",
"stylesheetIframe": "client/css/espo/espo-iframe.css",
"dashboardCellHeight": 155,
"dashboardCellMargin": 19,
"navbarHeight": 44,

View File

@@ -1,5 +1,6 @@
{
"stylesheet": "client/css/espo-rtl.css",
"stylesheet": "client/css/espo/espo-rtl.css",
"stylesheetIframe": "client/css/espo/espo-rtl-iframe.css",
"dashboardCellHeight": 155,
"dashboardCellMargin": 19,
"navbarHeight": 44,

View File

@@ -1,5 +1,6 @@
{
"stylesheet": "client/css/espo-vertical.css",
"stylesheet": "client/css/espo/espo-vertical.css",
"stylesheetIframe": "client/css/espo/espo-vertical-iframe.css",
"navbarIsVertical": true,
"navbarStaticItemsHeight": 65,
"recordTopButtonsStickTop": 61,

View File

@@ -1,5 +1,6 @@
{
"stylesheet": "client/css/hazyblue.css",
"stylesheet": "client/css/espo/hazyblue.css",
"stylesheetIframe": "client/css/espo/hazyblue-iframe.css",
"dashboardCellHeight": 155,
"dashboardCellMargin": 19,
"navbarHeight": 44,

View File

@@ -1,5 +1,6 @@
{
"stylesheet": "client/css/hazyblue-vertical.css",
"stylesheet": "client/css/espo/hazyblue-vertical.css",
"stylesheetIframe": "client/css/espo/hazyblue-vertical-iframe.css",
"navbarIsVertical": true,
"navbarStaticItemsHeight": 65,
"recordTopButtonsStickTop": 61,

View File

@@ -1,5 +1,6 @@
{
"stylesheet": "client/css/sakura.css",
"stylesheet": "client/css/espo/sakura.css",
"stylesheetIframe": "client/css/espo/sakura-iframe.css",
"dashboardCellHeight": 155,
"dashboardCellMargin": 19,
"navbarHeight": 44,

View File

@@ -1,5 +1,6 @@
{
"stylesheet": "client/css/sakura-vertical.css",
"stylesheet": "client/css/espo/sakura-vertical.css",
"stylesheetIframe": "client/css/espo/sakura-vertical-iframe.css",
"navbarIsVertical": true,
"navbarStaticItemsHeight": 65,
"recordTopButtonsStickTop": 61,

View File

@@ -1,5 +1,6 @@
{
"stylesheet": "client/css/violet.css",
"stylesheet": "client/css/espo/violet.css",
"stylesheetIframe": "client/css/espo/violet-iframe.css",
"dashboardCellHeight": 155,
"dashboardCellMargin": 19,
"navbarHeight": 44,

View File

@@ -1,5 +1,6 @@
{
"stylesheet": "client/css/violet-vertical.css",
"stylesheet": "client/css/espo/violet-vertical.css",
"stylesheetIframe": "client/css/espo/violet-vertical-iframe.css",
"navbarIsVertical": true,
"navbarStaticItemsHeight": 65,
"recordTopButtonsStickTop": 61,

4
client/css/espo/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@@ -1,49 +0,0 @@
body, table {
font-size: 14px;
font-family: 'Open Sans';
color: #333;
}
body{
margin: 0;
}
@font-face {
font-family: Open Sans;
src: url('../fonts/open-sans-regular.eot?') format('eot'),
url('../fonts/open-sans-regular.woff') format('woff'),
url('../fonts/open-sans-regular.ttf') format('truetype'),
url('../fonts/open-sans-regular.svg#svgFontName') format('svg');
}
a {
color: #5184b0;
text-decoration: none;
}
table {
display: table;
border-collapse: separate;
border-spacing: 2px;
border-color: #e8eced;
border-spacing: 0;
}
.table {
width: 100%;
}
.table-bordered {
border: 1px solid #e8eced;
}
.table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td {
border: 1px solid #e8eced;
}
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
padding: 8px;
line-height: 1.36;
vertical-align: top;
border-top: 1px solid #e8eced;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -62,7 +62,15 @@ Espo.define('theme-manager', [], function () {
},
getStylesheet: function () {
var link = this.metadata.get('themes.' + this.getName() + '.stylesheet') || 'client/css/espo.css';
var link = this.metadata.get(['themes', this.getName(), 'stylesheet']) || 'client/css/espo/espo.css';
if (this.config.get('cacheTimestamp')) {
link += '?r=' + this.config.get('cacheTimestamp').toString();
}
return link
},
getIframeStylesheet: function () {
var link = this.metadata.get(['themes', this.getName(), 'stylesheetIframe']) || 'client/css/espo/espo-iframe.css';
if (this.config.get('cacheTimestamp')) {
link += '?r=' + this.config.get('cacheTimestamp').toString();
}
@@ -70,7 +78,7 @@ Espo.define('theme-manager', [], function () {
},
getParam: function (name) {
return this.metadata.get('themes.' + this.getName() + '.' + name) || this.defaultParams[name] || null;
return this.metadata.get(['themes', this.getName(), name]) || this.defaultParams[name] || null;
},
isUserTheme: function () {

View File

@@ -153,7 +153,7 @@ Espo.define('views/fields/wysiwyg', ['views/fields/text', 'lib!Summernote'], fun
var linkElement = documentElement.createElement('link');
linkElement.type = 'text/css';
linkElement.rel = 'stylesheet';
linkElement.href = this.getBasePath() + 'client/css/iframe.css';
linkElement.href = this.getBasePath() + this.getThemeManager().getIframeStylesheet();
var body = this.sanitizeHtml(this.model.get(this.name) || '');
documentElement.write(body);

12
diff.js
View File

@@ -76,15 +76,9 @@ execute('git diff --name-only ' + versionFrom, function (stdout) {
fileList.push('client/espo.min.js');
fileList.push('client/css/espo.css');
fileList.push('client/css/espo-vertical.css');
fileList.push('client/css/sakura.css');
fileList.push('client/css/sakura-vertical.css');
fileList.push('client/css/violet.css');
fileList.push('client/css/violet-vertical.css');
fileList.push('client/css/hazyblue.css');
fileList.push('client/css/hazyblue-vertical.css');
fileList.push('client/css/espo-rtl.css');
fs.readdirSync('client/css/espo/').forEach(function (file) {
fileList.push('client/css/espo/' + file);
});
fs.writeFileSync(diffFilePath, fileList.join('\n'));

View File

@@ -0,0 +1,6 @@
@import "../../espo/bootstrap/variables.less";
@import "../../espo/variables.less";
@import "../variables.less";
@import "../../espo/iframe/iframe.less";

View File

@@ -0,0 +1,6 @@
@import "../../espo/bootstrap/variables.less";
@import "../../espo/variables.less";
@import "../variables.less";
@import "../../espo/iframe/iframe.less";

View File

@@ -954,10 +954,10 @@ td.cell[data-name="buttons"] > .btn-group {
@font-face {
font-family: Open Sans;
src: url('../fonts/open-sans-regular.eot?') format('eot'),
url('../fonts/open-sans-regular.woff') format('woff'),
url('../fonts/open-sans-regular.ttf') format('truetype'),
url('../fonts/open-sans-regular.svg#svgFontName') format('svg');
src: url('../../fonts/open-sans-regular.eot?') format('eot'),
url('../../fonts/open-sans-regular.woff') format('woff'),
url('../../fonts/open-sans-regular.ttf') format('truetype'),
url('../../fonts/open-sans-regular.svg#svgFontName') format('svg');
}
.notifications-badge-container > .notifications-button > .number-badge {

View File

@@ -0,0 +1,60 @@
body, table {
font-size: @font-size-base;
font-family: 'Open Sans';
color: @text-color;
}
body {
margin: 0;
}
@font-face {
font-family: Open Sans;
src: url('../../fonts/open-sans-regular.eot?') format('eot'),
url('../../fonts/open-sans-regular.woff') format('woff'),
url('../../fonts/open-sans-regular.ttf') format('truetype'),
url('../../fonts/open-sans-regular.svg#svgFontName') format('svg');
}
a {
color: @link-color;
text-decoration: none;
}
table {
display: table;
border-collapse: separate;
border-spacing: 2px;
border-color: #e8eced;
border-spacing: 0;
}
.table {
width: 100%;
}
.table-bordered {
border: 1px solid @default-border-color;
}
.table-bordered>thead>tr>th,
.table-bordered>tbody>tr>th,
.table-bordered>tfoot>tr>th,
.table-bordered>thead>tr>td,
.table-bordered>tbody>tr>td,
.table-bordered>tfoot>tr>td {
border: 1px solid @default-border-color;
}
.table>thead>tr>th,
.table>tbody>tr>th,
.table>tfoot>tr>th,
.table>thead>tr>td,
.table>tbody>tr>td,
.table>tfoot>tr>td {
padding: 8px;
line-height: 1.36;
vertical-align: top;
border-top: 1px solid @default-border-color;
}

View File

@@ -0,0 +1,4 @@
@import "../bootstrap/variables.less";
@import "../variables.less";
@import "iframe.less";

View File

@@ -6,6 +6,8 @@
@font-family-base: @font-family-sans-serif;
@headings-font-family: @font-family-base;
@icon-font-path: "../../fonts/";
@border-radius-base: 0;
@border-radius-large: 0;
@border-radius-small: 0;

View File

@@ -0,0 +1,6 @@
@import "../../espo/bootstrap/variables.less";
@import "../../espo/variables.less";
@import "../variables.less";
@import "../../espo/iframe/iframe.less";

View File

@@ -0,0 +1,4 @@
@import "../../espo/bootstrap/variables.less";
@import "../../espo/variables.less";
@import "../../espo/iframe/iframe.less";

View File

@@ -0,0 +1,4 @@
@import "../../espo/bootstrap/variables.less";
@import "../../espo/variables.less";
@import "../../espo/iframe/iframe.less";

View File

@@ -0,0 +1,6 @@
@import "../../espo/bootstrap/variables.less";
@import "../../espo/variables.less";
@import "../variables.less";
@import "../../espo/iframe/iframe.less";

View File

@@ -0,0 +1,4 @@
@import "../../espo/bootstrap/variables.less";
@import "../../espo/variables.less";
@import "../../espo/iframe/iframe.less";

View File

@@ -0,0 +1,6 @@
@import "../../espo/bootstrap/variables.less";
@import "../../espo/variables.less";
@import "../variables.less";
@import "../../espo/iframe/iframe.less";