frontend stuff

This commit is contained in:
akemidx 2023-12-12 18:56:21 -05:00
parent e791ebbe76
commit e9e68171bb
2 changed files with 21 additions and 13 deletions

View file

@ -53,9 +53,9 @@ class SavedReport extends Model
// @todo: this method feels more like "radioShouldBeChecked" or something... // @todo: this method feels more like "radioShouldBeChecked" or something...
// @todo: improve the variable names... // @todo: improve the variable names...
// if (array_has($this->options, $property) && $this->options[$property] === $value) { if (array_has($this->options, $property) && $this->options[$property] === $value) {
// return $return; return $return;
// } }
// this is currently throwing an error. $property is coming through as a string and it needs to be an array // this is currently throwing an error. $property is coming through as a string and it needs to be an array
return null; return null;

View file

@ -365,23 +365,17 @@
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<div style=padding-bottom:5px>
<button type="submit" class="btn btn-success" style="width: 100%">
<i class="fas fa-download icon-white" aria-hidden="true"></i>
{{ trans('general.generate') }}
</button>
</div>
<div style=padding-bottom:5px> <div style=padding-bottom:5px>
<form method="post" id="savetemplateform" action="{{ route("savedreports/store") }}"> <form method="post" id="savetemplateform" action="{{ route("savedreports/store") }}">
@csrf @csrf
<input type="hidden" id="savetemplateform" name="options"> <input type="hidden" id="savetemplateform" name="options">
<input type="text" id="name" name="name" value="{{ $savedReport->name }}"> <input type="text" id="name" name="name" value="{{ $savedReport->name }}">
{{-- this will be a box to name the report? --}} <button class="btn btn-primary" style="width: 100%">
<button class = "btn btn-primary" style="width: 100%">
{{ trans('admin/reports/general.save_template') }} {{ trans('admin/reports/general.save_template') }}
</button> </button>
</form> </form>
</div> </div>
<div style=padding-bottom:5px> <div style=padding-bottom:5px>
{{-- <a href="#" class="js-data-ajax" data-toggle="dropdown" tabindex="-1" data-placeholder="{{ trans('admin/reports/general.saved_reports')}}" style="width:100%">--}} {{-- <a href="#" class="js-data-ajax" data-toggle="dropdown" tabindex="-1" data-placeholder="{{ trans('admin/reports/general.saved_reports')}}" style="width:100%">--}}
{{-- {{ trans('admin/reports/general.select_template') }}--}} {{-- {{ trans('admin/reports/general.select_template') }}--}}
@ -391,7 +385,7 @@
<select <select
id="saved_report_select" id="saved_report_select"
class="form-control select2" class="form-control select2"
data-placeholder="Load Saved Report" data-placeholder="Load Saved Report" {{-- needs translation --}}
data-allow-clear="true" data-allow-clear="true"
> >
<option></option> <option></option>
@ -401,6 +395,19 @@
</option> </option>
@endforeach @endforeach
</select> </select>
@if($saved_reports->first()!="")
<button class = "btn btn-success" style="width: 32%">
<i class="fas fa-download icon-white" aria-hidden="true"></i>
</button>
<button class = "btn btn-primary" style="width: 32%">
{{ "update"}}
</button>
<button class = "btn btn-warning" style="width: 32%">
{{ "delete" }}
</button>
@endif
@push('js') @push('js')
<script> <script>
$('#saved_report_select') $('#saved_report_select')
@ -461,7 +468,8 @@
e.preventDefault(e); e.preventDefault(e);
let form = $('#custom-report-form'); let form = $('#custom-report-form');
{{-- handle null? --}}
{{-- handle duplicate name? --}}
$('<input>').attr({ $('<input>').attr({
type: 'hidden', type: 'hidden',
name: 'name', name: 'name',