# This file is part of NIT ( http://www.nitlanguage.org ). # # Copyright 2014-2015 Alexandre Terrasa # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Templates that compose the `nitrpg` site. module templates import panels # A page in the nitrp site. class NitRpgPage super Template # URL used as prefix for all the links generated in this page. var root_url: String # Breadcrumbs to this page if any. var breadcrumbs: nullable Breadcrumbs = null is public writable # Panels to display in the sidebar. var side_panels = new Array[Panel] # Panels to display in the page main container. var flow_panels = new Array[Panel] redef fun rendering do render_header render_footer end # Render the header shared by all pages. fun render_header do add """ Github RPG
""" if not side_panels.is_empty then add """
""" for panel in side_panels do add panel add """
""" else add """
""" end for panel in flow_panels do add panel add """
""" end # Render the footer shared by all pages. fun render_footer do add """ """ end end # A Bootstrap breadcrumbs component. class Breadcrumbs super Template # Items to display in this breadcrumb. var entries = new Array[String] redef fun rendering do add "
    " for entry in entries do add "
  1. {entry}
  2. " end add "
" end # Add a link to the breadcrumbs. fun add_link(href, name: String) do entries.add "{name}" end end