From 1caba2d634980ca12f0688ec948c1587b738267e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sat, 29 Jun 2013 13:41:39 +0200 Subject: [PATCH] Added git information to website --- octoprint/server.py | 5 ++++- octoprint/static/css/octoprint.less | 21 ++++++++++++++------- octoprint/templates/index.jinja2 | 7 ++++++- octoprint/util/__init__.py | 22 +++++++++++++++++++++- 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/octoprint/server.py b/octoprint/server.py index 3c8d38f..387bd77 100644 --- a/octoprint/server.py +++ b/octoprint/server.py @@ -130,6 +130,7 @@ class PrinterStateConnection(tornadio2.SocketConnection): @app.route("/") def index(): + branch, commit = util.getGitInfo() return render_template( "index.jinja2", ajaxBaseUrl=BASEURL, @@ -138,7 +139,9 @@ def index(): enableGCodeVisualizer=settings().get(["feature", "gCodeVisualizer"]), enableSystemMenu=settings().get(["system"]) is not None and settings().get(["system", "actions"]) is not None and len(settings().get(["system", "actions"])) > 0, enableAccessControl=userManager is not None, - enableSdSupport=settings().get(["feature", "sdSupport"]) + enableSdSupport=settings().get(["feature", "sdSupport"]), + gitBranch=branch, + gitCommit=commit ) #~~ Printer control diff --git a/octoprint/static/css/octoprint.less b/octoprint/static/css/octoprint.less index d2de9d8..37165c3 100644 --- a/octoprint/static/css/octoprint.less +++ b/octoprint/static/css/octoprint.less @@ -441,15 +441,22 @@ ul.dropdown-menu li a { /** Footer */ .footer { - text-align: right; + ul { + margin: 0; - ul li { - display: inline; - margin-left: 1em; - font-size: 85%; - a { - color: #555; + li { + &:first-child { + margin-left: 0; + } + + display: inline; + margin-left: 1em; + font-size: 85%; + a { + color: #555; + } } + } } diff --git a/octoprint/templates/index.jinja2 b/octoprint/templates/index.jinja2 index eef6c31..c0ea7be 100644 --- a/octoprint/templates/index.jinja2 +++ b/octoprint/templates/index.jinja2 @@ -568,7 +568,12 @@