Tell view whether we’re in Sandstorm.IO mode.

This commit is contained in:
James Cole 2017-02-05 08:27:23 +01:00
parent 3e510bd3f6
commit 959a1a08f0
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
3 changed files with 10 additions and 4 deletions

View File

@ -15,6 +15,7 @@ use Auth;
use Closure; use Closure;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use View;
/** /**
* Class Sandstorm * Class Sandstorm
@ -37,6 +38,7 @@ class Sandstorm
{ {
// is in Sandstorm environment? // is in Sandstorm environment?
$sandstorm = intval(getenv('SANDSTORM')) === 1; $sandstorm = intval(getenv('SANDSTORM')) === 1;
View::share('SANDSTORM', $sandstorm);
if (!$sandstorm) { if (!$sandstorm) {
return $next($request); return $next($request);
} }
@ -55,6 +57,7 @@ class Sandstorm
'password' => str_random(16), 'password' => str_random(16),
] ]
); );
} }

View File

@ -72,13 +72,13 @@
</span> </span>
</li> </li>
<!-- Notifications: style can be found in dropdown.less --> {% if not SANDSTORM %}
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu"> <li class="dropdown user user-menu">
<span style="cursor:default;color:#fff;padding: 15px;display: block;line-height: 20px;"> <span style="cursor:default;color:#fff;padding: 15px;display: block;line-height: 20px;">
<span class="hidden-xs">{{ Auth.user.email }}</span> <span class="hidden-xs">{{ Auth.user.email }}</span>
</span> </span>
</li> </li>
{% endif %}
<li id="sidebar-toggle"> <li id="sidebar-toggle">
<a href="#" data-toggle="control-sidebar"><i class="fa fa-plus-circle"></i></a> <a href="#" data-toggle="control-sidebar"><i class="fa fa-plus-circle"></i></a>
</li> </li>

View File

@ -136,6 +136,7 @@
</li> </li>
<!-- options and preferences --> <!-- options and preferences -->
<li id="option-menu" <li id="option-menu"
class="{{ activeRoutePartial('admin') }} {{ activeRoutePartial('profile') }} {{ activeRoutePartial('preferences') }} {{ activeRoutePartial('currency') }} treeview"> class="{{ activeRoutePartial('admin') }} {{ activeRoutePartial('profile') }} {{ activeRoutePartial('preferences') }} {{ activeRoutePartial('currency') }} treeview">
<a href="#"> <a href="#">
@ -147,9 +148,11 @@
</a> </a>
<ul class="treeview-menu"> <ul class="treeview-menu">
{% if not SANDSTORM %}
<li class="{{ activeRoutePartial('profile') }}"> <li class="{{ activeRoutePartial('profile') }}">
<a class="{{ activeRouteStrict('profile.index') }}" href="{{ route('profile.index') }}"><i class="fa fa-user fa-fw"></i> {{ 'profile'|_ }}</a> <a class="{{ activeRouteStrict('profile.index') }}" href="{{ route('profile.index') }}"><i class="fa fa-user fa-fw"></i> {{ 'profile'|_ }}</a>
</li> </li>
{% endif %}
<li class="{{ activeRoutePartial('preferences') }}"> <li class="{{ activeRoutePartial('preferences') }}">
<a class="{{ activeRouteStrict('preferences.index') }}" href="{{ route('preferences.index') }}"><i class="fa fa-gear fa-fw"></i> {{ 'preferences'|_ }}</a> <a class="{{ activeRouteStrict('preferences.index') }}" href="{{ route('preferences.index') }}"><i class="fa fa-gear fa-fw"></i> {{ 'preferences'|_ }}</a>
</li> </li>
@ -171,12 +174,12 @@
<!-- other options --> <!-- other options -->
{% if not SANDSTORM %}
<li> <li>
<a href="{{ route('logout') }}"> <a href="{{ route('logout') }}">
<i class="fa fa-sign-out fa-fw"></i> <i class="fa fa-sign-out fa-fw"></i>
<span>{{ 'logout'|_ }}</span> <span>{{ 'logout'|_ }}</span>
</a> </a>
</li> </li>
{% endif %}
</ul> </ul>