From: Dan Brown Date: Tue, 3 May 2016 20:10:05 +0000 (+0100) Subject: Added bookstack version in settings X-Git-Tag: v0.9.3~1^2 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/4e8722661faaf1f44d6884a48cbd301b40d194d8 Added bookstack version in settings Gets the app version via git. Closes #99 --- diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 1791ccfac..61ce55fa9 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -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]); } /** diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.php index 7c1ec59bf..1d4f2ebda 100644 --- a/resources/views/settings/index.blade.php +++ b/resources/views/settings/index.blade.php @@ -4,11 +4,11 @@ @include('settings/navbar', ['selected' => 'settings']) -
+

Settings

-
+ {!! csrf_field() !!}

App Settings

@@ -94,6 +94,9 @@
+ + BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }} +