This commit is contained in:
Razi KAntorp 2014-03-14 11:24:40 +01:00
commit d6e7f19f2f
30 changed files with 1106 additions and 2076 deletions

View File

@ -65,7 +65,7 @@ return array(
|
*/
'key' => 'a2jfy6HtBEdNtJnRSOC7vIM3UVhxZ1BB',
'key' => '',
/*
|--------------------------------------------------------------------------

View File

@ -60,7 +60,7 @@ class AccountController extends \BaseController {
public function setTrashVisible($entityType, $visible)
{
Session::put('show_trash', $visible == 'true');
Session::put('show_trash', $visible == 'true');
return Redirect::to("{$entityType}s");
}
@ -450,7 +450,7 @@ class AccountController extends \BaseController {
if ($validator->fails())
{
return Redirect::to('company/settings')
return Redirect::to('company/payments')
->withErrors($validator)
->withInput();
}

View File

@ -1,8 +1,18 @@
<?php
use ninja\mailers\Mailer;
class HomeController extends BaseController {
protected $layout = 'master';
protected $mailer;
public function __construct(Mailer $mailer)
{
parent::__construct();
$this->mailer = $mailer;
}
public function showWelcome()
{
@ -19,6 +29,24 @@ class HomeController extends BaseController {
return View::make('contact_us');
}
public function doContactUs()
{
$email = Input::get('email');
$name = Input::get('name');
$message = Input::get('message');
$data = [
'name' => $name,
'email' => $email,
'text' => $message
];
$this->mailer->sendTo('contact@invoiceninja.com', 'contact@invoiceninja.com', 'Invoice Ninja Feedback', 'contact', $data);
Session::flash('message', 'Successfully sent message');
return Redirect::to('/contact');
}
public function showComingSoon()
{
return View::make('coming_soon');

View File

@ -253,7 +253,9 @@ class InvoiceController extends \BaseController {
$invoice = $input->invoice;
if ($errors = $this->invoiceRepo->getErrors($invoice))
{
{
Session::flash('error', 'Please make sure to select a client and correct any errors');
return Redirect::to('invoices/create')
->withInput()->withErrors($errors);
}

View File

@ -21,6 +21,7 @@ class AddSupportForInvoiceDesigns extends Migration {
DB::table('invoice_designs')->insert(['name' => 'Clean']);
DB::table('invoice_designs')->insert(['name' => 'Bold']);
DB::table('invoice_designs')->insert(['name' => 'Modern']);
DB::table('invoice_designs')->insert(['name' => 'Plain']);
Schema::table('invoices', function($table)
{

View File

@ -27,7 +27,8 @@ class Utils
'url' => Input::get('url', Request::url()),
'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',
'ip' => Request::getClientIp(),
'count' => Session::get('error_count', 0)
'count' => Session::get('error_count', 0),
'input' => Input::all()
];
Log::error('\n'.$error, $data);

View File

@ -54,7 +54,7 @@ class Invoice extends EntityModel
public function hidePrivateFields()
{
$this->setVisible(['invoice_number', 'discount', 'po_number', 'invoice_date', 'due_date', 'terms', 'public_notes', 'amount', 'balance', 'invoice_items', 'client', 'tax_name', 'tax_rate', 'account']);
$this->setVisible(['invoice_number', 'discount', 'po_number', 'invoice_date', 'due_date', 'terms', 'public_notes', 'amount', 'balance', 'invoice_items', 'client', 'tax_name', 'tax_rate', 'account', 'invoice_design_id']);
$this->client->setVisible(['name', 'address1', 'address2', 'city', 'state', 'postal_code', 'work_phone', 'payment_terms', 'contacts', 'country', 'currency_id' ]);
$this->account->setVisible(['name', 'address1', 'address2', 'city', 'state', 'postal_code', 'work_phone', 'work_email', 'country', 'currency_id']);

View File

@ -2,7 +2,7 @@
use Mail;
abstract class Mailer {
class Mailer {
public function sendTo($toEmail, $fromEmail, $subject, $view, $data = [])
{

View File

@ -93,7 +93,7 @@ class InvoiceRepository
$invoice = (array) $input;
$invoiceId = isset($invoice['public_id']) && $invoice['public_id'] ? Invoice::getPrivateId($invoice['public_id']) : null;
$rules = ['invoice_number' => 'unique:invoices,invoice_number,' . $invoiceId . ',id,account_id,' . \Auth::user()->account_id];
$rules = ['invoice_number' => 'required|unique:invoices,invoice_number,' . $invoiceId . ',id,account_id,' . \Auth::user()->account_id];
if ($invoice['is_recurring'] && $invoice['start_date'] && $invoice['end_date'])
{

View File

@ -56,8 +56,9 @@ Route::get('/send_emails', function() {
Route::get('/', 'HomeController@showWelcome');
Route::get('/rocksteady', 'HomeController@showWelcome');
Route::get('/about_us', 'HomeController@showAboutUs');
Route::get('/contact_us', 'HomeController@showContactUs');
Route::get('/about', 'HomeController@showAboutUs');
Route::get('/contact', 'HomeController@showContactUs');
Route::post('/contact', 'HomeController@doContactUs');
Route::get('log_error', 'HomeController@logError');
Route::post('get_started', 'AccountController@getStarted');

View File

@ -9,43 +9,77 @@
@stop
@section('body')
<<<<<<< HEAD
<!--<script>
$(document).ready(function () {
=======
{{ Form::open(array('url' => 'get_started', 'id' => 'startForm')) }}
{{ Form::hidden('guest_key') }}
{{ Form::close() }}
<script>
$(document).ready(function () {
if (isStorageSupported()) {
$('[name="guest_key"]').val(localStorage.getItem('guest_key'));
}
>>>>>>> upstream/master
var $window = $(window);
$('section[data-type="background"]').each(function () {
var $bgobj = $(this);
$(window).scroll(function () {
var yPos = -($window.scrollTop() / $bgobj.data('speed'));
var coords = '50% ' + yPos + 'px';
$bgobj.css({ backgroundPosition: coords });
});
});
var $bgobj = $(this);
$(window).scroll(function () {
var yPos = -($window.scrollTop() / $bgobj.data('speed'));
var coords = '50% ' + yPos + 'px';
$bgobj.css({ backgroundPosition: coords });
});
});
<<<<<<< HEAD
</script>-->
=======
});
function isStorageSupported() {
try {
return 'localStorage' in window && window['localStorage'] !== null;
} catch (e) {
return false;
}
}
function getStarted() {
$('#startForm').submit();
}
</script>
>>>>>>> upstream/master
<div class="navbar" style="margin-bottom:0px">
<div class="container">
<div class="navbar-inner">
<a class="brand" href="#"><img src=
<a class="brand" href="/"><img src=
"images/invoiceninja-logo.png"></a>
<ul class="navbar-list">
<li>{{ link_to('about_us', 'About Us' ) }}</li>
<li>{{ link_to('contact_us', 'Contact Us' ) }}</li>
<li>{{ link_to('login', Auth::check() ? 'Continue' : 'Login' ) }}</li>
<li>{{ link_to('about', 'About Us' ) }}</li>
<li>{{ link_to('contact', 'Contact Us' ) }}</li>
<li>{{ link_to('login', Auth::check() ? 'My Account' : 'Login' ) }}</li>
</ul>
</div>
</div>
</div>
</div>
<section class="hero3" data-speed="2" data-type="background">
<div class="container">
<div class="caption">
<h1>WHY INVOICE NINJA?
</h1>
</div>
</div>
</section>
<section class="hero3" data-speed="2" data-type="background">
<div class="container">
<div class="caption">
<h1>WHY INVOICE NINJA?
</h1>
</div>
</div>
</section>
<<<<<<< HEAD
<section class="about center">
<div class="container">
<div class="row">
@ -86,8 +120,49 @@
</div>
</div>
</div>
=======
<section class="about center">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2>Open Source Platform</h2>
<p>Free yourself from online invoicing platforms with high monthly fees and limited functionality. Being open source allows us fast app development, security audits by the open-course community, and we can keep it <span style="color:#2299c0"><strong>FREE!</strong></span></p>
</div>
</div>
</div>
</section>
<section class="about white-bg">
<div class="container">
<div class="row">
<div class="col-md-5">
<div class="screendump">
</div>
</section>
</div>
<div class="col-md-7">
<h2>Live PDF Creation</h2>
<p><strong>Look professional from day #1.</strong> Select one of our beautiful invoice templates to suit your company identity, switch between designs in real time to preview invoices & email them to clients with one click. The live preview PDF function was designed for an efficient and hassle-free experience, and its awesome!
</p>
</div>
</div>
</div>
</section>
<section class="about">
<div class="container">
<div class="row">
<div class="col-md-7">
<h2>Online Payments</h2>
<p><strong>Authorize.net, Beanstream, PayPal?</strong> InvoiceNinja supports the most popular online payment gateways! If you need help integrating a third party gateway we dont yet support, please contact us! Were happy to help! If you need assistance of want to learn more about online payment solutions, contact us!</p>
</div>
<div class="col-md-5">
<div class="screendump">
>>>>>>> upstream/master
</div>
</div>
</div>
</div>
</section>
<!--
<section class="about center white-bg">
<div class="container">
<div class="row">
@ -102,24 +177,25 @@
</div>
</div>
</section>
<section class="upper-footer">
<div class="container">
<div class="row">
<div class="col-md-3 center-block">
<a href="#">
<div class="cta">
<h2 onclick="getStarted()">Invoice Now <span>+</span></h2>
</div>
</a>
</div>
</div>
</div>
</section>
-->
<section class="upper-footer">
<div class="container">
<div class="row">
<div class="col-md-3 center-block">
<a href="#">
<div class="cta">
<h2 onclick="getStarted()">Invoice Now <span>+</span></h2>
</div>
</a>
</div>
</div>
</div>
</section>
<footer>
<div class="navbar" style="margin-bottom:0px">
<div class="container">
<div class="social">
<footer>
<div class="navbar" style="margin-bottom:0px">
<div class="container">
<div class="social">
<!--
<a href="http://twitter.com/eas_id"><span class=
"socicon">c</span></a>
@ -134,7 +210,9 @@
<div class="navbar-inner">
<ul class="navbar-list">
<li>{{ link_to('login', Auth::check() ? 'Continue' : 'Login' ) }}</li>
<li>{{ link_to('about', 'About Us' ) }}</li>
<li>{{ link_to('contact', 'Contact Us' ) }}</li>
<li>{{ link_to('login', Auth::check() ? 'My Account' : 'Login' ) }}</li>
</ul>
<!--
@ -150,4 +228,4 @@
</div>
</footer><script src="{{ asset('/js/retina-1.1.0.min.js') }}" type="text/javascript"></script>
@stop
@stop

View File

@ -10,6 +10,11 @@
@stop
@section('body')
{{ Form::open(array('url' => 'get_started', 'id' => 'startForm')) }}
{{ Form::hidden('guest_key') }}
{{ Form::close() }}
<script>
$(document).ready(function () {
$("#feedbackSubmit").click(function() {
@ -18,7 +23,7 @@
//do a little client-side validation -- check that each field has a value and e-mail field is in proper format
var hasErrors = false;
$('#feedbackForm input,textarea').each(function() {
$('.feedbackForm input,textarea').each(function() {
if (!$(this).val()) {
hasErrors = true;
contactForm.addError($(this));
@ -35,23 +40,6 @@
return false;
}
//send the feedback e-mail
$.ajax({
type: "POST",
url: "library/sendmail.php",
data: $("#feedbackForm").serialize(),
success: function(data)
{
contactForm.addAjaxMessage(data.message, false);
//get new Captcha on success
$('#captcha').attr('src', '/vendor/securimage/securimage_show.php?' + Math.random());
},
error: function(response)
{
contactForm.addAjaxMessage(response.responseJSON.message, true);
}
});
return false;
});
});
@ -64,8 +52,8 @@ var contactForm = {
},
clearErrors: function () {
$('#emailAlert').remove();
$('#feedbackForm .help-block').hide();
$('#feedbackForm .form-group').removeClass('has-error');
$('.feedbackForm .help-block').hide();
$('.feedbackForm .form-group').removeClass('has-error');
},
addError: function ($input) {
$input.siblings('.help-block').show();
@ -75,16 +63,29 @@ var contactForm = {
$("#feedbackSubmit").after('<div id="emailAlert" class="alert alert-' + (isError ? 'danger' : 'success') + '" style="margin-top: 5px;">' + $('<div/>').text(msg).html() + '</div>');
}
};
function isStorageSupported() {
try {
return 'localStorage' in window && window['localStorage'] !== null;
} catch (e) {
return false;
}
}
function getStarted() {
$('#startForm').submit();
}
</script>
<div class="navbar" style="margin-bottom:0px">
<div class="container">
<div class="navbar-inner">
<a class="brand" href="#"><img src=
<a class="brand" href="/"><img src=
"images/invoiceninja-logo.png"></a>
<ul class="navbar-list">
<li>{{ link_to('about_us', 'About Us' ) }}</li>
<li>{{ link_to('contact_us', 'Contact Us' ) }}</li>
<li>{{ link_to('login', Auth::check() ? 'Continue' : 'Login' ) }}</li>
<li>{{ link_to('about', 'About Us' ) }}</li>
<li>{{ link_to('contact', 'Contact Us' ) }}</li>
<li>{{ link_to('login', Auth::check() ? 'My Account' : 'Login' ) }}</li>
</ul>
</div>
</div>
@ -103,13 +104,23 @@ var contactForm = {
<section class="about contact">
<div class="container">
<div id="contact_form" class="row">
@if (Session::has('message'))
<div class="alert alert-info">{{ Session::get('message') }}</div>
@endif
@if (Session::has('error'))
<div class="alert alert-danger">{{ Session::get('error') }}</div>
@endif
<div class="row">
<div class="col-md-7">
<h2>Have a question or just want to say hi?</h2>
<p>Fill in the form below and we'll get back to you as soon as possible (within 24 hours). Hope to hear from you.</p>
<form role="form" id="feedbackForm">
{{ Former::open('contact')->addClass('feedbackForm') }}
<div class="form-group">
<input type="text" class="form-control" id="name" name="name" placeholder="Name">
<span class="help-block" style="display: none;">Please enter your name.</span>
@ -127,19 +138,16 @@ var contactForm = {
<button type="submit" id="feedbackSubmit" class="btn btn-primary btn-lg">Send Message <span class="glyphicon glyphicon-send"></span></button>
</div>
</div>
     </form>
{{ Former::close() }}
</div>
<div class="col-md-4 col-md-offset-1 address">
<h2>Other ways to reach us</h2>
<p><span class="glyphicon glyphicon-send"></span><a href="mailto:hello@invoiceninja.com">hello@invoiceninja.com</a></p>
<p><span class="glyphicon glyphicon-earphone"></span>+524 975 502</p>
<address>
<span class="glyphicon glyphicon-pencil"></span><strong>InvoiceNinja</strong><br>
<span class="push">795 Folsom Ave, Suite 600<br></span>
<span class="push">San Francisco, CA 94107<br></span>
<span class="push">Isarel</span>
</address>
</p>
<p><span class="glyphicon glyphicon-send"></span><a href="mailto:contact@invoiceninja.com">contact@invoiceninja.com</a></p>
<p><span class="glyphicon glyphicon-earphone"></span>(800) 763-1948</p>
<p><span class="github"></span><div style="padding-top:10px"> &nbsp;&nbsp;<a href="https://github.com/hillelcoren/invoice-ninja" target="_blank">GitHub Project</a></div></p>
</div>
</div>
</div>
@ -182,7 +190,9 @@ var contactForm = {
<div class="navbar-inner">
<ul class="navbar-list">
<li>{{ link_to('login', Auth::check() ? 'Continue' : 'Login' ) }}</li>
<li>{{ link_to('about', 'About Us' ) }}</li>
<li>{{ link_to('contact', 'Contact Us' ) }}</li>
<li>{{ link_to('login', Auth::check() ? 'My Account' : 'Login' ) }}</li>
</ul>
<!--

View File

@ -0,0 +1,3 @@
Name: {{ $name }}<br/>
Email: {{ $email }}<p/>
Message: {{ $text }}

View File

@ -0,0 +1,4 @@
Name: {{ $name }}
Email: {{ $email }}
Message: {{ $text }}

View File

@ -12,7 +12,7 @@
To view your client invoice click the link below: <br/>
{{ $invoiceLink }} <p/>
To adjust your email notification settings please <a href="http://www.invoiceninja.com/company/settings">click here</a>.
To adjust your email notification settings please <a href="http://www.invoiceninja.com/company/notifications">click here</a>.
</body>
</html>

View File

@ -6,4 +6,4 @@ A payment of {{ $paymentAmount }} was made by client {{ $clientName }} towards i
To view your client invoice click the link below:
{{ $invoiceLink }} <p/>
To adjust your email notification settings please visit http://www.invoiceninja.com/company/settings
To adjust your email notification settings please visit http://www.invoiceninja.com/company/notifications

View File

@ -9,7 +9,7 @@
The following client {{ $clientName }} was emailed Invoice {{ $invoiceNumber }} for {{ $invoiceAmount}}.<p/>
To adjust your email notification settings please <a href="http://www.invoiceninja.com/company/settings">click here</a>.<p/>
To adjust your email notification settings please <a href="http://www.invoiceninja.com/company/notifications">click here</a>.<p/>
</body>
</html>

View File

@ -2,4 +2,4 @@ Dear {{ $userName }},
The following client {{ $clientName }} was emailed Invoice {{ $invoiceNumber }} for {{ $invoiceAmount}}.
To adjust your email notification settings visit this link http://www.invoiceninja.com/company/settings
To adjust your email notification settings visit this link http://www.invoiceninja.com/company/notifications

View File

@ -9,7 +9,7 @@
The following client {{ $clientName }} viewed Invoice {{ $invoiceNumber }} for {{ $invoiceAmount}}.<p/>
To adjust your email notification settings please <a href="http://www.invoiceninja.com/company/settings">click here</a>.<p/>
To adjust your email notification settings please <a href="http://www.invoiceninja.com/company/notifications">click here</a>.<p/>
</body>
</html>

View File

@ -2,4 +2,4 @@ Dear {{ $userName }},
The following client {{ $clientName }} viewed Invoice {{ $invoiceNumber }} for {{ $invoiceAmount }}.
To adjust your email notification settings visit this link http://www.invoiceninja.com/company/settings
To adjust your email notification settings visit this link http://www.invoiceninja.com/company/notifications

View File

@ -217,7 +217,7 @@
<h4 class="modal-title" id="myModalLabel">Sign up</h4>
</div>
<div style="background-color: #fff; padding-right:20px" id="signUpDiv" onkeyup="validateSignUp()" onkeydown="checkForEnter(event)">
<div style="background-color: #fff; padding-right:20px" id="signUpDiv" onkeyup="validateSignUp()" onclick="validateSignUp()" onkeydown="checkForEnter(event)">
<br/>
{{ Former::open('signup/submit')->addClass('signUpForm') }}
@ -232,11 +232,16 @@
{{ Former::text('new_first_name')->label('First name') }}
{{ Former::text('new_last_name')->label('Last name') }}
{{ Former::text('new_email')->label('Email') }}
{{ Former::password('new_password')->label('Password') }}
{{ Former::password('new_password')->label('Password') }}
{{ Former::checkbox('terms_checkbox')->label(' ')->text('I agree to the Invoice Ninja <a href="#" target="_blank">Terms of Service</a>') }}
{{ Former::close() }}
<center><div id="errorTaken" style="display:none">&nbsp;<br/>The email address is already regiestered</div></center>
<br/>
<center><div id="errorTaken" style="display:none">&nbsp;<br/>The email address is already regiestered</div></center>
<br/>
</div>
<div style="padding-left:40px;padding-right:40px;display:none;min-height:130px" id="working">
@ -255,8 +260,8 @@
<div class="modal-footer" id="signUpFooter" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">Close <i class="glyphicon glyphicon-remove-circle"></i></button>
<button type="button" class="btn btn-primary" id="saveSignUpButton" onclick="validateServerSignUp()">Save <i class="glyphicon glyphicon-floppy-disk"></i></button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close <i class="glyphicon glyphicon-remove-circle"></i></button>
<button type="button" class="btn btn-primary" id="saveSignUpButton" onclick="validateServerSignUp()" disabled>Save <i class="glyphicon glyphicon-floppy-disk"></i></button>
</div>
</div>
</div>
@ -285,7 +290,11 @@
</div>
@endif
@if ($_SERVER['SERVER_NAME'] != 'www.invoiceninja.com')
<div class="container">Powered by <a href="https://www.invoiceninja.com/" target="_blank">InvoiceNinja.com</a></div>
@endif
<p>&nbsp;</p>
</body>
@ -319,6 +328,13 @@
}
}
});
if (!$('#terms_checkbox').is(':checked')) {
isFormValid = false;
}
$('#saveSignUpButton').prop('disabled', !isFormValid);
return isFormValid;
}

View File

@ -30,7 +30,7 @@
<div class="form-group">
<label for="client" class="control-label col-lg-4 col-sm-4">Client</label>
<div class="col-lg-8 col-sm-8" style="padding-top: 7px">
<a id="editClientLink" class="pointer" data-bind="click: $root.showClientForm">{{ $client->getDisplayName() }}</a>
<a id="editClientLink" class="pointer" data-bind="click: $root.showClientForm, text: getClientDisplayName(ko.toJS(client()))"></a>
</div>
</div>
<div style="display:none">
@ -63,16 +63,16 @@
<div class="col-md-4" id="col_2">
<div data-bind="visible: !is_recurring()">
{{ Former::text('invoice_date')->data_bind("datePicker: invoice_date, valueUpdate: 'afterkeydown'")
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar"></i>') }}
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar" onclick="toggleDatePicker(\'invoice_date\')"></i>') }}
{{ Former::text('due_date')->data_bind("datePicker: due_date, valueUpdate: 'afterkeydown'")
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar"></i>') }}
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar" onclick="toggleDatePicker(\'due_date\')"></i>') }}
</div>
<div data-bind="visible: is_recurring" style="display: none">
{{ Former::select('frequency_id')->label('How often')->options($frequencies)->data_bind("value: frequency_id") }}
{{ Former::text('start_date')->data_bind("datePicker: start_date, valueUpdate: 'afterkeydown'")
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar"></i>') }}
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar" onclick="toggleDatePicker(\'start_date\')"></i>') }}
{{ Former::text('end_date')->data_bind("datePicker: end_date, valueUpdate: 'afterkeydown'")
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar"></i>') }}
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))->append('<i class="glyphicon glyphicon-calendar" onclick="toggleDatePicker(\'end_date\')"></i>') }}
</div>
@if ($invoice && $invoice->recurring_invoice_id)
<div class="pull-right" style="padding-top: 6px">
@ -138,7 +138,7 @@
<td>
<input onkeyup="onItemChange()" data-bind="value: prettyQty, valueUpdate: 'afterkeydown'" style="text-align: right" class="form-control"//>
</td>
<td style="display:none;vertical-align:middle" data-bind="visible: $root.invoice_item_taxes.show">
<td style="display:none;" data-bind="visible: $root.invoice_item_taxes.show">
<select class="form-control" style="width:100%" data-bind="value: tax, options: $root.tax_rates, optionsText: 'displayName'"></select>
</td>
<td style="text-align:right;padding-top:9px !important">
@ -176,9 +176,9 @@
<tr style="display:none" data-bind="visible: $root.invoice_taxes.show">
<td class="hide-border" colspan="3"/>
<td style="display:none" class="hide-border" data-bind="visible: $root.invoice_item_taxes.show"/>
<td style="vertical-align: middle">Tax</td>
<td>Tax</td>
<td style="min-width:120px"><select class="form-control" style="width:100%" data-bind="value: tax, options: $root.tax_rates, optionsText: 'displayName'"></select></td>
<td style="vertical-align: middle; text-align: right"><span data-bind="text: totals.taxAmount"/></td>
<td style="text-align: right"><span data-bind="text: totals.taxAmount"/></td>
</tr>
<tr>
<td class="hide-border" colspan="3"/>
@ -217,9 +217,9 @@
@if (!$invoice || (!$invoice->trashed() && !$invoice->client->trashed()))
@if ($invoice)
<div id="primaryActions" style="text-align:left" data-bind="css: $root.enable.save" class="btn-group">
<button class="btn-success btn" type="button" data-bind="css: $root.enable.save">Save Invoice</button>
<button class="btn-success btn dropdown-toggle" type="button" data-toggle="dropdown" data-bind="css: $root.enable.save">
<div id="primaryActions" style="text-align:left" class="btn-group">
<button class="btn-success btn" type="button">Save Invoice</button>
<button class="btn-success btn dropdown-toggle" type="button" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
@ -255,10 +255,10 @@
)
, array('id'=>'primaryActions', 'style'=>'text-align:left', 'data-bind'=>'css: $root.enable.save'))->split(); --}}
@else
{{ Button::success_submit('Save Invoice', array('data-bind'=>'css: $root.enable.save', 'id' => 'saveButton')) }}
{{ Button::success_submit('Save Invoice', array('id' => 'saveButton')) }}
@endif
{{ Button::normal('Email Invoice', array('id' => 'email_button', 'onclick' => 'onEmailClick()', 'data-bind' => 'css: $root.enable.email'))->append_with_icon('send'); }}
{{ Button::normal('Email Invoice', array('id' => 'email_button', 'onclick' => 'onEmailClick()'))->append_with_icon('send'); }}
@if ($invoice)
{{ Button::primary('Enter Payment', array('onclick' => 'onPaymentClick()'))->append_with_icon('usd'); }}
@ -579,6 +579,10 @@
return invoice;
}
function toggleDatePicker(field) {
$('#'+field).datepicker('show');
}
/*
function refreshPDF() {
setTimeout(function() {
@ -589,13 +593,15 @@
var isRefreshing = false;
var needsRefresh = false;
function refreshPDF() {
function getPDFString() {
var invoice = createInvoiceModel();
var doc = generatePDF(invoice);
if (!doc) return;
var string = doc.output('datauristring');
return doc.output('datauristring');
}
function refreshPDF() {
if (isFirefox || (isChrome && !isChromium)) {
var string = getPDFString();
$('#theFrame').attr('src', string).show();
} else {
if (isRefreshing) {
@ -603,7 +609,7 @@
return;
}
isRefreshing = true;
var string = getPDFString();
var pdfAsArray = convertDataURIToBinary(string);
PDFJS.getDocument(pdfAsArray).then(function getPdfHelloWorld(pdf) {
@ -650,6 +656,39 @@
$('.main_form').submit();
}
function isSaveValid() {
var isValid = false;
for (var i=0; i<self.invoice().client().contacts().length; i++) {
var contact = self.invoice().client().contacts()[i];
if (isValidEmailAddress(contact.email())) {
isValid = true;
} else {
isValid = false;
break;
}
}
return isValid;
}
function isEmailValid() {
var isValid = false;
var sendTo = false;
var client = self.invoice().client();
for (var i=0; i<client.contacts().length; i++) {
var contact = client.contacts()[i];
if (isValidEmailAddress(contact.email())) {
isValid = true;
if (contact.send_invoice() || client.contacts().length == 1) {
sendTo = true;
}
} else {
isValid = false;
break;
}
}
return (isValid && sendTo)
}
function onCloneClick() {
$('#action').val('clone');
$('.main_form').submit();
@ -684,9 +723,6 @@
}
event.preventDefault();
if (model.enable.save() != 'enabled') {
return;
}
$('.main_form').submit();
return false;
@ -893,40 +929,6 @@
$('#invoice_number').focus();
}
self.enable = {};
self.enable.save = ko.computed(function() {
var isValid = false;
for (var i=0; i<self.invoice().client().contacts().length; i++) {
var contact = self.invoice().client().contacts()[i];
if (isValidEmailAddress(contact.email())) {
isValid = true;
} else {
isValid = false;
break;
}
}
return isValid ? "enabled" : "disabled";
});
self.enable.email = ko.computed(function() {
var isValid = false;
var sendTo = false;
var client = self.invoice().client();
for (var i=0; i<client.contacts().length; i++) {
var contact = client.contacts()[i];
if (isValidEmailAddress(contact.email())) {
isValid = true;
if (contact.send_invoice() || client.contacts().length == 1) {
sendTo = true;
}
} else {
isValid = false;
break;
}
}
return isValid && sendTo ? "enabled" : "disabled";
});
self.clientLinkText = ko.computed(function() {
if (self.invoice().client().public_id())
{
@ -954,7 +956,7 @@
self.discount = ko.observable('');
self.frequency_id = ko.observable('');
//self.currency_id = ko.observable({{ $client && $client->currency_id ? $client->currency_id : Session::get(SESSION_CURRENCY) }});
self.terms = ko.observable(wordWrapText('{{ str_replace(["\r\n","\r","\n"], '\n', $account->invoice_terms) }}', 340));
self.terms = ko.observable(wordWrapText('{{ str_replace(["\r\n","\r","\n"], '\n', $account->invoice_terms) }}', 300));
self.set_default_terms = ko.observable(false);
self.public_notes = ko.observable('');
self.po_number = ko.observable('');
@ -1027,7 +1029,7 @@
return this.terms();
},
write: function(value) {
value = wordWrapText(value, 340);
value = wordWrapText(value, 300);
self.terms(value);
$('#terms').height(value.split('\n').length * 36);
},
@ -1041,7 +1043,7 @@
return this.public_notes();
},
write: function(value) {
value = wordWrapText(value, 340);
value = wordWrapText(value, 300);
self.public_notes(value);
$('#public_notes').height(value.split('\n').length * 36);
},
@ -1337,7 +1339,7 @@
return this.notes();
},
write: function(value) {
value = wordWrapText(value);
value = wordWrapText(value, 235);
self.notes(value);
onItemChange();
},

View File

@ -45,16 +45,22 @@
<body>
@if (App::environment() == ENV_PRODUCTION)
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
@if (App::environment() == ENV_PRODUCTION)
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46031341-1');
ga('send', 'pageview');
</script>
ga('create', 'UA-46031341-1');
ga('send', 'pageview');
</script>
@else
<style>
.navbar {
background-color: #006600 !important;
}
</style>
@endif
@yield('body')

View File

@ -38,12 +38,12 @@
<div class="navbar" style="margin-bottom:0px">
<div class="container">
<div class="navbar-inner">
<a class="brand" href="#"><img src=
<a class="brand" href="/"><img src=
"images/invoiceninja-logo.png"></a>
<ul class="navbar-list">
<!--<li>{{ link_to('about_us', 'About Us' ) }}</li>-->
<!--<li>{{ link_to('contact_us', 'Contact Us' ) }}</li>-->
<li>{{ link_to('login', Auth::check() ? 'Continue' : 'Login' ) }}</li>
<li>{{ link_to('about', 'About Us' ) }}</li>
<li>{{ link_to('contact', 'Contact Us' ) }}</li>
<li>{{ link_to('login', Auth::check() ? 'My Account' : 'Login' ) }}</li>
</ul>
</div>
</div>
@ -174,7 +174,9 @@
<div class="navbar-inner">
<ul class="navbar-list">
<li>{{ link_to('login', Auth::check() ? 'Continue' : 'Login' ) }}</li>
<li>{{ link_to('about', 'About Us' ) }}</li>
<li>{{ link_to('contact', 'Contact Us' ) }}</li>
<li>{{ link_to('login', Auth::check() ? 'My Account' : 'Login' ) }}</li>
</ul>
<!--

View File

@ -517,6 +517,17 @@ footer .social .socicon {
}
.github {
background-image: url('../images/GitHub.png');
background-size: contain;
background-repeat: no-repeat;
width: 40px;
height: 40px;
display: inline-block;
margin-right: 10px;
float: left;
}
@font-face {
font-family: 'socicon';

View File

@ -60,7 +60,7 @@ min-height: 40px;
table.dataTable { border-radius: 3px; border-collapse: collapse;
/*border-spacing: 0;*/}
table.dataTable thead > tr > th, table.invoice-table thead > tr > th {
background: #e37329 !important;
background-color: #e37329 !important;
color:#fff;
}
th:first-child {
@ -223,7 +223,7 @@ margin-left: 10px !important;
/*new*/
div {
word-break: break-word;
word-break: break-all;
}
div.required > label {
@ -591,7 +591,6 @@ color: #fff;
background-color: #08273c;
border-color: #08273c;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #ecf0f1;

BIN
public/images/GitHub.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

File diff suppressed because it is too large Load Diff