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: improve the variable names...
// if (array_has($this->options, $property) && $this->options[$property] === $value) {
// return $return;
// }
if (array_has($this->options, $property) && $this->options[$property] === $value) {
return $return;
}
// this is currently throwing an error. $property is coming through as a string and it needs to be an array
return null;

View file

@ -365,23 +365,17 @@
</div>
<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>
<form method="post" id="savetemplateform" action="{{ route("savedreports/store") }}">
@csrf
<input type="hidden" id="savetemplateform" name="options">
<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') }}
</button>
</form>
</div>
<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%">--}}
{{-- {{ trans('admin/reports/general.select_template') }}--}}
@ -391,7 +385,7 @@
<select
id="saved_report_select"
class="form-control select2"
data-placeholder="Load Saved Report"
data-placeholder="Load Saved Report" {{-- needs translation --}}
data-allow-clear="true"
>
<option></option>
@ -401,6 +395,19 @@
</option>
@endforeach
</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')
<script>
$('#saved_report_select')
@ -461,7 +468,8 @@
e.preventDefault(e);
let form = $('#custom-report-form');
{{-- handle null? --}}
{{-- handle duplicate name? --}}
$('<input>').attr({
type: 'hidden',
name: 'name',