Lots of HTML/CSS tweaks for better UI

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-03-08 00:32:30 -08:00
parent e143e0c5ee
commit 1ed7cd27b4

View file

@ -1,120 +1,122 @@
<tr id="importer-file">
<td colspan="5">
<div class="col-md-12">
<div class="row">
<div class="dynamic-form-row">
<div class="col-md-5 col-xs-12">
<label for="import-type">Import Type:</label>
</div>
<div class="col-md-12">
<div class="col-md-7 col-xs-12">
<div class="form-group col-md-12">
<label for="activeFile.import_type" class="col-md-3 col-xs-12 text-right">
Import Type
</label>
<div class="col-md-9 col-xs-12">
{{ Form::select('activeFile.import_type', $importTypes, $activeFile->import_type, [
'id' => 'import_type',
'class' => 'livewire-select2',
'style' => 'min-width: 350px',
'data-placeholder' => 'Select an import type...', /* TODO: translate me */
'placeholder' => '', //needed so that the form-helper will put an empty option first
'data-minimum-results-for-search' => '-1', // Remove this if the list gets long enough that we need to search
'data-livewire-component' => $_instance->id
]) }}
</div>
</div>
</div><!-- /dynamic-form-row -->
<div class="dynamic-form-row">
<div class="col-md-5 col-xs-12">
<label for="import-update">Update Existing Values?:</label>
</div>
<div class="col-md-7 col-xs-12" wire:ignore>
<div class="form-group col-md-12">
<label for="update" class="col-md-9 col-md-offset-3 col-xs-12" wire:ignore>
<input type="checkbox" class="minimal livewire-icheck" name="update" data-livewire-component="{{ $_instance->id }}">
</div>
</div><!-- /dynamic-form-row -->
Update Existing Values?
</label>
</div>
<div class="dynamic-form-row">
<div class="col-md-5 col-xs-12">
<label for="send_welcome">Send Welcome Email for new Users?</label>
</div>
<div class="col-md-7 col-xs-12" wire:ignore>
<input type="checkbox" class="minimal livewire-icheck" name="send_welcome" data-livewire-component="{{ $_instance->id }}">
</div>
</div><!-- /dynamic-form-row -->
<div class="form-group col-md-12">
<label for="send_welcome" class="col-md-9 col-md-offset-3 col-xs-12" wire:ignore>
<input type="checkbox" class="minimal livewire-icheck" name="send_welcome" data-livewire-component="{{ $_instance->id }}">
Send Welcome Email for new Users?
</label>
</div>
<div class="dynamic-form-row">
<div class="col-md-5 col-xs-12">
<label for="run_backup">Backup before importing?</label>
</div>
<div class="col-md-7 col-xs-12" wire:ignore>
<div class="form-group col-md-12">
<label for="run_backup" class="col-md-9 col-md-offset-3 col-xs-12" wire:ignore>
<input type="checkbox" class="minimal livewire-icheck" name="run_backup" data-livewire-component="{{ $_instance->id }}">
Backup before importing?
</label>
</div>
@if ($statusText)
<div class="form-group">
<div class="alert col-md-8 col-md-offset-2 {{ $statusType == 'success' ? 'alert-success' : ($statusType == 'error' ? 'alert-danger' : 'alert-info') }}" style="text-align:left">
{{ $statusText }}
</div><!-- /alert -->
</div>
</div><!-- /dynamic-form-row -->
@if($statusText)
<div class="alert col-md-8 col-md-offset-2 {{ $statusType == 'success' ? 'alert-success' : ($statusType == 'error' ? 'alert-danger' : 'alert-info') }}" style="text-align:left">
{{ $statusText }}
</div><!-- /alert -->
@endif
</div> <!-- /div row -->
@if($activeFile->import_type)
<div class="row">
<div class="col-md-12" style="padding-top: 30px;">
<div class="col-md-4 text-right"><h4>Header Field</h4></div>
<div class="col-md-4"><h4>Import Field</h4></div>
<div class="col-md-4"><h4>Sample Value</h4></div>
@if ($activeFile->import_type)
<div class="form-group col-md-12">
<hr style="border-top: 1px solid lightgray">
<h3>Map Import Fields</h3>
<hr style="border-top: 1px solid lightgray">
</div>
<div class="form-group col-md-12">
<div class="col-md-3 text-right">
<strong>Header Field</strong>
</div>
<div class="col-md-4">
<strong>Import Field</strong>
</div>
<div class="col-md-5">
<strong>Sample Value</strong>
</div>
</div><!-- /div row -->
@if($activeFile->header_row)
@foreach($activeFile->header_row AS $index => $header)
<div class="row" wire:key="header-row-{{ $index }}">
<div class="col-md-12">
<div class="col-md-4 text-right">
<label for="field_map.{{ $index }}" class="control-label">{{ $header }}</label>
</div>
<div class="col-md-4 form-group">
<div required>
@foreach($activeFile->header_row as $index => $header)
<div class="form-group col-md-12" wire:key="header-row-{{ $index }}">
<label for="field_map.{{ $index }}" class="col-md-3 control-label text-right">{{ $header }}</label>
<div class="col-md-4">
{{ Form::select('field_map.'.$index, $columnOptions[$activeFile->import_type], @$field_map[$index],
[
'class' => 'mappings livewire-select2',
'placeholder' => 'Do Not Import',
'style' => 'min-width: 100%',
'data-livewire-component' => $_instance->id
],[
'-' => ['disabled' => true] // this makes the "-----" line unclickable
])
}}
</div>
</div>
<div class="col-md-4">
<p class="form-control-static">{{ $activeFile->first_row[$index] }}</p>
<div class="col-md-5">
<p class="form-control-static">{{ str_limit($activeFile->first_row[$index], 50, '...') }}</p>
</div>
</div><!-- /div col-md-8 -->
</div><!-- /div row -->
@endforeach
@else
No Columns Found!
@endif
<div class="row">
<div class="col-md-6 col-md-offset-2 text-right" style="padding-top: 20px;">
<button type="button" class="btn btn-sm btn-default" wire:click="$emit('hideDetails')">Cancel</button>
<button type="submit" class="btn btn-sm btn-primary" id="import">Import</button>
<br><br>
<div class="form-group col-md-12">
<div class="col-md-3 text-left">
<a href="#" wire:click="$emit('hideDetails')">{{ trans('general.cancel') }}</a>
</div>
<div class="col-md-9">
<button type="submit" class="btn btn-primary col-md-5" id="import">Import</button>
<br><br>
</div>
</div>
</div><!-- /div row -->
<div class="row">
@if($statusText)
<div class="alert col-md-8 col-md-offset-2 {{ $statusType == 'success' ? 'alert-success' : ($statusType == 'error' ? 'alert-danger' : 'alert-info') }}"
style="padding-top: 20px;"
>
{{ $statusText }}
</div>
<div class="alert col-md-12 col-md-offset-2 {{ $statusType == 'success' ? 'alert-success' : ($statusType == 'error' ? 'alert-danger' : 'alert-info') }}" style="padding-top: 20px;">
{{ $statusText }}
</div>
@endif
</div><!-- /div row -->
@endif {{-- end of if ... activeFile->import_type --}}
</div><!-- /div v-show -->
</td>
</tr>
<script>
$(function () {
// initialize iCheck for use with livewire