Fixed validation error
Change-Id: Idcee2ad4fdaae3ece1d1d8438528ca318d173292 Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
parent
55d3c2b15f
commit
d74b708d78
|
@ -184,7 +184,6 @@ Route::group(['namespace' => 'App\Http\Controllers', 'middleware' => 'web' ], fu
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
Route::group(['prefix' => 'groups', 'middleware' => ['openstackid.currentuser.serveradmin.json']], function () {
|
||||
Route::get('', "GroupApiController@getAll");
|
||||
Route::post('', "GroupApiController@create");
|
||||
|
|
|
@ -325,6 +325,7 @@ span.help-block::before {
|
|||
vertical-align: middle;
|
||||
border-radius: 50%;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.help-block{
|
||||
|
|
|
@ -39,6 +39,8 @@ $(document).ready(function() {
|
|||
$('#statement_of_interest').summernote();
|
||||
$('#birthday').datepicker();
|
||||
|
||||
$('#img-pic',form).data('original-src', $('#img-pic', form).attr('src'));
|
||||
|
||||
$('#country_iso_code').chosen({width: '100%', height: '34px'});
|
||||
$("#country_iso_code").val(current_country);
|
||||
$("#country_iso_code").trigger("chosen:updated");
|
||||
|
@ -138,8 +140,35 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
|
||||
$("#pic", form).change(function() {
|
||||
readURL(this);
|
||||
function fileValidation(input) {
|
||||
|
||||
var filePath = input.value;
|
||||
|
||||
// Allowing file type
|
||||
var allowedExtensions =
|
||||
/(\.png|\.jpeg|\.jpg)$/i;
|
||||
|
||||
if (!allowedExtensions.exec(filePath)) {
|
||||
swal({
|
||||
title: "Validation Error",
|
||||
type: "warning",
|
||||
text: "Invalid file type",
|
||||
});
|
||||
var imgSrc = $('#img-pic', form).data('original-src');
|
||||
$(input).val('');
|
||||
$('#img-pic', form).attr('src', imgSrc);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$("#pic", form).change(function(evt) {
|
||||
if(fileValidation(this)) {
|
||||
readURL(this);
|
||||
return true;
|
||||
}
|
||||
evt.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#password_container").hide();
|
||||
|
|
|
@ -237,5 +237,5 @@
|
|||
{!! HTML::script('assets/chosen-js/chosen.jquery.js') !!}
|
||||
{!! HTML::script("assets/js/urlfragment.jquery.js") !!}
|
||||
{!! HTML::script("assets/moment/min/moment.min.js") !!}
|
||||
{!! HTML::script('assets/js/admin/edit-user.js') !!}
|
||||
{!! HTML::script('assets/js/admin/edit-user.js?v='.rand(1,1000)) !!}
|
||||
@append
|
|
@ -351,5 +351,5 @@
|
|||
{!! HTML::script('assets/chosen-js/chosen.jquery.js') !!}
|
||||
{!! HTML::script("assets/js/urlfragment.jquery.js") !!}
|
||||
{!! HTML::script("assets/moment/min/moment.min.js") !!}
|
||||
{!! HTML::script('assets/js/profile.js') !!}
|
||||
{!! HTML::script('assets/js/profile.js?v='.rand(1,1000)) !!}
|
||||
@append
|
Loading…
Reference in New Issue