Commit 22930050 authored by Guillaume Agniéray's avatar Guillaume Agniéray Committed by Johan Cwiklinski
Browse files

Move all assets' sources out of webroot folder

parent f3874f70
......@@ -28,27 +28,49 @@ gulp.task('build-javascript', buildJS);
gulp.task('build-assets', buildAssets);
var paths = {
galette: {
modules: './node_modules/',
semantic: './semantic/',
ui: {
css: './galette/webroot/assets/ui/semantic.min.css',
js: './galette/webroot/assets/ui/semantic.min.js'
},
public: './galette/webroot/assets/'
webroot: './galette/webroot/',
assets: {
public: './galette/webroot/assets/',
css: './galette/webroot/assets/css/',
js: './galette/webroot/assets/js/',
webfonts: './galette/webroot/assets/webfonts/',
theme: {
public: './galette/webroot/themes/default/',
css: './galette/webroot/themes/default/ui/semantic.min.css',
js: './galette/webroot/themes/default/ui/semantic.min.js',
images: './galette/webroot/themes/default/images/'
}
},
src: {
theme: './ui/semantic/galette/**/*',
config: './ui/semantic/theme*',
files: [
'./ui/semantic/galette/*',
'./ui/semantic/galette/**/*.*'
],
css: './ui/css/**/*.css',
js: './ui/js/*.js',
favicon:'./ui/images/favicon.ico',
faviconpng:'./ui/images/favicon.png',
logo: './ui/images/galette.png',
photo:'./ui/images/default.png'
},
semantic: {
src: './semantic/src/',
theme: './semantic/src/themes/galette/'
},
css: {
styles: {
main: [
'./galette/webroot/themes/default/galette.css',
'./ui/css/galette.css',
'./node_modules/summernote/dist/summernote-lite.min.css'
]
},
js: {
scripts: {
main: [
'./node_modules/jquery/dist/jquery.js',
'./node_modules/js-cookie/dist/js.cookie.min.js',
'./node_modules/summernote/dist/summernote-lite.min.js',
'./galette/webroot/js/common.js'
'./ui/js/common.js'
],
chartjs: [
'./node_modules/chart.js/dist/chart.min.js',
......@@ -61,75 +83,89 @@ var paths = {
},
extras: [
{
src: './ui/css/galette_print.css',
dest: 'css/'
}, {
src: './ui/css/install.css',
dest: 'css/'
}, {
src: './ui/js/mass_changes.js',
dest: 'js/'
}, {
src: './node_modules/summernote/dist/font/*',
dest: '/webfonts/'
dest: 'webfonts/'
}, {
src: './node_modules/summernote/dist/lang/*.min.js',
dest: '/js/lang/'
dest: 'js/lang/'
}
],
src: {
theme: './theme/themes/galette/**/*',
css: './galette/webroot/themes/**/*.css',
js: './galette/webroot/js/*.js'
}
]
};
function theme() {
var _dir = paths.galette.semantic + 'src/';
var _themes = paths.galette.semantic + 'src/themes/galette';
function galette() {
favicon = gulp.src(paths.src.favicon)
.pipe(gulp.dest(paths.webroot))
.pipe(browserSync.stream());
faviconpng = gulp.src(paths.src.faviconpng)
.pipe(gulp.dest(paths.assets.theme.images))
.pipe(browserSync.stream());
logo = gulp.src(paths.src.logo)
.pipe(gulp.dest(paths.assets.theme.images))
.pipe(browserSync.stream());
photo = gulp.src(paths.src.photo)
.pipe(gulp.dest(paths.assets.theme.images))
.pipe(browserSync.stream());
return merge(favicon, logo, photo);
}
config = gulp.src([
'./theme/theme.config'
])
.pipe(gulp.dest(_dir))
function theme() {
config = gulp.src(paths.src.config)
.pipe(gulp.dest(paths.semantic.src))
.pipe(browserSync.stream());
theme = gulp.src([
'./theme/themes/galette/*',
'./theme/themes/galette/**/*.*'
])
.pipe(gulp.dest(_themes))
theme = gulp.src(paths.src.files)
.pipe(gulp.dest(paths.semantic.theme))
.pipe(browserSync.stream());
return merge(config, theme);
}
function clean() {
return del([paths.galette.public]);
return del([
paths.assets.public,
paths.assets.theme.public,
]);
}
function styles() {
var _dir = paths.galette.public + '/css/';
main = gulp.src(paths.css.main)
.pipe(replace('url(images/', 'url(../images/'))
main = gulp.src(paths.styles.main)
.pipe(replace('url(font/', 'url(../webfonts/'))
.pipe(cleanCSS())
.pipe(concat('galette-main.bundle.min.css'))
.pipe(gulp.dest(_dir))
.pipe(gulp.dest(paths.assets.css))
.pipe(browserSync.stream());
return merge(main);
}
function scripts() {
var _dir = paths.galette.public + '/js/';
main = gulp.src(paths.js.main)
main = gulp.src(paths.scripts.main)
.pipe(concat('galette-main.bundle.min.js'))
.pipe(uglify())
.pipe(gulp.dest(_dir))
.pipe(gulp.dest(paths.assets.js))
.pipe(browserSync.stream());
chartjs = gulp.src(paths.js.chartjs)
chartjs = gulp.src(paths.scripts.chartjs)
.pipe(concat('galette-chartjs.bundle.min.js'))
.pipe(gulp.dest(_dir))
.pipe(gulp.dest(paths.assets.js))
.pipe(browserSync.stream());
sortablejs = gulp.src(paths.js.sortablejs)
sortablejs = gulp.src(paths.scripts.sortablejs)
.pipe(concat('galette-sortablejs.bundle.min.js'))
.pipe(gulp.dest(_dir))
.pipe(gulp.dest(paths.assets.js))
.pipe(browserSync.stream());
return merge(main, chartjs, sortablejs);
......@@ -138,7 +174,7 @@ function scripts() {
function extras() {
main = paths.extras.map(function (extra) {
return gulp.src(extra.src)
.pipe(gulp.dest(paths.galette.public + extra.dest))
.pipe(gulp.dest(paths.assets.public + extra.dest))
.pipe(browserSync.stream());
}
);
......@@ -151,18 +187,20 @@ function watch() {
proxy: localServer.url
})
gulp.watch([paths.src.theme], gulp.series(theme, 'build-css')).on('change', browserSync.reload)
gulp.watch([paths.src.favicon, paths.src.faviconpng, paths.src.logo, paths.src.photo], gulp.series(galette)).on('change', browserSync.reload)
gulp.watch([paths.src.theme, paths.src.config], gulp.series(theme, 'build-css')).on('change', browserSync.reload)
gulp.watch([paths.src.css], gulp.series(styles)).on('change', browserSync.reload)
gulp.watch([paths.src.js], gulp.series(scripts)).on('change', browserSync.reload)
gulp.watch([paths.galette.ui.css, paths.galette.ui.js]).on('change', browserSync.reload)
gulp.watch([paths.assets.theme.css, paths.assets.theme.js, paths.assets.theme.images]).on('change', browserSync.reload)
}
exports.clean = clean;
exports.galette = galette;
exports.theme = theme;
exports.clean = clean;
exports.styles = styles;
exports.scripts = scripts;
exports.extras = extras;
exports.watch = watch;
var build = gulp.series(theme, clean, styles, scripts, extras, 'build ui');
var build = gulp.series(theme, clean, styles, scripts, extras, 'build ui', galette);
exports.default = build;
......@@ -7,7 +7,7 @@
"lib": "lib"
},
"scripts": {
"clean": "rm -rf node_modules && rm -rf semantic && rm -rf galette/vendor && rm -rf galette/webroot/assets",
"clean": "rm -rf node_modules && rm -rf semantic && rm -rf galette/vendor && rm -rf galette/webroot/assets && rm -rf galette/webroot/themes && rm galette/webroot/favicon.ico",
"install-deps": "npm run clean && cd galette && composer install -o && cd .. && npm install",
"build": "gulp",
"rebuild": "npm run install-deps && gulp",
......
......@@ -8,10 +8,10 @@
"themes": "src/themes/"
},
"output": {
"packaged": "../galette/webroot/assets/ui/",
"uncompressed": "../galette/webroot/assets/ui/components/",
"compressed": "../galette/webroot/assets/ui/components/",
"themes": "../galette/webroot/assets/ui/themes/"
"packaged": "../galette/webroot/themes/default/ui/",
"uncompressed": "../galette/webroot/themes/default/ui/components/",
"compressed": "../galette/webroot/themes/default/ui/components/",
"themes": "../galette/webroot/themes/default/ui/themes/"
},
"clean": "dist/"
},
......@@ -20,4 +20,4 @@
"rtl": "both",
"components": ["reset", "site", "button", "container", "divider", "header", "icon", "input", "label", "list", "loader", "segment", "step", "form", "grid", "menu", "message", "table", "card", "item", "accordion", "checkbox", "dimmer", "dropdown", "popup", "sidebar", "tab", "transition", "text", "calendar", "toast", "modal", "api"],
"version": "2.8.8"
}
}
\ No newline at end of file
/*
████████╗██╗ ██╗███████╗███╗ ███╗███████╗███████╗
╚══██╔══╝██║ ██║██╔════╝████╗ ████║██╔════╝██╔════╝
██║ ███████║█████╗ ██╔████╔██║█████╗ ███████╗
██║ ██╔══██║██╔══╝ ██║╚██╔╝██║██╔══╝ ╚════██║
██║ ██║ ██║███████╗██║ ╚═╝ ██║███████╗███████║
╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝
*/
/*******************************
Theme Selection
*******************************/
/* To override a theme for an individual element
specify theme name below
*/
/* Global */
@site : 'galette';
@reset : 'default';
/* Elements */
@button : 'galette';
@container : 'default';
@divider : 'default';
@emoji : 'default';
@flag : 'default';
@header : 'galette';
@icon : 'default';
@image : 'default';
@input : 'default';
@label : 'galette';
@list : 'default';
@loader : 'default';
@placeholder: 'default';
@rail : 'default';
@reveal : 'default';
@segment : 'default';
@step : 'default';
@text : 'default';
/* Collections */
@breadcrumb : 'default';
@form : 'default';
@grid : 'default';
@menu : 'galette';
@message : 'galette';
@table : 'default';
/* Modules */
@accordion : 'galette';
@calendar : 'default';
@checkbox : 'default';
@dimmer : 'default';
@dropdown : 'default';
@embed : 'default';
@modal : 'default';
@nag : 'default';
@popup : 'galette';
@progress : 'default';
@slider : 'default';
@rating : 'default';
@search : 'default';
@shape : 'default';
@sidebar : 'galette';
@sticky : 'default';
@tab : 'default';
@toast : 'default';
@transition : 'default';
/* Views */
@ad : 'default';
@card : 'default';
@comment : 'default';
@feed : 'default';
@item : 'default';
@statistic : 'default';
/*******************************
Folders
*******************************/
/* Path to theme packages */
@themesFolder : 'themes';
/* Path to site override folder */
@siteFolder : 'site';
/*******************************
Import Theme
*******************************/
@import (multiple) "theme.less";
/* End Config */
/*******************************
Galette Overrides
*******************************/
/*--------------
Header
---------------*/
.ui.menu .header.item,
.ui.vertical.menu .header.item {
font-weight: @headerWeight;
text-align: left;
}
& when (@variationMenuFixed) {
/*--------------
Fixed
---------------*/
.ui.fixed.menu .item {
background: rgba(255,255,255,.6);
}
.ui.fixed.menu .item.active {
background: @activeItemBackground;
}
}
& when (@variationMenuVertical) {
/*--------------
Vertical
---------------*/
.ui.vertical.menu {
display: block;
flex-direction: column;
background: @verticalBackground;
box-shadow: @verticalBoxShadow;
}
.ui.vertical.menu {
border: @border;
}
.ui.vertical.menu div.item .ui.button {
width: 100%;
border: @border;
margin: 0 0 .4rem 0;
box-shadow: none;
}
.ui.vertical.menu div.item .item.button::before {
content: none;
}
}
/*******************************
Galette Variable Overrides
*******************************/
/*-------------------
Collection
--------------------*/
/* Menu */
@border: @borderWidth solid @solidBorderColor;
/*--------------
States
---------------*/
/* Hovered Item */
@hoverItemBackground: @primaryColor;
@hoverItemTextColor: darken(@textColor, 15);
/* Pressed Item */
@pressedItemBackground: @primaryColor;
@pressedItemTextColor: @hoverItemTextColor;
/* Active Item */
@activeItemBackground: @lightPrimaryColor;
@activeItemTextColor: darken(@textColor, 15);
@activeItemFontWeight: @bold;
@activeIconOpacity: 1;
@activeItemBoxShadow: none;
/* Active Hovered Item */
@activeHoverItemBackground: @lightPrimaryColor;
@activeHoverItemColor: darken(@textColor, 15);
/*--------------
Types
---------------*/
/* Tabular */
@tabularActiveBackground: @lightPrimaryColor;
/*--------------
Variations
---------------*/
/* Inverted */
@invertedBackground: @textColor;
/* Inverted Hover */
@invertedHoverBackground: @primaryColor;
@invertedHoverColor: darken(@textColor, 15);
/* Inverted Active */
@invertedActiveBackground: @invertedArrowActiveColor;
@invertedActiveColor: darken(@textColor, 15);
@invertedArrowActiveColor: @lightPrimaryColor;
/* Inverted Active Hover */
@invertedActiveHoverBackground: @invertedActiveBackground;
@invertedActiveHoverColor: darken(@textColor, 15);
@invertedArrowActiveHoverColor: @invertedArrowActiveColor;
/*******************************
Galette Overrides
*******************************/
body.nojs .ui.message > .close.icon {
display: none;
}
.ui.message > .password-lost:first-child:last-child,
.column > .ui.message:first-child:last-child {
margin-top: 0;
margin-bottom: 0;
}
.ui.message:first-child:last-child {
margin-top: 1em;
margin-bottom: 1em;
}
/*******************************
Galette Variable Overrides
*******************************/
/*******************************
Galette Overrides
*******************************/
a.ui.button i.icon,
a.ui.button:hover i.icon {
color: inherit;
}
.ui.primary.button,
.ui.primary.buttons .button {
color: darken(@textColor, 15);
}
/*******************************
Galette Variable Overrides
*******************************/
/*******************************
Galette Overrides
*******************************/
h1.ui.block.header {
color: darken(@textColor, 15);
}
.ui.block.brand.header {
background: rgba(255,255,255,.6);
box-shadow: @blockBoxShadow;
border: 0px;
}
/*******************************
Galette Variable Overrides
*******************************/
@blockBackground: @primaryColor url(themes/galette/assets/images/bg.png) no-repeat;
@blockBorder: 0px;
/*******************************
Galette Overrides
*******************************/
.ui.primary.labels .label,
.ui.ui.ui.primary.label {
color: darken(@textColor, 15);
}
/*******************************
Galette Variable Overrides
*******************************/
/*******************************
Galette Overrides
*******************************/
html {
overflow: hidden;
}
.sr-only {
display: none;
}
#back2top {
position: fixed;
right: 0;
bottom: 0;
z-index: 2;
opacity: 0.45;
}
#back2top:hover {
opacity: 1;
}
#top-navbar,
aside.computer.toc {
background: @galetteNavBackground;
}
#top-navbar.ui.menu .item img.logo {
margin-right: 1.5rem;
max-height: 2.5rem;
width: auto;
}
#top-navbar div.item a.button:not(:first-child) {
margin-left: .5rem;
}
.language span {
text-transform: uppercase;
}
body.pushable:not(.loggedin) > .pusher {
display: flex;
justify-content: center;
}
.ui.fixed.menu + .pusher {
padding-top: 4.5rem;
}
.ui.grid > aside.column:not(.row) {
padding-bottom: 2rem;
}
aside.toc {
display: none;
}
aside .ui.vertical.menu {
width: auto;
max-width: 100%;
}
section.content,
.front-page section:not(.content) {
padding: 1.25rem;
}