Bug fixes

This commit is contained in:
Hillel Coren 2015-06-10 23:55:23 +03:00
parent a2b4c25a56
commit fcaacdf48b
28 changed files with 387 additions and 79 deletions

View File

@ -229,8 +229,9 @@ class InvoiceController extends BaseController
} }
foreach(Gateway::$paymentTypes as $type) { foreach(Gateway::$paymentTypes as $type) {
if ($account->getGatewayByType($type)) { if ($account->getGatewayByType($type)) {
$typeLink = strtolower(str_replace('PAYMENT_TYPE_', '', $type));
$paymentTypes[] = [ $paymentTypes[] = [
'url' => URL::to("/payment/{$invitation->invitation_key}/{$type}"), 'label' => trans('texts.'.strtolower($type)) 'url' => URL::to("/payment/{$invitation->invitation_key}/{$typeLink}"), 'label' => trans('texts.'.strtolower($type))
]; ];
} }
} }

View File

@ -292,7 +292,9 @@ class PaymentController extends BaseController
$account = $client->account; $account = $client->account;
$useToken = false; $useToken = false;
if (!$paymentType) { if ($paymentType) {
$paymentType = 'PAYMENT_TYPE_' . strtoupper($paymentType);
} else {
$paymentType = Session::get('payment_type', $account->account_gateways[0]->getPaymentType()); $paymentType = Session::get('payment_type', $account->account_gateways[0]->getPaymentType());
} }
if ($paymentType == PAYMENT_TYPE_TOKEN) { if ($paymentType == PAYMENT_TYPE_TOKEN) {

View File

@ -204,6 +204,9 @@ Route::get('/testimonials', function() {
Route::get('/compare-online-invoicing{sites?}', function() { Route::get('/compare-online-invoicing{sites?}', function() {
return Redirect::to(NINJA_WEB_URL, 301); return Redirect::to(NINJA_WEB_URL, 301);
}); });
Route::get('/forgot_password', function() {
return Redirect::to(NINJA_APP_URL.'/forgot', 301);
});
define('CONTACT_EMAIL', Config::get('mail.from.address')); define('CONTACT_EMAIL', Config::get('mail.from.address'));

View File

@ -39,6 +39,14 @@ class Gateway extends Eloquent
return '/images/gateways/logo_'.$this->provider.'.png'; return '/images/gateways/logo_'.$this->provider.'.png';
} }
public static function getPaymentTypeLinks() {
$data = [];
foreach (self::$paymentTypes as $type) {
$data[] = strtolower(str_replace('PAYMENT_TYPE_', '', $type));
}
return $data;
}
public function getHelp() public function getHelp()
{ {
$link = ''; $link = '';

View File

@ -7,6 +7,7 @@ use URL;
use App\Models\Invoice; use App\Models\Invoice;
use App\Models\Payment; use App\Models\Payment;
use App\Models\Activity; use App\Models\Activity;
use App\Models\Gateway;
use App\Events\InvoiceSent; use App\Events\InvoiceSent;
class ContactMailer extends Mailer class ContactMailer extends Mailer
@ -43,15 +44,8 @@ class ContactMailer extends Mailer
]; ];
// Add variables for available payment types // Add variables for available payment types
foreach([PAYMENT_TYPE_CREDIT_CARD, PAYMENT_TYPE_PAYPAL, PAYMENT_TYPE_BITCOIN] as $type) { foreach (Gateway::getPaymentTypeLinks() as $type) {
if ($invoice->account->getGatewayByType($type)) { $variables["\${$type}_link"] = URL::to("/payment/{$invitation->invitation_key}/{$type}");
// Changes "PAYMENT_TYPE_CREDIT_CARD" to "$credit_card_link"
$gateway_slug = '$'.strtolower(str_replace('PAYMENT_TYPE_', '', $type)).'_link';
$variables[$gateway_slug] = URL::to("/payment/{$invitation->invitation_key}/{$type}");
}
} }
$data['body'] = str_replace(array_keys($variables), array_values($variables), $emailTemplate); $data['body'] = str_replace(array_keys($variables), array_values($variables), $emailTemplate);

77
public/css/built.css vendored
View File

@ -3268,3 +3268,80 @@ a .glyphicon,
button .glyphicon { button .glyphicon {
padding-left: 8px; padding-left: 8px;
} }
.pro-plan-modal {
background-color: #4b4b4b;
padding-bottom: 40px;
padding-right: 25px;
/*opacity:0.96 !important;*/
}
.pro-plan-modal .left-side {
margin-top: 50px;
}
.pro-plan-modal h2 {
color: #36c157;
font-size: 71px;
font-weight: 800;
}
.pro-plan-modal img.price {
height: 90px;
}
.pro-plan-modal a.button {
font-family: 'roboto_slabregular', Georgia, Times, serif;
background: #f38c4f;
background: -moz-linear-gradient(top, #f38c4f 0%, #db7134 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f38c4f), color-stop(100%,#db7134));
background: -webkit-linear-gradient(top, #f38c4f 0%,#db7134 100%);
background: -o-linear-gradient(top, #f38c4f 0%,#db7134 100%);
background: -ms-linear-gradient(top, #f38c4f 0%,#db7134 100%);
background: linear-gradient(to bottom, #f38c4f 0%,#db7134 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f38c4f', endColorstr='#db7134',GradientType=0 );
text-shadow: 1px 1px 1px rgba(0, 0, 0, .25);
width: 68%;
margin-top: 20px;
font-size: 28px;
color: #fff;
border-radius: 10px;
padding: 20px 0;
display: inline-block;
text-decoration: none;
}
.pro-plan-modal a.button:hover {
background: #db7134; /* Old browsers */
background: -moz-linear-gradient(top, #db7134 0%, #f38c4f 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#db7134), color-stop(100%,#f38c4f)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #db7134 0%,#f38c4f 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #db7134 0%,#f38c4f 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #db7134 0%,#f38c4f 100%); /* IE10+ */
background: linear-gradient(to bottom, #db7134 0%,#f38c4f 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#db7134', endColorstr='#f38c4f',GradientType=0 ); /* IE6-9 */
}
.pro-plan-modal ul {
color: #fff;
list-style: none;
padding: 0 0 30px 0;
text-align: left;
white-space: pre-line;
margin: 0;
}
.pro-plan-modal ul li {
font-family: 'roboto_slabregular', Georgia, Times, serif;
background: url('../images/pro_plan/check.png') no-repeat 0px 12px;
display: inline-block;
font-size: 17px;
line-height: 36px;
padding: 0 0 0 19px;
}
.pro-plan-modal img.close {
width: 35px;
margin-top: 20px;
}

77
public/css/style.css vendored
View File

@ -884,3 +884,80 @@ a .glyphicon,
button .glyphicon { button .glyphicon {
padding-left: 8px; padding-left: 8px;
} }
.pro-plan-modal {
background-color: #4b4b4b;
padding-bottom: 40px;
padding-right: 25px;
/*opacity:0.96 !important;*/
}
.pro-plan-modal .left-side {
margin-top: 50px;
}
.pro-plan-modal h2 {
color: #36c157;
font-size: 71px;
font-weight: 800;
}
.pro-plan-modal img.price {
height: 90px;
}
.pro-plan-modal a.button {
font-family: 'roboto_slabregular', Georgia, Times, serif;
background: #f38c4f;
background: -moz-linear-gradient(top, #f38c4f 0%, #db7134 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f38c4f), color-stop(100%,#db7134));
background: -webkit-linear-gradient(top, #f38c4f 0%,#db7134 100%);
background: -o-linear-gradient(top, #f38c4f 0%,#db7134 100%);
background: -ms-linear-gradient(top, #f38c4f 0%,#db7134 100%);
background: linear-gradient(to bottom, #f38c4f 0%,#db7134 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f38c4f', endColorstr='#db7134',GradientType=0 );
text-shadow: 1px 1px 1px rgba(0, 0, 0, .25);
width: 68%;
margin-top: 20px;
font-size: 28px;
color: #fff;
border-radius: 10px;
padding: 20px 0;
display: inline-block;
text-decoration: none;
}
.pro-plan-modal a.button:hover {
background: #db7134; /* Old browsers */
background: -moz-linear-gradient(top, #db7134 0%, #f38c4f 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#db7134), color-stop(100%,#f38c4f)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #db7134 0%,#f38c4f 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #db7134 0%,#f38c4f 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #db7134 0%,#f38c4f 100%); /* IE10+ */
background: linear-gradient(to bottom, #db7134 0%,#f38c4f 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#db7134', endColorstr='#f38c4f',GradientType=0 ); /* IE6-9 */
}
.pro-plan-modal ul {
color: #fff;
list-style: none;
padding: 0 0 30px 0;
text-align: left;
white-space: pre-line;
margin: 0;
}
.pro-plan-modal ul li {
font-family: 'roboto_slabregular', Georgia, Times, serif;
background: url('../images/pro_plan/check.png') no-repeat 0px 12px;
display: inline-block;
font-size: 17px;
line-height: 36px;
padding: 0 0 0 19px;
}
.pro-plan-modal img.close {
width: 35px;
margin-top: 20px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -678,4 +678,17 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -669,4 +669,16 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -676,4 +676,17 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -648,4 +648,16 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -677,4 +677,16 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -669,4 +669,16 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -669,4 +669,16 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -671,4 +671,17 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -679,5 +679,17 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -677,4 +677,16 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -672,4 +672,16 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -672,4 +672,16 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -675,4 +675,16 @@ return array(
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO',
'pro_plan_call_to_action' => 'Upgrade Now!',
'pro_plan_feature1' => 'Create Unlimited Clients',
'pro_plan_feature2' => 'Access to 10 Beautiful Invoice Designs',
'pro_plan_feature3' => 'Custom URLs - "YourBrand.InvoiceNinja.com"',
'pro_plan_feature4' => 'Remove "Created by Invoice Ninja"',
'pro_plan_feature5' => 'Multi-user Access & Activity Tracking',
'pro_plan_feature6' => 'Create Quotes & Pro-forma Invoices',
'pro_plan_feature7' => 'Customize Invoice Field Titles & Numbering',
'pro_plan_feature8' => 'Option to Attach PDFs to Client Emails',
); );

View File

@ -111,20 +111,10 @@
vals = [{!! json_encode($emailFooter) !!}, '{!! Auth::user()->account->getDisplayName() !!}', 'Client Name', formatMoney(100), '{!! NINJA_WEB_URL !!}', 'Contact Name']; vals = [{!! json_encode($emailFooter) !!}, '{!! Auth::user()->account->getDisplayName() !!}', 'Client Name', formatMoney(100), '{!! NINJA_WEB_URL !!}', 'Contact Name'];
// Add any available payment method links // Add any available payment method links
<?php @foreach (\App\Models\Gateway::getPaymentTypeLinks() as $type)
foreach([PAYMENT_TYPE_CREDIT_CARD, PAYMENT_TYPE_PAYPAL, PAYMENT_TYPE_BITCOIN] as $type) { {!! "keys.push('" . $type.'_link' . "');" !!}
if (Auth::user()->account->getGatewayByType($type)) { {!! "vals.push('" . URL::to("/payment/xxxxxx/{$type}") . "');" !!}
@endforeach
// Changes "PAYMENT_TYPE_CREDIT_CARD" to "credit_card"
$gateway_slug = strtolower(str_replace('PAYMENT_TYPE_', '', $type)).'_link';
echo "keys.push('$gateway_slug'); ";
echo "vals.push('".URL::to("/payment/xxxxxx/{$type}")."'); ";
echo "\n";
}
}
?>
for (var i=0; i<keys.length; i++) { for (var i=0; i<keys.length; i++) {
var regExp = new RegExp('\\$'+keys[i], 'g'); var regExp = new RegExp('\\$'+keys[i], 'g');

View File

@ -9,7 +9,7 @@
@if (!Auth::user()->account->isPro()) @if (!Auth::user()->account->isPro())
<center> <center>
<div style="font-size:larger;" class="col-md-8 col-md-offset-2">{!! trans('texts.pro_plan_advanced_settings', ['link'=>'<a href="#" onclick="submitProPlan(\''.$feature.'\')">'.trans('texts.pro_plan.remove_logo_link').'</a>']) !!}</div> <div style="font-size:larger;" class="col-md-8 col-md-offset-2">{!! trans('texts.pro_plan_advanced_settings', ['link'=>'<a href="#" onclick="showProPlan(\''.$feature.'\')">'.trans('texts.pro_plan.remove_logo_link').'</a>']) !!}</div>
&nbsp;<p/>&nbsp; &nbsp;<p/>&nbsp;
</center> </center>
@endif @endif

View File

@ -144,23 +144,31 @@
$('#signUpModal').modal('show'); $('#signUpModal').modal('show');
} }
NINJA.proPlanFeature = '';
function showProPlan(feature) {
$('#proPlanModal').modal('show');
trackEvent('/account', '/show_pro_plan/' + feature);
NINJA.proPlanFeature = feature;
}
function hideProPlan() {
$('#proPlanModal').modal('hide');
}
function buyProduct(affiliateKey, productId) { function buyProduct(affiliateKey, productId) {
window.open('{{ Utils::isNinjaDev() ? '' : NINJA_APP_URL }}/license?affiliate_key=' + affiliateKey + '&product_id=' + productId + '&return_url=' + window.location); window.open('{{ Utils::isNinjaDev() ? '' : NINJA_APP_URL }}/license?affiliate_key=' + affiliateKey + '&product_id=' + productId + '&return_url=' + window.location);
} }
@if (Auth::check() && !Auth::user()->isPro()) @if (Auth::check() && !Auth::user()->isPro())
function submitProPlan(feature) { function submitProPlan() {
trackEvent('/account', '/submit_pro_plan/' + feature); trackEvent('/account', '/submit_pro_plan/' + NINJA.proPlanFeature);
if (NINJA.isRegistered) { if (NINJA.isRegistered) {
$('#proPlanDiv, #proPlanFooter').hide();
$('#proPlanWorking').show();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '{{ URL::to('account/go_pro') }}', url: '{{ URL::to('account/go_pro') }}',
success: function(result) { success: function(result) {
NINJA.formIsChanged = false; NINJA.formIsChanged = false;
window.location = '/view/' + result; window.location = '/payment/' + result;
} }
}); });
} else { } else {
@ -321,7 +329,7 @@
@if (!Auth::user()->registered) @if (!Auth::user()->registered)
{!! Button::success(trans('texts.sign_up'))->withAttributes(array('id' => 'signUpButton', 'data-toggle'=>'modal', 'data-target'=>'#signUpModal'))->small() !!} &nbsp; {!! Button::success(trans('texts.sign_up'))->withAttributes(array('id' => 'signUpButton', 'data-toggle'=>'modal', 'data-target'=>'#signUpModal'))->small() !!} &nbsp;
@elseif (!Auth::user()->isPro()) @elseif (!Auth::user()->isPro())
{!! Button::success(trans('texts.go_pro'))->withAttributes(array('id' => 'proPlanButton', 'onclick' => 'submitProPlan("")'))->small() !!} &nbsp; {!! Button::success(trans('texts.go_pro'))->withAttributes(array('id' => 'proPlanButton', 'onclick' => 'showProPlan("")'))->small() !!} &nbsp;
@endif @endif
@endif @endif
@ -526,47 +534,36 @@
@if (Auth::check() && !Auth::user()->isPro()) @if (Auth::check() && !Auth::user()->isPro())
<div class="modal fade" id="proPlanModal" tabindex="-1" role="dialog" aria-labelledby="proPlanModalLabel" aria-hidden="true"> <div class="modal fade" id="proPlanModal" tabindex="-1" role="dialog" aria-labelledby="proPlanModalLabel" aria-hidden="true">
<div class="modal-dialog medium-dialog"> <div class="modal-dialog large-dialog">
<div class="modal-content"> <div class="modal-content pro-plan-modal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="proPlanModalLabel">{{ trans('texts.pro_plan_product') }}</h4>
</div>
<div style="background-color: #fff; padding-left: 16px; padding-right: 16px" id="proPlanDiv">
<section class="plans"> <div class="pull-right">
<img onclick="hideProPlan()" class="close" src="{{ asset('images/pro_plan/close.png') }}"/>
</div>
<div class="row"> <div class="row">
<div class="col-md-12">
<h2>Go Pro to Unlock Premium Invoice Ninja Features</h2> <div class="col-md-7 left-side">
<p>We believe that the free version of Invoice Ninja is a truly awesome product loaded <center>
with the key features you need to bill your clients electronically. But for those who <h2>{{ trans('texts.pro_plan_title') }}</h2>
crave still more Ninja awesomeness, we've unmasked the Invoice Ninja Pro plan, which <img class="img-responsive price" alt="Only $50 Per Year" src="{{ asset('images/pro_plan/price.png') }}"/>
offers more versatility, power and customization options for just $50 per year. </p> <a class="button" href="#" onclick="submitProPlan()">{{ trans('texts.pro_plan_call_to_action') }}</a>
</center>
</div>
<div class="col-md-5">
<ul>
<li>{{ trans('texts.pro_plan_feature1') }}</li>
<li>{{ trans('texts.pro_plan_feature2') }}</li>
<li>{{ trans('texts.pro_plan_feature3') }}</li>
<li>{{ trans('texts.pro_plan_feature4') }}</li>
<li>{{ trans('texts.pro_plan_feature5') }}</li>
<li>{{ trans('texts.pro_plan_feature6') }}</li>
<li>{{ trans('texts.pro_plan_feature7') }}</li>
<li>{{ trans('texts.pro_plan_feature8') }}</li>
</ul>
</div> </div>
</div> </div>
@include('plans')
&nbsp;
</div>
<div style="padding-left:40px;padding-right:40px;display:none;min-height:130px" id="proPlanWorking">
<h3>{{ trans('texts.working') }}...</h3>
<div class="progress progress-striped active">
<div class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>
</div>
</div>
<div style="background-color: #fff; padding-right:20px;padding-left:20px; display:none" id="proPlanSuccess">
&nbsp;<br/>
{{ trans('texts.pro_plan_success') }}
<br/>&nbsp;
</div>
<div class="modal-footer" style="margin-top: 0px" id="proPlanFooter">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.close') }}</button>
<button type="button" class="btn btn-primary" id="proPlanButton" onclick="submitProPlan()">{{ trans('texts.sign_up') }}</button>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -357,7 +357,7 @@
@if (!Auth::user()->account->isPro()) @if (!Auth::user()->account->isPro())
<div style="font-size:larger"> <div style="font-size:larger">
{!! trans('texts.pro_plan.remove_logo', ['link'=>'<a href="#" onclick="submitProPlan(\'remove_logo\')">'.trans('texts.pro_plan.remove_logo_link').'</a>']) !!} {!! trans('texts.pro_plan.remove_logo', ['link'=>'<a href="#" onclick="showProPlan(\'remove_logo\')">'.trans('texts.pro_plan.remove_logo_link').'</a>']) !!}
</div> </div>
@endif @endif

View File

@ -35,7 +35,7 @@
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.cancel') }}</button> <button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.cancel') }}</button>
@if (Utils::isNinjaProd()) @if (Utils::isNinjaProd())
<button type="button" class="btn btn-primary" onclick="submitProPlan('invoice_designs')">{{ trans('texts.go_pro') }}</button> <button type="button" class="btn btn-primary" onclick="showProPlan('invoice_designs')">{{ trans('texts.go_pro') }}</button>
@else @else
<button type="button" class="btn btn-primary" onclick="buyProduct('{{ INVOICE_DESIGNS_AFFILIATE_KEY }}', '{{ PRODUCT_INVOICE_DESIGNS }}')">{{ trans('texts.buy') }}</button> <button type="button" class="btn btn-primary" onclick="buyProduct('{{ INVOICE_DESIGNS_AFFILIATE_KEY }}', '{{ PRODUCT_INVOICE_DESIGNS }}')">{{ trans('texts.buy') }}</button>
@endif @endif