comparison cpack/dml/skin/framework/kube.pl @ 0:718306e29690 tip

commiting public release
author Daniel Wolff
date Tue, 09 Feb 2016 21:05:06 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:718306e29690
1 /* Part of DML (Digital Music Laboratory)
2 Copyright 2014-2015 Samer Abdallah, University of London
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 :- module(kube, []).
20
21 /** <module> Enables use of Kube CSS framework
22 */
23
24 :- use_module(library(http/html_write)).
25 :- use_module(library(http/html_head)).
26 :- use_module(library(htmlutils)).
27
28 :- set_prolog_flag(double_quote,string).
29
30 http:location( kube, css(kube310), []).
31
32 user:head(kube(_),Head) --> !,
33 html(head([ meta([name(viewport), content("width-device-width,initial-scale=1")])
34 | Head ])).
35
36 requirements -->
37 html_requires("//imperavi.com/css/combined.min.css"),
38 html_requires("//imperavi.com/js/combined.min.js").
39
40 user:body(kube(Nav),Body) --> !,
41 { setting(htmlutils:appname, AppName) },
42 use_font("Source Sans Pro",sourcepro),
43 % html_requires(kube('kube.min.css')),
44 requirements,
45
46 html(body(class=kubepage,
47 [ div( class=wrap,
48 [ nav([id=nav,class=[navbar,fullwidth]],
49 \navmenu(AppName,Nav))
50 ])
51 , div(class=wrap,
52 div(id=main,
53 [ aside(id=side,nav([class=nav,id="side-nav"],
54 \navmenu(AppName,Nav)))
55 , div(id=area,Body)
56 ]))
57 , div(class=wrap,
58 footer(id=footer,
59 [a(href='.',AppName), nav(class=[navbar,'navbar-right'], ul(\Nav))]))
60 ])).
61
62 navmenu(AppName,Nav) --> html(ul([li(\link(root,b(AppName))),\Nav])).
63 navmenu(Nav) --> html(nav(class=[navbar,"navbar-left"],ul(\Nav))).
64 sidebar(Contents) --> html(aside(id=side,Contents)).
65
66 button_link(Ref,Content) -->
67 html(a([class('btn btn-small'),href(Ref)],Content)).
68
69 % menu(Classes,Content) -->
70 % html(div(class(['pure-menu', 'pure-menu-open'|Classes]), Content)).
71 % % Add pure-menu-selected to active item
72 % hmenu(Heading,Items) -->
73 % menu(['pure-menu-horizontal'], [a([href='.',class="pure-menu-heading"],Heading), ul(\Items)]).
74
75 % vmenu(Heading,Items) -->
76 % menu([], [a([href='.',class="pure-menu-heading"],Heading), ul(\Items)]).