mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
commit
fc70b7ad8c
8 changed files with 7881 additions and 83 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -16,5 +16,4 @@ ca.crt
|
||||||
# Debug CSS file
|
# Debug CSS file
|
||||||
src/css/style.css
|
src/css/style.css
|
||||||
|
|
||||||
src/bower_components
|
|
||||||
src/dist
|
src/dist
|
||||||
|
|
9
.travis.yml
Normal file
9
.travis.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- "10"
|
||||||
|
before_install:
|
||||||
|
- cd src
|
||||||
|
script:
|
||||||
|
- npm ci
|
||||||
|
- gulp build --dev
|
||||||
|
- gulp lint --dev
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"name": "yunohost-admin",
|
|
||||||
"description": "YunoHost Admin web interface",
|
|
||||||
"license": "AGPL-3.0",
|
|
||||||
"private": true,
|
|
||||||
"dependencies": {
|
|
||||||
"bootstrap": "3.3.6",
|
|
||||||
"fork-awesome": "1.1.7",
|
|
||||||
"handlebars-helper-intl": "1.1.2",
|
|
||||||
"handlebars": "4.0.11",
|
|
||||||
"sammy": "0.7.6",
|
|
||||||
"js-cookie": "2.1.0",
|
|
||||||
"isotope-layout": "3.0.6",
|
|
||||||
"source-sans-pro": "git://github.com/adobe-fonts/source-sans-pro.git#2.020R-ro/1.075R-it",
|
|
||||||
"source-code-pro": "git://github.com/adobe-fonts/source-code-pro.git#2.010R-ro/1.030R-it"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,7 +3,7 @@
|
||||||
/*
|
/*
|
||||||
* Bootstrap
|
* Bootstrap
|
||||||
*/
|
*/
|
||||||
@import "../bower_components/bootstrap/less/bootstrap.less";
|
@import "../node_modules/bootstrap/less/bootstrap.less";
|
||||||
|
|
||||||
// Bootstrap variables override
|
// Bootstrap variables override
|
||||||
@font-family-sans-serif: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
@font-family-sans-serif: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
/*
|
/*
|
||||||
* FontAwesome
|
* FontAwesome
|
||||||
*/
|
*/
|
||||||
@import "../bower_components/fork-awesome/less/fork-awesome.less";
|
@import "../node_modules/fork-awesome/less/fork-awesome.less";
|
||||||
|
|
||||||
|
|
||||||
// Fixes
|
// Fixes
|
||||||
|
|
|
@ -6,6 +6,7 @@ var concat = require('gulp-concat'),
|
||||||
uglify = require('gulp-uglify'),
|
uglify = require('gulp-uglify'),
|
||||||
csslint = require('gulp-csslint'),
|
csslint = require('gulp-csslint'),
|
||||||
jshint = require('gulp-jshint'),
|
jshint = require('gulp-jshint'),
|
||||||
|
mustache = require('gulp-mustache'),
|
||||||
less = require('gulp-less'),
|
less = require('gulp-less'),
|
||||||
autoprefixer = require('gulp-autoprefixer'),
|
autoprefixer = require('gulp-autoprefixer'),
|
||||||
cssmin = require('gulp-cssmin'),
|
cssmin = require('gulp-cssmin'),
|
||||||
|
@ -19,35 +20,18 @@ var concat = require('gulp-concat'),
|
||||||
isDev = (util.env.dev) ? true : false;
|
isDev = (util.env.dev) ? true : false;
|
||||||
isProduction = !isDev;
|
isProduction = !isDev;
|
||||||
|
|
||||||
// Global build task
|
|
||||||
gulp.task('build', [
|
|
||||||
'css',
|
|
||||||
'fonts',
|
|
||||||
'js',
|
|
||||||
'img',
|
|
||||||
]);
|
|
||||||
|
|
||||||
|
|
||||||
// Watch task
|
|
||||||
gulp.task('watch', function(){
|
|
||||||
gulp.watch('js/**/*.js', ['js']);
|
|
||||||
gulp.watch('css/*.less', ['css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// JS task
|
// JS task
|
||||||
gulp.task('js', function() {
|
gulp.task('js', function() {
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
'bower_components/jquery/dist/jquery.js',
|
'node_modules/jquery/dist/jquery.js',
|
||||||
'bower_components/js-cookie/src/js.cookie.js',
|
'node_modules/handlebars/dist/handlebars.js',
|
||||||
'bower_components/handlebars/handlebars.js',
|
'node_modules/handlebars-intl/dist/handlebars-intl-with-locales.js',
|
||||||
'bower_components/handlebars-helper-intl/dist/handlebars-intl-with-locales.js',
|
'node_modules/sammy/lib/sammy.js',
|
||||||
'bower_components/sammy/lib/sammy.js',
|
'node_modules/sammy/lib/plugins/sammy.handlebars.js',
|
||||||
'bower_components/sammy/lib/plugins/sammy.handlebars.js',
|
'node_modules/sammy/lib/plugins/sammy.json.js',
|
||||||
'bower_components/sammy/lib/plugins/sammy.json.js',
|
'node_modules/sammy/lib/plugins/sammy.storage.js',
|
||||||
'bower_components/sammy/lib/plugins/sammy.storage.js',
|
'node_modules/bootstrap/dist/js/bootstrap.js',
|
||||||
'bower_components/bootstrap/dist/js/bootstrap.js',
|
'node_modules/isotope-layout/dist/isotope.pkgd.js',
|
||||||
'bower_components/isotope-layout/dist/isotope.pkgd.js',
|
|
||||||
'js/yunohost/y18n.js',
|
'js/yunohost/y18n.js',
|
||||||
'js/yunohost/main.js',
|
'js/yunohost/main.js',
|
||||||
'js/yunohost/helpers.js',
|
'js/yunohost/helpers.js',
|
||||||
|
@ -63,25 +47,26 @@ gulp.task('js', function() {
|
||||||
|
|
||||||
// JS Lint task
|
// JS Lint task
|
||||||
gulp.task('js-lint', function() {
|
gulp.task('js-lint', function() {
|
||||||
return gulp.src('js/*.js')
|
return gulp.src('js/**/*.js')
|
||||||
.pipe(jshint())
|
.pipe(jshint())
|
||||||
.pipe(jshint.reporter('default'));
|
.pipe(jshint.reporter('default'))
|
||||||
|
.pipe(jshint.reporter('fail'))
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fonts
|
// Fonts
|
||||||
gulp.task('fonts', function() {
|
gulp.task('fonts', function() {
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
'bower_components/fork-awesome/fonts/*',
|
'node_modules/fork-awesome/fonts/*',
|
||||||
'bower_components/source-code-pro/EOT/*.eot',
|
'node_modules/source-code-pro/EOT/*.eot',
|
||||||
'bower_components/source-code-pro/OTF/*.otf',
|
'node_modules/source-code-pro/OTF/*.otf',
|
||||||
'bower_components/source-code-pro/TTF/*.ttf',
|
'node_modules/source-code-pro/TTF/*.ttf',
|
||||||
'bower_components/source-code-pro/WOFF/OTF/*.woff',
|
'node_modules/source-code-pro/WOFF/OTF/*.woff',
|
||||||
'bower_components/source-code-pro/WOFF2/TTF/*.woff2',
|
'node_modules/source-code-pro/WOFF2/TTF/*.woff2',
|
||||||
'bower_components/source-sans-pro/EOT/*.eot',
|
'node_modules/source-sans-pro/EOT/*.eot',
|
||||||
'bower_components/source-sans-pro/OTF/*.otf',
|
'node_modules/source-sans-pro/OTF/*.otf',
|
||||||
'bower_components/source-sans-pro/TTF/*.ttf',
|
'node_modules/source-sans-pro/TTF/*.ttf',
|
||||||
'bower_components/source-sans-pro/WOFF/OTF/*.woff',
|
'node_modules/source-sans-pro/WOFF/OTF/*.woff',
|
||||||
'bower_components/source-sans-pro/WOFF2/TTF/*.woff2',
|
'node_modules/source-sans-pro/WOFF2/TTF/*.woff2',
|
||||||
])
|
])
|
||||||
.pipe(gulp.dest('./dist/fonts'))
|
.pipe(gulp.dest('./dist/fonts'))
|
||||||
});
|
});
|
||||||
|
@ -105,8 +90,7 @@ gulp.task('css-lint', function() {
|
||||||
.pipe(less())
|
.pipe(less())
|
||||||
.pipe(autoprefixer())
|
.pipe(autoprefixer())
|
||||||
.pipe(csslint())
|
.pipe(csslint())
|
||||||
.pipe(csslint.reporter('compact'))
|
.pipe(csslint.formatter())
|
||||||
.pipe(gulp.dest('./css/'))
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,3 +100,23 @@ gulp.task('img', function () {
|
||||||
.pipe(gulpif(isProduction, imagemin()))
|
.pipe(gulpif(isProduction, imagemin()))
|
||||||
.pipe(gulp.dest('./dist/img'))
|
.pipe(gulp.dest('./dist/img'))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Views task
|
||||||
|
gulp.task('views', function () {
|
||||||
|
return gulp.src('views/**/*.ms')
|
||||||
|
.pipe(gulp.dest("./dist/views"));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Global build task
|
||||||
|
gulp.task('build', gulp.series('css', 'fonts', 'js', 'img', 'views'));
|
||||||
|
|
||||||
|
// Watch task
|
||||||
|
gulp.task('watch', function() {
|
||||||
|
gulp.watch('js/**/*.js', gulp.series('js'));
|
||||||
|
gulp.watch('css/*.less', gulp.series('css'));
|
||||||
|
gulp.watch('views/**/*.ms', gulp.series('views'));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('lint', gulp.series('css-lint', 'js-lint'));
|
||||||
|
|
||||||
|
gulp.task('default', gulp.series('build', 'watch'));
|
|
@ -118,13 +118,13 @@
|
||||||
$.ajax({
|
$.ajax({
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
url: 'https://'+ baseUrl +'/installed',
|
url: 'https://'+ baseUrl +'/installed',
|
||||||
timeout: 3000
|
timeout: 3000,
|
||||||
})
|
success: function(data) {
|
||||||
.success(function(data) {
|
|
||||||
callback(data.installed);
|
callback(data.installed);
|
||||||
})
|
},
|
||||||
.fail(function() {
|
fail: function() {
|
||||||
callback(undefined);
|
callback(undefined);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@
|
||||||
$('#modal').modal('hide');
|
$('#modal').modal('hide');
|
||||||
|
|
||||||
// Render content
|
// Render content
|
||||||
var rendered = this.render('views/'+ view +'.ms', data);
|
var rendered = this.render('dist/views/'+ view +'.ms', data);
|
||||||
|
|
||||||
// Update content helper
|
// Update content helper
|
||||||
var leSwap = function() {
|
var leSwap = function() {
|
||||||
|
|
7792
src/package-lock.json
generated
Normal file
7792
src/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -6,7 +6,6 @@
|
||||||
"url": "https://github.com/YunoHost/yunohost-admin"
|
"url": "https://github.com/YunoHost/yunohost-admin"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "bower install",
|
|
||||||
"build": "gulp build",
|
"build": "gulp build",
|
||||||
"build-dev": "gulp build --dev",
|
"build-dev": "gulp build --dev",
|
||||||
"watch": "gulp watch",
|
"watch": "gulp watch",
|
||||||
|
@ -19,18 +18,30 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/YunoHost/yunohost-admin",
|
"homepage": "https://github.com/YunoHost/yunohost-admin",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"bower": "^1.7.7",
|
"gulp": "^4.0.2",
|
||||||
"gulp": "^3.9.0",
|
"gulp-autoprefixer": "^7.0.1",
|
||||||
"gulp-autoprefixer": "^2.3.1",
|
"gulp-concat": "^2.6.1",
|
||||||
"gulp-concat": "^2.6.0",
|
"gulp-csslint": "^1.0.1",
|
||||||
"gulp-csslint": "^0.2.0",
|
"gulp-cssmin": "^0.2.0",
|
||||||
"gulp-cssmin": "^0.1.7",
|
"gulp-if": "^3.0.0",
|
||||||
"gulp-if": "^2.0.0",
|
"gulp-imagemin": "^7.1.0",
|
||||||
"gulp-imagemin": "^2.3.0",
|
"gulp-jshint": "^2.1.0",
|
||||||
"gulp-jshint": "^1.11.2",
|
"jshint": "^2.11.1",
|
||||||
"gulp-less": "^3.0.3",
|
"gulp-less": "^4.0.1",
|
||||||
"gulp-rename": "^1.2.2",
|
"gulp-rename": "^2.0.0",
|
||||||
"gulp-uglify": "^1.2.0",
|
"gulp-uglify": "^3.0.2",
|
||||||
"gulp-util": "^3.0.7"
|
"gulp-mustache": "^5.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"bootstrap": "^3.3.7",
|
||||||
|
"fork-awesome": "^1.1.7",
|
||||||
|
"handlebars": "^4.7.6",
|
||||||
|
"handlebars-intl": "1.1.2",
|
||||||
|
"isotope-layout": "^3.0.6",
|
||||||
|
"jquery": "^3.5.1",
|
||||||
|
"js-cookie": "^2.2.1",
|
||||||
|
"sammy": "^0.7.6",
|
||||||
|
"source-code-pro": "^2.30.2",
|
||||||
|
"source-sans-pro": "^3.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue