diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..abf43f4c5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +sudo: false + +language: node_js + +node_js: + - "4" + +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 + +install: + - npm config set spin false + - npm install -g npm@3 + - npm install -g gulp + - npm install -g bower + + - npm install + +script: + - gulp build diff --git a/CHANGELOG.md b/CHANGELOG.md index aad431b12..47ae97c8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +v1.2.0 - 16 May 2016 +-------------------- +- Refactoring to improve customization, fixes #22, #26 +- Add documentation +- Sidebar refactoring, fixes #14, #15, #27 +- Bootstrap select refactoring #18 + v1.1.1 - 11 Apr 2016 -------------------- - Improved scrolling performance, fixes #2 diff --git a/README.md b/README.md index acf96bd72..26f6f73e7 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,31 @@ -# Blur Admin HTML template +[![Build Status](https://travis-ci.org/akveo/blur-admin.svg?branch=master)](https://travis-ci.org/akveo/blur-admin) -Admin template made with ♥ by [Akveo team](http://akveo.com/). +# BlurAdmin Angular admin panel front-end framework -We put a lot of efforts to bring together latest and the most trending web design approaches, while creating this template. -Every color, character or image was carefully selected by our team to provide the best experience possible. -We're very proud of it and like it very much. We also hope that you will enjoy it as well. +Customizable admin panel framework made with :heart: by [Akveo team](http://akveo.com/). Follow us on [Twitter](https://twitter.com/akveo_inc) to get latest news about this template first! -It's just a first version, but we will continue development of this template to create not just another bootstrap customization, but the whole HTML framework that can be applied in a lot of places. +### Demo +**[Mint version demo](http://akveo.com/blur-admin-mint/)** | **[Blur version demo](http://akveo.com/blur-admin/)** +:-------------------------:|:-------------------------: +![Mint version demo](http://i.imgur.com/A3TMviJ.png) | ![Blur version demo](http://i.imgur.com/EAoiK2O.jpg) -## Theme Demo -![alt tag](http://i.imgur.com/yOZPlps.jpg) -**[Template Demo](http://akveo.com/blur-admin/#/dashboard)** +## Angular 2 version +Here you can find Angular2 based version: [ng2-admin](https://github.com/akveo/ng2-admin). -## Installation +### Documentation +Installation, customization and other useful articles: https://akveo.github.io/blur-admin/ + +*If you have problems installing and just want to download JS and css files, you can find download links here*: http://akveo.github.io/blur-admin/articles/091-downloads/ + +## How can I support developers? +- Star our GitHub repo +- Create pull requests, submit bugs, suggest new features or documentation updates +- Follow us on [Twitter](https://twitter.com/akveo_inc) +- Like our page on [Facebook](https://www.facebook.com/akveo/) + +## Can I hire you guys? +Yes! We are available for hire. Visit [our homepage](http://akveo.com/) or simply leave us a note to contact@akveo.com. We will be happy to work with you! -To build the template from scratch you will be required to have following tools -* Download and install nodejs [https://nodejs.org](https://nodejs.org) -* Open the console inside of extracted folder and run `npm install` to fetch all dependencies -* Run `gulp` to build sources -* Go to `release\` folder in check out your freshly made compiled files -* Run `gulp serve` and enjoy the beauty! - ## Features * Responsive layout * High resolution @@ -29,7 +34,6 @@ To build the template from scratch you will be required to have following tools * Gulp build * AngularJS * Jquery -* Jquery ui * Charts (amChart, Chartist, Chart.js, Morris) * Maps (Google, Leaflet, amMap) * etc @@ -41,5 +45,4 @@ License ### From akveo Enjoy! - -Made with ♥ by [Akveo team](http://akveo.com/). +We're always happy to hear your feedback. diff --git a/bower.json b/bower.json index 08ff65615..368b7af24 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "blur-admin", - "version": "1.1.1", + "version": "1.2.0", "homepage": "https://github.com/1itvinka/blur-admin", "authors": [ "akveo" @@ -43,18 +43,21 @@ "moment": "~2.10.6", "slimScroll": "jquery-slimscroll#~1.3.6", "angular-progress-button-styles": "~0.1.0", - "angular-ui-router": "~0.2.15", + "angular-ui-router": "~0.2.16", "angular-chart.js": "~0.8.8", "angular-chartist.js": "~3.3.12", "chartist": "0.9.5", "angular-morris-chart": "~1.1.0", "ionrangeslider": "~2.1.2", - "angular-bootstrap": "~0.14.3", + "angular-bootstrap": "~1.3.3", "angular-animate": "~1.4.8", "textAngular": "~1.4.6", "angular-xeditable": "~0.1.9", "ng-js-tree": "~0.0.7" }, + "resolutions": { + "angular": "~1.4.8" + }, "overrides": { "amcharts": { "main": [ @@ -78,7 +81,8 @@ "bootstrap": { "main": [ "dist/css/bootstrap.css", - "js/dropdown.js" + "js/dropdown.js", + "./dist/fonts/**.*" ] }, "slimScroll": { diff --git a/docs/config.json b/docs/config.json new file mode 100644 index 000000000..8e9e1b679 --- /dev/null +++ b/docs/config.json @@ -0,0 +1,33 @@ +{ + "baseUrl": "/blur-admin/", + "locals": { + "url": "http://localhost:8080", + "name": "The Wintersmith's blog", + "owner": "Someone", + "description": "Ramblings of an immor(t)al demigod" + }, + "plugins": [ + "./plugins/paginator.coffee" + ], + "require": { + "moment": "moment", + "_": "underscore", + "typogr": "typogr" + }, + "jade": { + "pretty": true + }, + "markdown": { + "smartLists": true, + "smartypants": true + }, + "paginator": { + "perPage": 3, + "groupSort": { + "Quick Start": 1000, + "Customization": 900, + "Components": 800, + "Other": 100 + } + } +} diff --git a/docs/contents/articles/001-getting-started/index.md b/docs/contents/articles/001-getting-started/index.md new file mode 100644 index 000000000..f0a1fcaaf --- /dev/null +++ b/docs/contents/articles/001-getting-started/index.md @@ -0,0 +1,43 @@ +--- +title: Getting Started +author: vl +sort: 999 +group: Quick Start +template: article.jade +--- + +## What is BlurAdmin? + +Blur admin is Angular front-end Admin Dashboard template. That means all data you can see on graphs, charts tables is hardcoded in Javascript. You can use any backend you want with it without limitations. + +## How can it help me? + +We believe that that at the moment a lot of business applications have some kind of admin interface inside of them. Sometimes it's not that obvious, but a lot of web applications have dashboard with panels, charts analytics. + +BlurAdmin aims to bootstrap development of your product and provide ecosystem for building a prototype or even production-ready application. + +Despite frameworks like Bootstrap provide a number of components, usually it's not enough of them to build real-world app. This template comes with lots of popular UI components with unified color scheme. + +As well you can use BlurAdmin for learning purposes. + +## List of features + +* Responsive layout +* High resolution +* Bootstrap CSS Framework +* Sass +* Gulp build +* AngularJS +* Jquery +* Jquery ui +* Charts (amChart, Chartist, Chart.js, Morris) +* Maps (Google, Leaflet, amMap) +* etc + +## I want to start developing with BlurAdmin + +Welcome abroad! + +You can start with [Installation Guidelines](/blur-admin/articles/002-installation-guidelines/). We describe there how can you download and run template on you local machine. + +Good luck and have fun! \ No newline at end of file diff --git a/docs/contents/articles/002-installation-guidelines/index.md b/docs/contents/articles/002-installation-guidelines/index.md new file mode 100644 index 000000000..e1358ae85 --- /dev/null +++ b/docs/contents/articles/002-installation-guidelines/index.md @@ -0,0 +1,46 @@ +--- +title: Installation Guidelines +author: vl +sort: 500 +group: Quick Start +template: article.jade +--- + +## Prerequisites + +Despite BlurAdmin can be run without any development experience, it would be much easier if you already know something about it. In general following instruction do allow to run local copy by complete newbie, but it doesn't answer questions that can arise in the process of installation. + +## Install tools + +If you don't havee any of these tools installed already, you will need to: +* Download and install [git](https://git-scm.com/) +* Download and install nodejs [https://nodejs.org](https://nodejs.org) + +**Note**: It seems like there are some problems with some libraries used in this template and old node versions. That's why we suggest you to have one of the latest. + +## Clone repository and install dependencies + +You will need to clone source code of BlurAdmin GitHub repository. To do this open console and execute following lines: +```bash +git clone https://github.com/akveo/blur-admin.git +``` +After repository is cloned, go inside of repository directory and install dependencies there: +```bash +cd blur-admin +npm install +``` +This will setup a working copy of BlurAdmin on your local machine + +## Running local copy + +To run local copy in development mode, execute: +```bash +gulp serve +``` +This script should automatically open template in your default browser. + +To run local copy in production mode, execute: +```bash +gulp serve:dist +``` +For addition information about build, please check out [this angular generator](https://github.com/Swiip/generator-gulp-angular) diff --git a/docs/contents/articles/011-changing-color-scheme/index.md b/docs/contents/articles/011-changing-color-scheme/index.md new file mode 100644 index 000000000..1ffa41410 --- /dev/null +++ b/docs/contents/articles/011-changing-color-scheme/index.md @@ -0,0 +1,60 @@ +--- +title: Changing Color Scheme +author: vl +sort: 900 +group: Customization +template: article.jade +--- + +We tried to make the process of changing color scheme in BlurAdmin as easy as possible. + +By default BlurAdmin has two color profiles: mint and blur. +This article will help you to create your own color profile. +Let's say you want to make BlurAdmin dark. + +First we advice you to take some colorscheme file as a basis. +For light themes we suggest you to take `src/sass/theme/conf/colorScheme/_mint.scss` one and for dark take `src/sass/theme/conf/colorScheme/_blur.scss` one. +As we want dark theme, we're taking `blur`. + +1) Copy `src/sass/theme/conf/colorScheme/_blur.scss` to `src/sass/theme/conf/colorScheme/_dark.scss`. + +2) Include your colorscheme file in `src/sass/theme/common.scs`. + +To do this, replace +```scss +@import 'theme/conf/colorScheme/mint'; +``` + +to + +```scss +@import 'theme/conf/colorScheme/dark'; +``` + +Now you can start changing your colors. +For example, after playing a bit with different colors, we changed 5 first main variables in `_dark.scss` file: +```sass +$default: rgba(#000000, 0.2); //Panel background color +$body-bg: #F0F3F4; // Body background color +$default-text: #ffffff; // Default text color +$help-text: #eeeeee; // Default subtext color +$label-text: #ffffff; // Text for labels in forms (Basically it should be equal to default-text in most cases) +``` + +After this is done, you need to setup javascript to use **same colors** while building charts and other javascript components. +To do this, add following code to some configuration block, for example to `src/app/theme/theme.config.js`: +```javascript + baConfigProvider.changeColors({ + default: '#4e4e55', + defaultText: '#e2e2e2', + }); +``` + +That's basically it! Right now your admin application should look like this: + +![](new-color-scheme.jpg) + +For further reference, please look in +- Colorscheme scss file (`src/sass/theme/conf/colorScheme/_mint.scss` or `src/sass/theme/conf/colorScheme/_blur.scss`) +- `src/app/theme/theme.configProvider.js` to understand which javascript colors can be changed +- If you want to know how to change theme to blur, read [following article](/blur-admin/articles/014-switch-to-blur-theme/) \ No newline at end of file diff --git a/docs/contents/articles/011-changing-color-scheme/new-color-scheme.jpg b/docs/contents/articles/011-changing-color-scheme/new-color-scheme.jpg new file mode 100644 index 000000000..72d8dc7b9 Binary files /dev/null and b/docs/contents/articles/011-changing-color-scheme/new-color-scheme.jpg differ diff --git a/docs/contents/articles/012-project-structure/index.md b/docs/contents/articles/012-project-structure/index.md new file mode 100644 index 000000000..907761173 --- /dev/null +++ b/docs/contents/articles/012-project-structure/index.md @@ -0,0 +1,33 @@ +--- +title: Project Structure +author: vl +sort: 800 +group: Customization +template: article.jade +--- + +Project structure was originally based on [this angular generator](https://github.com/Swiip/generator-gulp-angular). We made some changes we thought would be better for our particular problem. + +The directory structure of this template is as follows: +``` +├── bower.json <- front-end library dependencies +├── gulpfile.js <- main task runner file +├── package.json <- mostly task runner dependencies +├── docs/ <- wintersmith documentation generator +├── gulp/ <- build tasks +├── src/ <- main front-end assets +│   ├── 404.html +│   ├── auth.html +│   ├── index.html <- main app dashboard page +│   ├── reg.html +│   ├── app/ <- angular application files +│   │   ├── app.js <- angular application entry point. Used for managing dependencies +│   │   ├── pages/ <- UI router pages. Pages created for demonstration purposes. Put your application js and html files here +│   │   ├── theme/ <- theme components. Contains various common widgets, panels which used across application +│   ├── assets/ <- static files (images, fonts etc.) +│   ├── sass/ <- sass styles +│   │   ├── app/ <- application styles. Used mostly for demonstration purposes. Put your app styles here. +│   │   ├── theme/ <- theme styles. Used to customize bootstrap and other common components used in tempate. +``` + +In our template we tried to separate theme layer and presentation layer. We believe most of other templates have them combined. That's why when you start developing using them, it gets very hard for you to remove things you don't need. Though we understand that our structure is not ideal, but we're aiming to make it as good as possible. diff --git a/docs/contents/articles/013-create-new-page/index.md b/docs/contents/articles/013-create-new-page/index.md new file mode 100644 index 000000000..104d016e1 --- /dev/null +++ b/docs/contents/articles/013-create-new-page/index.md @@ -0,0 +1,68 @@ +--- +title: Create New Page +author: vl +sort: 300 +group: Customization +template: article.jade +--- + +Blur admin uses [Angular UI router](https://github.com/angular-ui/ui-router) for navigation. +That means to create new page you need to basically configure `ui-router` state. + +We strongly recommend to follow pages structure in your application. +If it doesn't fit your needs please create a GitHub issue and tell us why. We would be glad to discuss. + +Also we recommend to put pages to separate modules. +This will allow you to easily switch off some pages in the future if needed. + +## Page creation example + +0) Let's assume we want to create a blank page with title 'My New Page' + +1) Let's Create a new directory to contain our new page inside of `src/app/pages`. Let's call this directory `myNewPage`. + +2) Then let's create blank angular module to contain our page called 'myNewPage.module.js' inside of `src/app/pages/myNewPage`: + +```javascript +(function () { + 'use strict'; + + angular.module('BlurAdmin.pages.myNewPage', []) + .config(routeConfig); + + /** @ngInject */ + function routeConfig() { + + } + +})(); +``` + +3) Then let's create empty html file called `my-new-page.html` inside of `src/app/pages/myNewPage`. + +4) Lastly let's create ui router state for this page. To do this we need to modify module.js file we created on step 2: +```javascript +(function () { + 'use strict'; + + angular.module('BlurAdmin.pages.myNewPage', []) + .config(routeConfig); + + /** @ngInject */ + function routeConfig($stateProvider) { + $stateProvider + .state('myNewPage', { + url: '/myNewPage', + templateUrl: 'app/pages/myNewPage/my-new-page.html', + title: 'My New Page', + sidebarMeta: { + order: 800, + }, + }); + } + +})(); +``` + +That's it! Your can now open your new page either from sidebar or through hash URL. + diff --git a/docs/contents/articles/014-switch-to-blur-theme/index.md b/docs/contents/articles/014-switch-to-blur-theme/index.md new file mode 100644 index 000000000..aa7fbcd65 --- /dev/null +++ b/docs/contents/articles/014-switch-to-blur-theme/index.md @@ -0,0 +1,54 @@ +--- +title: Enabling blur theme +author: kd +sort: 850 +group: Customization +template: article.jade +--- + +If you want to switch theme to the blur, you need to follow 3 simple steps: + +1) Blur theme needs some javascript to calculate initial background offsets for panels. +That's why first thing you need to do is enable that code. +This should be done in Angular **configuration block**. +For example you can add following lines to `src/app/theme/theme.config.js`: +```javascript + baConfigProvider.changeTheme({blur: true}); +``` + +2) As well you need to change some colors. +For example *Mint*'s default gray text color doesn't look good on blurred panels. +For our blur theme we use following configuration: +```javascript + baConfigProvider.changeColors({ + default: 'rgba(#000000, 0.2)', + defaultText: '#ffffff', + dashboard: { + white: '#ffffff', + }, + }); +``` +3) CSS should also be recompiled. +Before running build command, we suggest you to switch to *blur* color profile. +To do this replace theme in file `src/sass/theme/common.scss`: + + +```scss +@import 'theme/conf/colorScheme/mint'; +``` + +to + +```scss +@import 'theme/conf/colorScheme/blur'; +``` + +3.1) If you would like to use some different background, replace following images: + +- `src/app/assets/img/blur-bg.jpg` (main background image) +- `src/app/assets/img/blur-bg-blurred.jpg` (blurred background image used on panels) + +We suggest using 10px Gaussian blur to blur original image. + +_________________________________________ +That's it! You have successfully blurred your theme! Run `gulp serve` and check it out. \ No newline at end of file diff --git a/docs/contents/articles/051-sidebar/index.md b/docs/contents/articles/051-sidebar/index.md new file mode 100644 index 000000000..5a82b32b7 --- /dev/null +++ b/docs/contents/articles/051-sidebar/index.md @@ -0,0 +1,132 @@ +--- +title: Sidebar +author: vl +sort: 900 +group: Components +template: article.jade +--- + +Sidebar is used to provide convenient way of navigation in the application. +Application support only one sidebar per angular application. +That means sidebar is basically a singletone object. +Currently sidebar supports level 1 and 2 sub menus. + +Sidebar can be created using `baSidebar` directive: +```html + +``` + +For now it support only javascript configuration. Though it can be configured manually or via `ui-router` states. +This methods can be used either together or one at a time. + + +## Manual configuration + +For manual configuration you need to use `baSidebarServiceProvider` provider in angular [configuration block](https://docs.angularjs.org/guide/module#configuration-blocks). +The provider has `addStaticItem` method, which receives menuItem object as an argument, which can have following properties: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
propertytypemeaning
titleStringName of the menu item
iconStringIcon (it's a class name) to be displayed near title
stateRefString`ui-router` state associated with this menu item
fixedHrefStringUrl associated with this menu item
blankStringSpecifies if following Url should be opened in new browser tab
subMenuArray of menu itemsList of menu items to be displayed as next level submenu
+ +Sample manual configuration: +```javascript + baSidebarServiceProvider.addStaticItem({ + title: 'Menu Level 1', + icon: 'ion-ios-more' + }); +``` + +## Route configuration + +By default sidebar iterates through all **ui-router** states you defined in your application and searches for `sidebarMeta` object in them. +For each state, which has this property, sidebar element is created. + +States are being grouped hierarchically. +That means if there's a parent abstract state for some state and they both have `sidebarMeta` property, it will be displayed as a sub item of that abstract state's menu item. + +Name of the item is taken from `state`'s `title` property. Sample state configuration, which will add an item to sidebar: +```javascript +$stateProvider + .state('dashboard', { + url: '/dashboard', + templateUrl: 'app/pages/dashboard/dashboard.html', + title: 'Dashboard', + sidebarMeta: { + icon: 'ion-android-home', + order: 0, + }, + }); +``` + +`sidebarMeta` object can have following properties: + + + + + + + + + + + + + + + + + + + + + + + + +
propertytypemeaning
iconStringIcon (it's a class name) to be displayed near title
orderNumberElement's order in current hierarchy
\ No newline at end of file diff --git a/docs/contents/articles/091-downloads/index.md b/docs/contents/articles/091-downloads/index.md new file mode 100644 index 000000000..cebe57734 --- /dev/null +++ b/docs/contents/articles/091-downloads/index.md @@ -0,0 +1,37 @@ +--- +title: Downloads +author: vl +sort: 900 +group: Other +template: article.jade +--- + +If you have problems installing node.js and/or other tools to build and run BlurAdmin on your machine and you just want to download html/js/css files, you can find links for download on this page. + +Development (non-compressed) files can be found in `{ARCHIVE_ROOT}/blur-admin-{VERSION}/dev-release` directory. Compressed files are in `{ARCHIVE_ROOT}/blur-admin-{VERSION}/release` directory. +Then you can just open `index.html` to view your local version. + +**Please note**: *As chrome doesn't support AJAX requests, when you open HTML file via **file** protocol, you might need to disable web security to have your template running.* + +Sample command on OS X: + +```bash +open -a Google\ Chrome --args --disable-web-security --user-data-dir=~/ChromeDevSession/ +``` + +Sample command on Linux: + +```bash +google-chrome --user-data-dir="~/chrome-dev-session" --disable-web-security +``` + +Sample command on Windows: + +```bash +start chrome --user-data-dir="C:/Chrome dev session" --disable-web-security +``` + +## Links for downloads + +[BlurAdmin 1.2.0](/blur-admin/downloads/blur-admin-1.2.0.zip) + diff --git a/docs/contents/css/main.css b/docs/contents/css/main.css new file mode 100644 index 000000000..ba16c4fe3 --- /dev/null +++ b/docs/contents/css/main.css @@ -0,0 +1,960 @@ +html { + font-family: 'Source Sans Pro', sans-serif; + color: #484848; + line-height: 1.28 +} + +p { + margin: 0 0 10px +} + +.subHeader { + font-size: 21px; + font-weight: 200; + line-height: 30px; + margin-bottom: 10px +} + +em { + font-style: italic +} + +h1, h2, h3, h4, h5, h6 { + margin: 10px 0; + font-family: inherit; + font-weight: bold; + line-height: 20px; + color: inherit; + text-rendering: optimizelegibility +} + +h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { + font-weight: normal; + color: #7b7b7b +} + +h1, h2, h3 { + line-height: 40px +} + +h1 { + font-size: 39px +} + +h2 { + font-size: 31px +} + +h3 { + font-size: 23px +} + +h4 { + font-size: 16px +} + +h5 { + font-size: 14px +} + +h6 { + font-size: 11px +} + +h1 small { + font-size: 24px +} + +h2 small { + font-size: 18px +} + +h3 small { + font-size: 16px +} + +h4 small { + font-size: 14px +} + +ul, ol { + margin: 0 0 10px 25px; + padding: 0 +} + +ul ul, ul ol, ol ol, ol ul { + margin-bottom: 0 +} + +li { + line-height: 20px +} + +a { + color: #c05b4d; + text-decoration: none +} + +a:hover, a:focus { + color: #a5473a; + text-decoration: underline +} + +a:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px +} + +.center { + text-align: center +} + +html * { + color-profile: sRGB; + rendering-intent: auto +} + +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: none; + margin: 0; + padding: 0 +} + +html { + background: #f9f9f9 +} + +.left { + float: left +} + +.right { + float: right +} + +.container { + padding-top: 50px; + min-width: 960px +} + +.wrap { + width: 960px; + margin-left: auto; + margin-right: auto; + padding-left: 20px; + padding-right: 20px +} + +.skinnyWrap { + width: 690px; + margin-left: auto; + margin-right: auto; + padding-left: 20px; + padding-right: 20px +} + +hr { + height: 0; + border-top: 1px solid #ccc; + border-bottom: 1px solid #eee +} + +ul, li { + margin-left: 20px +} + +li + li { + margin-top: 10px +} + +h1 .anchor, h2 .anchor, h3 .anchor, h4 .anchor, h5 .anchor, h6 .anchor { + margin-top: -50px; + position: absolute +} + +h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-link, h5:hover .hash-link, h6:hover .hash-link { + display: inline +} + +.hash-link { + color: #aaa; + display: none +} + +.nav-main { + background: #222; + color: #fafafa; + position: fixed; + top: 0; + height: 50px; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); + width: 100%; + z-index: 100 +} + +.nav-main:after { + content: ""; + display: table; + clear: both +} + +.nav-main a { + color: #e9e9e9; + text-decoration: none +} + +.nav-main .nav-site-internal { + margin: 0 0 0 20px +} + +.nav-main .nav-site-external { + float: right; + margin: 0 +} + +.nav-main .nav-site li { + margin: 0 +} + +.nav-main .nav-site li > a { + box-sizing: content-box; + padding: 0 10px; + line-height: 50px; + display: inline-block; + height: 50px; + color: #ddd +} + +.nav-main .nav-site li > a:hover { + color: #fff +} + +.nav-main .nav-site li > a.active { + color: #fafafa; + border-bottom: 3px solid #cc7a6f; + background: #333 +} + +.nav-main .nav-home { + color: #ffffff; + font-size: 24px; + line-height: 50px; + height: 50px; + display: inline-block +} + +.nav-main .nav-home .blur-label { + color: #209e91; +} + +.nav-main .nav-logo { + vertical-align: middle; + display: inline-block +} + +.nav-main ul { + display: inline-block; + vertical-align: top +} + +.nav-main li { + display: inline +} + +.hero { + padding-bottom: 75px; +} + +.hero .hero-content { + color: #e9e9e9; + font-weight: 300; + background: #313131; + padding-top: 50px; +} + +.hero .text { + font-size: 64px; + text-align: center +} + +.hero .minitext { + font-size: 16px; + text-align: center; + text-transform: uppercase +} + +.hero strong { + color: #209e91; + font-weight: 400 +} + +.white-text { + color: rgb(249, 249, 249); +} + +.hero .admin-screenshots { + margin-top: 40px; + display: flex; + flex-direction: row; +} + +.hero .admin-screenshot { + width: 50%; + padding: 0 15px; + text-align: center; + height: 250px; +} + +.admin-screenshot img { + width: 100%; +} + +.demo-link { + display: block; + position: relative; + line-height: 0; +} + +.demo-link:before { + content: ''; + position: absolute; + width: 100%; + bottom: 0; + left: 0; + height: 52px; + background-image: linear-gradient(to bottom, transparent, rgb(249,259,249)); +} + +.demo-link .demo-link-label { + display: flex; + align-items: center; + justify-content: center; + content: 'Demo'; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.5); + color: rgb(249, 249, 249); + font-size: 32px; + opacity: 0; + transition: opacity 0.3s ease-out; +} + +.demo-link:hover .demo-link-label { + opacity: 1; +} + +.buttons-unit { + margin-top: 60px; + text-align: center +} + +.buttons-unit a { + color: #61dafb +} + +.buttons-unit .button { + font-size: 24px; + background: #cc7a6f; + color: #fafafa +} + +.buttons-unit .button:active { + background: #c5695c +} + +.buttons-unit.downloads { + margin: 30px 0 +} + +.index-block { + padding:40px 0; +} + +.index-block h1 { + text-align: center; +} + +.index-block.black { + background: #f2f2f2; +} + +.why-items { + display: flex; + flex-direction: row; + align-items: baseline; + margin-top: 15px; + padding-top: 15px; +} + +.why-item { + flex: 33%; + text-align: center; + padding: 0 15px; +} + +.why-item img { + width: 110px; +} + +.nav-docs { + color: #2d2d2d; + font-size: 14px; + float: left; + width: 210px +} + +.nav-docs ul { + list-style: none; + margin: 0 +} + +.nav-docs ul ul { + margin: 6px 0 0 20px +} + +.nav-docs li { + line-height: 16px; + margin: 0 0 6px +} + +.nav-docs h3 { + text-transform: uppercase; + font-size: 14px +} + +.nav-docs a { + color: #666; + display: block +} + +.nav-docs a:hover { + text-decoration: none; + color: #cc7a6f +} + +.nav-docs a.active { + color: #cc7a6f +} + +.nav-docs a.external:after { + content: ""; + display: inline-block; + width: 10px; + height: 10px; + padding-left: 5px; + background-image: url("../img/external.png"); + background-position: 100% 0; + background-repeat: no-repeat; + font-size: 10px; + line-height: 1em; + opacity: 0.5 +} + +@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3 / 1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) { + .nav-docs a.external:after { + background-image: url("../img/external_2x.png"); + background-size: 10px 10px + } +} + +.nav-docs .nav-docs-section { + border-bottom: 1px solid #ccc; + border-top: 1px solid #eee; + padding: 12px 0 +} + +.nav-docs .nav-docs-section:first-child { + padding-top: 0; + border-top: 0 +} + +.nav-docs .nav-docs-section:last-child { + padding-bottom: 0; + border-bottom: 0 +} + +.nav-blog li { + margin-bottom: 5px +} + +.nav-docs-right { + display: block; + float: right; + line-height: 50px; +} + +.nav-docs-right a { + color: #c05b4d; + text-decoration: none; +} + +.nav-docs-right a:hover { + text-decoration: underline; +} + +.home-section { + margin: 50px 0 +} + +.home-divider { + border-top-color: #bbb; + margin: 0 auto; + width: 400px +} + +.skinny-row:after { + content: ""; + display: table; + clear: both +} + +.skinny-col { + float: left; + margin-left: 40px; + width: 305px +} + +.skinny-col:first-child { + margin-left: 0 +} + +.marketing-row { + margin: 50px 0 +} + +.marketing-row:after { + content: ""; + display: table; + clear: both +} + +.marketing-col { + float: left; + margin-left: 40px; + width: 280px +} + +.marketing-col h3 { + color: #2d2d2d; + font-size: 24px; + font-weight: normal; + text-transform: uppercase +} + +.marketing-col p { + font-size: 16px +} + +.marketing-col:first-child { + margin-left: 0 +} + +#examples h3, .home-presentation h3 { + color: #2d2d2d; + font-size: 24px; + font-weight: normal; + margin-bottom: 5px +} + +#examples p { + margin: 0 0 25px 0; + max-width: 600px +} + +#examples .example { + margin-top: 60px +} + +#examples #todoExample { + font-size: 14px +} + +#examples #todoExample ul { + list-style-type: square; + margin: 0 0 10px 0 +} + +#examples #todoExample input { + border: 1px solid #ccc; + font: 14px proxima-nova, "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + padding: 3px; + width: 150px +} + +#examples #todoExample button { + font: 14px proxima-nova, "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + margin-left: 5px; + padding: 4px 10px +} + +#examples #markdownExample textarea { + border: 1px solid #ccc; + font: 14px proxima-nova, "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + margin-bottom: 10px; + padding: 5px +} + +.home-bottom-section { + margin-bottom: 100px +} + +.docs-nextprev:after { + content: ""; + display: table; + clear: both +} + +.jsxCompiler { + margin: 0 auto; + padding-top: 20px; + width: 1220px +} + +.jsxCompiler label.compiler-option { + display: block; + margin-top: 5px +} + +.jsxCompiler #jsxCompiler { + margin-top: 20px +} + +.jsxCompiler .playgroundPreview { + padding: 0; + width: 600px; + word-wrap: break-word +} + +.jsxCompiler .playgroundPreview pre { + font-family: 'source-code-pro', Menlo, Consolas, 'Courier New', monospace; + font-size: 13px; + line-height: 1.5 +} + +.jsxCompiler .playgroundError { + padding: 15px 20px +} + +.docs-prev { + float: left +} + +.docs-next { + float: right +} + +footer { + font-size: 13px; + font-weight: 600; + margin-top: 36px; + margin-bottom: 18px; + overflow: auto +} + +section.black content { + padding-bottom: 18px +} + +.blogContent { + padding-top: 20px +} + +.blogContent:after { + content: ""; + display: table; + clear: both +} + +.blogContent blockquote { + padding: 5px 15px; + margin: 20px 0; + background-color: #f8f5ec; + border-left: 5px solid #f7ebc6 +} + +.blogContent h2 > code { + font-size: inherit; + line-height: inherit; + color: #555; + background-color: rgba(0, 0, 0, 0.04) +} + +.documentationContent { + padding-top: 20px +} + +.documentationContent:after { + content: ""; + display: table; + clear: both +} + +.documentationContent .subHeader { + font-size: 24px +} + +.documentationContent h2 { + margin-top: 30px +} + +.documentationContent blockquote { + padding: 15px 30px 15px 15px; + margin: 20px 0; + background-color: rgba(204, 122, 111, 0.1); + border-left: 5px solid rgba(191, 87, 73, 0.2) +} + +.documentationContent blockquote h4 { + margin-top: 0 +} + +.documentationContent blockquote p { + margin-bottom: 0 +} + +.documentationContent blockquote p:first-child { + font-weight: bold; + font-size: 17.5px; + line-height: 20px; + margin-top: 0; + text-rendering: optimizelegibility +} + +.docs-prevnext { + padding-top: 40px; + padding-bottom: 40px +} + +.button { + background: -webkit-linear-gradient(#9a9a9a, #646464); + background: linear-gradient(#9a9a9a, #646464); + border-radius: 4px; + padding: 8px 16px; + font-size: 18px; + font-weight: 400; + margin: 0 12px; + display: inline-block; + color: #fafafa; + text-decoration: none; + text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + text-decoration: none +} + +.button:hover { + text-decoration: none +} + +.button:active { + box-shadow: none +} + +.hero .button { + box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.3) +} + +.button.blue { + background: -webkit-linear-gradient(#77a3d2, #4783c2); + background: linear-gradient(#77a3d2, #4783c2) +} + +.row { + padding-bottom: 4px +} + +.row .span4 { + width: 33.33%; + display: table-cell +} + +.row .span8 { + width: 66.66%; + display: table-cell +} + +.row .span6 { + width: 50%; + display: table-cell +} + +p { + margin: 10px 0 +} + +.highlight { + padding: 10px; + margin-bottom: 20px +} + +figure { + text-align: center +} + +.inner-content { + float: right; + width: 650px +} + +.nosidebar .inner-content { + float: none; + margin: 0 auto +} + +.inner-content img { + max-width: 100%; +} + +.inner-content table { + border-collapse: collapse; + width: 100%; +} +.inner-content th, .inner-content td { + padding: 0.25rem; + text-align: left; + border: 1px solid #ccc; +} +.inner-content tbody tr:nth-child(odd) { + background: #eee; +} + +h1:after { + content: ""; + display: table; + clear: both +} + +.edit-page-link { + float: right; + font-size: 16px; + font-weight: normal; + line-height: 20px; + margin-top: 17px +} + +.post-list-item + .post-list-item { + margin-top: 60px +} + +/* code styling */ + +code { + font-family: 'Anonymous Pro', sans-serif; + font-size: 0.85em; + color: #000; +} + +pre code { + display: block; + line-height: 1.1; + color: #333333; + background: #f8f5ec; + padding: 30px 14px 14px; + position: relative; + overflow-x: auto; +} + +pre code:before { + position: absolute; + top: 0; + right: 0; + left: 0; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + color: #c2c0bc; + background-color: #f1ede4; + content: "Code"; +} + +p code { + padding: 0.1em 0.3em 0.2em; + border-radius: 0.3em; + position: relative; + background: #fffff3; + + white-space: nowrap; +} + +/* syntax hl stuff */ + +code.lang-markdown { + color: #424242; +} + +code.lang-markdown .header, +code.lang-markdown .strong { + font-weight: bold; +} + +code.lang-markdown .emphasis { + font-style: italic; +} + +code.lang-markdown .horizontal_rule, +code.lang-markdown .link_label, +code.lang-markdown .code, +code.lang-markdown .header, +code.lang-markdown .link_url { + color: #555; +} + +code.lang-markdown .blockquote, +code.lang-markdown .bullet { + color: #bbb; +} + +/* Tomorrow Theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ +.tomorrow-comment, pre .comment, pre .title { + color: #8e908c; +} + +.tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { + color: #c82829; +} + +.tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant { + color: #f5871f; +} + +.tomorrow-yellow, pre .class, pre .ruby .class .title, pre .css .rules .attribute { + color: #eab700; +} + +.tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { + color: #718c00; +} + +.tomorrow-aqua, pre .css .hexcolor { + color: #3e999f; +} + +.tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { + color: #4271ae; +} + +.tomorrow-purple, pre .keyword, pre .javascript .function { + color: #8959a8; +} + +/* media queries */ + + +@media screen and (max-width: 960px) { + .nav-main { + position: static + } + + .container { + padding-top: 0 + } +} \ No newline at end of file diff --git a/docs/contents/images/blur-admin-logo.png b/docs/contents/images/blur-admin-logo.png new file mode 100644 index 000000000..963504fcb Binary files /dev/null and b/docs/contents/images/blur-admin-logo.png differ diff --git a/docs/contents/images/blur-preview-mint.jpg b/docs/contents/images/blur-preview-mint.jpg new file mode 100644 index 000000000..9967997b7 Binary files /dev/null and b/docs/contents/images/blur-preview-mint.jpg differ diff --git a/docs/contents/images/blur-preview.jpg b/docs/contents/images/blur-preview.jpg new file mode 100644 index 000000000..bdd78ae09 Binary files /dev/null and b/docs/contents/images/blur-preview.jpg differ diff --git a/docs/contents/images/favicon.png b/docs/contents/images/favicon.png new file mode 100644 index 000000000..25606ff4e Binary files /dev/null and b/docs/contents/images/favicon.png differ diff --git a/docs/contents/images/why-design.svg b/docs/contents/images/why-design.svg new file mode 100644 index 000000000..941661446 --- /dev/null +++ b/docs/contents/images/why-design.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/contents/images/why-practices.svg b/docs/contents/images/why-practices.svg new file mode 100644 index 000000000..aeed6289d --- /dev/null +++ b/docs/contents/images/why-practices.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/contents/images/why-structure.svg b/docs/contents/images/why-structure.svg new file mode 100644 index 000000000..0d16bead9 --- /dev/null +++ b/docs/contents/images/why-structure.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/contents/index.json b/docs/contents/index.json new file mode 100644 index 000000000..7991fa95f --- /dev/null +++ b/docs/contents/index.json @@ -0,0 +1,4 @@ +{ + "template": "index.jade", + "activeHome": true +} diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 000000000..f7ff42622 --- /dev/null +++ b/docs/package.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "moment": "2.3.x", + "underscore": "1.4.x", + "typogr": "0.5.x" + }, + "private": "true" +} diff --git a/docs/plugins/paginator.coffee b/docs/plugins/paginator.coffee new file mode 100644 index 000000000..be6aa6b80 --- /dev/null +++ b/docs/plugins/paginator.coffee @@ -0,0 +1,44 @@ + +module.exports = (env, callback) -> + ### Paginator plugin. Defaults can be overridden in config.json + e.g. "paginator": {"perPage": 10} ### + + defaults = + template: 'index.jade' # template that renders pages + articles: 'articles' # directory containing contents to paginate + first: 'index.html' # filename/url for first page + filename: 'page/%d/index.html' # filename for rest of pages + perPage: 2 # number of articles per page + groupSort: {} + + # assign defaults any option not set in the config file + options = env.config.paginator or {} + for key, value of defaults + options[key] ?= defaults[key] + + getArticles = (contents) -> + # helper that returns a list of articles found in *contents* + # note that each article is assumed to have its own directory in the articles directory + articles = contents[options.articles]._.directories.map (item) -> item.index + # skip articles that does not have a template associated + articles = articles.filter (item) -> item.template isnt 'none' + # sort article by date + articles.sort (a, b) -> b.metadata.sort - a.metadata.sort + groupedArticlesObj = articles.reduce (acc, curr) -> + groupName = curr.metadata.group + if not acc[groupName] + acc[groupName] = + groupName: groupName + items: [] + acc[groupName].items.push curr + return acc + , {} + groupedArticles = (val for key, val of groupedArticlesObj) + groupedArticles.sort (a, b) -> (options.groupSort[b.groupName] || 0) - (options.groupSort[a.groupName] || 0) + return groupedArticles + + # add the article helper to the environment so we can use it later + env.helpers.getGroupedArticles = getArticles + + # tell the plugin manager we are done + callback() diff --git a/docs/templates/article.jade b/docs/templates/article.jade new file mode 100644 index 000000000..e174fc1a5 --- /dev/null +++ b/docs/templates/article.jade @@ -0,0 +1,21 @@ + +extends layout + +block title + | BlurAdmin documentation - #{page.title] + +block content + section.content.wrap.documentationContent + div.nav-docs + each group in groupedArticles + div.nav-docs.section + h3=group.groupName + ul + each article in group.items + li + a(href=article.url)(class= locals.page === article ? 'active': '')= article.title + div.inner-content + h1=locals.page.title + div.subHeader + != typogr(page.html).typogrify() + diff --git a/docs/templates/index.jade b/docs/templates/index.jade new file mode 100644 index 000000000..c37ab39b8 --- /dev/null +++ b/docs/templates/index.jade @@ -0,0 +1,69 @@ + +extends layout + +block title + | BlurAdmin angular admin dashboard template + +block content + div.hero + div.hero-content + div.wrap + div.text + strong Blur#[span.white-text Admin] + div.minitext Angular admin panel front-end framework + div.buttons-unit + a.button(href=installationArticleUrl) Installation guidelines + a.button(href=firstArticleUrl) Documentation + div.admin-screenshots + div.admin-screenshot + h3 Mint version + a.demo-link(href='http://akveo.com/blur-admin-mint/',target='_blank') + img(src=contents.images['blur-preview-mint.jpg'].url) + span.demo-link-label Demo + div.admin-screenshot + h3 Blur version (experimental) + a.demo-link(href='http://akveo.com/blur-admin/',target='_blank') + img(src=contents.images['blur-preview.jpg'].url) + span.demo-link-label Demo + div.index-block + div.wrap + h1 Why BlurAdmin? + div.why-items + div.why-item + img(src=contents.images['why-structure.svg'].url) + h4 Awesome structure + p Feature-based structure has proven itself as a good choice for large angular applications. + div.why-item + img(src=contents.images['why-design.svg'].url) + h4 Neat design + p We have put a lot of efforts and carefully selected each color and character for this template! + div.why-item + img(src=contents.images['why-practices.svg'].url) + h4 Ease of customization + p Check out #[a(href='/blur-admin/articles/011-changing-color-scheme') our article], where we describe how you can create different look in just 2 minutes! + div.index-block.black + div.wrap + h1 Is it free? + p Blur admin is completely free and MIT licensed. That means you can do whatever you want with it. + p + | Initially we planned to sell it on template markets. + | But they #[a(href='http://akveo.com/blog/why-i-hate-template-markets/',target='_blank') rejected us several times]. + | That's why we decided to make it open-source. And honestly, we have completely no regrets about it! + | And we suggest you to not waste your money and use our template instead of paid ones! + | Trust us, it's better than large number of them. + div.index-block + div.wrap + h1 How can I support you guys? + p Here's what you can do: + ul + li Star #[a(href='https://github.com/akveo/blur-admin',target='_blank') our GitHub repo] + li Create pull requests, submit bugs, suggest new features + li Follow #[a(href='https://twitter.com/akveo_inc',target='_blank') us on Twitter] + li Like #[a(href='https://www.facebook.com/akveo/',target='_blank') our page on Facebook] + div.index-block.black + div.wrap + h1 Can I hire you? + p Yes! We are available for hire. Visit #[a(href='http://akveo.com',target='_blank') our homepage] + | or simply leave us a note to #[a(href='mailto:contact@akveo.com') contact@akveo.com]. + | We will be happy to work with you! + diff --git a/docs/templates/layout.jade b/docs/templates/layout.jade new file mode 100644 index 000000000..0de2dcc54 --- /dev/null +++ b/docs/templates/layout.jade @@ -0,0 +1,47 @@ +doctype html +block vars + - var bodyclass = null; + - var groupedArticles = env.helpers.getGroupedArticles(contents); + - var firstArticleUrl = groupedArticles[0].items[0].url + - var installationArticleUrl = groupedArticles[0].items[1].url +html(lang='en') + head + block head + meta(charset='utf-8') + meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1') + meta(name='viewport', content='width=device-width') + meta(name='keywords', content='admin,dashboard,template,angular,bootstrap,blur,panel,html,css,javascript') + title + block title + = locals.name + link(rel='alternate', href=locals.url+'/feed.xml', type='application/rss+xml', title=locals.description) + link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900italic,900|Anonymous+Pro:400,700,400italic,700italic&subset=latin,greek,greek-ext,vietnamese,cyrillic-ext,latin-ext,cyrillic') + link(rel='stylesheet', href=contents.css['main.css'].url) + link(rel='shortcut icon', href=contents.images['favicon.png'].url) + body(class=bodyclass) + div.container + div.nav-main + div.wrap + a.nav-home(href=contents['index'].url) + img.nav-logo(src=contents.images['blur-admin-logo.png'].url, width=36,height=36) + | #[span.blur-label Blur]Admin + ul.nav-site.nav-site-internal + li + a(class= locals.page.metadata.activeHome ? 'active': '')(href=contents['index'].url) Home + li + a(class= !locals.page.metadata.activeHome ? 'active': '')(href=firstArticleUrl) Docs + span.nav-docs-right + | Need some help? Let us know! #[a(href='mailto:contact@akveo.com') contact@akveo.com] + block content + h2 Welcome to blur admin! + footer.wrap + div.left Powered by Angular, Bootsrap, Gulp and more... + div.right + | © 2015–2016 Akveo LLC
+ | Documentation licensed under #[a(href='https://creativecommons.org/licenses/by/4.0/') CC BY 4.0]. + a(href='https://github.com/akveo/blur-admin') + img(style='position: fixed; top: 0; right: 0; border: 0; z-index: 1000;',src='https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67',alt='Fork me on GitHub',data-canonical-src='https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png') + script. + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q || []).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + ga('create', 'UA-61945105-3', 'auto'); + ga('send', 'pageview'); \ No newline at end of file diff --git a/gulp/build.js b/gulp/build.js index 79bcf2330..efbccfb74 100644 --- a/gulp/build.js +++ b/gulp/build.js @@ -72,8 +72,7 @@ gulp.task('html', ['inject', 'partials'], function () { // Only applies for fonts from bower dependencies // Custom fonts are handled by the "other" task gulp.task('fonts', function () { - return gulp.src($.mainBowerFiles()) - .pipe($.filter('**/*.{eot,svg,ttf,woff,woff2}')) + return gulp.src($.mainBowerFiles('**/*.{eot,svg,ttf,woff,woff2}')) .pipe($.flatten()) .pipe(gulp.dest(path.join(conf.paths.dist, '/fonts/'))); }); diff --git a/gulp/conf.js b/gulp/conf.js index 1f0be2d69..a29fd293c 100644 --- a/gulp/conf.js +++ b/gulp/conf.js @@ -14,6 +14,7 @@ var gutil = require('gulp-util'); exports.paths = { src: 'src', dist: 'release', + devDist: 'dev-release', tmp: '.tmp', e2e: 'e2e' }; diff --git a/gulp/devRelease.js b/gulp/devRelease.js new file mode 100644 index 000000000..43278680d --- /dev/null +++ b/gulp/devRelease.js @@ -0,0 +1,57 @@ +'use strict'; + +var path = require('path'); +var gulp = require('gulp'); +var conf = require('./conf'); + +var $ = require('gulp-load-plugins')({ + pattern: ['gulp-*', 'main-bower-files'] +}); + +var _ = require('lodash'); + +gulp.task('dev-fonts', function () { + return gulp.src($.mainBowerFiles()) + .pipe($.filter('**/*.{eot,svg,ttf,woff,woff2}')) + .pipe($.flatten()) + .pipe(gulp.dest(path.join(conf.paths.devDist, 'fonts'))); +}); + +gulp.task('dev-copy-lib', function () { + var assets = require('wiredep')(_.extend({}, conf.wiredep)); + var srcList = []; + srcList.push.apply(srcList, assets.js); + srcList.push.apply(srcList, assets.css); + return gulp + .src(srcList/*, { base: '.' }*/) +/* .pipe($.rename(function (p) { + p.dirname = p.dirname.replace(/\\/g, '/').replace('bower_components/', ''); + if (p.dirname.indexOf('/') !== -1) { + p.dirname = p.dirname.substr(0, p.dirname.indexOf('/')); + } + }))*/ + .pipe(gulp.dest(path.join(conf.paths.devDist, 'lib'))); +}); + +gulp.task('dev-css-replace', ['dev-copy-assets'], function() { + return gulp.src(path.join(conf.paths.devDist, '*.html')) + .pipe($.replace(//g, '')) + .pipe(gulp.dest(conf.paths.devDist)); +}); + +gulp.task('dev-js-replace', ['dev-copy-assets'], function() { + return gulp.src(path.join(conf.paths.devDist, '.html')) + .pipe($.replace(/