About Template (Light Blue 4.0.0)

Light Blue Admin Template is next-generation, well-designed and powerful front-end template. It's very useful for designing either your next web application or admin entrance for it.

It's based on super powerful Bootstrap front-end framework which uses 12-column responsive grid layout.

Structure

Tl;dr - go to ../html-transparent/dist folder (../html-white/dist folder if you prefer Transparent Dark version or ../html-white/dist folder if you prefer White version) to check the most default html/css-only version of Light Blue. The stuff below is for compiling different variations of Light Blue from sass/handlebars sources.

For React JS Full version please refer to React JS Section of this documentation.

For Angular 5.0 Full version please refer to Angular 5.0 Section of this documentation.

Since version 3.0.0 Light Blue template depends on Grunt Task runner to build an application version. So Light Blue root folder contains only setting & build files. Here is the structure:

  • *root* - package meta-files (bower.json, package.json, etc);
  • bower_components - various JS & CSS libraries used in Light Blue. Bower package manager is used to manage Light Blue dependencies;
  • documentation - you're actually reading it now;
  • html-transparent - transparent Light version of Light Blue template;
  • html-transparent-dark - transparent Dark version of Light Blue template;
  • html-white - white version of Light Blue template;
  • node_modules - npm modules used in Light Blue to assemble a compiled version;

Every version (as of 3.3.0 there are html-transparent-light, html-transparent-dark and html-white) goes with the following folders (except angular 5.0 version):

  • src - handlebars & sass sources;
  • dist - compiled html & css files;
  • src/img - images;
  • src/js - custom javascript written for Light Blue;
  • src/partials - reusable layouts & partials handlebars templates;
  • src/sass - scss stylesheets that compiled into css;
  • src/server - few php files used for fileupload & ajax widgets demo.
  • dist/css - compiled css stylesheets;
  • dist/img - images copied from src/img by grunt task;
  • dist/js - custom javascript copied or minified from src/js by grunt task;
  • dist/lib - js libs extracted from ../bower_components (Only js files are copied);
  • dist/server - few php files used for fileupload & ajax widgets demo copied from src/server.

Bower

Since maintaining front-end libraries is getting more and more complicated we use Bower to manage Light Blue dependencies. Bower is a front-end package management system which allows you to easely install required packages. Installing Bootstrap (for instance) becomes really simple:

bower install bootstrap

Above command installs bootstrap framework from https://github.com/twbs/bootstrap directly into the bower_components folder.

There is also a bower.json file where all libraries are put. Check it out for complete list of libs used in Light Blue.

Scss

Light Blue uses scss to generate css. This choice has been made because of significant boost scss gives when developing front-end apps like this one. We used compass to compile scss to css, but what to use is absolutely up to your choice. Anyway editing css is a good old way, right? :)

The main scss file is application.scss. It includes all libraries and partial files.

  • base.scss - core application styles. Layout, sidebar, right chat, basic widget layout styles are here.

  • bootstrap-override.scss - there are situations when just changing bootstrap sass variable is not enough - we need to override something manually. This is the place for such overrides.

  • override-custom-libs.scss - same but for custom not essential libs (datepickers, calendar). This file can be removed.

  • font.scss - downloaded version of Open Sans font.

  • general.scss - all application styles. Only tag-selector styles (body, a, h2, etc).

  • override-libs.scss - core libs (Font Awesome, Bootstrap select) overrides.

  • mixins.scss - Light Blue sass mixins. Use when needed.

  • print.scss - yep, print styles. Disables parts of layout when printing.

  • utils.scss - utilities classes. Mostly so-called property classes (margins, borders, etc).

  • variables.scss - all template variables like colors, button sizes, etc.

  • widgets.scss - custom widgets classes (email widget, charts, etc). This file can be removed.

Building a package

In order to build a package you need to be familiar with Grunt Task runner and have it installed. Before building a package we need to make sure that all required npm libraries (and npm itself) are installed:

$> npm install -g grunt-cli
$> npm install
$> bower install

After that all you need to do is to run:

$> grunt --env=development --target=html-transparent

This will compile handlebars templates and sass files into html and css accordingly and put them into a html-transparent/dist folder. Options that may be passed to grunt are:

  • --env - may be either development or production. The first one compiles commented css and unminified js files, while the second one compiles both minified css and js files. Default value is development;
  • --target - the version to be compiled. Currently there are three versions available: html-transparent, html-transparent-dark and html-white. Default value is html-transparent

There are also other Grunt tasks available. Check Gruntfile.js for a list of them. The most important one would be grunt dist-watch, that you may want to use during developement. It will watch for changes in a src folder and recompile dist if necessary.

Templates

Since version 3.0.0 Light Blue template uses Handlebars to compile html from handlebars sources.

Most handlebars views are files placed into a src folder. All views extend layout.hbs that exists in a folder named partials.

Compiling handlebars layouts into an html is done by a special lib called grunt-handlebars-layouts.

Pjax

Light Blue uses jquery-pjax library that uses ajax and pushState which makes page loading super fast.

In case you want to turn off ajax page loading you need to just set window.PJAX_ENABLED variable to false (js/app.js file):

window.PJAX_ENABLED = false;

Running the project react js full version

  1. Install Yarn package + Node.js v6.5 or newer

  2. Run yarn install to install node dependencies defined in package.json.

  3. Run yarn start to run the project

Now you can open your web app in a browser http://localhost:3001/, on mobile devices and start hacking. Whenever you modify any of the source files inside the `/src` folder, the module bundler ([Webpack](http://webpack.github.io/)) will recompile the app on the fly and refresh all the connected browsers.

There are also other yarn tasks:

  • yarn run build - builds a production version of the application. All html/css/js code is minified and put to build folder. The contents of this folder you will want to put to your production server when publising the application;

  • yarn run lint - checks your code files for javascript & scss errors.

For more instruction please refer to React JS Seed readme.md.

Running the project angular 5 full version

  1. Windows 10 users need to install Visual C++ Build Tools, choose Custom Install, and select both Windows 8.1 and Windows 10 SDKs. Python 2.7 is also required. For an extensive description on how to solve node-gyp problems please read though this thread on github.

  2. Run npm install to install node dependencies defined in package.json and to install typings defined in typings.json

  3. Run npm start to run the project

There are also other npm tasks:

  • npm run build:prod - builds a production version of the application. All html/css/js code is minified and put to dist folder. The contents of this folder you will want to put to your production server when publising the application;

  • npm run lint - checks your code in .ts files for typescript errors

For more instruction please refer to angular 5.0 readme.md.

Seed (minimal setup)

There are two more versions of Light Blue included into the package angular 5 seed version and react js seed version. They are intended to be used when you want to build a project from scratch and do not want to have all libraries enabled in Light Blue demo to be included in your project be default. So, in short, it's a same Light Blue angular version but containing only essential functionality. You don't need to throw anything out of it; it is ready to be a "seed" for your project - just start to add your code.

Custom angular 5 Widget

Angular applications are made up of components. A component is the combination of an HTML template and a component class that controls a portion of the screen. Here is an example of a component that displays a current date:

  1. Create directory current-date in ./src/app path

  2. Create current-date.component.ts, current-date.template.html, current-date.style.scss, current-date.service.ts and current-date.module.ts files

    • current-date.components.ts:
      import { Component } from '@angular/core';
      import { CurrentDateService } from './current-date.service.ts';
      
      @Component({
          selector: 'current-date',                        <-- template selector (as tag name)
          templateUrl: './current-date.template.html',     <-- link to your custom widget template
          styleUrls: ['./current-date.style.scss']         <-- links to your custom styles
      })
      export class CurrentDateComponent {
          name = 'Get Date Widget on Light Blue';
          currentDate: string;
      
          constructor(public currentDateService: currentDateService) {}
      
          getDate() {
              currentDateService.getDate();
          }
      }
    • current-date.template.html:
      <h1 class="header">This is a {{name}}</h1>
      <button class="date-btn" (click)="getDate()">Get Date</button>
    • current-date.style.scss:
      .header {
          color: #rgba(232, 122, 10, .5)
      }
      .date-btn {
          background: #44dd55;
      }
    • current-date.service.ts:
      import { Injectable } from '@angular/core';
      
      @Injectable()
      export class CurrentDateService {
      
          public getDate(): void {
              let date = new Date();
              console.log(date);
          }
      }
    • current-date.module.ts:
      import { NgModule }      from '@angular/core';
      import { CommonModule }  from '@angular/common';
      import { RouterModule } from '@angular/router';
      import { CurrentDateComponent } from './current-date.component';
      import { CurrentDateService } from './current-date.service';
      
      export const routes = [
          { path: '', component: CurrentDateComponent, pathMatch: 'full' }
      ];
      
      @NgModule({
          imports: [ CommonModule, RouterModule.forChild(routes) ],
          declarations: [ WidgetComponent ],
          providers: [ CurrentDateService ]
      })
      export class CurrentDateModule {
          static routes = routes;
      }
      
  3. To add route for the custom widget page go to ./src/app/layout/layout.routes.ts; Add to the routes object next code: { path: 'current-date', loadChildren: '../current-date/current-date.module#CurrentDateModule' }
  4. Full start guide for angular 5 framework you can find here: Angualar 2 Guide

Support

If you have any questions or problems when installing template feel free to contact us via email - contact@flatlogic.com. We will provide as much help as possible.

Statistics Boxes


See statistics section.

Left Sidebar


Left sidebar is based on Bootstrap's collapse component. Settings.js holds additional javascript code which is used to change sidebar state and sidebar position depending on chosen option (icons, auto) and (left, right).

Top Navigation


Is simple Bootstrap's Navbar. User profile and settings popovers are implemented via Bootstrap's popover

Widget Controls


Each widget may have widget controls. See Widgets.

Charts


Charts are built with D3.js-based nvd3 library. Read more in charts section

Change Log


Version 4.0.0

  • - React JS Full version with Server Side Rendering and Bootstrap 4 Beta support
  • - Update Angular to 5.0.0
  • - Retouch design
  • - Fix various bugs

Version 3.9.1

  • - Bootstrap 4 Beta update for Angular 4.0 version
  • - Styles refactoring

Version 3.9.0

  • - React JS Seed version with Server Side Rendering and Bootstrap 4 Beta support

Version 3.8.0

  • - Update Angular to 4.2.4 version
  • - Update webpack to 3.0.0 version
  • - Update all dependencies and devDependencies
  • - Update webpack configs

Version 3.7.0

  • - Update Angular to 4.0 version on full and seed projects
  • - Charts bug fixes

Version 3.6.0

  • - Bootstrap 4 alpha 6 version
  • - Bootstrap Bugfixes
  • - Webpack 2.0 version
  • - Add angular preload strategy to fix first long time app loading
  • - Add pages loader

Version 3.5.0

  • - Angular 2.0 Full Version

Version 3.4.0

  • - Angular 2.0 Seed Version

Version 3.3.0

  • - Completely new Transparent Light version!
  • - Updated color scheme and design improvements
  • - Bugfixes

Version 3.2.1

  • - Using node-sass instead of compass
  • - Full library list update

Version 3.2

  • - Full library list update

Version 3.1

  • - White Version codebase rewrite & improvement
  • - Bootstrap 3.3.1 update
  • - UI issues fixing and improvements

Version 3.0

  • - Entire codebase rewrite & improvement
  • - Grunt tasks to build an application
  • - Bower package management
  • - General layout redesign
  • - Handlebars templates
  • - Bootstrap 3.2.0 update

Version 2.1

  • - Widgster plugin (closable, fullscreenable, collapsible, refreshable widgets)
  • - Messenger notifications
  • - Input Sliders
  • - Parsley 2.0.0
  • - White version bug fixes

Version 2.0

  • - Super fast Ajax page loading
  • - Lib updates
  • - Few bug fixes

Version 1.8

  • - Bootstrap v3.1 update
  • - Few bug fixes

Version 1.7.1

  • - Bootstrap 3.0.3 upgrade fix

Version 1.7

  • - 4+ level menu
  • - Libs updates & fixes
  • - Documentation update

Version 1.6

  • - Bootstrap components page
  • - Draggable Grid
  • - List Groups
  • - Jquery 2.0, lib updates
  • - Font Awesome 4.0.3

Version 1.5

  • - White version (white/) Thanks to Quang Pham for convincing me :)
  • - Landing page (landing.html)
  • - Css & Structure refactoring
  • - Drop Bootstrap 2 version from package

Version 1.4

Version 1.3

  • - Overall UI improvements
  • - New iCheck library instead of out-of-date uniform
  • - Print Optimized
  • - Invoice Page (special_invoice.html)

Version 1.2

  • - Fileupload fix
  • - Second level menu overlap fix

Version 1.1