]> BookStack Code Mirror - bookstack/commitdiff
Added bookstack version in settings
authorDan Brown <redacted>
Tue, 3 May 2016 20:10:05 +0000 (21:10 +0100)
committerDan Brown <redacted>
Tue, 3 May 2016 20:10:05 +0000 (21:10 +0100)
Gets the app version via git. Closes #99

app/Http/Controllers/SettingController.php
resources/views/settings/index.blade.php

index 1791ccface8876754ce9dc6127891ef4a79732ae..61ce55fa9405921c65cd5684c33fb4b42cb9d0d1 100644 (file)
@@ -15,7 +15,14 @@ class SettingController extends Controller
     {
         $this->checkPermission('settings-manage');
         $this->setPageTitle('Settings');
-        return view('settings/index');
+
+        // Get application version
+        $version = false;
+        if (function_exists('exec')) {
+            $version = exec('git describe --always --tags ');
+        }
+
+        return view('settings/index', ['version' => $version]);
     }
 
     /**
index 7c1ec59bfd44c6189c98b0313aa64230039c834e..1d4f2ebda8ed221abb9f2954bc920f29ae3c4dc8 100644 (file)
@@ -4,11 +4,11 @@
 
     @include('settings/navbar', ['selected' => 'settings'])
 
-<div class="container small">
+<div class="container small settings-container">
 
     <h1>Settings</h1>
 
-    <form action="/settings" method="POST">
+    <form action="/settings" method="POST" ng-cloak>
         {!! csrf_field() !!}
 
         <h3>App Settings</h3>
@@ -94,6 +94,9 @@
         <hr class="margin-top">
 
         <div class="form-group">
+            <span class="float right muted">
+                BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
+            </span>
             <button type="submit" class="button pos">Save Settings</button>
         </div>
     </form>