From e2bfdfd10cc91c41412bc6492df9369a7c63ad65 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 (cherry picked from commit 1caba2d) --- 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 e038adc8..b2c177ef 100644 --- a/octoprint/server.py +++ b/octoprint/server.py @@ -111,6 +111,7 @@ class PrinterStateConnection(tornadio2.SocketConnection): @app.route("/") def index(): + branch, commit = util.getGitInfo() return render_template( "index.jinja2", ajaxBaseUrl=BASEURL, @@ -119,7 +120,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 1251ae06..a253b96f 100644 --- a/octoprint/static/css/octoprint.less +++ b/octoprint/static/css/octoprint.less @@ -426,15 +426,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 d6d43363..793cc013 100644 --- a/octoprint/templates/index.jinja2 +++ b/octoprint/templates/index.jinja2 @@ -563,7 +563,12 @@