diff --git a/app/Models/Account.php b/app/Models/Account.php index cca359734ee0..876804bf42a7 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -726,6 +726,10 @@ class Account extends Eloquent public function isTrial() { + if (!Utils::isNinjaProd()) { + return false; + } + if ($this->pro_plan_paid && $this->pro_plan_paid != '0000-00-00') { return false; } diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index 5b7ff15ba803..74d293ed4232 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -258,20 +258,12 @@ localStorage.setItem('auth_provider', provider); } - $(function() { - window.setTimeout(function() { - $(".alert-hide").fadeOut(); - }, 3000); - - $('#search').blur(function(){ - $('#search').css('width', '110px'); - $('ul.navbar-right').show(); - }); - - $('#search').focus(function(){ - $('#search').css('width', '224px'); - $('ul.navbar-right').hide(); - if (!window.hasOwnProperty('searchData')) { + function showSearch() { + $('#search-form').show(); + $('#navbar-options').hide(); + if (window.hasOwnProperty('searchData')) { + $('#search').focus(); + } else { trackEvent('/activity', '/search'); $.get('{{ URL::route('getSearchData') }}', function(data) { window.searchData = true; @@ -291,11 +283,25 @@ $('#search').typeahead(datasets).on('typeahead:selected', function(element, datum, name) { var type = name == 'Contacts' ? 'clients' : name.toLowerCase(); window.location = '{{ URL::to('/') }}' + '/' + type + '/' + datum.public_id; - }).focus().typeahead('setQuery', $('#search').val()); + }).focus().typeahead('setQuery', $('#search').val()); }); - } - }); + } + } + function hideSearch() { + $('#search').typeahead('setQuery', ''); + $('#search-form').hide(); + $('#navbar-options').show(); + } + + $(function() { + window.setTimeout(function() { + $(".alert-hide").fadeOut(); + }, 3000); + + $('#search').blur(function(){ + hideSearch(); + }); if (isStorageSupported()) { @if (Auth::check() && !Auth::user()->registered) @@ -378,18 +384,19 @@ {!! HTML::menu_link('payment') !!} +