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