Bootstrap 3 theme designed for Admin Templates
The following picture describes the main pieces of the layout
The layout is based on the following markup represented with
<html> <head> #metas and css </head> <body> <section class="wrapper"> <nav class="navbar navbar-default navbar-top navbar-fixed-top"> #navbar top content </nav> <aside class="aside"> #aside content (sidebar left) </aside> <aside class="offsidebar"> #offsidebar content (right) </aside> <section> <div class="main-content"> #page content </div> </section> </section> #scripts </body> </html>
The top navbar, is a compoenent based on the classic navbar-top from bootstrap but redesigned to contain a larger and collapsible header,
The sidebar (right) has different behavior on mobile and desktop devices. On desktop, under the class .aside-toggle the navbar is condensed (to save space), on mobiles, under the same class the navbar is displayed on screen and if toggled the navbar hides automatically (off-canvas)
The offsidebar is similar to the sidebar but it hides always off the screen. That means, the offsidebar is an offcanvas components.
The section tag, child of the .wrapper element contains the main content of the page under the element .main-content. All this structure is used to achieve the slide effect on different devices when the sidebar (on mobile) or offsidebar is toggled.
To change the color scheme you have 2 options:
From LESS files
Edit the LESS files in folder master/less/app and the file master/less/bootstrap/variables.less to use the color you want.
Like Bootstrap, most of the colors are based on @brand-* variables. For example, the primary color used for the theme is based on the variable @brand-primary.
You can also edit the files in master/less/theme folder to create your own set of color schemes. This files must be included before the app.css in your page to override the default color set.
From CSS files
This template support color schemes including a css file. You can find 4 color options in the folder app/css/, and files are named wintermin-theme*.css
If you want to change or add a new component color, just inspect the color using your favorite browser devtool and then replace the value in the file.
This files are prepared to change the basic color scheme (both sidebars and top navbar) but if you want to make a more deep change I suggest you to check the LESS way which is more simple to large component changes.
To use the compiled files you only need the content of the app folder.
You only need to link to this files in your pages (or use the template.html as a base) and done. Then you can continue customizing the app.css, app.js or bootstrap.js
It's strongly suggested that you create and use a file custom.css for all your pages to avoid changing the main styles. This will make easy for you to track changes you have made and more simple to detect any issue in case you need support.
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications.
Gulp is a task manager, you can define different tasks to run certain commands. Those commands does the compilation job for JADE and LESS, and concats the JS files.
The package includes under the master/ folder the file gulpfile.js and package.json to install the required componets to compile the source files.
The following steps are intended to be an orientation guide, if you are not experienced with this you will need to learn more about it from Google :)
- To install node, go to http://nodejs.org/
- Then install npm https://www.npmjs.org/doc/README.html
After that, open a terminal and go to the master folder, then run the command npm install. This command will install gulp and all depencies.
Then run gulp to start the task manager
If everything goes fine, you should see the messages in the terminal telling you that most the task are done ok. The task includes a watch to compile automatically all files when they change.
The JS files are divided in the app script, the page script and the modules folders.
The module folder is shared by the app and pages script.
The modules folder contains different script used to init different features that requires Javascript. Those modules are plugin definitions (customized for this templates) and others are event listener like the dropdown animation, sidebar toggler, etc.
The app script is app.init.js. This script is concatenated after all modules to have one point where all the modules are loaded and interpreted and so, they are ready to use.
The page script is page.init.js. This script is concatenated after all modules to have one point where all the modules are loaded and interpreted and so, they are ready to use. The difference here is that the modules that you want to include in your pages must be specified in the file gulpfile.js (in case your using gulp)
The JADE structure is based on a layout file named main-layout.jade, under the layout/ folder and all templates extends this layout. There are also partials, included in the layout file to separate different section of the page that are common to all templates.
The sidebar has a special treatment when using JADE templates. The main file for the sidebar is sidebar.jade under the partials/ folders.
This files include another named sidebar sidebar-config.jade this contains an array definition with the menu elements and mixin that uses that array to iterate and create all menu items.
This technique has the following advantages
- It allows to mark every menu item according to each page compiling, so you don't need to do it manually in the html source.
- You can see more clearly the menu structure and make changes easily without browsing through the markup
The LESS files are divided in three folders
bootstrap folder contains the bootstrap files. This files are compiled into bootstrap.css, with just the main bootstrap styles.
app folder contains the custom files for this templates and also it uses variables.less and mixins.less from bootstrap so it's possible to integrate the new components with the framework reducing duplicated declarations and allowing to have a single point of definition.
pages folder contains the custom files pages. Each LESS file in this folder will should be compiled into its CSS version for a particular page. For example, the file include landing.less is included as landing.css just the for the landing page.
The vector maps are based on the jQuery jVectorMap plugin.
You can find more information about this plugin here and other maps here.
This item implementation uses two object to populate the map. One is for the series and other is for markers.
With series you can choose which region should hilight in the map to display some information associated with that region (e.g. visitors). Markers are similar to the google maps marker, just set a coordinate and a name and the marker will appear on the map.
To change the color scheme of the map, you can play with data-* attributes in the map element, or directly in the js file (app.js or vector-maps.js) by editing the object defaultColors
Classyloader allow you to create radial progress bar using jQuery and canvas. This plugin is very simple to use and in js included with this product you can change the options directly from data-* attributes.
There is a special option data-trigger-in-view which allows to start the loader animation when the element is visible on the screen. Just add a markup like follows
<canvas data-toggle="classyloader" data-trigger-in-view="true" data-percentage="100" data-speed="20" data-.... ></canvas>
This a custom component made to filter elements on screen. You can see a demo in the page FileBox by clicking on each category
The idea behind is, you have one or more buttons to trigger the filter and the elements to be filtered.
For the trigger buttons use data-filter-tag with the value of the group to filter
<a href="#" data-filter-tag="audio">
For the elements to be filtered use the attribute data-filter-group with the name of the filterable group.
<div data-filter-group="audio" ...> ...</div>
To reset the filter, you can use the special group name "all" in a button attribute. For example
<a href="#" data-filter-tag="all">...</a>
Panels can perform different actions. Currently there are three actions triggered by clicking an icon in the panel heading. The example markup is like follows
<div class="panel-heading"> <a href="#" data-perform="panel-dismiss" data-toggle="tooltip" title="" class="pull-right" data-original-title="Close Panel"> <em class="fa fa-times"></em> </a> <a href="#" data-perform="panel-collapse" data-toggle="tooltip" title="" class="pull-right" data-original-title="Collapse Panel"> <em class="fa fa-minus"></em> </a> <a href="#" data-perform="panel-refresh" data-spinner="traditional" data-toggle="tooltip" title="" class="pull-right" data-original-title="Refresh Panel"> <em class="fa fa-refresh"></em> </a> <div class="panel-title">Title Here</div> </div>
Note the importance of the data-attibutes, the .pull-right class and the icon element.
And those actions are
- Dismiss: With a click the panel closes and remove itself. If the panel in inside a col-* element, it will remove the column to not leave an empty space.
- Collapse: this actions allows to collapse the panel body. This action uses extra clases thar are handled via Javascript transparently.
- Refresh: This action simply triggers an event in the .panel element that can be hooked by any other module to know when the user request a refresh (content reload).
In this action there are two parts to consider
At last, the spinner animation can be changed using the data-spinner attribute and the allowed values are the same used in the demo page for the Spinner animations. You can learn more about the spinner plugin here.
The notification system is based on the notify component from UIKIT.
There are two way to use it.
- Using a trigger element (via click) like a button , anchor, etc.
<button type="button" data-toggle="notify" data-message="Message .." class="btn btn-default">Button text</button>
data-toggle="notifiy" is what idenitfies the element to be handled by the notify plugin
data-message: the message you want to display. It accepts text or html.
data-options: This is a string of options in json format. Learn more here
- Or when the pages first loads
<div data-toggle="notify" data-onload data-message="..." data-options="{"status":"danger", "pos":"top-right"}" class="hidden-xs"></div>
Note the following
data-onload: When present, the alert box will be displayed automatically when page loads. No value required.
hidden-xs: this class from bootstrap hides the element so its not displayed in the page.
The animations components uses a plugin called animo.js http://labs.bigroomstudios.com/libraries/animo-js
This plugin uses the animation library animate.css by Dan Eden http://daneden.github.io/animate.css/
Using this plugin allows to run animations directly from jQuery but running CSS3 based animations which makes the animation handling more flexible and performant at the same time.
This plugin is used in the following JS modules
- dropdown-animate: Allow to animate the dropdown when it opens. You see a demonstration in the page dropdown-animations.html
- panel-perform: Allows to animate a panel when it is destroyed by clicking on the cross icon.
- play-animation: This component allows to play animation in an element using another element as a trigger via the click event or by setting an offset so the element animates when it becomes visible when scrolling.
This components is a set of CSS classes that helps to create different element or changes a default behavior just adding the class.
This classes are defined in the file utils.less or app.css and they are most used in the creation of widgets.
Example of utilities classes are for clearing margins or add different margins sizes. Same for padding, and also you can set different background colors or text color
Chart system is based on the plugin Flot Charts
According to the type of chart you want to display, you must provide a set of values so the chart can display it. This set of values are usually stores in database or a file in the server. Because of that, there are PHP files created to server the information for each chart via AJAX POST requests using the JSON format.
Every time a page with a chart is loaded, the script flot-chart.js find the chart elements and request a content for that chart via AJAX POST, this script uses an object defined which does the ajax request, and after receive the data it inits the corresponding chart.
This is an example markup of a chart
<div style="height: 250px;" data-source="server/chart-data.php?type=area" class="chart-area flot-chart"></div>
As you can see you have to define a height, classnames to target a particular type of chart and the data-source.
The data-source is the PHP script location that returns the data in JSON format
There is one main PHP file chart-data.php that routes the request to the corresponding PHP script to return the right data for the chart.
You only need to copy or edit the content a some of the files named chart-data-*.php according to your needs to populate the charts in the page.
Loading from JSON files
To load from a JSON file directly just put the URL to the json file in the data-source attribute like follows
<div style="height: 250px;" data-source="server/chart-data-donut.json" class="chart-area flot-chart"></div>
The file upload component is handlded by a compoent from the framework UIKIT which can handle upload inputs and also uploas via drag-drop zones
The JS script for this component is upload-demo.js and like the name says, this files is a demostration and guid of how to implement your own file upload.
There is also a file in the server folder upload.php which gets the uploaded file information and save its content to the right location.
The save feature is commented so you need to uncomment and edit to set the directories where your uploaded files should be located.
The php script has many consideration regarding to security issues so is preferable to avoid making many changes
The slimcroll plugin is used to simulate a scroll bar inside custom components. To use it only wrap the component in the following markup
<div class="scroll-viewport"> <div class="scroll-content"> # component content here </div> </div>
The masonry grid is a grid that allows to convert a list of items into a column layout. This component is based on CSS3 Columns layout (support).
The grid is "mobile first" and the number of columns can vary from one device to another with max of 12 columns.
To use the masonry grid add the following markup
<div class="row-masonry row-masonry-lg-4"> <div class="col-masonry"> # first column </div> <div class="col-masonry"> # another column </div> </div>
Note that you can use the responsive columns in a similar way like Bootstrap grid does
.row-masonry-xl-* For large desktops resolutions
.row-masonry-lg-* From normal desktop and above
.row-masonry-md-* From tablet devices and above
.row-masonry-sm-* From mobiles and above
DataTables is a very flexible, advanced tables plugin for jQuery. This items uses a specialized version of DataTables built for Bootstrap 3. For complete documentation on DataTables, visit their website at https://datatables.net/.
Datatables supports extension to add more usability features.
This item includes the following usage modes
- Zero configuration: This is basic usage, which adds a select to change the number of row to display, an input to filter the content displayed and a pagination. All elements based on Bootstrap classes.
- Column Filtering: allows to use a text input below each columns to filter the table content by adding different filters by columns.
- Column Visibility: allows the user to chose via a dropdown the columns to be displayed by the table dynamically.
Each different usage includes the plugins invocation plus a set of options to add one level more of customization like text translation.
The Google Maps script support the following data attributes which are the most used when customizing a map. If you need more customization edit directly the plugin options.
<div class="gmap" data-toggle="gmap" data-address="address-1; address-2" data-title="title-for-address-1;title-for-address-2" data-maptype="ROADMAP" data-styled data-zoom="14" ></div>
The class .gmap is required to set a height for the map. Google needs a height at least so you can use any other class that provides a height for the element.
Data attributes
data-toggle="gmap" indicates the element must be handled by the Google Map script
data-address indicates the address(es) you want to display. Multiple address can be separated by ;
data-title indicates the text for the popover for each address. Multiple title can be separated by ; and each one will be associated with the respective address in the same order as defined
data-zoom: change the zoom of the map 0 - 19
data-maptype: The type of map. ROADMAP or TERRAIN or SATELLITE
data-styled No value required. If present the map will be styled using the styles arrays defined in the Google Map script.
This item include the full calender plugin wrapped into a classic application to manage events. This app is intended to show how to work with the most common features that full calendar provides. You can find more on its website at http://arshaw.com/fullcalendar/docs/
The full calendar app is contained in the js module calendar.js and the execution is in 3 steps.
1- createDemoEvents() This function prepares the events data to be displayed when the calendar inits. You can wrap into this function a request to a source to get via ajax the stored events
2- initExternalEvents() attaches all necessary events to the left panel to add, remove and drag/drop events into the calendar
3- initCalendar() this function finally invokes the calendar plugin and displays the events loaded from the source. This function also contains the drop handler to know when an event has been dragged/droppped into the calendar.
At last, the ExternalEvent object is used to handle external events by adding draggable functionality and the internal event data.
All functions above must run inside the document ready event to ensure a correct elements detection.
The portlets system allows to drag and re-order panel position in the screen.
The module involved is portlet.js. It makes use of the jQueryUI sortable widget to create the portlet structure. It also use functions to save and restore the portlet position from the browser storage.
About the markup, portlet works switching position between columns. So you need to create a predefined number of columns that will contain your panels with a portlet like behavior. To do that use the following markup as base
<div class="row"> <div id="portlet-1" data-toggle="portlet" class="col-lg-4"> <div id="panel-1" class="panel panel-default"> ... </div> <div id="panel-2" class="panel panel-primary"> ... </div> </div> <div id="portlet-2" data-toggle="portlet" class="col-lg-4"> # your panels here </div> <div id="portlet-3" data-toggle="portlet" class="col-lg-4"> # your panels here </div> </div>
Note the two required things
The panel state is a feature added into the module panel-perform.js used to save the state of the panel if the user has closed or expanded it.
The module uses the internal browser storage via the plugin named store.js
This features needs that panel have a unique id to know how to restore each one when the page loads.
This module is included in the file clear-storage.js What it does is to simply allow to clear any storage data from a button, link or another clickable element.
Just use any element with the data- atributes like this
<button type="button" data-toggle="reset" data-key="panelState" >Reset something</button>
After the storage has been cleared, the current page is reaload automatically. In case you don't want to auto reaload the page, just open the module clear-storage.js and comment line 20
window.location.reload();
Since version 1.2 when no key has been specified, the module tries to clear all key from browser storage for the current site. A Javascript confirm box is displayed to receive a confirmation from the user before remove.
The from wizard uses the Javascript module form-wizard.js
The markup required for the wizard is
<form action="/" method="POST"> <div data-toggle="wizard" data-validate-step="true" class="form-wizard wizard-vertical"> <ol> <li> <h4>Step name</h4> </li> # other steps ... </ol> <div> # form elements for first step </div> <div> # form elements for other steps </div> </div> </form>
<button type="button" data-toggle="load-css" data-uri="path/to/file.css"> ... </button>
<a href="#" data-toggle-state="aside-collapsed" data-persists="true">...</a>
The following projects has been used in this item