diff --git a/resources/public/css/app.css b/resources/public/css/app.css index aa4264d..da22c51 100644 --- a/resources/public/css/app.css +++ b/resources/public/css/app.css @@ -1,3 +1,30 @@ +html, body { + height: 100%; +} + +#wrap { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -60px; +} + +#push, #footer { + height: 60px; +} + +#app-body { + padding-bottom: 40px; +} + +#footer { + background-color: #f5f5f5; +} + +#footer .content { + margin: 20px 0; +} + div.popover.card-image { max-width: none; } diff --git a/src/mtgcoll/routes/main_page.clj b/src/mtgcoll/routes/main_page.clj index 3bedc67..c0b0b3d 100644 --- a/src/mtgcoll/routes/main_page.clj +++ b/src/mtgcoll/routes/main_page.clj @@ -1,11 +1,14 @@ (ns mtgcoll.routes.main-page (:require + [clojure.string :as string] [compojure.core :refer [routes GET POST]] [hiccup.page :refer [include-css include-js]] [hiccup.element :refer [javascript-tag]] [webtools.page :refer [html5 js-env-settings]] [webtools.reagent.page :refer [include-bootstrap-metatags include-bootstrap-css]] - [mtgcoll.config :as config])) + [mtgcoll.config :as config]) + (:use + mtgcoll.utils)) (defn main-page [request] @@ -16,7 +19,15 @@ (include-bootstrap-css true) (include-css "css/app.css")] [:body - [:div#app [:h1 "Please wait, loading ..."]] + [:div#wrap + [:div#app [:h1 "Please wait, loading ..."]] + [:div#push]] + [:div#footer + [:div.container-fluid + [:div.content.text-center.text-muted + "mtgcoll " (get-app-version) "  |  " + [:a {:href "https://github.com/gered/mtgcoll"} "Source code"] " licensed under MIT."] + ]] (js-env-settings "" (boolean (config/get :dev?))) (include-js "cljs/app.js")])) diff --git a/src/mtgcoll/utils.clj b/src/mtgcoll/utils.clj index e744f99..cfb6201 100644 --- a/src/mtgcoll/utils.clj +++ b/src/mtgcoll/utils.clj @@ -5,7 +5,8 @@ [clj-http.client :as http]) (:import (java.io ByteArrayInputStream InputStream) - (java.text Normalizer Normalizer$Form))) + (java.text Normalizer Normalizer$Form) + (java.util Properties))) (def chrome-osx-request-headers {"User-Agent" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36" @@ -57,3 +58,14 @@ (if (< (count s) n) (->> (repeat c) (concat s) (take n) (string/join)) s))) + +(defn get-app-version + [] + (if-let [version (System/getProperty "mtgcoll.version")] + version + (-> (doto (Properties.) + (.load (-> "META-INF/maven/%s/%s/pom.properties" + (format "mtgcoll" "mtgcoll") + (io/resource) + (io/reader)))) + (.get "version"))))