Hide upload button if app is locked

This commit is contained in:
snipe 2017-11-01 23:44:31 -07:00
parent 4f008e118f
commit 3ca5d39c66
2 changed files with 29 additions and 7 deletions

View file

@ -29,12 +29,16 @@
<div class="box-body">
<div class="row">
<div class="col-md-3">
<!-- The fileinput-button span is used to style the file input field as button -->
@if (!config('app.lock_passwords'))
<span class="btn btn-info fileinput-button">
<span>Select Import File...</span>
<!-- The file input field used as target for the file upload widget -->
<input id="fileupload" type="file" name="files[]" data-url="{{ route('api.imports.index') }}" accept="text/csv">
</span>
@endif
</div>
<div class="col-md-9" v-show="progress.visible" style="padding-bottom:20px">
<div class="col-md-11">

View file

@ -13,12 +13,17 @@ Create a User
{{-- Page content --}}
@section('content')
<link rel="stylesheet" type="text/css" href="{{ asset('css/lib/jquery.fileupload.css') }}">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" action="">
<div class="box box-default">
<div class="box-body">
@if (config('app.lock_passwords'))
<p class="alert alert-warning">CSV uploads are disabled on the demo.</p>
@endif
<!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
@ -41,14 +46,22 @@ Create a User
Any additional fields to the right of those fields will be ignored. Email is optional, however users will not be able to recover their passwords or receive EULAs if you do not provide an email address. If you wish to include a company association, you must reference the ID number of an existing company - companies will not be created on the fly.
</p>
@if (config('app.lock_passwords'))
<p>Note: Email notification for users is disabled for this installation.</p>
@endif
<div class="form-group {!! $errors->first('user_import_csv', 'has-error') }}">
<div class="form-group {!! $errors->first('user_import_csv', 'has-error') !!}">
<label for="first_name" class="col-sm-3 control-label">{{ trans('admin/users/general.usercsv') }}</label>
<div class="col-sm-5">
<input type="file" name="user_import_csv" id="user_import_csv">
<span class="btn btn-info fileinput-button">
<span>Select Import File...</span>
@if (config('app.lock_passwords'))
<input id="fileupload" type="file" name="user_import_csv" accept="text/csv" disabled="disabled" class="disabled">
@else
<input id="fileupload" type="file" name="user_import_csv" accept="text/csv">
@endif
</span>
</div>
</div>
@ -81,7 +94,12 @@ Create a User
</div> <!--/box-body-->
<!-- Form Actions -->
<div class="box-footer text-right">
@if (config('app.lock_passwords'))
<button type="submit" class="btn btn-default disabled" disabled="disabled">{{ trans('button.submit') }}</button>
@else
<button type="submit" class="btn btn-default">{{ trans('button.submit') }}</button>
@endif
</div>
</div>
</form>