Daniel@0: /* Part of DML (Digital Music Laboratory) Daniel@0: Copyright 2014-2015 Samer Abdallah, University of London Daniel@0: Daniel@0: This program is free software; you can redistribute it and/or Daniel@0: modify it under the terms of the GNU General Public License Daniel@0: as published by the Free Software Foundation; either version 2 Daniel@0: of the License, or (at your option) any later version. Daniel@0: Daniel@0: This program is distributed in the hope that it will be useful, Daniel@0: but WITHOUT ANY WARRANTY; without even the implied warranty of Daniel@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Daniel@0: GNU General Public License for more details. Daniel@0: Daniel@0: You should have received a copy of the GNU General Public Daniel@0: License along with this library; if not, write to the Free Software Daniel@0: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Daniel@0: */ Daniel@0: Daniel@0: :- module(kube, []). Daniel@0: Daniel@0: /** Enables use of Kube CSS framework Daniel@0: */ Daniel@0: Daniel@0: :- use_module(library(http/html_write)). Daniel@0: :- use_module(library(http/html_head)). Daniel@0: :- use_module(library(htmlutils)). Daniel@0: Daniel@0: :- set_prolog_flag(double_quote,string). Daniel@0: Daniel@0: http:location( kube, css(kube310), []). Daniel@0: Daniel@0: user:head(kube(_),Head) --> !, Daniel@0: html(head([ meta([name(viewport), content("width-device-width,initial-scale=1")]) Daniel@0: | Head ])). Daniel@0: Daniel@0: requirements --> Daniel@0: html_requires("//imperavi.com/css/combined.min.css"), Daniel@0: html_requires("//imperavi.com/js/combined.min.js"). Daniel@0: Daniel@0: user:body(kube(Nav),Body) --> !, Daniel@0: { setting(htmlutils:appname, AppName) }, Daniel@0: use_font("Source Sans Pro",sourcepro), Daniel@0: % html_requires(kube('kube.min.css')), Daniel@0: requirements, Daniel@0: Daniel@0: html(body(class=kubepage, Daniel@0: [ div( class=wrap, Daniel@0: [ nav([id=nav,class=[navbar,fullwidth]], Daniel@0: \navmenu(AppName,Nav)) Daniel@0: ]) Daniel@0: , div(class=wrap, Daniel@0: div(id=main, Daniel@0: [ aside(id=side,nav([class=nav,id="side-nav"], Daniel@0: \navmenu(AppName,Nav))) Daniel@0: , div(id=area,Body) Daniel@0: ])) Daniel@0: , div(class=wrap, Daniel@0: footer(id=footer, Daniel@0: [a(href='.',AppName), nav(class=[navbar,'navbar-right'], ul(\Nav))])) Daniel@0: ])). Daniel@0: Daniel@0: navmenu(AppName,Nav) --> html(ul([li(\link(root,b(AppName))),\Nav])). Daniel@0: navmenu(Nav) --> html(nav(class=[navbar,"navbar-left"],ul(\Nav))). Daniel@0: sidebar(Contents) --> html(aside(id=side,Contents)). Daniel@0: Daniel@0: button_link(Ref,Content) --> Daniel@0: html(a([class('btn btn-small'),href(Ref)],Content)). Daniel@0: Daniel@0: % menu(Classes,Content) --> Daniel@0: % html(div(class(['pure-menu', 'pure-menu-open'|Classes]), Content)). Daniel@0: % % Add pure-menu-selected to active item Daniel@0: % hmenu(Heading,Items) --> Daniel@0: % menu(['pure-menu-horizontal'], [a([href='.',class="pure-menu-heading"],Heading), ul(\Items)]). Daniel@0: Daniel@0: % vmenu(Heading,Items) --> Daniel@0: % menu([], [a([href='.',class="pure-menu-heading"],Heading), ul(\Items)]).