Merge pull request #1 from rbkmoney/ft/FE-23/infrastructure

FE-23: Project infrastructure
This commit is contained in:
Ildar Galeev 2016-07-18 18:16:00 +03:00 committed by GitHub
commit ec0fd6789e
13 changed files with 204 additions and 1 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.idea/
/node_modules/
/dist/

View File

@ -1,2 +1,2 @@
# koffing
# Koffing
Личный кабинет мерчанта

14
app/components/app/app.js Normal file
View File

@ -0,0 +1,14 @@
var koffing = angular.module('koffing', ['ngComponentRouter', 'dashboard', 'sidebar', 'topPanel', 'templates']);
koffing.config(function ($locationProvider) {
$locationProvider.html5Mode(true);
});
koffing.value('$routerRootComponent', 'app');
koffing.component('app', {
templateUrl: 'components/app/app.html',
$routeConfig: [
{ path: '/dashboard', name: 'Dashboard', component: 'dashboard', useAsDefault: true }
]
});

View File

@ -0,0 +1,9 @@
.container.body
.main_container
sidebar
top-panel
.right_col(style="min-height:800px")
ng-outlet
footer
.pull-right @Copyright
.clearfix

View File

@ -0,0 +1,8 @@
var dashboard = angular.module('dashboard', []);
dashboard.component('dashboard', {
templateUrl: 'components/dashboard/dashboard.html',
controller: function () {
this.testField = 'Test';
}
});

View File

@ -0,0 +1,2 @@
.row
.col-md-12 {{$ctrl.testField}}

View File

@ -0,0 +1,8 @@
var sidebar = angular.module('sidebar', []);
sidebar.component('sidebar', {
templateUrl: 'components/sidebar/sidebar.html',
controller: function () {
}
});

View File

@ -0,0 +1,17 @@
.col-md-3.left_col
.left_col.scroll-view
.navbar.nav_title
a.site_title(href="/")
span RBK Money
.clearfix
#sidebar-menu.main_menu_side.hidden-print.main_menu
.menu_section
ul.nav.side-menu
li.active
a(ng-link="[\'Dashboard\']")
i.fa.fa-home
| Обзор
li
a
i.fa.fa-bar-chart-o
| Финансы

View File

@ -0,0 +1,8 @@
var topPanel = angular.module('topPanel', []);
topPanel.component('topPanel', {
templateUrl: 'components/top-panel/top-panel.html',
controller: function () {
}
});

View File

@ -0,0 +1,8 @@
.top_nav
.nav_menu
nav
ul.nav.navbar-nav.navbar-right
li
a.user-profile.dropdown-toggle(data-toggle="dropdown", aria-expanded="false")
img(src="img.png" alt="")
| Koffing

12
app/index.pug Normal file
View File

@ -0,0 +1,12 @@
doctype html
html(ng-app="koffing" lang="en")
head
meta(charset="utf-8")
base(href="/")
title Private Office
link(href="vendor.min.css" rel="stylesheet")
body.nav-md
app
script(src="vendor.min.js")
script(src="https://use.fontawesome.com/a5c70f40dd.js")
script(src="source.js")

85
gulpfile.js Normal file
View File

@ -0,0 +1,85 @@
const gulp = require('gulp');
const pug = require('gulp-pug');
const sourcemaps = require('gulp-sourcemaps');
const concat = require('gulp-concat');
const connect = require('gulp-connect');
const livereload = require('gulp-livereload');
const templateCache = require('gulp-angular-templatecache');
const addStream = require('add-stream');
const uglify = require('gulp-uglify');
const cleanCSS = require('gulp-clean-css');
function prepareTemplates() {
return gulp.src('app/**/*.pug')
.pipe(pug({
pretty: true
}))
.pipe(templateCache({
standalone: true
}));
}
gulp.task('sources', () => {
return gulp.src([
'app/app/app.js',
'app/**/*.module.js',
'app/**/*.js'
])
.pipe(addStream.obj(prepareTemplates()))
.pipe(sourcemaps.init())
.pipe(concat('source.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist'))
.pipe(livereload());
});
gulp.task('vendorScripts', () => {
return gulp.src([
'node_modules/jquery/dist/jquery.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/gentelella/build/js/custom.js',
'node_modules/angular/angular.js',
'node_modules/@angular/router/angular1/angular_1_router.js'
])
.pipe(uglify())
.pipe(concat('vendor.min.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('vendorStyles', () => {
return gulp.src([
'node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/gentelella/build/css/custom.css'
])
.pipe(cleanCSS())
.pipe(concat('vendor.min.css'))
.pipe(gulp.dest('dist'));
});
gulp.task('index', () => {
return gulp.src('app/index.pug')
.pipe(pug({
pretty: true
}))
.pipe(gulp.dest('dist'))
.pipe(livereload());
});
gulp.task('connect', () => {
connect.server({
root: 'dist',
host: '127.0.0.1',
port: 8000,
fallback: 'dist/index.html',
livereload: true
});
});
gulp.task('watch', () => {
livereload.listen();
gulp.watch(['app/**/*.js', 'app/**/*.pug'], ['sources']);
gulp.watch('app/index.pug', ['index']);
});
gulp.task('build', ['index', 'sources', 'vendorScripts', 'vendorStyles']);
gulp.task('default', ['connect', 'watch', 'build']);

29
package.json Normal file
View File

@ -0,0 +1,29 @@
{
"name": "koffing",
"version": "1.0.0",
"description": "",
"repository": {
"type": "git",
"url": "git+https://github.com/rbkmoney/koffing.git"
},
"author": "rbkmoney",
"devDependencies": {
"add-stream": "^1.0.0",
"gulp": "^3.9.1",
"gulp-angular-templatecache": "^2.0.0",
"gulp-clean-css": "^2.0.11",
"gulp-concat": "^2.6.0",
"gulp-connect": "^4.1.0",
"gulp-livereload": "^3.8.1",
"gulp-pug": "^3.0.3",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.4"
},
"dependencies": {
"@angular/router": "^0.2.0",
"angular": "^1.5.7",
"bootstrap": "^3.3.6",
"gentelella": "^1.3.0",
"jquery": "^2.2.3"
}
}