f1affb954b12fccce5696e4611334bcf7dcc5591
1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2014-2015 Alexandre Terrasa <alexandre@moz-code.org>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Templates that compose the `nitrpg` site.
22 # A page in the nitrp site.
26 # URL used as prefix for all the links generated in this page.
29 # Breadcrumbs to this page if any.
30 var breadcrumbs
: nullable Breadcrumbs = null is public
writable
32 # Panels to display in the sidebar.
33 var side_panels
= new Array[Panel]
35 # Panels to display in the page main container.
36 var flow_panels
= new Array[Panel]
38 redef fun rendering
do
43 # Render the header shared by all pages.
49 <meta charset="UTF-8">
50 <title>Github RPG</title>
51 <link rel="stylesheet"
52 href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
53 <link rel="stylesheet" href="{{{root_url}}}/styles/main.css">
56 <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
57 <a class="navbar-brand" href="/">Github RPG</a>"""
58 if not breadcrumbs
== null then
59 add breadcrumbs
.as(not null)
63 <div class="container-fluid">
65 if not side_panels
.is_empty
then
66 add
"""<div class="col-xs-3" id="side">"""
67 for panel
in side_panels
do add panel
69 <div class="col-xs-9" id="flow">"""
71 add
"""<div class="col-xs-12" id="flow">"""
73 for panel
in flow_panels
do add panel
80 # Render the footer shared by all pages.
83 <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
84 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
91 # A Bootstrap breadcrumbs component.
95 # Items to display in this breadcrumb.
96 var entries
= new Array[String]
98 redef fun rendering
do
99 add
"<ol class=\"breadcrumb\
">"
100 for entry
in entries
do
101 add
"<li>{entry}</li>"
106 # Add a link to the breadcrumbs.
107 fun add_link
(href
, name
: String) do
108 entries
.add
"<a href=\"{href}\
">{name}</a>"