Minor fixes

This commit is contained in:
Hillel Coren 2016-06-05 21:08:41 +03:00
parent 85d94b5a36
commit d5669fdbf9
5 changed files with 97 additions and 80 deletions

View File

@ -206,7 +206,7 @@ class AccountController extends BaseController
}
}
if (!empty($new_plan)) {
if (!empty($new_plan) && $new_plan['plan'] != PLAN_FREE) {
$time_used = $planDetails['paid']->diff(date_create());
$days_used = $time_used->days;
@ -1320,12 +1320,14 @@ class AccountController extends BaseController
}
$account = Auth::user()->account;
$invitation = $invoice->invitations->first();
// replace the variables with sample data
$data = [
'account' => $account,
'invoice' => $invoice,
'invitation' => $invoice->invitations->first(),
'invitation' => $invitation,
'link' => $invitation->getLink(),
'client' => $invoice->client,
'amount' => $invoice->amount
];

View File

@ -39,6 +39,13 @@ class AccountGatewayController extends BaseController
return $this->accountGatewayService->getDatatable(Auth::user()->account_id);
}
public function show($publicId)
{
Session::reflash();
return Redirect::to("gateways/$publicId/edit");
}
public function edit($publicId)
{
$accountGateway = AccountGateway::scope($publicId)->firstOrFail();

View File

@ -309,6 +309,10 @@ Route::get('/forgot', function() {
Route::get('/feed', function() {
return Redirect::to(NINJA_WEB_URL.'/feed', 301);
});
Route::get('/comments/feed', function() {
return Redirect::to(NINJA_WEB_URL.'/comments/feed', 301);
});
if (!defined('CONTACT_EMAIL')) {
define('CONTACT_EMAIL', Config::get('mail.from.address'));

View File

@ -1,6 +1,6 @@
@extends('header')
@section('content')
@section('content')
@parent
@include('accounts.nav', ['selected' => ACCOUNT_MANAGEMENT])
@ -134,10 +134,10 @@
<div class="modal-footer" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.go_back') }}</button>
@if ($planDetails && $planDetails['active'])
<button type="button" class="btn btn-primary" onclick="confirmChangePlan()">{{ trans('texts.plan_change') }}</button>
<button type="button" class="btn btn-primary" onclick="confirmChangePlan()">{{ trans('texts.plan_change') }}</button>
@else
<button type="button" class="btn btn-success" onclick="confirmChangePlan()">{{ trans('texts.plan_upgrade') }}</button>
@endif
<button type="button" class="btn btn-success" onclick="confirmChangePlan()">{{ trans('texts.plan_upgrade') }}</button>
@endif
</div>
</div>
</div>
@ -165,12 +165,12 @@
<div style="background-color: #fff; padding-left: 16px; padding-right: 16px">
&nbsp;<p>{{ trans('texts.cancel_account_message') }}</p>&nbsp;
&nbsp;<p>{!! Former::textarea('reason')->placeholder(trans('texts.reason_for_canceling'))->raw() !!}</p>&nbsp;
&nbsp;<p>{!! Former::textarea('reason')->placeholder(trans('texts.reason_for_canceling'))->raw() !!}</p>&nbsp;
</div>
<div class="modal-footer" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.go_back') }}</button>
<button type="button" class="btn btn-danger" onclick="confirmCancel()">{{ trans('texts.cancel_account') }}</button>
<button type="button" class="btn btn-danger" onclick="confirmCancel()">{{ trans('texts.cancel_account') }}</button>
</div>
</div>
@ -182,7 +182,7 @@
<script type="text/javascript">
function showChangePlan() {
$('#changePlanModel').modal('show');
$('#changePlanModel').modal('show');
}
function confirmChangePlan() {
@ -190,13 +190,13 @@
}
function showConfirm() {
$('#confirmCancelModal').modal('show');
$('#confirmCancelModal').modal('show');
}
function confirmCancel() {
$('form.cancel-account').submit();
}
}
@if ($account->company->pending_plan)
function cancelPendingChange(){
$('#plan').val('{{ $planDetails['plan'] }}')
@ -205,12 +205,12 @@
return false;
}
@endif
jQuery(document).ready(function($){
function updatePlanModal() {
var plan = $('#plan').val();
$('#plan_term').closest('.form-group').toggle(plan!='free');
if(plan=='{{PLAN_PRO}}'){
$('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>PLAN_PRICE_PRO_MONTHLY])) !!});
$('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>PLAN_PRICE_PRO_YEARLY])) !!});
@ -221,11 +221,15 @@
}
$('#plan_term, #plan').change(updatePlanModal);
updatePlanModal();
if(window.location.hash) {
var hash = window.location.hash;
$(hash).modal('toggle');
}
@if (Request::input('upgrade'))
showChangePlan();
@endif
});
</script>
@stop
@stop

View File

@ -4,25 +4,25 @@
@section('head')
<link href="//fonts.googleapis.com/css?family=Roboto:400,700,900,100|Roboto+Slab:400,300,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link href="{{ asset('css/built.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('css/built.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
<style type="text/css">
body {
background-color: #EEEEEE;
padding-top: 114px;
padding-top: 114px;
}
/* Fix for header covering stuff when the screen is narrower */
@media screen and (min-width: 1200px) {
body {
padding-top: 56px;
padding-top: 56px;
}
}
@media screen and (max-width: 768px) {
body {
padding-top: 56px;
padding-top: 56px;
}
}
@ -53,12 +53,12 @@
}
@if (!Auth::check() || !Auth::user()->registered)
function validateSignUp(showError)
function validateSignUp(showError)
{
var isFormValid = true;
$(['first_name','last_name','email','password']).each(function(i, field) {
var $input = $('form.signUpForm #new_'+field),
val = $.trim($input.val());
val = $.trim($input.val());
var isValid = val && val.length >= (field == 'password' ? 6 : 1);
if (isValid && field == 'email') {
isValid = isValidEmailAddress(val);
@ -96,8 +96,8 @@
type: 'POST',
url: '{{ URL::to('signup/validate') }}',
data: 'email=' + $('form.signUpForm #new_email').val(),
success: function(result) {
if (result == 'available') {
success: function(result) {
if (result == 'available') {
submitSignUp();
} else {
$('#errorTaken').show();
@ -106,19 +106,19 @@
$('#working').hide();
}
}
});
});
}
function submitSignUp() {
$.ajax({
type: 'POST',
url: '{{ URL::to('signup/submit') }}',
data: 'new_email=' + encodeURIComponent($('form.signUpForm #new_email').val()) +
'&new_password=' + encodeURIComponent($('form.signUpForm #new_password').val()) +
'&new_first_name=' + encodeURIComponent($('form.signUpForm #new_first_name').val()) +
data: 'new_email=' + encodeURIComponent($('form.signUpForm #new_email').val()) +
'&new_password=' + encodeURIComponent($('form.signUpForm #new_password').val()) +
'&new_first_name=' + encodeURIComponent($('form.signUpForm #new_first_name').val()) +
'&new_last_name=' + encodeURIComponent($('form.signUpForm #new_last_name').val()) +
'&go_pro=' + $('#go_pro').val(),
success: function(result) {
success: function(result) {
if (result) {
handleSignedUp();
NINJA.isRegistered = true;
@ -142,7 +142,7 @@
function checkForEnter(event)
{
if (event.keyCode === 13){
event.preventDefault();
event.preventDefault();
validateServerSignUp();
return false;
}
@ -154,10 +154,10 @@
NINJA.formIsChanged = false;
}
if (force || NINJA.isRegistered) {
if (force || NINJA.isRegistered) {
window.location = '{{ URL::to('logout') }}';
} else {
$('#logoutModal').modal('show');
$('#logoutModal').modal('show');
}
}
@ -197,7 +197,7 @@
window.location = '/settings/account_management#changePlanModel';
}
} else {
$('#proPlanModal').modal('hide');
$('#proPlanModal').modal('hide');
$('#go_pro').val('true');
showSignUp();
}
@ -262,7 +262,7 @@
$('#navbar-options').hide();
$('#search-form').show();
$('#search').focus();
if (!window.loadedSearchData) {
trackEvent('/activity', '/search');
$.get('{{ URL::route('getSearchData') }}', function(data) {
@ -279,7 +279,7 @@
templates: {
header: '&nbsp;<span style="font-weight:600;font-size:16px">{{ Auth::user()->account->custom_client_label1 }}</span>'
}
}
}
@endif
@if (Auth::check() && Auth::user()->account->custom_client_label2)
,{
@ -290,7 +290,7 @@
templates: {
header: '&nbsp;<span style="font-weight:600;font-size:16px">{{ Auth::user()->account->custom_client_label2 }}</span>'
}
}
}
@endif
@foreach (['clients', 'contacts', 'invoices', 'quotes', 'navigation'] as $type)
,{
@ -305,19 +305,19 @@
@endforeach
).on('typeahead:selected', function(element, datum, name) {
window.location = datum.url;
}).focus();
}).focus();
window.loadedSearchData = true;
});
}
}
function hideSearch() {
$('#search-form').hide();
$('#navbar-options').show();
}
$(function() {
window.setTimeout(function() {
window.setTimeout(function() {
$(".alert-hide").fadeOut();
}, 3000);
@ -341,7 +341,7 @@
$(['first_name','last_name','email','password']).each(function(i, field) {
var $input = $('form.signUpForm #new_'+field);
if (!$input.val()) {
$input.focus();
$input.focus();
return false;
}
});
@ -350,7 +350,7 @@
@if (Auth::check() && !Utils::isNinja() && !Auth::user()->registered)
$('#closeSignUpButton').hide();
showSignUp();
showSignUp();
@elseif(Session::get('sign_up') || Input::get('sign_up'))
showSignUp();
@endif
@ -385,7 +385,7 @@
});
</script>
</script>
@stop
@ -404,7 +404,7 @@
<a href="{{ URL::to(NINJA_WEB_URL) }}" class='navbar-brand' target="_blank">
{{-- Per our license, please do not remove or modify this link. --}}
<img src="{{ asset('images/invoiceninja-logo.png') }}" style="height:20px;width:auto;padding-right:10px"/>
</a>
</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse-1">
@ -423,7 +423,7 @@
@if (!Auth::user()->registered)
{!! Button::success(trans('texts.sign_up'))->withAttributes(array('id' => 'signUpButton', 'data-toggle'=>'modal', 'data-target'=>'#signUpModal', 'style' => 'max-width:100px;;overflow:hidden'))->small() !!} &nbsp;
@elseif (Utils::isNinjaProd() && (!Auth::user()->isPro() || Auth::user()->isTrial()))
{!! Button::success(trans('texts.go_pro'))->withAttributes(array('id' => 'proPlanButton', 'onclick' => 'showProPlan("")', 'style' => 'max-width:100px;overflow:hidden'))->small() !!} &nbsp;
{!! Button::success(trans('texts.plan_upgrade'))->asLinkTo(url('/settings/account_management?upgrade=true'))->withAttributes(array('style' => 'max-width:100px;overflow:hidden'))->small() !!} &nbsp;
@endif
@endif
@ -437,9 +437,9 @@
@endif
<span class="caret"></span>
</div>
<span class="glyphicon glyphicon-user nav-account-icon" style="padding-left:0px"
title="{{ Auth::user()->account->getDisplayName() }}"/>
</button>
<span class="glyphicon glyphicon-user nav-account-icon" style="padding-left:0px"
title="{{ Auth::user()->account->getDisplayName() }}"/>
</button>
<ul class="dropdown-menu user-accounts">
@if (session(SESSION_USER_ACCOUNTS))
@foreach (session(SESSION_USER_ACCOUNTS) as $item)
@ -468,12 +468,12 @@
@endforeach
@else
@include('user_account', [
'account_name' => Auth::user()->account->name ?: trans('texts.untitled'),
'account_name' => Auth::user()->account->name ?: trans('texts.untitled'),
'user_name' => Auth::user()->getDisplayName(),
'logo_url' => Auth::user()->account->getLogoURL(),
'selected' => true,
])
@endif
@endif
<li class="divider"></li>
@if (Utils::isAdmin())
@if (count(session(SESSION_USER_ACCOUNTS)) > 1)
@ -486,9 +486,9 @@
</ul>
</div>
</div>
<ul class="nav navbar-nav navbar-right navbar-settings">
</div>
<ul class="nav navbar-nav navbar-right navbar-settings">
<li class="dropdown">
@if (Utils::isAdmin())
<a href="{{ URL::to('/settings') }}" class="dropdown-toggle">
@ -509,18 +509,18 @@
</ul>
<ul class="nav navbar-nav navbar-right navbar-search">
<ul class="nav navbar-nav navbar-right navbar-search">
<li class="dropdown">
<a href="#" onclick="showSearch()">
<span class="glyphicon glyphicon-search" title="{{ trans('texts.search') }}"/>
</a>
<ul class="dropdown-menu">
<ul class="dropdown-menu">
@if (count(Session::get(RECENTLY_VIEWED)) == 0)
<li><a href="#">{{ trans('texts.no_items') }}</a></li>
@else
@foreach (Session::get(RECENTLY_VIEWED) as $link)
@if (property_exists($link, 'accountId') && $link->accountId == Auth::user()->account_id)
<li><a href="{{ $link->url }}">{{ $link->name }}</a></li>
<li><a href="{{ $link->url }}">{{ $link->name }}</a></li>
@endif
@endforeach
@endif
@ -531,12 +531,12 @@
<form id="search-form" class="navbar-form navbar-right" role="search" style="display:none">
<div class="form-group">
<input type="text" id="search" style="width: 240px;padding-top:0px;padding-bottom:0px"
<input type="text" id="search" style="width: 240px;padding-top:0px;padding-bottom:0px"
class="form-control" placeholder="{{ trans('texts.search') . ': ' . trans('texts.search_hotkey')}}">
</div>
</form>
</div><!-- /.navbar-collapse -->
@ -545,7 +545,7 @@
<br/>
<div class="container">
@include('partials.warn_session', ['redirectTo' => '/dashboard'])
@if (Session::has('warning'))
@ -558,8 +558,8 @@
</div>
@elseif (Session::has('news_feed_message'))
<div class="alert alert-info">
{!! Session::get('news_feed_message') !!}
<a href="#" onclick="hideMessage()" class="pull-right">{{ trans('texts.hide') }}</a>
{!! Session::get('news_feed_message') !!}
<a href="#" onclick="hideMessage()" class="pull-right">{{ trans('texts.hide') }}</a>
</div>
@endif
@ -571,7 +571,7 @@
{!! Form::breadcrumbs(isset($entityStatus) ? $entityStatus : '') !!}
@endif
@yield('content')
@yield('content')
</div>
@ -600,7 +600,7 @@
{!! Former::text('go_pro') !!}
</div>
<div class="row signup-form">
<div class="col-md-11 col-md-offset-1">
{!! Former::checkbox('terms_checkbox')->label(' ')->text(trans('texts.agree_to_terms', ['terms' => '<a href="'.URL::to('terms').'" target="_blank">'.trans('texts.terms_of_service').'</a>']))->raw() !!}
@ -610,7 +610,7 @@
<div class="col-md-4 col-md-offset-1">
<h4>{{ trans('texts.sign_up_using') }}</h4><br/>
@foreach (App\Services\AuthService::$providers as $provider)
<a href="{{ URL::to('auth/' . $provider) }}" class="btn btn-primary btn-block"
<a href="{{ URL::to('auth/' . $provider) }}" class="btn btn-primary btn-block"
onclick="setSocialLoginProvider('{{ strtolower($provider) }}')" id="{{ strtolower($provider) }}LoginButton">
<i class="fa fa-{{ strtolower($provider) }}"></i> &nbsp;
{{ $provider }}
@ -623,12 +623,12 @@
<div style="border-right:thin solid #CCCCCC;height:110px;width:8px;margin-top:10px;"></div>
</div>
<div class="col-md-6">
@else
@else
<div class="col-md-12">
@endif
{{ Former::setOption('TwitterBootstrap3.labelWidths.large', 1) }}
{{ Former::setOption('TwitterBootstrap3.labelWidths.small', 1) }}
{!! Former::text('new_first_name')
->placeholder(trans('texts.first_name'))
->autocomplete('given-name')
@ -644,7 +644,7 @@
{!! Former::password('new_password')
->placeholder(trans('texts.password'))
->label(' ') !!}
{{ Former::setOption('TwitterBootstrap3.labelWidths.large', 4) }}
{{ Former::setOption('TwitterBootstrap3.labelWidths.small', 4) }}
</div>
@ -655,9 +655,9 @@
</div>
{!! Former::close() !!}
<center><div id="errorTaken" style="display:none">&nbsp;<br/>{{ trans('texts.email_taken') }}</div></center>
<br/>
@ -679,7 +679,7 @@
<br/>&nbsp;
</div>
<div class="modal-footer" id="signUpFooter" style="margin-top: 0px">
<div class="modal-footer" id="signUpFooter" style="margin-top: 0px">
<button type="button" class="btn btn-default" id="closeSignUpButton" data-dismiss="modal">{{ trans('texts.close') }} <i class="glyphicon glyphicon-remove-circle"></i></button>
<button type="button" class="btn btn-primary" id="saveSignUpButton" onclick="validateServerSignUp()" disabled>{{ trans('texts.save') }} <i class="glyphicon glyphicon-floppy-disk"></i></button>
</div>
@ -696,14 +696,14 @@
<h4 class="modal-title" id="myModalLabel">{{ trans('texts.logout') }}</h4>
</div>
<div class="container">
<div class="container">
<h3>{{ trans('texts.are_you_sure') }}</h3>
<p>{{ trans('texts.erase_data') }}</p>
<p>{{ trans('texts.erase_data') }}</p>
</div>
<div class="modal-footer" id="signUpFooter">
<div class="modal-footer" id="signUpFooter">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.cancel') }}</button>
<button type="button" class="btn btn-primary" onclick="logout(true)">{{ trans('texts.logout') }}</button>
<button type="button" class="btn btn-primary" onclick="logout(true)">{{ trans('texts.logout') }}</button>
</div>
</div>
</div>
@ -717,7 +717,7 @@
<div class="pull-right">
<img onclick="hideProPlan()" class="close" src="{{ asset('images/pro_plan/close.png') }}"/>
</div>
</div>
<div class="row">
<div class="col-md-7 left-side">
@ -758,7 +758,7 @@
@if (Utils::isNinjaProd())
@if (Auth::check() && Auth::user()->isTrial())
{!! trans(Auth::user()->account->getCountTrialDaysLeft() == 0 ? 'texts.trial_footer_last_day' : 'texts.trial_footer', [
'count' => Auth::user()->account->getCountTrialDaysLeft(),
'count' => Auth::user()->account->getCountTrialDaysLeft(),
'link' => '<a href="javascript:submitProPlan()">' . trans('texts.click_here') . '</a>'
]) !!}
@endif
@ -766,8 +766,8 @@
{{ trans('texts.powered_by') }}
{{-- Per our license, please do not remove or modify this section. --}}
{!! link_to('https://www.invoiceninja.com/?utm_source=powered_by', 'InvoiceNinja.com', ['target' => '_blank', 'title' => 'invoiceninja.com']) !!} -
{!! link_to(RELEASES_URL, 'v' . NINJA_VERSION, ['target' => '_blank', 'title' => trans('texts.trello_roadmap')]) !!} |
@if (Auth::user()->account->hasFeature(FEATURE_WHITE_LABEL))
{!! link_to(RELEASES_URL, 'v' . NINJA_VERSION, ['target' => '_blank', 'title' => trans('texts.trello_roadmap')]) !!} |
@if (Auth::user()->account->hasFeature(FEATURE_WHITE_LABEL))
{{ trans('texts.white_labeled') }}
@else
<a href="#" onclick="loadImages('#whiteLabelModal');$('#whiteLabelModal').modal('show');">{{ trans('texts.white_label_link') }}</a>
@ -794,7 +794,7 @@
</div>
</div>
<div class="modal-footer" id="signUpFooter" style="margin-top: 0px">
<div class="modal-footer" id="signUpFooter" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.close') }} </button>
{{-- DropdownButton::success_lg(trans('texts.buy'), [
['url' => URL::to(""), 'label' => trans('texts.pay_with_paypal')],