Bug fixes

This commit is contained in:
Hillel Coren 2015-09-29 21:19:18 +03:00
parent c38577e0a8
commit 06be7afedf
6 changed files with 35 additions and 31 deletions

View File

@ -49,8 +49,7 @@ class Handler extends ExceptionHandler {
}
// In production, except for maintenance mode, we'll show a custom error screen
//if (Utils::isNinjaProd() && $e->getStatusCode() != 503) {
if (Utils::isNinjaProd()) {
if (Utils::isNinjaProd() && !Utils::isDownForMaintenance()) {
$data = [
'error' => get_class($e),
'hideHeader' => true,

View File

@ -586,7 +586,7 @@ class InvoiceController extends BaseController
{
Session::reflash();
return Redirect::to('invoices/'.$publicId.'/edit');
return Redirect::to("invoices/{$publicId}/edit");
}
/**

View File

@ -119,6 +119,13 @@ class TaskController extends BaseController
return $this->save();
}
public function show($publicId)
{
Session::reflash();
return Redirect::to("tasks/{$publicId}/edit");
}
/**
* Show the form for creating a new resource.
*

View File

@ -40,6 +40,11 @@ class Utils
}
}
public static function isDownForMaintenance()
{
return file_exists(storage_path() . '/framework/down');
}
public static function isProd()
{
return App::environment() == ENV_PRODUCTION;

View File

@ -62,8 +62,12 @@
@section('body')
<div class="container">
@include('partials.warn_session', ['redirectTo' => '/login'])
{!! Former::open('login')->rules(['email' => 'required|email', 'password' => 'required'])->addClass('form-signin') !!}
{!! Former::open('login')
->rules(['email' => 'required|email', 'password' => 'required'])
->addClass('form-signin warn-on-exit') !!}
{{ Former::populateField('remember', 'true') }}
<div class="modal-header">

View File

@ -691,21 +691,17 @@
while($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) {
$(this).height($(this).height()+1);
};
});
});
@if (Auth::user()->account->fill_products)
$('.datalist').on('input', function() {
$('.datalist').on('input', function() {
var key = $(this).val();
for (var i=0; i<products.length; i++) {
var product = products[i];
if (product.product_key == key) {
var model = ko.dataFor(this);
if (!model.notes()) {
model.notes(product.notes);
}
if (!model.cost()) {
model.cost(accounting.toFixed(product.cost,2));
}
var model = ko.dataFor(this);
model.notes(product.notes);
model.cost(accounting.toFixed(product.cost,2));
if (!model.qty()) {
model.qty(1);
}
@ -1741,23 +1737,22 @@
} else {
return total ? formatMoney(total, 1) : '';
}
});
});
this.hideActions = function() {
this.actionsVisible(false);
}
this.hideActions = function() {
this.actionsVisible(false);
}
this.showActions = function() {
this.actionsVisible(true);
}
this.showActions = function() {
this.actionsVisible(true);
}
this.isEmpty = function() {
return !self.product_key() && !self.notes() && !self.cost() && (!self.qty() || {{ $account->hide_quantity ? 'true' : 'false' }});
}
this.isEmpty = function() {
return !self.product_key() && !self.notes() && !self.cost() && (!self.qty() || {{ $account->hide_quantity ? 'true' : 'false' }});
}
this.onSelect = function(){
this.onSelect = function() {}
}
}
function onItemChange()
{
@ -1772,12 +1767,6 @@
if (!hasEmpty) {
model.invoice().addItem();
}
/*
$('.word-wrap').each(function(index, input) {
$(input).height($(input).val().split('\n').length * 20);
});
*/
}
function onTaxRateChange()