1 Namespaces

(ns exam-vault.views.layout
  (:require [hiccup.page :refer [html5 include-css]]
	    [hiccup.form :refer [form-to text-field password-field submit-button]]))

2 Meta data

(defn meta-data [title]
  [:head
   [:title title]
   (include-css "/css/ui-elements.css")
   (include-css "/css/screen.css")
  (str
   "<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-40809630-4', 'auto');
  ga('send', 'pageview');
</script>")])

3 Login

(defn meta-data-login [title]
  [:head
   [:title title]
   (include-css "/css/ui-elements.css")
   (include-css "/css/gateway.css")])

4 Header

(defn universal-header []
  [:header {:id "universal-header"}
   [:section {:class "global-nav"} [:h1 [:em "NCL"] [:strong "Exams"]]]])

5 Header with login

(defn universal-header-with-login []
  [:header {:id "universal-header"}
   [:section {:class "global-nav"} [:h1 [:em "NCL"] [:strong "Exams"]]
(form-to [:post "/logout"] (submit-button "Log Out"))]])

6 Main Container

Main container for the app

(defn container [& sections] [:section {:id "app"} sections])

7 Common

(defn common [& body]
  (html5
   (meta-data "NCLExams")
   [:body (universal-header-with-login) (container body)]))

8 Login

(defn login [& body]
  (html5
   (meta-data-login "Welcome to NCLVerse")
   [:body body]))