Bug fixes

This commit is contained in:
Hillel Coren 2014-04-22 23:10:14 +03:00
parent 4a7432cc41
commit b11ab39a9f
13 changed files with 74 additions and 18 deletions

View File

@ -701,6 +701,8 @@ class AccountController extends \BaseController {
Session::set(REQUESTED_PRO_PLAN, true);
}
Session::set(SESSION_COUNTER, -1);
return "{$user->first_name} {$user->last_name}";
}
}

View File

@ -13,6 +13,9 @@
App::before(function($request)
{
$count = Session::get(SESSION_COUNTER, 0);
Session::put(SESSION_COUNTER, ++$count);
if (App::environment() == ENV_PRODUCTION)
{
if (!Request::secure())

View File

@ -71,6 +71,10 @@ return array(
"unique" => ":attribute ist schon vergeben.",
"url" => "Das Format von :attribute ist ungültig.",
"positive" => "The :attribute must be greater than zero.",
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines

View File

@ -323,7 +323,7 @@ return array(
'field_label' => 'Field Label',
'field_value' => 'Field Value',
'edit' => 'Edit',
'set_name' => 'Set your company name',

View File

@ -71,7 +71,7 @@ return array(
"positive" => "The :attribute must be greater than zero.",
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
/*
|--------------------------------------------------------------------------

View File

@ -73,6 +73,10 @@ return array(
"positive" => ":attribute debe ser mayor que cero.",
"has_credit" => "el cliente no tiene crédito suficiente.",
"positive" => "The :attribute must be greater than zero.",
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
/*
|--------------------------------------------------------------------------

View File

@ -71,6 +71,10 @@ return array(
"unique" => "La valeur du champ :attribute est déjà utilisée.",
"url" => "Le format de l'URL de :attribute n'est pas valide.",
"positive" => "The :attribute must be greater than zero.",
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines

View File

@ -70,6 +70,10 @@ return array(
"unique" => ":attribute è stato già utilizzato.",
"url" => ":attribute deve essere un URL.",
"positive" => "The :attribute must be greater than zero.",
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines

View File

@ -74,6 +74,10 @@ return array(
"positive" => ":attribute moet groter zijn dan nul.",
"has_credit" => "De klant heeft niet voldoende krediet.",
"positive" => "The :attribute must be greater than zero.",
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines

View File

@ -72,6 +72,10 @@ return array(
"positive" => ":attribute deve ser maior que zero.",
"has_credit" => "O cliente não possui crédito suficiente.",
"positive" => "The :attribute must be greater than zero.",
"has_credit" => "The client does not have enough credit.",
"notmasked" => "The values are masked",
/*
|--------------------------------------------------------------------------

View File

@ -114,12 +114,32 @@ class User extends ConfideUser implements UserInterface, RemindableInterface
return !$this->theme_id || in_array($this->theme_id, [2, 3, 5, 6, 7, 8, 10, 11, 12]);
}
public function showSignUpPopOver()
public function getRequestsCount()
{
$count = Session::get(SESSION_COUNTER, 0);
Session::put(SESSION_COUNTER, ++$count);
return Session::get(SESSION_COUNTER, 0);
}
return $count == 1 || $count % 7 == 0;
public function getPopOverText()
{
if (!Auth::check())
{
return false;
}
$count = self::getRequestsCount();
if ($count == 1 || $count % 5 == 0)
{
if (!Utils::isRegistered())
{
return trans('texts.sign_up_to_save');
}
else if (!Auth::user()->account->name)
{
return trans('texts.set_name');
}
}
return false;
}
public function afterSave($success=true, $forced = false)

View File

@ -108,32 +108,29 @@
<div class="navbar-form navbar-right">
@if (Auth::check() && !Auth::user()->registered)
{{ Button::sm_success_primary(trans('texts.sign_up'), array('id' => 'signUpButton', 'data-toggle'=>'modal', 'data-target'=>'#signUpModal')) }} &nbsp;
@endif
@if (Auth::check() && Auth::user()->showSignUpPopOver())
<button id="signUpPopOver" type="button" class="btn btn-default" data-toggle="popover" data-placement="bottom" data-content="{{ trans('texts.sign_up_to_save') }}" data-html="true" style="display:none">
@if (Auth::user()->getPopOverText() && !Utils::isRegistered())
<button id="ninjaPopOver" type="button" class="btn btn-default" data-toggle="popover" data-placement="bottom" data-content="{{ Auth::user()->getPopOverText() }}" data-html="true" style="display:none">
{{ trans('texts.sign_up') }}
</button>
@endif
@if (Auth::user()->getPopOverText())
<script>
$(function() {
$('#signUpPopOver').show().popover('show').hide();
$('#ninjaPopOver').show().popover('show').hide();
$('body').click(function() {
$('#signUpPopOver').popover('hide');
$('#ninjaPopOver').popover('hide');
});
});
</script>
@endif
@endif
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
<span id="myAccountButton">
@if (Auth::user()->registered)
{{ Auth::user()->getFullName() }}
@else
{{ trans('texts.guest') }}
@endif
{{ Auth::user()->getDisplayName() }}
</span>
<span class="caret"></span>
</button>
@ -148,6 +145,16 @@
<li>{{ link_to('#', trans('texts.logout'), array('onclick'=>'logout()')) }}</li>
</ul>
</div>
@if (Auth::user()->getPopOverText() && Utils::isRegistered())
<button id="ninjaPopOver" type="button" class="btn btn-default" data-toggle="popover" data-placement="bottom" data-content="{{ Auth::user()->getPopOverText() }}" data-html="true" style="display:none">
{{ Auth::user()->getDisplayName() }}
</button>
@endif
</div>