Merge branch 'master' of gitlab.com:jankstudio/resq

This commit is contained in:
Kendrick Chan 2018-02-04 18:49:47 +08:00
commit 1961a86dfa
31 changed files with 639 additions and 683 deletions

View file

@ -0,0 +1,14 @@
$(function() {
$(document).ajaxError(function(event, response, ajaxSettings, thrownError) {
switch (response.status) {
case 500:
default:
swal({
title: 'Whoops!',
text: 'We encountered a problem. Please contact technical support.',
type: 'error'
});
break;
}
});
});

View file

@ -694,6 +694,7 @@
<!--end::Page Vendors --> <!--end::Page Vendors -->
<!--begin::Page Snippets --> <!--begin::Page Snippets -->
<script src="/assets/app/js/dashboard.js" type="text/javascript"></script> <script src="/assets/app/js/dashboard.js" type="text/javascript"></script>
<script src="/assets/js/common.js" type="text/javascript"></script>
<!--end::Page Snippets --> <!--end::Page Snippets -->
<!--begin::Extra Scripts --> <!--begin::Extra Scripts -->

View file

@ -86,6 +86,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -118,6 +119,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -137,12 +137,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -86,6 +86,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -118,6 +119,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -137,12 +137,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -86,6 +86,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -118,6 +119,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -137,12 +137,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -32,18 +32,8 @@
</div> </div>
</div> </div>
</div> </div>
<form id="row-form" class="m-form m-form--label-align-right" method="post" action="{{ mode == 'update' ? url('battery_update_submit', {'id': obj.getId()}) : url('battery_create_submit') }}"> <form id="row-form" class="m-form m-form--fit m-form--label-align-right" method="post" action="{{ mode == 'update' ? url('battery_update_submit', {'id': obj.getId()}) : url('battery_create_submit') }}">
<div class="m-portlet__body"> <div class="m-portlet__body">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#product-info">Product Information</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#vehicle-compatibility">Vehicle Compatibility</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="product-info" role="tabpanel">
<div class="m-form__section m-form__section--first"> <div class="m-form__section m-form__section--first">
<div class="m-form__heading"> <div class="m-form__heading">
<h3 class="m-form__heading-title"> <h3 class="m-form__heading-title">
@ -131,6 +121,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="m-form__seperator m-form__seperator--dashed"></div>
<div class="m-form__section"> <div class="m-form__section">
<div class="m-form__heading"> <div class="m-form__heading">
<h3 class="m-form__heading-title"> <h3 class="m-form__heading-title">
@ -182,14 +173,19 @@
</div> </div>
</div> </div>
</div> </div>
<div class="m-form__seperator m-form__seperator--dashed"></div>
<div class="m-form__section m-form__section--last">
<div class="m-form__heading">
<h3 class="m-form__heading-title">
Vehicle Compatibility
</h3>
</div> </div>
<div class="tab-pane" id="vehicle-compatibility" role="tabpanel"> <div class="form-group m-form__group row">
<div class="form-group m-form__group row form-group-inner">
<div class="col-lg-12"> <div class="col-lg-12">
<div id="data-vehicles"></div> <div id="data-vehicles"></div>
</div> </div>
</div> </div>
<div class="form-group m-form__group row form-group-inner"> <div class="form-group m-form__group row">
<label class="col-lg-1 col-form-label" data-field="vehicle_list"> <label class="col-lg-1 col-form-label" data-field="vehicle_list">
Add Vehicle: Add Vehicle:
</label> </label>
@ -212,7 +208,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="m-portlet__foot m-portlet__foot--fit"> <div class="m-portlet__foot m-portlet__foot--fit">
<div class="m-form__actions m-form__actions--solid m-form__actions--right"> <div class="m-form__actions m-form__actions--solid m-form__actions--right">
<div class="row"> <div class="row">
@ -264,6 +259,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -296,6 +292,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -171,12 +171,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -139,18 +139,18 @@
<div class="m_datatable" id="data-tickets"></div> <div class="m_datatable" id="data-tickets"></div>
</div> </div>
</div> </div>
<div class="form-group m-form__group row">
<div class="col-lg-12">
<a href="{{ url('ticket_create', {'customer_id': obj.getID}) }}" class="btn btn-primary">Create Ticket</a>
</div>
</div>
</div> </div>
{% endif %} {% endif %}
</div> </div>
<div class="m-portlet__foot m-portlet__foot--fit"> <div class="m-portlet__foot m-portlet__foot--fit">
<div class="m-form__actions m-form__actions--solid m-form__actions--right"> <div class="m-form__actions m-form__actions--solid m-form__actions--right">
<div class="row"> <div class="row">
<div class="col-lg-6 text-left"> <div class="col-lg-12">
{% if mode == 'update' %}
<a href="{{ url('ticket_create', {'customer_id': obj.getID}) }}" class="btn btn-info"><i class="fa fa-ticket fa-fw"></i>Create Ticket</a>
{% endif %}
</div>
<div class="col-lg-6">
<button type="submit" class="btn btn-success">Submit</button> <button type="submit" class="btn btn-success">Submit</button>
<a href="{{ url('customer_list') }}" class="btn btn-secondary">Cancel</a> <a href="{{ url('customer_list') }}" class="btn btn-secondary">Cancel</a>
</div> </div>
@ -369,6 +369,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var json = response.responseJSON; var json = response.responseJSON;
var errors = json.errors; var errors = json.errors;
var nerrors = json.nerrors; var nerrors = json.nerrors;
@ -462,6 +463,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -192,12 +192,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -269,6 +269,7 @@ $(function() {
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -301,6 +302,7 @@ $(function() {
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -154,12 +154,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -698,6 +698,7 @@ $(function() {
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -730,6 +731,7 @@ $(function() {
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -248,6 +248,7 @@ $(function() {
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -280,6 +281,7 @@ $(function() {
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -158,12 +158,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -114,6 +114,7 @@ $(function() {
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -146,6 +147,7 @@ $(function() {
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -146,12 +146,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -169,6 +169,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -201,6 +202,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -161,12 +161,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -116,6 +116,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -148,6 +149,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -133,12 +133,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -102,7 +102,7 @@
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<button type="submit" class="btn btn-success">Submit</button> <button type="submit" class="btn btn-success">Submit</button>
<a href="{{ url('ticket_list') }}" class="btn btn-secondary">Cancel</a> <a href="{{ redirect_url }}" class="btn btn-secondary">Cancel</a>
</div> </div>
</div> </div>
</div> </div>
@ -138,6 +138,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -170,6 +171,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -163,12 +163,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -184,6 +184,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -216,6 +217,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -165,12 +165,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -86,6 +86,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -118,6 +119,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -137,12 +137,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });

View file

@ -122,6 +122,7 @@
} }
}); });
}).fail(function(response) { }).fail(function(response) {
if (response.status == 422) {
var errors = response.responseJSON.errors; var errors = response.responseJSON.errors;
var firstfield = false; var firstfield = false;
@ -154,6 +155,7 @@
$('html, body').animate({ $('html, body').animate({
scrollTop: $(firstfield).offset().top - 200 scrollTop: $(firstfield).offset().top - 200
}, 100); }, 100);
}
}); });
}); });

View file

@ -145,12 +145,6 @@
}).done(function(response) { }).done(function(response) {
table.row(btn.parents('tr')).remove(); table.row(btn.parents('tr')).remove();
table.reload(); table.reload();
}).fail(function() {
swal({
title: 'Whoops',
text: 'An error occurred while deleting this item. Please contact support.',
type: 'error'
});
}); });
} }
}); });