initial commit
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
@foreach ($obj as $key => $field)
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
||||
@switch($field['type'])
|
||||
@case('text')
|
||||
<input name="{{ $key }}" id="{{ $key }}" type="text" class="form-control" value="{{$data->$key ?? ''}}">
|
||||
@break
|
||||
@case('select')
|
||||
<select name="{{ $key }}" id="{{ $key }}" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($field['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? "" }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+509
@@ -0,0 +1,509 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/".$general['cont_name'];
|
||||
@endphp
|
||||
@if($parents['grupa']||$parents['objekat'])
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-12 col-xl-6">
|
||||
<div class="h3">unutar:</div>
|
||||
<table class="hiddenAtLoad d-none table table-striped table-bordered"
|
||||
id="dep_table"
|
||||
data-toggle="table"
|
||||
data-pagination="false"
|
||||
data-search="false"
|
||||
data-show-columns="false"
|
||||
data-show-footer="false"
|
||||
data-show-header="false"
|
||||
data-detail-formatter="def_detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th data-align="center" data-formatter="breadFormatter" data-events="breadEvents"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($parents['grupa'])
|
||||
@foreach ($parents['grupa'] as $key => $field)
|
||||
<tr data-id="1">
|
||||
<td>Grupe</td>
|
||||
<td>{{ $field->ime_grupe}}, {{ $field->j_grad }} ({{ $field->j_tip }})</td>
|
||||
<td>grupa</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@if($parents['objekat'])
|
||||
<tr data-id="2" data-qs="getrelObj={{ $parents['objekat']->j_grupa_ids}}">
|
||||
<td>Objekta</td>
|
||||
<td>{{ $parents['objekat']->prezime}} {{ $parents['objekat']->ime}}, {{ $parents['objekat']->j_ulica }} ({{ $parents['objekat']->j_grad }})</td>
|
||||
<td>objekat</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if($parents['prostorija'])
|
||||
<tr data-id="3" data-qs="getrelProst={{ $parents['prostorija']->objekat_id}}">
|
||||
<td>Prostorije</td>
|
||||
<td>{{ $parents['prostorija']->j_tip_prostorije}} ({{ $parents['prostorija']->dim_duzina}} x {{ $parents['prostorija']->dim_sirina }})</td>
|
||||
<td>prostorija</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if($parents['radijator'])
|
||||
<tr data-id="3" data-qs="getrelRadi={{ $parents['prostorija']->id}}">
|
||||
<td>Radijatora</td>
|
||||
<td>{{ $parents['radijator']->id}} {{ $parents['radijator']->j_tip_radijatora}} (priklj vent: {{ $parents['radijator']->j_tip_cola}}, vent: {{ $parents['radijator']->j_tip_ventila}})</td>
|
||||
<td>radijator</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div id="toolbar" class="">
|
||||
<div class="">
|
||||
<select name="f_mesta" id="f_mesta" class="filter ui search fluid normal dropdown f_mesta">
|
||||
<option value="">Sva mesta</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-toolbar="#toolbar"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="{{ $ajaxUrl }}/browse?{{ $qstring }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
data-query-params="queryParams"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endforeach
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui.label {
|
||||
background-color: #EEE;
|
||||
color: #666 !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.ui.label .icon:before {
|
||||
content: '\f00d';
|
||||
font-family: fontAwesome;
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
padding-left: 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
.ui.label .icon:hover:before {
|
||||
color: #F00;
|
||||
}
|
||||
.ui.selection.dropdown {
|
||||
min-height: inherit;
|
||||
}
|
||||
.bootstrap-table .fixed-table-container .fixed-table-body {
|
||||
overflow: visible !important;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
$(".f_mesta").dropdown({
|
||||
apiSettings: {
|
||||
url: '/admin/api/mesta',
|
||||
cache: false,
|
||||
},
|
||||
filterRemoteData: true,
|
||||
});
|
||||
$('.filter').dropdown('setting', 'onChange', function(){
|
||||
$("#listing_table").bootstrapTable('refresh',{pageNumber: 1});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function queryParams(params) {
|
||||
$.each($(".filter"), function( key, value ){
|
||||
console.log(value);
|
||||
params[$(value).attr('name')] = $(value).dropdown('get value');
|
||||
});
|
||||
// params['status'] = $("input[name='status']:checked").val();
|
||||
return params;
|
||||
}
|
||||
|
||||
function breadFormatter(value, row) {
|
||||
var t = [];
|
||||
switch(value) {
|
||||
case 'grupa':
|
||||
break;
|
||||
case 'objekat':
|
||||
t.push('<a class="objekat" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na objekat"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
case 'prostorija':
|
||||
t.push('<a class="prostorija" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na prostoriju"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
case 'radijator':
|
||||
t.push('<a class="radijator" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na radijator"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
}
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit mr-2" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
@if($getRelated === false)
|
||||
t.push('<a class="related mr-2" href="javascript:void(0)" title="Relacije"><i class="fa fa-filter"></i></a>');
|
||||
@endif
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit?'+queryStr, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create?'+queryStr, function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$('.ui.dropdown').dropdown();
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#grad_id").change(function() {
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url+'?'+queryStr,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
if(response.data){
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('refresh');
|
||||
}
|
||||
}else
|
||||
$("#listing_table").bootstrapTable('refresh');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
window.breadEvents = {
|
||||
'click .objekat': function (e, value, row, index) {
|
||||
window.location.href = '/admin/objekat?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
'click .prostorija': function (e, value, row, index) {
|
||||
window.location.href = '/admin/prostorija?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
'click .radijator': function (e, value, row, index) {
|
||||
window.location.href = '/admin/radijator?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .related': function (e, value, row, index) {
|
||||
window.location.href = '/admin/alokator?getrelAlok=' + row.radijator_id;
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', 'Dashboard')
|
||||
|
||||
@section('content_header')
|
||||
<h1>Dashboard</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<p></p>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script>
|
||||
|
||||
</script>
|
||||
@stop
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
@extends('adminlte::page')
|
||||
@section('content')
|
||||
<div class="error-page">
|
||||
<h2 class="headline text-danger">500</h2>
|
||||
<div class="error-content pt-5">
|
||||
<h3><i class="fas fa-exclamation-triangle text-danger"></i> Oops! Something went wrong.</h3>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
@foreach ($obj as $key => $field)
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
||||
@switch($field['type'])
|
||||
@case('text')
|
||||
<input name="{{ $key }}" id="{{ $key }}" type="text" class="form-control" value="{{$data->$key ?? ''}}">
|
||||
@break
|
||||
@case('select')
|
||||
<select name="{{ $key }}" id="{{ $key }}" class="form-control">
|
||||
@foreach ($field['fetch']() as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include("Admin.uredjaj.attach_index", ['id' => $data->id, 'type' => 'grupa'])
|
||||
@include("Admin.grupa.tip_obracuna_index", ['id' => $data->id])
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? '' }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
Executable
+370
@@ -0,0 +1,370 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-6">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new hideOnEdit" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="/admin/{{ $general['cont_name'] }}/browse"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-search="false"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
<th data-field="j_tip" data-sortable="true">
|
||||
Tip
|
||||
</th>
|
||||
<th data-field="ime_grupe" data-sortable="true">
|
||||
Naziv
|
||||
</th>
|
||||
<th data-field="j_grad" data-sortable="true">
|
||||
Grad
|
||||
</th>
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = "/admin/{{ $general['cont_name'] }}";
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete hideOnEdit mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit hideOnEdit mr-2" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
t.push('<a class="xml mr-2" href="javascript:void(0)" title="Genrisanje XML-a"><i class="fas fa-fw fa-code "></i></a>');
|
||||
t.push('<a class="objekti" href="javascript:void(0)" title="Objekti u ovoj grupi"><i class="fa fa-arrow-alt-circle-right"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit', function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create', function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.data)
|
||||
{
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else
|
||||
window.location.href = '';
|
||||
}
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#editor_container a.hideOnEdit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .objekti': function (e, value, row, index) {
|
||||
window.location.href = '/admin/objekat?getrelObj=' + row.id;
|
||||
},
|
||||
'click .xml': function (e, value, row, index) {
|
||||
window.location.href = '/admin/xml/' + row.id;
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#editor_container a.hideOnEdit').addClass('d-none');
|
||||
// $('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
@@ -0,0 +1,20 @@
|
||||
<div class="col-12 bg-uredjaj-edit">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="obracun_id">Obračun</label>
|
||||
<select name="obracun_id" id="obracun_id" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($obracuni as $key => $obracun)
|
||||
<option value="{{ $obracun->id }}">{{ $obracun->ime_tipa }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12 mb-2">
|
||||
<button type="button" class="btn-sm btn-secondary uredjaj_cancel">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-secondary uredjaj_submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,122 @@
|
||||
<style type="text/css">
|
||||
.card-header {
|
||||
background-color: rgba(0,0,0,.03);
|
||||
}
|
||||
.card-header, .card-body {
|
||||
padding: 0.6rem;
|
||||
}
|
||||
#tipObrContainer .fa {
|
||||
color: magenta;
|
||||
}
|
||||
</style>
|
||||
<div id="tipObrContainer" data-id="{{ $id }}" class="row">
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
getObracunForm();
|
||||
});
|
||||
|
||||
function getObracunForm() {
|
||||
$("#tipObrContainer").empty();
|
||||
var formData = [];
|
||||
formData.push({name:'grupa_id', value: $("#tipObrContainer").data('id') });
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
$("#tipObrContainer").load('/admin/grupa/{{ $id }}/getTipObracuna', formData, function() {
|
||||
$(this).find(".linkObracun").click(function (e) {
|
||||
loadObrLinkFrom($(this));
|
||||
return false;
|
||||
});
|
||||
$(this).find(".unLinkObracun").click(function (e) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Unlink ?',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var btn = $(this);
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
formData.push({name:'grupa_id', value: $("#tipObrContainer").data('id') });
|
||||
formData.push({name:'obracun_id', value: btn.data('id') });
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: '/admin/grupa/{{ $id }}/unlinkObracun',
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
getObracunForm();
|
||||
},
|
||||
error: function (response) {
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadObrLinkFrom(element) {
|
||||
var newEl = $( "<div id='LinkObrContainer'></div>" );
|
||||
var mRow = element.parent();
|
||||
mRow.after(newEl);
|
||||
|
||||
var formData = [];
|
||||
formData.push({name:'grupa_id', value: $("#tipObrContainer").data('id') });
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
url: '/admin/grupa/{{ $id }}/unlinkObracun',
|
||||
|
||||
$("#LinkObrContainer").load('/admin/grupa/{{ $id }}/linkObracunLoadForm', formData, function() {
|
||||
$(this).find('.dropdown').dropdown();
|
||||
$(this).find(".uredjaj_cancel").click(function (e) {
|
||||
$("#LinkObrContainer").remove();
|
||||
return false;
|
||||
});
|
||||
$(this).find(".uredjaj_submit").click(function (e) {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
var token = false;
|
||||
for(const [index, el] of formData.entries()) {
|
||||
if(el.name == '_token'){
|
||||
token = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!token){
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
}
|
||||
$.ajax({
|
||||
url: '/admin/grupa/{{ $id }}/linkObracun',
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
getObracunForm();
|
||||
if(response.error) {
|
||||
}else{
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
}
|
||||
});
|
||||
|
||||
$("#uredjajEditContainer").remove();
|
||||
mRow.addClass('d-flex').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="col-12">
|
||||
<div class="card bg-light">
|
||||
<div class="card-header">
|
||||
Dodeljeni tipovi obračuna
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center pb-1">
|
||||
<a href="#" data-id="0" class="hideOnEdit ml-auto linkObracun"><i class="fa fa-link" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
<div class="row editcontainer">
|
||||
</div>
|
||||
<ul id="list" class="list-group">
|
||||
@foreach($obracuni as $key => $obracun_tip)
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<b>{{ $obracun_tip->ime_tipa }}</b>
|
||||
<a href="#" data-id="{{$obracun_tip->id}}" class="hideOnEdit ml-auto unLinkObracun"><i class="fa fa-unlink" aria-hidden="true"></i></a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', 'Dashboard')
|
||||
|
||||
@section('content_header')
|
||||
<h1>Dashboard</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<p>Welcome to this beautiful admin panel.</p>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<link rel="stylesheet" href="/css/admin_custom.css">
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script>
|
||||
</script>
|
||||
@stop
|
||||
@@ -0,0 +1,99 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', 'Dashboard')
|
||||
|
||||
@section('content_header')
|
||||
<h1>{!! $general['title'] !!}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/".$general['cont_name'];
|
||||
@endphp
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="{{ $ajaxUrl }}/browse"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="false"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endforeach
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="report" href="javascript:void(0)" data-id="'+row.id+'" title="Radni nalog"><i class="fa fa-file"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
window.optEvents = {
|
||||
'click .report': function (e, value, row, index) {
|
||||
window.location.href = '/admin/izvestaji/radni_nalog/' + row.id;
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
@stop
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="ime_grada">Ime grada</label>
|
||||
<input name="ime_grada" id="ime_grada" type="text" class="form-control" value="{{$data->ime_grada ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="post_broj">Ime grada</label>
|
||||
<input name="post_broj" id="post_broj" type="text" class="form-control" value="{{$data->post_broj ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="zoom btn-sm btn-danger cancel" rel="{{ $data->id ?? "" }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+369
@@ -0,0 +1,369 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', 'Gradovi')
|
||||
|
||||
@section('content_header')
|
||||
<h1>Gradovi</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-6">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
Lista gradova
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="false"
|
||||
data-url="/admin/gradovi/browse"
|
||||
data-unique-id="id"
|
||||
data-sort-name="ime_grada"
|
||||
data-sort-order="asc"
|
||||
data-search="false"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
<th data-field="ime_grada" data-sortable="true">
|
||||
Ime
|
||||
</th>
|
||||
<th data-field="post_broj" data-sortable="true">
|
||||
Postanski broj
|
||||
</th>
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="card text-white bg-info mb-2 zoom col-6" style="max-width: 18rem;">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">12dfs sdf sdf sdf sdfsdfsd</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border-primary mb-2 zoom" style="max-width: 18rem;">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title align-middle">Primary card title</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border-primary mb-2 zoom" style="max-width: 18rem;">
|
||||
<div class="card-body text-primary">
|
||||
<h5 class="card-title">Primary card title</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = "/admin/gradovi";
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit', function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create', function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function openEditor(element, index){
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
// $('.bsToggle').bootstrapToggle();
|
||||
$(".role_check").change(function() {
|
||||
var id = $(this).attr('id');
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$(".role_check").each(function(key, value){
|
||||
if($(value).attr('id') != id) {
|
||||
$(value).prop('checked', false).change();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.data)
|
||||
{
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else
|
||||
window.location.href = '';
|
||||
}
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
Executable
+339
@@ -0,0 +1,339 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="card">
|
||||
<div class="card-header font-weight-bolder text-primary">
|
||||
Podaci objekta
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="grad_id">Grad</label>
|
||||
<select name="grad_id" id="grad_id" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($obj['grad_id']['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->grad_id == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="ulica_id">Ulica</label>
|
||||
<select name="ulica_id" id="ulica_id" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($obj['ulica_id']['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->ulica_id == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="position-relative form-group">
|
||||
<label for="broj">Broj</label>
|
||||
<input name="broj" id="broj" type="text" class="form-control" value="{{$data->broj ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="position-relative form-group">
|
||||
<label for="ulaz">Ulaz</label>
|
||||
<input name="ulaz" id="ulaz" type="text" class="form-control" value="{{$data->ulaz ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="position-relative form-group">
|
||||
<label for="stan">Stan</label>
|
||||
<input name="stan" id="stan" type="text" class="form-control" value="{{$data->stan ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="position-relative form-group">
|
||||
<label for="sprat">Sprat</label>
|
||||
<input name="sprat" id="sprat" type="text" class="form-control" value="{{$data->sprat ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="tip_tarife">Tip tarife</label>
|
||||
<select name="tip_tarife" id="tip_tarife" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($obj['tip_tarife']['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->tip_tarife == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="grupa_id">Grupa</label>
|
||||
<select name="grupa_id[]" id="grupa_id" multiple class="form-control multiple ui search fluid normal dropdown server">
|
||||
@foreach ($data->grupe as $grupa)
|
||||
<option value="{{ $grupa->id }}" selected>{{ $grupa->ime_grupe . ', ' . $grupa->grad->ime_grada . '(' . $grupa->tip->ime_tipa . ')'}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="position-relative form-group">
|
||||
<label for="tarifna_grupa">Tarifna grupa</label>
|
||||
<input name="tarifna_grupa" id="tarifna_grupa" type="text" class="form-control" value="{{$data->tarifna_grupa ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="position-relative form-group">
|
||||
<label for="ind_kom">Ind kom</label>
|
||||
<input name="ind_kom" id="ind_kom" type="text" class="form-control" value="{{$data->ind_kom ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="position-relative form-group">
|
||||
<label for="povrsina">Povrsina</label>
|
||||
<input name="povrsina" id="povrsina" type="text" class="form-control" value="{{$data->povrsina ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="position-relative form-group">
|
||||
<label for="proc_povrsine">Procena povrsine</label>
|
||||
<input name="proc_povrsine" id="proc_povrsine" type="text" class="form-control" value="{{$data->proc_povrsine ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="position-relative form-group">
|
||||
<label for="ind_kal_zajednicki">Ind. kal. zajednicki</label>
|
||||
<input name="ind_kal_zajednicki" id="ind_kal_zajednicki" type="text" class="form-control" value="{{$data->ind_kal_zajednicki ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="position-relative form-group">
|
||||
<label for="ind_iskljucen">Ind. iskljucen</label>
|
||||
<input name="ind_iskljucen" id="ind_iskljucen" type="text" class="form-control" value="{{$data->ind_iskljucen ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="position-relative form-group">
|
||||
<label for="ind_los_kal">Ind. los. kal.</label>
|
||||
<input name="ind_los_kal" id="ind_los_kal" type="text" class="form-control" value="{{$data->ind_los_kal ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="position-relative form-group">
|
||||
<label for="los_koeficient">Los. koeficient</label>
|
||||
<input name="los_koeficient" id="los_koeficient" type="text" class="form-control" value="{{$data->los_koeficient ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="position-relative form-group">
|
||||
<label for="ind_alokator">Ind. alokator</label>
|
||||
<input name="ind_alokator" id="ind_alokator" type="text" class="form-control" value="{{$data->ind_alokator ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card @if(count($data->grupe)==0) d-none @endif" id="obracun_specific_fields">
|
||||
<div class="card-header font-weight-bolder text-primary">
|
||||
Polja vezana za obračun
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data->grupe as $grupa)
|
||||
@if(count($grupa->tipoviObracuna)>0)
|
||||
@foreach ($grupa->tipoviObracuna as $obracun)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if($i++ == 1) active @endif" id="obr-{{ $obracun->id }}-tab" data-toggle="tab" href="#obr-{{ $obracun->id }}" role="tab" aria-controls="obr-{{ $obracun->id }}" aria-selected="true">{{ $obracun->ime_tipa }}</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
</ul>
|
||||
<div class="tab-content" id="myTabContent">
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data->grupe as $grupa)
|
||||
@if(count($grupa->tipoviObracuna)>0)
|
||||
@foreach ($grupa->tipoviObracuna as $tipObracuna)
|
||||
@php
|
||||
$className = "App\\Services\\Obracuni\\" . $tipObracuna->ime_klase;
|
||||
$obrClass = new $className();
|
||||
$polja = $obrClass->getObracunSpecificFields();
|
||||
dd($polja);
|
||||
@endphp
|
||||
<div class="tab-pane fade show @if($i++ == 1) active @endif" id="obr-{{ $tipObracuna->id }}" role="tabpanel" aria-labelledby="obr-{{ $tipObracuna->id }}-tab">
|
||||
@if(isset($polja))
|
||||
@include("Admin.objekat.partial_formgen", ['obj' => $polja, 'obracun' => $tipObracuna, 'data' => $data->extr_obracun_fields[$tipObracuna->id]])
|
||||
@else
|
||||
Ne postoje polja definisana za ovaj tip obračuna
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header font-weight-bolder text-primary">
|
||||
Podaci o vlasniku objekta
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="prezime">Prezime</label>
|
||||
<input name="prezime" id="prezime" type="text" class="form-control" value="{{$data->prezime ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="ime">Ime</label>
|
||||
<input name="ime" id="ime" type="text" class="form-control" value="{{$data->ime ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="telefon">Telefon</label>
|
||||
<input name="telefon" id="telefon" type="text" class="form-control" value="{{$data->telefon ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="jmbg">JMBG/PIB</label>
|
||||
<input name="jmbg" id="jmbg" type="text" class="form-control" value="{{$data->jmbg ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="icheck-success">
|
||||
<input type="checkbox" name="adr_vlasnika_razl_check" value="1" @if($vl_adresa->grad) checked @endif id="adr_vlasnika_razl_check" />
|
||||
<label class="text-success" for="adr_vlasnika_razl_check">Adresa vlasnika se razlikuje od adrese objekta</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="adr_vlasnika" class="form-row @if(!$vl_adresa->grad) d-none @endif">
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="vl_grad_id">Grad</label>
|
||||
<select name="vl_grad_id" id="vl_grad_id" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($obj['grad_id']['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($vl_adresa->grad_id == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="vl_ulica_id">Ulica</label>
|
||||
<select name="vl_ulica_id" id="vl_ulica_id" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($obj['ulica_id']['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($vl_adresa->ulica_id == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="position-relative form-group">
|
||||
<label for="vl_broj">Broj</label>
|
||||
<input name="vl_broj" id="vl_broj" type="text" class="form-control" value="{{$vl_adresa->broj ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="position-relative form-group">
|
||||
<label for="vl_ulaz">Ulaz</label>
|
||||
<input name="vl_ulaz" id="vl_ulaz" type="text" class="form-control" value="{{$vl_adresa->ulaz ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="position-relative form-group">
|
||||
<label for="vl_stan">Stan</label>
|
||||
<input name="vl_stan" id="vl_stan" type="text" class="form-control" value="{{$vl_adresa->stan ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="icheck-default">
|
||||
<input type="checkbox" name="adr_zakupac_check" value="1" @if($zakup_adresa->grad) checked @endif id="adr_zakupac_check" />
|
||||
<label class="text-default" for="adr_zakupac_check">Postoji zakupac</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card @if(!$zakup_adresa->grad) d-none @endif" id="adr_zakupac">
|
||||
<div class="card-header font-weight-bolder text-primary">
|
||||
Podaci o zakupcu objekta
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="zak_prezime">Prezime</label>
|
||||
<input name="zak_prezime" id="zak_prezime" type="text" class="form-control" value="{{$zakup_adresa->prezime ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="zak_ime">Ime</label>
|
||||
<input name="zak_ime" id="zak_ime" type="text" class="form-control" value="{{$zakup_adresa->ime ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="zak_telefon">Telefon</label>
|
||||
<input name="zak_telefon" id="zak_telefon" type="text" class="form-control" value="{{$zakup_adresa->telefon ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="zak_jmbg">JMBG/PIB</label>
|
||||
<input name="zak_jmbg" id="zak_jmbg" type="text" class="form-control" value="{{$zakup_adresa->jmbg ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="zak_grad_id">Grad</label>
|
||||
<select name="zak_grad_id" id="zak_grad_id" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($obj['grad_id']['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($zakup_adresa->grad_id == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="zak_ulica_id">Ulica</label>
|
||||
<select name="zak_ulica_id" id="zak_ulica_id" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($obj['ulica_id']['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($zakup_adresa->ulica_id == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="position-relative form-group">
|
||||
<label for="zak_broj">zak_Broj</label>
|
||||
<input name="zak_broj" id="zak_broj" type="text" class="form-control" value="{{$zakup_adresa->broj ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="position-relative form-group">
|
||||
<label for="zak_ulaz">Ulaz</label>
|
||||
<input name="zak_ulaz" id="zak_ulaz" type="text" class="form-control" value="{{$zakup_adresa->ulaz ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="position-relative form-group">
|
||||
<label for="zak_stan">Stan</label>
|
||||
<input name="zak_stan" id="zak_stan" type="text" class="form-control" value="{{$zakup_adresa->stan ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include("Admin.uredjaj.attach_index", ['id' => $data->id, 'type' => 'objekat'])
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? "" }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+485
@@ -0,0 +1,485 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/".$general['cont_name'];
|
||||
@endphp
|
||||
@if($parents['grupa'])
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-12 col-xl-6">
|
||||
<div class="h3">unutar:</div>
|
||||
<table class="hiddenAtLoad d-none table table-striped table-bordered"
|
||||
id="dep_table"
|
||||
data-toggle="table"
|
||||
data-pagination="false"
|
||||
data-search="false"
|
||||
data-show-columns="false"
|
||||
data-show-footer="false"
|
||||
data-show-header="false"
|
||||
data-detail-formatter="def_detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th data-align="center"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($parents['grupa'])
|
||||
@foreach ($parents['grupa'] as $key => $field)
|
||||
<tr data-id="1">
|
||||
<td>Grupe</td>
|
||||
<td>{{ $field->ime_grupe}}, {{ $field->j_grad }} ({{ $field->j_tip }})</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="{{ $ajaxUrl }}/browse?{{ $qstring }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
@if($field['list'])
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui.label {
|
||||
background-color: #EEE;
|
||||
color: #666 !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.ui.label .icon:before {
|
||||
content: '\f00d';
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
padding-left: 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
.ui.label .icon:hover:before {
|
||||
color: #F00;
|
||||
}
|
||||
|
||||
</style>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/icheck-bootstrap/3.0.1/icheck-bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/components/transition.min.css" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/components/icon.min.css" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/components/label.min.css" />
|
||||
<link href="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/css/bootstrap4-toggle.min.css" rel="stylesheet">
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/js/bootstrap4-toggle.min.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
// var ajaxUrl = "/admin/{{ $general['cont_name'] }}";
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit mr-2" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
@if($getRelated === false)
|
||||
t.push('<a class="related mr-2" href="javascript:void(0)" title="Relacije"><i class="fa fa-filter"></i></a>');
|
||||
@endif
|
||||
t.push('<a class="prostorije" href="javascript:void(0)" title="Prostorije u ovom objektu"><i class="fa fa-arrow-alt-circle-right"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit?'+queryStr, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create?'+queryStr, function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$('.bsToggle').bootstrapToggle();
|
||||
$( "#adr_vlasnika_razl_check" ).change(function(e) {
|
||||
if(this.checked)
|
||||
$("#adr_vlasnika").removeClass('d-none');
|
||||
else
|
||||
$("#adr_vlasnika").addClass('d-none');
|
||||
});
|
||||
$( "#adr_zakupac_check" ).change(function(e) {
|
||||
if(this.checked)
|
||||
$("#adr_zakupac").removeClass('d-none');
|
||||
else
|
||||
$("#adr_zakupac").addClass('d-none');
|
||||
});
|
||||
$('.ui.dropdown:not(.server)').dropdown();
|
||||
$('#grupa_id').dropdown({
|
||||
onChange: function(value, text, $choice) {
|
||||
$('#grupa_id').dropdown('setup menu', []);
|
||||
console.log('bla');
|
||||
},
|
||||
apiSettings: {
|
||||
method: 'POST',
|
||||
cache: false,
|
||||
saveRemoteData: false,
|
||||
on: 'click',
|
||||
url: '/admin/grupa/getAssignableGroups',
|
||||
data: { '_token': '{{ csrf_token() }}'},
|
||||
beforeSend: function (settings) {
|
||||
settings.data.ids = $('#grupa_id').val().join();
|
||||
settings.data.query = settings.urlData.query;
|
||||
return settings;
|
||||
},
|
||||
onResponse: function(response) {
|
||||
var query = this.urlData.query;
|
||||
return {
|
||||
success: true,
|
||||
results: response.results.filter(function(value) { return value.name.toLowerCase().indexOf(query) >= 0 })
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#grupa_id').dropdown('setup menu', []);
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#grad_id").change(function() {
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
});
|
||||
|
||||
$("#vl_grad_id").change(function() {
|
||||
$("#vl_ulica_id").load('/admin/objekat/ulicepogradu/'+$("#vl_grad_id").val());
|
||||
});
|
||||
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url+'?'+queryStr,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.data)
|
||||
{
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else
|
||||
window.location.href = '';
|
||||
}
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .related': function (e, value, row, index) {
|
||||
window.location.href = '/admin/objekat?getrelObj=' + row.j_grupa_ids;
|
||||
},
|
||||
'click .prostorije': function (e, value, row, index) {
|
||||
window.location.href = '/admin/prostorija?getrelProst=' + row.id;
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
@@ -0,0 +1,30 @@
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
@foreach ($obj as $key => $field)
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="os[{{ $obracun->id }}][{{ $key }}]">{{ $field->label }}</label>
|
||||
@switch($field->type)
|
||||
@case('text')
|
||||
<input name=os[{{ $obracun->id }}][{{ $key }}]" id=os[{{ $obracun->id }}][{{ $key }}]" type="text" class="form-control" value="{{$data[$key] ?? ''}}">
|
||||
@break
|
||||
@case('select')
|
||||
<select name=os[{{ $obracun->id }}][{{ $key }}]" id=os[{{ $obracun->id }}][{{ $key }}]" class="form-control">
|
||||
@foreach ($field->values as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data[$key] == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@case('true_false')
|
||||
<div class="col-12">
|
||||
<input class="bsToggle" id=os[{{ $obracun->id }}][{{ $key }}]" name=os[{{ $obracun->id }}][{{ $key }}]" type="checkbox" data-toggle="toggle" data-on="{{ $field->true_val }}" data-off="{{ $field->false_val }}" data-onstyle="success" value="{{ $field->true_val }}" data-offstyle="danger" data-width="75" @if ($data[$key]==$field->true_val) checked @endif>
|
||||
</div>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,35 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
@foreach ($obj as $key => $field)
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
||||
@switch($field['type'])
|
||||
@case('text')
|
||||
<input name="{{ $key }}" id="{{ $key }}" type="text" class="form-control" value="{{$data->$key ?? ''}}">
|
||||
@break
|
||||
@case('select')
|
||||
<select name="{{ $key }}" id="{{ $key }}" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($field['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? "" }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,19 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', 'Dashboard')
|
||||
|
||||
@section('content_header')
|
||||
<h1>Dashboard</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div id="app">Test</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css">
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/file-manager.js"></script>
|
||||
@stop
|
||||
@@ -0,0 +1,448 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/".$general['cont_name'];
|
||||
@endphp
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="{{ $ajaxUrl }}/browse?{{ $qstring }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-sortable="true" data-visible="true">
|
||||
#
|
||||
</th>
|
||||
<th
|
||||
data-field="created_at"
|
||||
data-sortable="true"
|
||||
data-formatter="dateFormatter"
|
||||
data-visible="true">
|
||||
Kreiran
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
@if($field['list'])
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui.label {
|
||||
background-color: #EEE;
|
||||
color: #666 !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.ui.label .icon:before {
|
||||
content: '\f00d';
|
||||
font-family: fontAwesome;
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
padding-left: 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
.ui.label .icon:hover:before {
|
||||
color: #F00;
|
||||
}
|
||||
.ui.selection.dropdown {
|
||||
min-height: inherit;
|
||||
}
|
||||
.bootstrap-table .fixed-table-container .fixed-table-body {
|
||||
overflow: visible !important;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
// var ajaxUrl = "/admin/{{ $general['cont_name'] }}";
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function breadFormatter(value, row) {
|
||||
var t = [];
|
||||
switch(value) {
|
||||
case 'grupa':
|
||||
break;
|
||||
case 'objekat':
|
||||
t.push('<a class="objekat" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na objekat"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
}
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
|
||||
// if(row.status == 0) {
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
// }
|
||||
// t.push('<a class="edit mr-2" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
// if(row.status == 0) {
|
||||
t.push('<a class="mr-2" href="{{ $ajaxUrl }}/' + row.id + '/explore" title="Pregled fajlova"><i class="fa fa-folder-open"></i></a>');
|
||||
// t.push('<a class="next" href="javascript:void(0)" title="Detalji"><i class="fa fa-arrow-alt-circle-right"></i></a>');
|
||||
// }
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function dateFormatter(value, row) {
|
||||
if(Date.parse(value)) {
|
||||
const date = new Date(value);
|
||||
return new Intl.DateTimeFormat("lt-LT", {year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit'}).format(date);
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit?'+queryStr, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create?'+queryStr, function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
// function statusFormatter(value, row, index) {
|
||||
// switch(row.status) {
|
||||
// case 0:
|
||||
// return '<div class="badge badge-pill pl-2 pr-2 badge-success">Otvoren</div>';
|
||||
// break;
|
||||
// case 1:
|
||||
// return '<div class="badge badge-pill pl-2 pr-2 badge-warning">Zaključan</div>';
|
||||
// break;
|
||||
// case 2:
|
||||
// return '<div class="badge badge-pill pl-2 pr-2 badge-danger">Arhiviran</div>';
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$('.ui.dropdown').dropdown();
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url+'?'+queryStr,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.data)
|
||||
{
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else
|
||||
window.location.href = '';
|
||||
}
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
window.breadEvents = {
|
||||
'click .objekat': function (e, value, row, index) {
|
||||
window.location.href = '/admin/objekat?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .next': function (e, value, row, index) {
|
||||
window.location.href = '/admin/ocitavanje/' + row.id + '/detalji';
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
+601
@@ -0,0 +1,601 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/" . $general['cont_name'] . "/" . $parent. "/detalji";
|
||||
@endphp
|
||||
<div id="" class="card col-6">
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
Očitavanje: <b>{{ $ocitavanje->godina }} {{ $ocitavanje->j_mesec }} {{ $ocitavanje->naziv }}</b>
|
||||
</div>
|
||||
</div>
|
||||
<div id="logsCard" class="d-none card bg-info col-6">
|
||||
<div class="card-header" id="headingOne">
|
||||
<h5 class="mb-0">
|
||||
<button class="btn btn-warning" data-toggle="collapse" data-target="#logsContainer" aria-expanded="true" aria-controls="logsContainer">
|
||||
Error logs
|
||||
</button>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="logsContainer" class="collapse show" data-parent="#logsCard">
|
||||
<div class="card-body">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="errorLog_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="10"
|
||||
data-search="false"
|
||||
data-url="{{ $ajaxUrl }}/browseLogs?{{ $qstring }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="logRowStyle"
|
||||
data-row-attributes="logRowAttributes"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="logDetailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-sortable="true">
|
||||
#
|
||||
</th>
|
||||
<th data-field="created_at" data-sortable="true" data-formatter="logDateFormatter">
|
||||
Kreiran
|
||||
</th>
|
||||
<th data-align="center"
|
||||
data-formatter="logOptFormatter"
|
||||
data-events="logOptEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new mr-2" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
<a class="mr-2" href="{{ $ajaxUrl.'/uploadXML' }}" title="Upload XML"><i class="fa fa-file-code"></i></a>
|
||||
<a class="mr-2" href="{{ $ajaxUrl.'/uploadExcel' }}" title="Upload EXCEL"><i class="fa fa-file-excel"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="{{ $ajaxUrl }}/browse?{{ $qstring }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-sortable="true" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
@if($field['list'])
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui.label {
|
||||
background-color: #EEE;
|
||||
color: #666 !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.ui.label .icon:before {
|
||||
content: '\f00d';
|
||||
font-family: fontAwesome;
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
padding-left: 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
.ui.label .icon:hover:before {
|
||||
color: #F00;
|
||||
}
|
||||
.ui.selection.dropdown {
|
||||
min-height: inherit;
|
||||
}
|
||||
.bootstrap-table .fixed-table-container .fixed-table-body {
|
||||
overflow: visible !important;
|
||||
}
|
||||
input[type="file"] {
|
||||
display: none;
|
||||
}
|
||||
.xml-file-upload {
|
||||
border: none;
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
color: #007bff;
|
||||
cursor: pointer;
|
||||
}
|
||||
#errorLog_table .fa {
|
||||
color: black;
|
||||
}
|
||||
#errorLog_table.table {
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function breadFormatter(value, row) {
|
||||
var t = [];
|
||||
switch(value) {
|
||||
case 'grupa':
|
||||
break;
|
||||
case 'objekat':
|
||||
t.push('<a class="objekat" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na objekat"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
}
|
||||
// console.log(value);
|
||||
// console.log(row);
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
@if($ocitavanje->status == 0)
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit mr-2" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
@endif
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function logOptFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="view mr-2" href="javascript:void(0)" title="View"><i class="fa fa-eye"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function logDateFormatter(value, row) {
|
||||
if(Date.parse(value)) {
|
||||
const date = new Date(value);
|
||||
return new Intl.DateTimeFormat("lt-LT", {year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit'}).format(date);
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit?'+queryStr, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create?'+queryStr, function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function statusFormatter(value, row, index) {
|
||||
switch(row.status) {
|
||||
case 0:
|
||||
return '<div class="badge badge-pill pl-2 pr-2 badge-success">Otvoren</div>';
|
||||
break;
|
||||
case 1:
|
||||
return '<div class="badge badge-pill pl-2 pr-2 badge-warning">Zaključan</div>';
|
||||
break;
|
||||
case 2:
|
||||
return '<div class="badge badge-pill pl-2 pr-2 badge-danger">Arhiviran</div>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$('.ui.dropdown').dropdown();
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url+'?'+queryStr,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.data)
|
||||
{
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else
|
||||
window.location.href = '';
|
||||
}
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
window.breadEvents = {
|
||||
'click .objekat': function (e, value, row, index) {
|
||||
window.location.href = '/admin/objekat?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
}
|
||||
|
||||
$('#errorLog_table').on('load-success.bs.table', function(data, status, jqXHR) {
|
||||
let rows = $('#errorLog_table').bootstrapTable('getData').length;
|
||||
if(rows < 1) {
|
||||
$("#logsCard").addClass('d-none');
|
||||
}else{
|
||||
$("#logsCard").removeClass('d-none');
|
||||
}
|
||||
});
|
||||
|
||||
window.logOptEvents = {
|
||||
'click .view': function (e, value, row, index) {
|
||||
blockElement($(e.currentTarget).parents('.card'));
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/getLog/' + row.id ,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: 'GET',
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
let a = document.createElement('a')
|
||||
a.href = response.url
|
||||
a.download = response.url.split('/').pop()
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a);
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/deleteLog/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#errorLog_table").bootstrapTable('refresh');
|
||||
// $("#errorLog_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .next': function (e, value, row, index) {
|
||||
window.location.href = '/admin/ocitavanje/detalji/'+row.id;
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
@@ -0,0 +1,339 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/" . $general['cont_name'] . "/" . $parent. "/detalji";
|
||||
@endphp
|
||||
<div id="" class="card col-6">
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
Očitavanje: <b>{{ $ocitavanje->godina }} {{ $ocitavanje->j_mesec }} {{ $ocitavanje->naziv }}</b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div id="" class="card col-6">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<form id="xmlUploadForm">
|
||||
<div class="row">
|
||||
<div class="col-12 pb-2">
|
||||
<select name="distributer" id="distributer" class="form-control ui search fluid normal dropdown">
|
||||
<option value="0">Distributer</option>
|
||||
@foreach ($distributeri as $key => $value)
|
||||
<option value="{{ $value->id }}">{{ $value->naziv }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-grp">
|
||||
<div class="form-grp-label">
|
||||
U slučaju već postojećih vrednosti:
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-check-input" type="radio" name="overwrite" id="overwrite1" value="1" checked>
|
||||
<label class="form-check-label" for="overwrite1">
|
||||
Prepiši postojeće
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-check-input" type="radio" name="overwrite" id="overwrite2" value="0">
|
||||
<label class="form-check-label" for="overwrite2">
|
||||
Preskoči postojeće
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="uploadContainer col border">
|
||||
<div class="row">
|
||||
<div class="imgWrapper col-12 p-2">
|
||||
<div data-type="upload" class="dropzone upl-dropzone dz-clickable" id="upl-dropzone">
|
||||
<div class="dz-message d-flex flex-column">
|
||||
<i class="fa fa-cloud-upload-alt"></i>
|
||||
Drag and drop or click
|
||||
</div>
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" multiple />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="submit_container" class="d-none form-row pt-2">
|
||||
<div class="col-12">
|
||||
@csrf
|
||||
<button type="submit" class="btn-sm btn-primary submit float-right">Učitavanje</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-none">
|
||||
<div id="previewTPL" class="dz-preview dz-file-preview">
|
||||
<div class="dz-details">
|
||||
<div class="dz-error-message"><span data-dz-errormessage></span></div>
|
||||
</div>
|
||||
<div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.upl-dropzone {
|
||||
border: 2px dashed #dedede;
|
||||
border-radius: 5px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.upl-dropzone.dz-clickable .dz-message, .upl-dropzone.dz-clickable .dz-message * {
|
||||
cursor: pointer;
|
||||
}
|
||||
.upl-dropzone i{
|
||||
font-size: 5rem;
|
||||
}
|
||||
.dz-message i{
|
||||
font-size: 5rem;
|
||||
padding-top: 1rem;
|
||||
}
|
||||
.upl-dropzone .dz-message {
|
||||
color: rgba(0,0,0,.54);
|
||||
font-weight: 500;
|
||||
font-size: initial;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.dz-drag-hover {
|
||||
border: 2px solid #dedede !important;
|
||||
}
|
||||
.dz-drag-hover .dz-message {
|
||||
opacity: 0.5 !important;
|
||||
}
|
||||
.dz-error-message span {
|
||||
color: red;
|
||||
font-weight: 400;
|
||||
}
|
||||
.imgWrapper {
|
||||
text-align: center;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 500;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.form-grp .form-group{
|
||||
padding-left: 1rem;
|
||||
}
|
||||
.form-grp .form-group label{
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
.form-grp-label {
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
</style>
|
||||
<link href="/vendor/icheck/skins/all.css" rel="stylesheet">
|
||||
<link href="/vendor/dropzone/dropzone.css" rel="stylesheet">
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script src="/vendor/icheck/icheck.js"></script>
|
||||
<script src="/vendor/dropzone/dropzone.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
var dropzone;
|
||||
|
||||
Dropzone.autoDiscover = false;
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('input').iCheck({
|
||||
checkboxClass: 'icheckbox_square-red',
|
||||
radioClass: 'iradio_square-red',
|
||||
increaseArea: '30%' // optional
|
||||
});
|
||||
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
|
||||
dropzone = new Dropzone(".upl-dropzone", {
|
||||
url: "{{ $ajaxUrl.'/uploadExcel' }}",
|
||||
addRemoveLinks: true,
|
||||
uploadMultiple: false,
|
||||
maxFiles: 1,
|
||||
paramName: 'file',
|
||||
acceptedFiles: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
accept: function(file, done) {
|
||||
blockElement($("#xmlUploadForm"));
|
||||
done();
|
||||
},
|
||||
maxfilesexceeded: function(file) {
|
||||
this.removeAllFiles();
|
||||
this.addFile(file);
|
||||
},
|
||||
init: function() {
|
||||
this.on("removedfile", function(file) {
|
||||
if(this.files.length == 0) {
|
||||
$("#submit_container").addClass('d-none');
|
||||
}
|
||||
});
|
||||
this.on("addedfile", function(file) {
|
||||
});
|
||||
this.on("sending", function(file, xhr, formData) {
|
||||
formData.append("_token", '{{ csrf_token() }}');
|
||||
formData.append("type", $(this.element).data('type'));
|
||||
});
|
||||
this.on("complete", function(file) {
|
||||
unBlockAll();
|
||||
});
|
||||
this.on("success", function(file, response) {
|
||||
file.id = response.id;
|
||||
$("#submit_container").removeClass('d-none');
|
||||
});
|
||||
this.on("error", function(file, errorMessage) {
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on( 'submit', '#xmlUploadForm', function (e) {
|
||||
e.preventDefault();
|
||||
blockElement($(this));
|
||||
$("#submit_container .submit").attr('disabled','disabled');
|
||||
|
||||
var form = $(this).closest("form");
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
formData.push({name:'files', value: JSON.stringify(dropzone.files)});
|
||||
formData.push({name:'distributer', value: $("#distributer").val()});
|
||||
formData.push({name:'overwrite', value: $("input[name='overwrite']:checked").val()});
|
||||
|
||||
var data = {msg: null, running: true};
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/processExcel',
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
$("#submit_container .submit").removeAttr('disabled');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
$("#submit_container .submit").removeAttr('disabled');
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@stop
|
||||
@@ -0,0 +1,389 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/" . $general['cont_name'] . "/" . $parent. "/detalji";
|
||||
@endphp
|
||||
<div id="" class="card col-6">
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
Očitavanje: <b>{{ $ocitavanje->godina }} {{ $ocitavanje->j_mesec }} {{ $ocitavanje->naziv }}</b>
|
||||
</div>
|
||||
</div>
|
||||
<div id="progress" class="d-none card col-6 p-3">
|
||||
<div class="justify-content-center align-items-center">
|
||||
<b>Progress:</b>
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-animated bg-success progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hiddenAtLoad d-none">
|
||||
<div id="" class="card col-6">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<form id="xmlUploadForm">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-grp">
|
||||
<div class="form-grp-label">
|
||||
U slučaju već postojećih vrednosti:
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-check-input" type="radio" name="overwrite" id="overwrite1" value="1" checked>
|
||||
<label class="form-check-label" for="overwrite1">
|
||||
Prepiši postojeće
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-check-input" type="radio" name="overwrite" id="overwrite2" value="0">
|
||||
<label class="form-check-label" for="overwrite2">
|
||||
Preskoči postojeće
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="uploadContainer col border">
|
||||
<div class="row">
|
||||
<div class="imgWrapper col-12 p-2">
|
||||
<div data-type="upload" class="dropzone upl-dropzone dz-clickable" id="upl-dropzone">
|
||||
<div class="dz-message d-flex flex-column">
|
||||
<i class="fa fa-cloud-upload-alt"></i>
|
||||
Drag and drop or click
|
||||
</div>
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" multiple />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="submit_container" class="d-none form-row pt-2">
|
||||
<div class="col-12">
|
||||
@csrf
|
||||
<button type="submit" class="btn-sm btn-primary submit float-right">Učitavanje</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-none">
|
||||
<div id="previewTPL" class="dz-preview dz-file-preview">
|
||||
<div class="dz-details">
|
||||
<div class="dz-error-message"><span data-dz-errormessage></span></div>
|
||||
</div>
|
||||
<div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.upl-dropzone {
|
||||
border: 2px dashed #dedede;
|
||||
border-radius: 5px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.upl-dropzone.dz-clickable .dz-message, .upl-dropzone.dz-clickable .dz-message * {
|
||||
cursor: pointer;
|
||||
}
|
||||
.upl-dropzone i{
|
||||
font-size: 5rem;
|
||||
}
|
||||
.dz-message i{
|
||||
font-size: 5rem;
|
||||
padding-top: 1rem;
|
||||
}
|
||||
.upl-dropzone .dz-message {
|
||||
color: rgba(0,0,0,.54);
|
||||
font-weight: 500;
|
||||
font-size: initial;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.dz-drag-hover {
|
||||
border: 2px solid #dedede !important;
|
||||
}
|
||||
.dz-drag-hover .dz-message {
|
||||
opacity: 0.5 !important;
|
||||
}
|
||||
.dz-error-message span {
|
||||
color: red;
|
||||
font-weight: 400;
|
||||
}
|
||||
.imgWrapper {
|
||||
text-align: center;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 500;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.form-grp .form-group{
|
||||
padding-left: 1rem;
|
||||
}
|
||||
.form-grp .form-group label{
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
.form-grp-label {
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
</style>
|
||||
<link href="/vendor/icheck/skins/all.css" rel="stylesheet">
|
||||
<link href="/vendor/dropzone/dropzone.css" rel="stylesheet">
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script src="/vendor/icheck/icheck.js"></script>
|
||||
<script src="/vendor/dropzone/dropzone.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
var dropzone;
|
||||
|
||||
Dropzone.autoDiscover = false;
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('input').iCheck({
|
||||
checkboxClass: 'icheckbox_square-red',
|
||||
radioClass: 'iradio_square-red',
|
||||
increaseArea: '30%' // optional
|
||||
});
|
||||
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
|
||||
dropzone = new Dropzone(".upl-dropzone", {
|
||||
url: "{{ $ajaxUrl.'/uploadXML' }}",
|
||||
addRemoveLinks: true,
|
||||
uploadMultiple: false,
|
||||
paramName: 'file',
|
||||
acceptedFiles: '.xml',
|
||||
accept: function(file, done) {
|
||||
blockElement($("#xmlUploadForm"));
|
||||
done();
|
||||
},
|
||||
init: function() {
|
||||
this.on("removedfile", function(file) {
|
||||
if(this.files.length == 0) {
|
||||
$("#submit_container").addClass('d-none');
|
||||
}
|
||||
});
|
||||
this.on("addedfile", function(file) {
|
||||
});
|
||||
this.on("sending", function(file, xhr, formData) {
|
||||
formData.append("_token", '{{ csrf_token() }}');
|
||||
formData.append("type", $(this.element).data('type'));
|
||||
});
|
||||
this.on("complete", function(file) {
|
||||
unBlockAll();
|
||||
});
|
||||
this.on("success", function(file, response) {
|
||||
file.id = response.id;
|
||||
$("#submit_container").removeClass('d-none');
|
||||
});
|
||||
this.on("error", function(file, errorMessage) {
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on( 'submit', '#xmlUploadForm', function (e) {
|
||||
e.preventDefault();
|
||||
blockElement($(this));
|
||||
$("#submit_container .submit").attr('disabled','disabled');
|
||||
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
formData.push({name:'files', value: JSON.stringify(dropzone.files)});
|
||||
formData.push({name:'overwrite', value: $("input[name='overwrite']:checked").val()});
|
||||
// var status = data.msg.status;
|
||||
// var percent = status.current/status.max * 100;
|
||||
|
||||
var data = {msg: null, running: true};
|
||||
changeStatus(data, 'ImportOcitavanje');
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/processXML',
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
if(response.error)
|
||||
{
|
||||
}else{
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
|
||||
// var runningJobs = JSON.parse('{!! $runningJobsJS !!}');
|
||||
var runningJobs = [];
|
||||
(function poll() {
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/getImportStatus',
|
||||
type: "GET",
|
||||
success: function(data) {
|
||||
parsePollResults(data);
|
||||
},
|
||||
dataType: "json",
|
||||
complete: setTimeout(() => poll(), 3000),
|
||||
timeout: 2000
|
||||
})
|
||||
})();
|
||||
|
||||
function parsePollResults(data) {
|
||||
var t = Object.entries(data);
|
||||
for (var i = t.length - 1; i >= 0; i--) {
|
||||
var prop = t[i][0];
|
||||
if(typeof runningJobs[prop] === 'undefined'){
|
||||
runningJobs[prop] = {};
|
||||
changeStatus(data[prop], prop);
|
||||
}else if(data[prop].running != runningJobs[prop].running) {
|
||||
changeStatus(data[prop], prop);
|
||||
}
|
||||
if(data[prop].running){
|
||||
updateStatus(data[prop], prop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateStatus(data, prop) {
|
||||
var el = prop;
|
||||
if(data.msg) {
|
||||
var status = data.msg.status;
|
||||
var percent = status.current/status.max * 100;
|
||||
}else{
|
||||
var percent = 0;
|
||||
}
|
||||
|
||||
$('#progress').find('.progress-bar').css('width', percent+'%');
|
||||
}
|
||||
|
||||
function changeStatus(data, prop) {
|
||||
runningJobs[prop].running = data.running;
|
||||
var el = prop;
|
||||
if(data.running) {
|
||||
blockElement($("#xmlUploadForm"));
|
||||
$("#progress").removeClass('d-none');
|
||||
$("#submit_container .submit").attr('disabled','disabled');
|
||||
}else{
|
||||
$('#progress').find('.progress-bar').css('width', '100%');
|
||||
sleep(500).then(() => {
|
||||
dropzone.removeAllFiles();
|
||||
$("#progress").addClass('d-none');
|
||||
unBlockAll();
|
||||
$("#submit_container .submit").removeAttr('disabled');
|
||||
});
|
||||
// await new Promise(r => setTimeout(r, 500));
|
||||
}
|
||||
}
|
||||
|
||||
function sleep (time) {
|
||||
return new Promise((resolve) => setTimeout(resolve, time));
|
||||
}
|
||||
|
||||
</script>
|
||||
@stop
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
@foreach ($obj as $key => $field)
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
||||
@switch($field['type'])
|
||||
@case('text')
|
||||
<input name="{{ $key }}" id="{{ $key }}" type="text" class="form-control" value="{{$data->$key ?? ''}}">
|
||||
@break
|
||||
@case('select')
|
||||
<select name="{{ $key }}" id="{{ $key }}" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($field['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? "" }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+449
@@ -0,0 +1,449 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/".$general['cont_name'];
|
||||
@endphp
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="{{ $ajaxUrl }}/browse?{{ $qstring }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-sortable="true" data-visible="true">
|
||||
#
|
||||
</th>
|
||||
<th
|
||||
data-field="created_at"
|
||||
data-sortable="true"
|
||||
data-formatter="dateFormatter"
|
||||
data-visible="true">
|
||||
Kreiran
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
@if($field['list'])
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th data-field="status" data-sortable="true" data-align="center" data-formatter="statusFormatter">Status</th>
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui.label {
|
||||
background-color: #EEE;
|
||||
color: #666 !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.ui.label .icon:before {
|
||||
content: '\f00d';
|
||||
font-family: fontAwesome;
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
padding-left: 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
.ui.label .icon:hover:before {
|
||||
color: #F00;
|
||||
}
|
||||
.ui.selection.dropdown {
|
||||
min-height: inherit;
|
||||
}
|
||||
.bootstrap-table .fixed-table-container .fixed-table-body {
|
||||
overflow: visible !important;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
// var ajaxUrl = "/admin/{{ $general['cont_name'] }}";
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function breadFormatter(value, row) {
|
||||
var t = [];
|
||||
switch(value) {
|
||||
case 'grupa':
|
||||
break;
|
||||
case 'objekat':
|
||||
t.push('<a class="objekat" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na objekat"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
}
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
|
||||
// if(row.status == 0) {
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
// }
|
||||
t.push('<a class="edit mr-2" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
// if(row.status == 0) {
|
||||
t.push('<a class="mr-2" href="{{ $ajaxUrl }}/' + row.id + '/statistika" title="Statistika"><i class="fa fa-binoculars"></i></a>');
|
||||
t.push('<a class="next" href="javascript:void(0)" title="Detalji"><i class="fa fa-arrow-alt-circle-right"></i></a>');
|
||||
// }
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function dateFormatter(value, row) {
|
||||
if(Date.parse(value)) {
|
||||
const date = new Date(value);
|
||||
return new Intl.DateTimeFormat("lt-LT", {year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit'}).format(date);
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit?'+queryStr, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create?'+queryStr, function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function statusFormatter(value, row, index) {
|
||||
switch(row.status) {
|
||||
case 0:
|
||||
return '<div class="badge badge-pill pl-2 pr-2 badge-success">Otvoren</div>';
|
||||
break;
|
||||
case 1:
|
||||
return '<div class="badge badge-pill pl-2 pr-2 badge-warning">Zaključan</div>';
|
||||
break;
|
||||
case 2:
|
||||
return '<div class="badge badge-pill pl-2 pr-2 badge-danger">Arhiviran</div>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$('.ui.dropdown').dropdown();
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url+'?'+queryStr,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.data)
|
||||
{
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else
|
||||
window.location.href = '';
|
||||
}
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
window.breadEvents = {
|
||||
'click .objekat': function (e, value, row, index) {
|
||||
window.location.href = '/admin/objekat?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .next': function (e, value, row, index) {
|
||||
window.location.href = '/admin/ocitavanje/' + row.id + '/detalji';
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
@@ -0,0 +1,489 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
<div class="h4 pt-2">{{ $general['sub_title'] }}</div>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div id="" class="card col-6">
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
Očitavanje: <b>{{ $ocitavanje->godina }} {{ $ocitavanje->j_mesec }} {{ $ocitavanje->naziv }}</b>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main_container">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-6">
|
||||
<div class="small-box bg-info">
|
||||
<div class="inner">
|
||||
<h3>Očitano: {{ $sume['kalorimetar - zbirni']['ocitano'] }}<br>Ukupno: {{ $sume['kalorimetar - zbirni']['prisutno'] }}</h3>
|
||||
<p>Zbirni kalorimetri</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="fas fa-fw fa-microchip "></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-6">
|
||||
<div class="small-box bg-warning">
|
||||
<div class="inner">
|
||||
<h3>Očitano: {{ $sume['kalorimetar - individualni']['ocitano'] }}<br>Ukupno: {{ $sume['kalorimetar - individualni']['prisutno'] }}</h3>
|
||||
<p>Individualni kalorimetri</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="fas fa-fw fa-microchip "></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-6">
|
||||
<div class="small-box bg-success">
|
||||
<div class="inner">
|
||||
<h3>Očitano: {{ $sume['alokator']['ocitano'] }}<br>Ukupno: {{ $sume['alokator']['prisutno'] }}</h3>
|
||||
<p>Alokatori</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="fas fa-fw fa-microchip "></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="action_container" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
Kreirani obračuni
|
||||
</div>
|
||||
<div class="card-tools hideOnEdit">
|
||||
<button class="btn btn-info add_new hideOnCreate">
|
||||
Kreiraj novi obračun
|
||||
</button>
|
||||
<button disabled="" class="btn btn-info showOnCreate">
|
||||
<span role="status" aria-hidden="true" class="btnspn spinner-border spinner-border-sm"></span>
|
||||
Kreiranje novog obračuna je u toku
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div"></div>
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="/admin/obracun/browse?ocitavanje={{ $ocitavanje->id }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-sortable="true" data-visible="true">
|
||||
#
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
@if($field['list'])
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th data-field="godina" data-sortable="true" data-align="center">Godina</th>
|
||||
<th data-field="mesec" data-sortable="true" data-align="center">Mesec</th>
|
||||
<th data-field="closed" data-sortable="true" data-align="center" data-formatter="statusFormatter">Otvoren</th>
|
||||
<th
|
||||
data-field="created_at"
|
||||
data-sortable="true"
|
||||
data-formatter="dateFormatter"
|
||||
data-visible="true">
|
||||
Kreiran
|
||||
</th>
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<script src="https://unpkg.com/ionicons@5.4.0/dist/ionicons.js"></script>
|
||||
<style type="text/css">
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
|
||||
#action_container.in_progress {
|
||||
|
||||
}
|
||||
|
||||
#action_container.in_editmode .hideOnEdit {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#action_container .showOnCreate {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#action_container.in_createmode .showOnCreate {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#action_container.in_createmode .hideOnCreate {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = '/admin/obracun';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete mr-2 hideOnEdit" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit mr-2 hideOnEdit" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function dateFormatter(value, row) {
|
||||
if(Date.parse(value)) {
|
||||
const date = new Date(value);
|
||||
return new Intl.DateTimeFormat("lt-LT", {year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit'}).format(date);
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
function statusFormatter(value, row, index) {
|
||||
switch(row.closed) {
|
||||
case 0:
|
||||
return '<div class="badge badge-pill pl-2 pr-2 badge-success">Da</div>';
|
||||
break;
|
||||
case 1:
|
||||
return '<div class="badge badge-pill pl-2 pr-2 badge-danger">Ne</div>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit?'+queryStr, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create?'+queryStr, function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$('#action_container').addClass('in_editmode');
|
||||
$('.ui.dropdown').dropdown();
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
formData.push({name:'ocitavanjeID', value: '{{ $ocitavanje->id }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url+'?'+queryStr,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.data) {
|
||||
if(response.status == 'updated') {
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else{
|
||||
changeStatus({msg: "", running: true}, 'ObracunCreation');
|
||||
clearTimeout(pollTimer);
|
||||
pollTimer = setTimeout(poll, 5000);
|
||||
}
|
||||
}
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#action_container').removeClass('in_editmode');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
$('#action_container').removeClass('in_editmode');
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1){
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
}else{
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
}
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#action_container').removeClass('in_editmode');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
window.optEvents = {
|
||||
'click .next': function (e, value, row, index) {
|
||||
window.location.href = '/admin/ocitavanje/detalji/'+row.id;
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#action_container').addClass('in_editmode');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
let runningJobs = [];
|
||||
let pollTimer;
|
||||
poll();
|
||||
function poll() {
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/getCreationStatus',
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
timeout: 2000,
|
||||
success: (data) => {
|
||||
parsePollResults(data);
|
||||
},
|
||||
complete: () => {
|
||||
pollTimer = setTimeout(poll, 3000);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function parsePollResults(data) {
|
||||
var t = Object.entries(data);
|
||||
for (var i = t.length - 1; i >= 0; i--) {
|
||||
var prop = t[i][0];
|
||||
if(typeof runningJobs[prop] === 'undefined'){
|
||||
runningJobs[prop] = {};
|
||||
changeStatus(data[prop], prop);
|
||||
}else if(data[prop].running != runningJobs[prop].running) {
|
||||
changeStatus(data[prop], prop);
|
||||
}
|
||||
if(data[prop].running){
|
||||
updateStatus(data[prop], prop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateStatus(data, prop) {
|
||||
}
|
||||
|
||||
function changeStatus(data, prop) {
|
||||
runningJobs[prop].running = data.running;
|
||||
var el = prop;
|
||||
if(data.running) {
|
||||
$("#action_container").addClass('in_createmode');
|
||||
}else{
|
||||
$("#action_container").removeClass('in_createmode');
|
||||
$("#listing_table").bootstrapTable('refresh');
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
@@ -0,0 +1,64 @@
|
||||
@extends('Admin.pdf_izvestaji.base_bootstrap')
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
th.bordeless {
|
||||
border-bottom-width: 0px !important;
|
||||
}
|
||||
.table {
|
||||
font-size: 0.7rem !important;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-12 pb-4">
|
||||
<p class="fs-2 fw-bold">{{ $data['naslov'] }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@foreach ($data['grupe'] as $grupa)
|
||||
<div class="pb-2" style="page-break-inside: avoid;">
|
||||
<div class="row">
|
||||
<div class="col-12 pb-2">
|
||||
<p class="fs-4 fw-bold">{{ $grupa['ime'] }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 pb-2">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Potrošački broj</th>
|
||||
<th scope="col">Ime i prezime</th>
|
||||
<th scope="col">Broj impulsa</th>
|
||||
<th scope="col">Procenat učešća<br>prema ukupnom<br>broju impulsa</th>
|
||||
<th scope="col">Površina</th>
|
||||
<th scope="col">Procenat površine</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($grupa['objekti'] as $objekat)
|
||||
<tr>
|
||||
<th scope="row">{{ $objekat['sifra'] }}</th>
|
||||
<th scope="row">{{ $objekat['vlasnik'] }}</th>
|
||||
<th scope="row">{{ number_format($objekat['impulsi'], 3) }}</th>
|
||||
<th scope="row">{{ $objekat['impulsi']>0.0 ? number_format($objekat['sumUtrosak']/$grupa['ukupnaSnaga']*100.0, 4) : '' }}</th>
|
||||
<th scope="row">{{ number_format($objekat['povrsina'], 2) }}</th>
|
||||
<th scope="row">{{ $objekat['procpovrsine'] }}</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
<th class="bordeless" scope="row">{{ number_format($grupa['ukupniImpulsi'], 3) }}</th>
|
||||
<th class="bordeless" scope="row">100.000</th>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@stop
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
@extends('Admin.pdf_izvestaji.base_bootstrap')
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
th.bordeless {
|
||||
border-bottom-width: 0px !important;
|
||||
}
|
||||
.table {
|
||||
font-size: 0.7rem !important;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
@section('content')
|
||||
@foreach ($data['objekti'] as $objekat)
|
||||
<div class="pb-4" style="page-break-inside: avoid;">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 pb-2">
|
||||
<p class="text-center fs-4 fw-bold">{{ $data['naslov'] }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<div class="text-end">Šifra:</div>
|
||||
</div>
|
||||
<div class="col-sm-4 fw-bold">
|
||||
{{ $objekat['sifra'] }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<div class="text-end">Vlasnik:</div>
|
||||
</div>
|
||||
<div class="col-sm-4 fw-bold">
|
||||
{{ $objekat['vlasnik'] }}
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="text-end">Zbir svih alokatora:</div>
|
||||
</div>
|
||||
<div class="col-sm-2 fw-bold">
|
||||
{{ $data['ukupniImpulsi'] }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<div class="text-end">Adresa:</div>
|
||||
</div>
|
||||
<div class="col-sm-4 fw-bold">
|
||||
{{ $objekat['mesto'] }}
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="text-end">Procenat:</div>
|
||||
</div>
|
||||
<div class="col-sm-2 fw-bold">
|
||||
{{ number_format($objekat['sumUtrosak']/$data['ukupnaSnaga']*100.0, 4) }} %
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<div class="text-end"></div>
|
||||
</div>
|
||||
<div class="col-sm-4 fw-bold">
|
||||
{{ $objekat['adresa'] }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<div class="text-end">Površina:</div>
|
||||
</div>
|
||||
<div class="col-sm-4 fw-bold">
|
||||
{{ $objekat['povrsina'] }} m2
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pt-2">
|
||||
<div class="col-12">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Radio address</th>
|
||||
<th scope="col">Prostorija</th>
|
||||
<th scope="col">{{ $data['datumCol1'] }}</th>
|
||||
<th scope="col">{{ $data['datumCol2'] }}</th>
|
||||
<th scope="col">Razlika</th>
|
||||
<th scope="col">Kc</th>
|
||||
<th scope="col">Snaga</th>
|
||||
<th scope="col">Impulsi</th>
|
||||
<th scope="col">Proc.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($objekat['uredjaji'] as $uredjaj)
|
||||
<tr>
|
||||
<th scope="row">{{ $uredjaj['radio'] }}</th>
|
||||
<th scope="row">{{ $uredjaj['prostorija'] }}</th>
|
||||
<th scope="row">{{ $uredjaj['stanje1'] }}</th>
|
||||
<th scope="row">{{ $uredjaj['stanje2'] }}</th>
|
||||
<th scope="row">{{ $uredjaj['razlika'] }}</th>
|
||||
<th scope="row">{{ $uredjaj['kc'] }}</th>
|
||||
<th scope="row">{{ $uredjaj['snaga'] }}</th>
|
||||
<th scope="row">{{ $uredjaj['razlika']>0.0 ? number_format($uredjaj['razlika'], 3) : '' }}</th>
|
||||
<th scope="row">{{ $uredjaj['razlika']>0.0 ? number_format($uredjaj['utroseno']/$data['ukupnaSnaga']*100.0, 4) : '' }}</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
<th class="bordeless" scope="row">{{ $objekat['sumImpulsi'] }}</th>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
<th class="bordeless" scope="row"> </th>
|
||||
<th class="bordeless" scope="row">{{ $objekat['sumImpulsi']>0.0 ? number_format($objekat['sumImpulsi'], 3) : '' }}</th>
|
||||
<th class="bordeless" scope="row">{{ $objekat['sumImpulsi']>0.0 ? number_format($objekat['sumUtrosak']/$data['ukupnaSnaga']*100.0, 4) : '' }}</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@stop
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta content="" name="description">
|
||||
<meta content="" name="keywords">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
@php $css_File = file_get_contents(public_path('/pdf_izvestaji/css/bootstrap.min.css')); @endphp
|
||||
<style type="text/css">{!! $css_File; !!}</style>
|
||||
@yield("css");
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield("content")
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
@foreach ($obj as $key => $field)
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
||||
@switch($field['type'])
|
||||
@case('text')
|
||||
<input name="{{ $key }}" id="{{ $key }}" type="text" class="form-control" value="{{$data->$key ?? ''}}">
|
||||
@break
|
||||
@case('select')
|
||||
<select name="{{ $key }}" id="{{ $key }}" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($field['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? "" }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+466
@@ -0,0 +1,466 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/".$general['cont_name'];
|
||||
@endphp
|
||||
@if($parents['grupa']||$parents['objekat'])
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-12 col-xl-6">
|
||||
<div class="h3">unutar:</div>
|
||||
<table class="hiddenAtLoad d-none table table-striped table-bordered"
|
||||
id="dep_table"
|
||||
data-toggle="table"
|
||||
data-pagination="false"
|
||||
data-search="false"
|
||||
data-show-columns="false"
|
||||
data-show-footer="false"
|
||||
data-show-header="false"
|
||||
data-detail-formatter="def_detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th data-align="center" data-formatter="breadFormatter" data-events="breadEvents"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($parents['grupa'])
|
||||
@foreach ($parents['grupa'] as $key => $field)
|
||||
<tr data-id="1">
|
||||
<td>Grupe</td>
|
||||
<td>{{ $field->ime_grupe}}, {{ $field->j_grad }} ({{ $field->j_tip }})</td>
|
||||
<td>grupa</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@if($parents['objekat'])
|
||||
<tr data-id="2" data-qs="getrelObj={{ $parents['objekat']->j_grupa_ids}}">
|
||||
<td>Objekta</td>
|
||||
<td>{{ $parents['objekat']->prezime}} {{ $parents['objekat']->ime}}, {{ $parents['objekat']->j_ulica }} ({{ $parents['objekat']->j_grad }})</td>
|
||||
<td>objekat</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="{{ $ajaxUrl }}/browse?{{ $qstring }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
@if($field['list'])
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui.label {
|
||||
background-color: #EEE;
|
||||
color: #666 !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.ui.label .icon:before {
|
||||
content: '\f00d';
|
||||
font-family: fontAwesome;
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
padding-left: 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
.ui.label .icon:hover:before {
|
||||
color: #F00;
|
||||
}
|
||||
.ui.selection.dropdown {
|
||||
min-height: inherit;
|
||||
}
|
||||
.bootstrap-table .fixed-table-container .fixed-table-body {
|
||||
overflow: visible !important;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
// var ajaxUrl = "/admin/{{ $general['cont_name'] }}";
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function breadFormatter(value, row) {
|
||||
var t = [];
|
||||
switch(value) {
|
||||
case 'grupa':
|
||||
break;
|
||||
case 'objekat':
|
||||
t.push('<a class="objekat" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na objekat"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
}
|
||||
// console.log(value);
|
||||
// console.log(row);
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit mr-2" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
@if($getRelated === false)
|
||||
t.push('<a class="related mr-2" href="javascript:void(0)" title="Relacije"><i class="fa fa-filter"></i></a>');
|
||||
@endif
|
||||
t.push('<a class="next" href="javascript:void(0)" title="Radijatori"><i class="fa fa-arrow-alt-circle-right"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit?'+queryStr, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create?'+queryStr, function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$('.ui.dropdown').dropdown();
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#grad_id").change(function() {
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url+'?'+queryStr,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.data)
|
||||
{
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else
|
||||
window.location.href = '';
|
||||
}
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
window.breadEvents = {
|
||||
'click .objekat': function (e, value, row, index) {
|
||||
window.location.href = '/admin/objekat?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .related': function (e, value, row, index) {
|
||||
window.location.href = '/admin/prostorija?getrelProst=' + row.objekat_id;
|
||||
},
|
||||
'click .next': function (e, value, row, index) {
|
||||
window.location.href = '/admin/radijator?getrelRadi='+row.id;
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
@foreach ($obj as $key => $field)
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
||||
@switch($field['type'])
|
||||
@case('text')
|
||||
<input name="{{ $key }}" id="{{ $key }}" type="text" class="form-control" value="{{$data->$key ?? ''}}">
|
||||
@break
|
||||
@case('select')
|
||||
<select name="{{ $key }}" id="{{ $key }}" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($field['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include("Admin.uredjaj.attach_index", ['id' => $data->id, 'type' => 'radijator'])
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? "" }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+472
@@ -0,0 +1,472 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/".$general['cont_name'];
|
||||
@endphp
|
||||
@if($parents['grupa']||$parents['objekat'])
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-12 col-xl-6">
|
||||
<div class="h3">unutar:</div>
|
||||
<table class="hiddenAtLoad d-none table table-striped table-bordered"
|
||||
id="dep_table"
|
||||
data-toggle="table"
|
||||
data-pagination="false"
|
||||
data-search="false"
|
||||
data-show-columns="false"
|
||||
data-show-footer="false"
|
||||
data-show-header="false"
|
||||
data-detail-formatter="def_detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th data-align="center" data-formatter="breadFormatter" data-events="breadEvents"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($parents['grupa'])
|
||||
@foreach ($parents['grupa'] as $key => $field)
|
||||
<tr data-id="1">
|
||||
<td>Grupe</td>
|
||||
<td>{{ $field->ime_grupe}}, {{ $field->j_grad }} ({{ $field->j_tip }})</td>
|
||||
<td>grupa</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@if($parents['objekat'])
|
||||
<tr data-id="2" data-qs="getrelObj={{ $parents['objekat']->j_grupa_ids}}">
|
||||
<td>Objekta</td>
|
||||
<td>{{ $parents['objekat']->prezime}} {{ $parents['objekat']->ime}}, {{ $parents['objekat']->j_ulica }} ({{ $parents['objekat']->j_grad }})</td>
|
||||
<td>objekat</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if($parents['prostorija'])
|
||||
<tr data-id="3" data-qs="getrelProst={{ $parents['prostorija']->objekat_id}}">
|
||||
<td>Prostorije</td>
|
||||
<td>{{ $parents['prostorija']->j_tip_prostorije}} ({{ $parents['prostorija']->dim_duzina}} x {{ $parents['prostorija']->dim_sirina }})</td>
|
||||
<td>prostorija</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="{{ $ajaxUrl }}/browse?{{ $qstring }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
@if($field['list'])
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui.label {
|
||||
background-color: #EEE;
|
||||
color: #666 !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.ui.label .icon:before {
|
||||
content: '\f00d';
|
||||
font-family: fontAwesome;
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
padding-left: 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
.ui.label .icon:hover:before {
|
||||
color: #F00;
|
||||
}
|
||||
.ui.selection.dropdown {
|
||||
min-height: inherit;
|
||||
}
|
||||
.bootstrap-table .fixed-table-container .fixed-table-body {
|
||||
overflow: visible !important;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function breadFormatter(value, row) {
|
||||
var t = [];
|
||||
switch(value) {
|
||||
case 'grupa':
|
||||
break;
|
||||
case 'objekat':
|
||||
t.push('<a class="objekat" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na objekat"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
case 'prostorija':
|
||||
t.push('<a class="prostorija" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na prostoriju"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
}
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit mr-2" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
@if($getRelated === false)
|
||||
t.push('<a class="related mr-2" href="javascript:void(0)" title="Relacije"><i class="fa fa-filter"></i></a>');
|
||||
@endif
|
||||
// t.push('<a class="next" href="javascript:void(0)" title="Radijatori"><i class="fa fa-arrow-alt-circle-right"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit?'+queryStr, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create?'+queryStr, function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$('.ui.dropdown').dropdown();
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#grad_id").change(function() {
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url+'?'+queryStr,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
if(response.data){
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('refresh');
|
||||
}
|
||||
}else
|
||||
$("#listing_table").bootstrapTable('refresh');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
window.breadEvents = {
|
||||
'click .objekat': function (e, value, row, index) {
|
||||
window.location.href = '/admin/objekat?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
'click .prostorija': function (e, value, row, index) {
|
||||
window.location.href = '/admin/prostorija?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .related': function (e, value, row, index) {
|
||||
window.location.href = '/admin/radijator?getrelRadi=' + row.prostorija_id;
|
||||
},
|
||||
'click .next': function (e, value, row, index) {
|
||||
window.location.href = '/admin/alokator?getrelAlok=' + row.id;
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
@foreach ($obj['fields'] as $key => $field)
|
||||
@if($field['type']=='area')
|
||||
<div class="col-md-12">
|
||||
@else
|
||||
<div class="col-md-6">
|
||||
@endif
|
||||
<div class="position-relative form-group">
|
||||
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
||||
@switch($field['type'])
|
||||
@case('area')
|
||||
<textarea name="{{ $key }}" id="{{ $key }}" class="form-control" >{{$data->$key ?? ''}}</textarea>
|
||||
@break
|
||||
@case('text')
|
||||
<input name="{{ $key }}" id="{{ $key }}" type="text" class="form-control" value="{{$data->$key ?? ''}}">
|
||||
@break
|
||||
@case('select')
|
||||
<select name="{{ $key }}" id="{{ $key }}" class="form-control">
|
||||
@foreach ($field['fetch']() as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@case('true_false')
|
||||
<div class="col-12">
|
||||
<input class="bsToggle" id="{{ $key }}" name="{{ $key }}" type="checkbox" data-toggle="toggle" data-on="Da" data-off="Ne" data-onstyle="success" value="1" data-offstyle="danger" data-width="75" @if ($data->$key==1) checked @endif>
|
||||
</div>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? '' }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', 'Gradovi')
|
||||
|
||||
@section('content_header')
|
||||
<h1>Šifarnici</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div id="list_container" class="row">
|
||||
@foreach ($obj as $key => $field)
|
||||
<div data-target="{{ $key }}" class="card text-white bg-info mb-2 zoom col-6 ml-1" style="max-width: 18rem;">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ $field['title'] }}</h5>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = "/admin/gradovi";
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#list_container').on( 'click', '.card', function (e) {
|
||||
window.location.href = '/admin/sifarnik/' + $(this).data('target');
|
||||
});
|
||||
|
||||
</script>
|
||||
@stop
|
||||
+369
@@ -0,0 +1,369 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $obj['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $obj['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-6">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
Postojeći elementi
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-page-list="[10, 25, 50, 100]"
|
||||
data-url="/admin/sifarnik/{{ $route }}/browse"
|
||||
data-unique-id="id"
|
||||
data-sort-name="{{ $obj['sort'][0] }}"
|
||||
data-sort-order="{{ $obj['sort'][1] }}"
|
||||
data-search="true"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
@foreach ($obj['fields'] as $key => $field)
|
||||
@if($field['list'])
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<link href="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/css/bootstrap4-toggle.min.css" rel="stylesheet">
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/js/bootstrap4-toggle.min.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = "/admin/sifarnik/{{ $route }}";
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/add', function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function openEditor(element, index){
|
||||
$('.bsToggle').bootstrapToggle();
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$(".role_check").change(function() {
|
||||
var id = $(this).attr('id');
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$(".role_check").each(function(key, value){
|
||||
if($(value).attr('id') != id) {
|
||||
$(value).prop('checked', false).change();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.data)
|
||||
{
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else
|
||||
window.location.href = '';
|
||||
}
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<div class="col-12 bg-uredjaj-edit">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="uredjaj_serijski_broj">Serijski broj</label>
|
||||
<input name="uredjaj_serijski_broj" id="uredjaj_serijski_broj" type="text" class="form-control" value="{{$uredjaj->serijski_broj ?? ''}}">
|
||||
</div>
|
||||
</div>
|
||||
@if(count($urDef['allowed_types'])>1)
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="uredjaj_tip_uredjaja">Serijski broj</label>
|
||||
<select name="uredjaj_tip_uredjaja" id="uredjaj_tip_uredjaja" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($urDef['allowed_types'] as $key => $value)
|
||||
<option value="{{ $value }}" @if($uredjaj->tip_uredjaja == $value) selected @endif>{{ $tipovi[$value] }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12 mb-2">
|
||||
<input type="hidden" name="uredjaj_id" value="{{$uredjaj->id ?? '0'}}">
|
||||
<button type="button" class="btn-sm btn-secondary uredjaj_cancel" rel="{{ $data->id ?? '' }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-secondary uredjaj_submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+228
@@ -0,0 +1,228 @@
|
||||
<style type="text/css">
|
||||
.card-header {
|
||||
background-color: rgba(0,0,0,.03);
|
||||
}
|
||||
.card-header, .card-body {
|
||||
padding: 0.6rem;
|
||||
}
|
||||
#uAttach .fa {
|
||||
color: green;
|
||||
}
|
||||
.bg-uredjaj-edit {
|
||||
background-color: #a0eb7a;
|
||||
}
|
||||
</style>
|
||||
<div id="uAttach" data-id="{{ $id }}" data-type="{{ $type }}" class="row">
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
getAttachForm();
|
||||
});
|
||||
|
||||
function getAttachForm() {
|
||||
$("#uAttach").empty();
|
||||
var formData = [];
|
||||
formData.push({name:'uredjaj_attached_to', value: $("#uAttach").data('id') });
|
||||
formData.push({name:'uredjaj_parent_type', value: $("#uAttach").data('type') });
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
$("#uAttach").load('/admin/uredjaj/getAttached', formData, function() {
|
||||
$(this).find(".addUredjaj").click(function (e) {
|
||||
loadEditFrom($(this));
|
||||
return false;
|
||||
});
|
||||
$(this).find(".linkUredjaj").click(function (e) {
|
||||
loadLinkFrom($(this));
|
||||
return false;
|
||||
});
|
||||
$(this).find(".editUredjaj").click(function (e) {
|
||||
loadEditFrom($(this));
|
||||
return false;
|
||||
});
|
||||
$(this).find(".deleteUredjaj").click(function (e) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete ?',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var btn = $(this);
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
formData.push({name:'uredjaj_id', value: btn.data('id') });
|
||||
formData.push({name:'uredjaj_attached_to', value: $("#uAttach").data('id') });
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: '/admin/uredjaj/attachDelete',
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
getAttachForm();
|
||||
},
|
||||
error: function (response) {
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
$(this).find(".unLinkUredjaj").click(function (e) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Unlink ?',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var btn = $(this);
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
formData.push({name:'uredjaj_id', value: btn.data('id') });
|
||||
formData.push({name:'uredjaj_attached_to', value: $("#uAttach").data('id') });
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: '/admin/uredjaj/attachUnlink',
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
getAttachForm();
|
||||
},
|
||||
error: function (response) {
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadLinkFrom(element) {
|
||||
var newEl = $( "<div id='uredjajLinkContainer'></div>" );
|
||||
var mRow = element.parent();
|
||||
mRow.after(newEl);
|
||||
|
||||
var formData = [];
|
||||
formData.push({name:'uredjaj_attached_to', value: $("#uAttach").data('id') });
|
||||
formData.push({name:'uredjaj_parent_type', value: $("#uAttach").data('type') });
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
$("#uredjajLinkContainer").load('/admin/uredjaj/attachLinkLoadForm', formData, function() {
|
||||
$(this).find('.dropdown').dropdown();
|
||||
$(this).find(".uredjaj_cancel").click(function (e) {
|
||||
$("#uredjajLinkContainer").remove();
|
||||
return false;
|
||||
});
|
||||
$(this).find(".uredjaj_submit").click(function (e) {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
var token = false;
|
||||
for(const [index, el] of formData.entries()) {
|
||||
if(el.name == '_token'){
|
||||
token = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!token){
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
}
|
||||
$.ajax({
|
||||
url: '/admin/uredjaj/attachLinkSave',
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
getAttachForm();
|
||||
if(response.error) {
|
||||
}else{
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
}
|
||||
});
|
||||
|
||||
$("#uredjajEditContainer").remove();
|
||||
mRow.addClass('d-flex').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function loadEditFrom(element) {
|
||||
|
||||
var id = element.data('id');
|
||||
var newEl = $( "<div id='uredjajEditContainer'></div>" );
|
||||
var mRow = element.parent();
|
||||
mRow.after(newEl);
|
||||
|
||||
var formData = [];
|
||||
formData.push({name:'uredjaj_attached_to', value: $("#uAttach").data('id') });
|
||||
formData.push({name:'uredjaj_parent_type', value: $("#uAttach").data('type') });
|
||||
formData.push({name:'uredjaj_id', value: id });
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
$("#uredjajEditContainer").load('/admin/uredjaj/attachEdit', formData, function() {
|
||||
mRow.removeClass('d-flex').addClass('d-none');
|
||||
$(this).find(".uredjaj_cancel").click(function (e) {
|
||||
$("#uredjajEditContainer").remove();
|
||||
mRow.addClass('d-flex').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
$(this).find(".uredjaj_submit").click(function (e) {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
var token = false;
|
||||
for(const [index, el] of formData.entries()) {
|
||||
if(el.name == '_token'){
|
||||
token = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!token){
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
}
|
||||
formData.push({name:'uredjaj_attached_to', value: $("#uAttach").data('id') });
|
||||
formData.push({name:'uredjaj_parent_type', value: $("#uAttach").data('type') });
|
||||
$.ajax({
|
||||
url: '/admin/uredjaj/attachSave',
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
getAttachForm();
|
||||
if(response.error) {
|
||||
}else{
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
}
|
||||
});
|
||||
|
||||
$("#uredjajEditContainer").remove();
|
||||
mRow.addClass('d-flex').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<div class="col-12 bg-uredjaj-edit">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="uredjaj_id">Serijski broj</label>
|
||||
<select name="uredjaj_id" id="uredjaj_id" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($uredjaji as $key => $uredjaj)
|
||||
<option value="{{ $uredjaj->id }}">{{ $uredjaj->serijski_broj }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12 mb-2">
|
||||
<input type="hidden" name="uredjaj_attached_to" value="{{$uredjaj_attached_to ?? '0'}}">
|
||||
<button type="button" class="btn-sm btn-secondary uredjaj_cancel">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-secondary uredjaj_submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<div class="col-12">
|
||||
<div class="card bg-light">
|
||||
<div class="card-header">
|
||||
Prikljuceni merni uredjaj(i)
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($urDef['single_uredjaj']===false || ($urDef['single_uredjaj'] && count($uredjaji)==0))
|
||||
<div class="d-flex justify-content-between align-items-center pb-1">
|
||||
<a href="#" data-id="0" class="ml-auto pr-2 hideOnEdit addUredjaj"><i class="fa fa-plus-square" aria-hidden="true"></i></a>
|
||||
<a href="#" data-id="0" class="hideOnEdit linkUredjaj"><i class="fa fa-link" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row editcontainer">
|
||||
</div>
|
||||
<ul id="list" class="list-group">
|
||||
@foreach($uredjaji as $key => $uredjaj)
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<b>{{ $uredjaj->serijski_broj }}</b> - {{ $tipovi[$uredjaj->tip_uredjaja] }}
|
||||
<a href="#" data-id="{{$uredjaj->id}}" class="hideOnEdit editUredjaj ml-auto pr-2"><i class="fa fa-edit" aria-hidden="true"></i></a>
|
||||
<a href="#" data-id="{{$uredjaj->id}}" class="hideOnEdit deleteUredjaj pr-2"><i class="fa fa-trash" aria-hidden="true"></i></a>
|
||||
<a href="#" data-id="{{$uredjaj->id}}" class="hideOnEdit unLinkUredjaj"><i class="fa fa-unlink" aria-hidden="true"></i></a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
<form data-id="{{$data->id ?? '0'}}" id="form2">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="form-row">
|
||||
@foreach ($obj as $key => $field)
|
||||
<div class="col-md-6">
|
||||
<div class="position-relative form-group">
|
||||
<label for="{{ $key }}">{{ $field['label'] }}</label>
|
||||
@switch($field['type'])
|
||||
@case('text')
|
||||
<input name="{{ $key }}" id="{{ $key }}" type="text" class="form-control" value="{{$data->$key ?? ''}}">
|
||||
@break
|
||||
@case('select')
|
||||
<select name="{{ $key }}" id="{{ $key }}" class="form-control ui search fluid normal dropdown">
|
||||
@foreach ($field['fetch']($data) as $key1 => $value1)
|
||||
<option value="{{ $key1 }}" @if($data->$key == $key1) selected @endif>{{ $value1 }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-12">
|
||||
<input type="hidden" name="id" value="{{$data->id ?? '0'}}">
|
||||
@csrf
|
||||
<button type="button" class="btn-sm btn-danger cancel" rel="{{ $data->id ?? "" }}">Cancel</button>
|
||||
<button type="button" class="btn-sm btn-primary submit float-right">Snimi</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
@isset($data->uredjajDef)
|
||||
<style type="text/css">
|
||||
.card-header {
|
||||
background-color: rgba(0,0,0,.03);
|
||||
}
|
||||
.card-header, .card-body {
|
||||
padding: 0.6rem;
|
||||
}
|
||||
</style>
|
||||
<div id="uAttach" class="row">
|
||||
<div class="col-12">
|
||||
<div class="card bg-light">
|
||||
<div class="card-header">
|
||||
Prikljuceni merni uredjaj(i)
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ $data->uredjajDef['allowed_types'][0] }}
|
||||
<ul id="list" class="list-group mt-4 pb-4">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<a href="#"><i class="fa fa-plus-square pr-3" aria-hidden="true"></i></a>Pay Car Insurance
|
||||
<a href="#" class="ml-auto pr-3"><i class="fa fa-edit" aria-hidden="true"></i></a>
|
||||
<a href="#"><i class="fa fa-trash" aria-hidden="true"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
{{ dd($data->uredjajDef) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endisset
|
||||
+449
@@ -0,0 +1,449 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', $general['title'])
|
||||
|
||||
@section('content_header')
|
||||
<h1>{{ $general['title'] }}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$ajaxUrl = "/admin/".$general['cont_name'];
|
||||
@endphp
|
||||
<div id="editor_container">
|
||||
<div id="" class="card col-12">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
{{ $general['sub_title'] }}
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a class="add_new" href="javascript:void(0)" title="Add')"><i class="fa fa-plus-square"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body justify-content-center align-items-center">
|
||||
<div id="toolbar" class="">
|
||||
<div class="">
|
||||
<select name="f_mesta" id="f_mesta" class="filter ui search fluid normal dropdown f_mesta">
|
||||
<option value="">Sva mesta</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="">
|
||||
<div class="col-12 pb-2">
|
||||
<div class="col-12 d-none pt-2 pb-2" id="editor_div">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="hiddenAtLoad d-none table-striped"
|
||||
id="listing_table"
|
||||
data-toggle="table"
|
||||
data-toolbar="#toolbar"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-page-size="25"
|
||||
data-search="true"
|
||||
data-url="{{ $ajaxUrl }}/browse?{{ $qstring }}"
|
||||
data-unique-id="id"
|
||||
data-sort-name="id"
|
||||
data-sort-order="desc"
|
||||
data-id-field="id"
|
||||
data-show-footer="false"
|
||||
data-row-style="rowStyle"
|
||||
data-row-attributes="rowAttributes"
|
||||
data-detail-view="true"
|
||||
data-detail-view-icon="true"
|
||||
data-detail-formatter="detailFormatter"
|
||||
data-query-params="queryParams"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="id" data-visible="false">
|
||||
#
|
||||
</th>
|
||||
@foreach ($fields as $key => $field)
|
||||
<th data-field="@if(array_key_exists('display_field', $field)){{ $field['display_field'] }}@else{{ $key }}@endif" data-sortable="true">
|
||||
{{ $field['label'] }}
|
||||
</th>
|
||||
@endforeach
|
||||
<th data-align="center"
|
||||
data-formatter="optFormatter"
|
||||
data-events="optEvents"
|
||||
data-sortable="false">
|
||||
Akcije
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner_overlay" id="spinner_overlay">
|
||||
<div class="w-100 d-flex justify-content-center align-items-center">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.zoom {
|
||||
transition:all .2s;
|
||||
position: inherit;
|
||||
text-align: center;
|
||||
}
|
||||
.zoom .card-body {
|
||||
}
|
||||
.zoom .card-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
}
|
||||
.zoom:hover {
|
||||
z-index:25;
|
||||
transform:scale(1.15);
|
||||
box-shadow:0 .46875rem 4.1875rem rgba(4,9,20,.05),0 .9375rem 2.40625rem rgba(4,9,20,.05),0 .25rem 1.3125rem rgba(4,9,20,.06),0 .125rem 1.1875rem rgba(4,9,20,.06);
|
||||
cursor:pointer;
|
||||
background:#fff
|
||||
}
|
||||
|
||||
td.editor, #editor_div {
|
||||
background-color: #F5DEB3 !important;
|
||||
}
|
||||
.spinner {
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
-webkit-animation: rotation .6s infinite linear;
|
||||
-moz-animation: rotation .6s infinite linear;
|
||||
-o-animation: rotation .6s infinite linear;
|
||||
animation: rotation .6s infinite linear;
|
||||
border-left: 6px solid rgba(0, 174, 239, .15);
|
||||
border-right: 6px solid rgba(0, 174, 239, .15);
|
||||
border-bottom: 6px solid rgba(0, 174, 239, .15);
|
||||
border-top: 6px solid rgba(0, 174, 239, .8);
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@-webkit-keyframes rotation {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes rotation {
|
||||
from {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes rotation {
|
||||
from {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner_overlay {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui.label {
|
||||
background-color: #EEE;
|
||||
color: #666 !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.ui.label .icon:before {
|
||||
content: '\f00d';
|
||||
font-family: fontAwesome;
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
padding-left: 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
.ui.label .icon:hover:before {
|
||||
color: #F00;
|
||||
}
|
||||
.ui.selection.dropdown {
|
||||
min-height: inherit;
|
||||
}
|
||||
.bootstrap-table .fixed-table-container .fixed-table-body {
|
||||
overflow: visible !important;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
var blocked = [];
|
||||
var ajaxUrl = '{{ $ajaxUrl }}';
|
||||
var queryStr = '{{ $qstring ?? '' }}';
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
$(".f_mesta").dropdown({
|
||||
apiSettings: {
|
||||
url: '/admin/api/mesta',
|
||||
cache: false,
|
||||
},
|
||||
filterRemoteData: true,
|
||||
});
|
||||
$('.filter').dropdown('setting', 'onChange', function(){
|
||||
$("#listing_table").bootstrapTable('refresh',{pageNumber: 1});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#listing_table').on('load-success.bs.table post-body.bs.table', function(data, status, jqXHR) {
|
||||
$('th:first-child, td:first-child', $(this)).addClass('d-none');;
|
||||
});
|
||||
|
||||
function queryParams(params) {
|
||||
$.each($(".filter"), function( key, value ){
|
||||
params[$(value).attr('name')] = $(value).dropdown('get value');
|
||||
});
|
||||
// params['status'] = $("input[name='status']:checked").val();
|
||||
return params;
|
||||
}
|
||||
|
||||
function breadFormatter(value, row) {
|
||||
var t = [];
|
||||
switch(value) {
|
||||
case 'grupa':
|
||||
break;
|
||||
case 'objekat':
|
||||
t.push('<a class="objekat" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na objekat"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
case 'prostorija':
|
||||
t.push('<a class="prostorija" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na prostoriju"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
case 'radijator':
|
||||
t.push('<a class="radijator" href="javascript:void(0)" data-id="'+row.id+'" title="Idi na radijator"><i class="fa fa-arrow-alt-circle-left"></i></a>');
|
||||
break;
|
||||
}
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function optFormatter(value, row) {
|
||||
var t = [];
|
||||
t.push('<a class="delete mr-2" href="javascript:void(0)" data-id="'+row.id+'" title="Delete"><i class="fa fa-trash"></i></a>');
|
||||
t.push('<a class="edit mr-2" href="javascript:void(0)" title="Edit"><i class="fa fa-edit"></i></a>');
|
||||
t.push('<a class="related mr-2" href="javascript:void(0)" title="Relacije"><i class="fa fa-filter"></i></a>');
|
||||
return t.join('');
|
||||
}
|
||||
|
||||
function detailFormatter(index, row, element) {
|
||||
element.addClass('editor').load(ajaxUrl + '/'+row.id+'/edit?'+queryStr, function() {
|
||||
openEditor(element, index);
|
||||
});
|
||||
}
|
||||
|
||||
$(".add_new").click(function () {
|
||||
$("#editor_div").addClass('editor').removeClass('d-none').load(ajaxUrl + '/create?'+queryStr, function() {
|
||||
$('#listing_table').removeClass('table-hover');
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
|
||||
openEditor($("#editor_div"), -1);
|
||||
});
|
||||
})
|
||||
|
||||
function rowAttributes(row, index) {
|
||||
return {
|
||||
'data-id': row.id
|
||||
}
|
||||
}
|
||||
|
||||
function openEditor(element, index){
|
||||
$('.ui.dropdown').dropdown();
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
element.find(':input').first().focus();
|
||||
element.keyup(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('.submit').click();
|
||||
return false;
|
||||
}
|
||||
if(e.which == 27) {
|
||||
$('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#grad_id").change(function() {
|
||||
$("#ulica_id").load('/admin/objekat/ulicepogradu/'+$("#grad_id").val());
|
||||
});
|
||||
$('.submit', element).click(function() {
|
||||
var form = $(this).closest("form");
|
||||
var formData = form.serializeArray();
|
||||
|
||||
form.removeClass('was-validated');
|
||||
$.each($('.is-invalid'), function(key, value){
|
||||
$(value).removeClass('is-invalid').parent().find('.invalid-feedback').remove();
|
||||
});
|
||||
|
||||
blockElement($(this).parents('.card'));
|
||||
var url = ajaxUrl ;
|
||||
if(index == -1) {
|
||||
var method = "POST";
|
||||
}else {
|
||||
var method = "PUT";
|
||||
url = url + '/'+form.data('id');
|
||||
}
|
||||
$.ajax({
|
||||
url: url+'?'+queryStr,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: method,
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
if(response.data){
|
||||
if($("#listing_table").bootstrapTable('getRowByUniqueId', response.data.id)){
|
||||
$("#listing_table").bootstrapTable('updateByUniqueId', {id: response.data.id, row: response.data});
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('refresh');
|
||||
}
|
||||
}else
|
||||
$("#listing_table").bootstrapTable('refresh');
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
if (response.status == 422) {
|
||||
$.each(response.responseJSON.errors, function (i, error) {
|
||||
var el = $(document).find('#'+i);
|
||||
el.addClass('is-invalid');
|
||||
el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
});
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$('.cancel', element).click(function() {
|
||||
if(index == -1)
|
||||
$("#editor_div").removeClass('editor').addClass('d-none').html('');
|
||||
else
|
||||
$('#listing_table').addClass('table-hover').bootstrapTable('collapseRow', index);
|
||||
$('#listing_table i.noedit').addClass('d-none');
|
||||
$('#listing_table a.edit').removeClass('d-none');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
window.breadEvents = {
|
||||
'click .objekat': function (e, value, row, index) {
|
||||
window.location.href = '/admin/objekat?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
'click .prostorija': function (e, value, row, index) {
|
||||
window.location.href = '/admin/prostorija?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
'click .radijator': function (e, value, row, index) {
|
||||
window.location.href = '/admin/radijator?' + $(e.currentTarget).closest('tr').data('qs');
|
||||
},
|
||||
}
|
||||
|
||||
window.optEvents = {
|
||||
'click .related': function (e, value, row, index) {
|
||||
window.location.href = '/admin/radijator?getrelAlok=' + row.id;
|
||||
},
|
||||
'click .edit': function (e, value, row, index) {
|
||||
$('#listing_table').removeClass('table-hover').bootstrapTable('expandRow', index);
|
||||
$('#listing_table a.edit').addClass('d-none');
|
||||
$('#listing_table i.noedit').removeClass('d-none');
|
||||
},
|
||||
'click .delete': function (e, value, row, index) {
|
||||
var popOpts={
|
||||
placement: 'left',
|
||||
title: 'Delete Item',
|
||||
html: true,
|
||||
trigger: 'focus',
|
||||
content: '<a class="btn btn-xs btn-danger decline" href="javascript:void(0)"><i class="fas fa-times"></i> Ne</a> <a class="btn btn-xs btn-success pull-right popover-confirm" href="javascript:void(0)"><i class="fas fa-check"></i> Da</a>',
|
||||
}
|
||||
$(e.currentTarget).popover(popOpts).popover('show').on('shown.bs.popover', function(e) {
|
||||
var pdelete=$(this);
|
||||
var pop=$(".popover");
|
||||
var popButtons=pop.find('a').click(function(){
|
||||
if($(this).is('.popover-confirm')){
|
||||
var formData = [];
|
||||
formData.push({name:'_token', value: '{{ csrf_token() }}'});
|
||||
blockElement($(this).parents('.card'));
|
||||
$.ajax({
|
||||
url: ajaxUrl + '/' + row.id,
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
type: "DELETE",
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
unBlockAll();
|
||||
if(response.error)
|
||||
{
|
||||
$('#ModalLabel').html(response.error.title);
|
||||
$('#ModalBody').html(response.error.msg);
|
||||
$("#AlertModal").modal('show');
|
||||
}else{
|
||||
$("#listing_table").bootstrapTable('removeByUniqueId', response.data.id);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
unBlockAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
pdelete.popover('dispose');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function blockElement(element)
|
||||
{
|
||||
var bl = $("#spinner_overlay").clone();
|
||||
bl.removeAttr('id').appendTo(element);
|
||||
bl.css("display","flex");
|
||||
blocked.push(bl);
|
||||
}
|
||||
|
||||
function unBlockAll()
|
||||
{
|
||||
for (var i = blocked.length - 1; i >= 0; i--) {
|
||||
blocked[i].remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
Executable
+175
@@ -0,0 +1,175 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', 'Izbor formata')
|
||||
|
||||
@section('content_header')
|
||||
<h1>Izbor tipa XML izlaza</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-12 col-xl-6">
|
||||
<div class="h4">Izabrana grupa:</div>
|
||||
<table class="hiddenAtLoad d-none table table-striped table-bordered"
|
||||
id="dep_table"
|
||||
data-toggle="table"
|
||||
data-pagination="false"
|
||||
data-search="false"
|
||||
data-show-columns="false"
|
||||
data-show-footer="false"
|
||||
data-show-header="false"
|
||||
data-detail-formatter="def_detailFormatter"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr data-id="1">
|
||||
<td>{{ $izabrana->ime_grupe}}, {{ $izabrana->j_grad }} ({{ $izabrana->j_tip }})</td>
|
||||
</tr>
|
||||
<tr data-id="1">
|
||||
<td>
|
||||
Ser. br. glavnog kalorimetra: <b>{{ $glavniKalorimetar }}</b><br>
|
||||
Broj individualnih kalorimetara: <b>{{ $kalorimetri }}</b><br>
|
||||
Broj alokatora: <b>{{ $alokatori }}</b><br>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-xl-6">
|
||||
<div class="card">
|
||||
<div class="card-header font-weight-bolder text-primary">
|
||||
Izbor tipa
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form id="kaloriRead" class="form-inline" method="post" action="/admin/xml/create/kaloriRead">
|
||||
<div class="col-8">
|
||||
<div class="col-12">
|
||||
<div class="form-group mb-2 float-right">
|
||||
<label class="mr-2" for="uredjaji_po_falju" class="float-left">Broj uređaja po fajlu</label>
|
||||
<input type="text" class="form-control float-right" id="uredjaji_po_falju" name="uredjaji_po_falju" aria-describedby="emailHelp" placeholder="neograničen">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="grupaID" value="{{ $grupaID }}">
|
||||
@csrf
|
||||
</div>
|
||||
<div class="col-4 float-right">
|
||||
<button id="readKalorimetar" type="submit" @if($kalorimetri==0) disabled @endif class="float-right btn btn-success">Kalorimetar Read</button>
|
||||
@csrf
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form id="alokatorRead" class="form-inline" method="post" action="/admin/xml/create/alokatorRead">
|
||||
<div class="col-8">
|
||||
<div class="col-12">
|
||||
<div class="form-group mb-2 float-right">
|
||||
<label class="mr-2" for="uredjaji_po_falju" class="float-left">Broj uređaja po fajlu</label>
|
||||
<input type="text" class="form-control float-right" id="uredjaji_po_falju" name="uredjaji_po_falju" aria-describedby="emailHelp" placeholder="neograničen">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="grupaID" value="{{ $grupaID }}">
|
||||
@csrf
|
||||
</div>
|
||||
<div class="col-4 float-right">
|
||||
<button id="readAlokator" type="submit" type="button" @if($alokatori==0) disabled @endif class="float-right btn btn-success">Alokator Read</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-4 float-right">
|
||||
<button id="writeAlokator" type="button" @if($alokatori==0) disabled @endif class="float-right btn btn-success">Alokator parametrizacija</button>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<form id="alokatorParam" class="form-inline" method="post" action="/admin/xml/create/alokatorParam">
|
||||
<div class="col-12">
|
||||
<div class="form-group mb-2 float-right">
|
||||
<label class="mr-2" for="setDay" class="float-left">Set day</label>
|
||||
<input type="text" class="form-control float-right" id="setDay" aria-describedby="emailHelp" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-group mb-2 float-right">
|
||||
<label class="mr-2" for="adjustClock">Adjust clock</label>
|
||||
<input type="text" class="form-control" id="adjustClock" aria-describedby="emailHelp" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-group mb-2 float-right">
|
||||
<label class="mr-2" for="summerStart">Summer start</label>
|
||||
<input type="text" class="form-control" id="summerStart" aria-describedby="emailHelp" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-group mb-2 float-right">
|
||||
<label class="mr-2" for="winterStart">Winter start</label>
|
||||
<input type="text" class="form-control" id="winterStart" aria-describedby="emailHelp" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-group mb-2 float-right">
|
||||
<label class="mr-2" for="summerPeriod">Summer period</label>
|
||||
<input type="text" class="form-control" id="summerPeriod" aria-describedby="emailHelp" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="grupaID" value="{{ $grupaID }}">
|
||||
@csrf
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@section('css')
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/icheck-bootstrap/3.0.1/icheck-bootstrap.min.css">
|
||||
@stop
|
||||
@section('js')
|
||||
<script src="/js/jquery.blockUI.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".hiddenAtLoad").removeClass('d-none');
|
||||
});
|
||||
|
||||
// $('#form2').on( 'click', "#readKalorimetar", function (e) {
|
||||
// var formData = $('#form2').serializeArray();
|
||||
// $.ajax({
|
||||
// url: '/admin/xml/create/kaloriRead',
|
||||
// dataType: "json",
|
||||
// type: "POST",
|
||||
// data: formData,
|
||||
// cache: false,
|
||||
// success: function (response) {
|
||||
// window.location.href = '/admin/lostpassword/success';
|
||||
// },
|
||||
// error: function (response) {
|
||||
// if (response.status == 419) {
|
||||
// location.reload(true);
|
||||
// }
|
||||
// if (response.status == 422) {
|
||||
// $.each(response.responseJSON.errors, function (i, error) {
|
||||
// var el = $(document).find('#'+i);
|
||||
// el.addClass('is-invalid');
|
||||
// el.after($('<div class="invalid-feedback">'+error[0]+'</div>'));
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// });
|
||||
|
||||
</script>
|
||||
@stop
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
@extends('adminlte::master')
|
||||
|
||||
@php( $dashboard_url = View::getSection('dashboard_url') ?? config('adminlte.dashboard_url', 'home') )
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $dashboard_url = $dashboard_url ? route($dashboard_url) : '' )
|
||||
@else
|
||||
@php( $dashboard_url = $dashboard_url ? url($dashboard_url) : '' )
|
||||
@endif
|
||||
|
||||
@section('adminlte_css')
|
||||
@stack('css')
|
||||
@yield('css')
|
||||
@stop
|
||||
|
||||
@section('classes_body'){{ ($auth_type ?? 'login') . '-page' }}@stop
|
||||
|
||||
@section('body')
|
||||
<div class="{{ $auth_type ?? 'login' }}-box">
|
||||
|
||||
{{-- Logo --}}
|
||||
<div class="{{ $auth_type ?? 'login' }}-logo">
|
||||
<a href="{{ $dashboard_url }}">
|
||||
<img src="{{ asset(config('adminlte.logo_img')) }}" height="50">
|
||||
{!! config('adminlte.logo', '<b>Admin</b>LTE') !!}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- Card Box --}}
|
||||
<div class="card {{ config('adminlte.classes_auth_card', 'card-outline card-primary') }}">
|
||||
|
||||
{{-- Card Header --}}
|
||||
@hasSection('auth_header')
|
||||
<div class="card-header {{ config('adminlte.classes_auth_header', '') }}">
|
||||
<h3 class="card-title float-none text-center">
|
||||
@yield('auth_header')
|
||||
</h3>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Card Body --}}
|
||||
<div class="card-body {{ $auth_type ?? 'login' }}-card-body {{ config('adminlte.classes_auth_body', '') }}">
|
||||
@yield('auth_body')
|
||||
</div>
|
||||
|
||||
{{-- Card Footer --}}
|
||||
@hasSection('auth_footer')
|
||||
<div class="card-footer {{ config('adminlte.classes_auth_footer', '') }}">
|
||||
@yield('auth_footer')
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('adminlte_js')
|
||||
@stack('js')
|
||||
@yield('js')
|
||||
@stop
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
@extends('adminlte::auth.auth-page', ['auth_type' => 'login'])
|
||||
|
||||
@section('adminlte_css_pre')
|
||||
<link rel="stylesheet" href="{{ asset('vendor/icheck-bootstrap/icheck-bootstrap.min.css') }}">
|
||||
@stop
|
||||
|
||||
@php( $login_url = View::getSection('login_url') ?? config('adminlte.login_url', 'login') )
|
||||
@php( $register_url = View::getSection('register_url') ?? config('adminlte.register_url', 'register') )
|
||||
@php( $password_reset_url = View::getSection('password_reset_url') ?? config('adminlte.password_reset_url', 'password/reset') )
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $login_url = $login_url ? route($login_url) : '' )
|
||||
@php( $register_url = $register_url ? route($register_url) : '' )
|
||||
@php( $password_reset_url = $password_reset_url ? route($password_reset_url) : '' )
|
||||
@else
|
||||
@php( $login_url = $login_url ? url($login_url) : '' )
|
||||
@php( $register_url = $register_url ? url($register_url) : '' )
|
||||
@php( $password_reset_url = $password_reset_url ? url($password_reset_url) : '' )
|
||||
@endif
|
||||
|
||||
@section('auth_header', __('adminlte::adminlte.login_message'))
|
||||
|
||||
@section('auth_body')
|
||||
<form action="{{ $login_url }}" method="post">
|
||||
{{ csrf_field() }}
|
||||
|
||||
{{-- Email field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" name="email" class="form-control {{ $errors->has('email') ? 'is-invalid' : '' }}"
|
||||
value="{{ old('email') }}" placeholder="{{ __('adminlte::adminlte.email') }}" autofocus>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('email'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Password field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" name="password" class="form-control {{ $errors->has('password') ? 'is-invalid' : '' }}"
|
||||
placeholder="{{ __('adminlte::adminlte.password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('password'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Login field --}}
|
||||
<div class="row">
|
||||
<div class="col-7">
|
||||
<div class="icheck-primary">
|
||||
<input type="checkbox" name="remember" id="remember">
|
||||
<label for="remember">{{ __('adminlte::adminlte.remember_me') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<button type=submit class="btn btn-block {{ config('adminlte.classes_auth_btn', 'btn-flat btn-primary') }}">
|
||||
<span class="fas fa-sign-in-alt"></span>
|
||||
{{ __('adminlte::adminlte.sign_in') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@stop
|
||||
|
||||
@section('auth_footer')
|
||||
{{-- Password reset link --}}
|
||||
@if($password_reset_url)
|
||||
<p class="my-0">
|
||||
<a href="{{ $password_reset_url }}">
|
||||
{{ __('adminlte::adminlte.i_forgot_my_password') }}
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
|
||||
{{-- Register link --}}
|
||||
@if($register_url)
|
||||
<p class="my-0">
|
||||
<a href="{{ $register_url }}">
|
||||
{{ __('adminlte::adminlte.register_a_new_membership') }}
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
@stop
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
@extends('adminlte::master')
|
||||
|
||||
@section('adminlte_css')
|
||||
@yield('css')
|
||||
@stop
|
||||
|
||||
@section('classes_body', 'lockscreen')
|
||||
|
||||
@php( $password_reset_url = View::getSection('password_reset_url') ?? config('adminlte.password_reset_url', 'password/reset') )
|
||||
@php( $dashboard_url = View::getSection('dashboard_url') ?? config('adminlte.dashboard_url', 'home') )
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $password_reset_url = $password_reset_url ? route($password_reset_url) : '' )
|
||||
@php( $dashboard_url = $dashboard_url ? route($dashboard_url) : '' )
|
||||
@else
|
||||
@php( $password_reset_url = $password_reset_url ? url($password_reset_url) : '' )
|
||||
@php( $dashboard_url = $dashboard_url ? url($dashboard_url) : '' )
|
||||
@endif
|
||||
|
||||
@section('body')
|
||||
<div class="lockscreen-wrapper">
|
||||
|
||||
{{-- Lockscreen logo --}}
|
||||
<div class="lockscreen-logo">
|
||||
<a href="{{ $dashboard_url }}">
|
||||
<img src="{{ asset(config('adminlte.logo_img')) }}" height="50">
|
||||
{!! config('adminlte.logo', '<b>Admin</b>LTE') !!}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- Lockscreen user name --}}
|
||||
<div class="lockscreen-name">
|
||||
{{ isset(Auth::user()->name) ? Auth::user()->name : Auth::user()->email }}
|
||||
</div>
|
||||
|
||||
{{-- Lockscreen item --}}
|
||||
<div class="lockscreen-item">
|
||||
@if(config('adminlte.usermenu_image'))
|
||||
<div class="lockscreen-image">
|
||||
<img src="{{ Auth::user()->adminlte_image() }}" alt="{{ Auth::user()->name }}">
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('password.confirm') }}"
|
||||
class="lockscreen-credentials @if(!config('adminlte.usermenu_image'))ml-0 @endif">
|
||||
@csrf
|
||||
|
||||
<div class="input-group">
|
||||
<input id="password" type="password" name="password" autocomplete="current-password"
|
||||
class="form-control @error('password') is-invalid @enderror"
|
||||
placeholder="{{ __('adminlte::adminlte.password') }}" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="submit" class="btn">
|
||||
<i class="fas fa-arrow-right text-muted"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{-- Password error alert --}}
|
||||
@error('password')
|
||||
<div class="lockscreen-subitem text-center" role="alert">
|
||||
<b class="text-danger">{{ $message }}</b>
|
||||
</div>
|
||||
@enderror
|
||||
|
||||
{{-- Help block --}}
|
||||
<div class="help-block text-center">
|
||||
{{ __('adminlte::adminlte.confirm_password_message') }}
|
||||
</div>
|
||||
|
||||
{{-- Additional links --}}
|
||||
<div class="text-center">
|
||||
<a href="{{ $password_reset_url }}">
|
||||
{{ __('adminlte::adminlte.i_forgot_my_password') }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('adminlte_js')
|
||||
@stack('js')
|
||||
@yield('js')
|
||||
@stop
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
@extends('adminlte::auth.auth-page', ['auth_type' => 'login'])
|
||||
|
||||
@php( $password_email_url = View::getSection('password_email_url') ?? config('adminlte.password_email_url', 'password/email') )
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $password_email_url = $password_email_url ? route($password_email_url) : '' )
|
||||
@else
|
||||
@php( $password_email_url = $password_email_url ? url($password_email_url) : '' )
|
||||
@endif
|
||||
|
||||
@section('auth_header', __('adminlte::adminlte.password_reset_message'))
|
||||
|
||||
@section('auth_body')
|
||||
|
||||
@if(session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{ $password_email_url }}" method="post">
|
||||
{{ csrf_field() }}
|
||||
|
||||
{{-- Email field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" name="email" class="form-control {{ $errors->has('email') ? 'is-invalid' : '' }}"
|
||||
value="{{ old('email') }}" placeholder="{{ __('adminlte::adminlte.email') }}" autofocus>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('email'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Send reset link button --}}
|
||||
<button type="submit" class="btn btn-block {{ config('adminlte.classes_auth_btn', 'btn-flat btn-primary') }}">
|
||||
<span class="fas fa-share-square"></span>
|
||||
{{ __('adminlte::adminlte.send_password_reset_link') }}
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
@stop
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
@extends('adminlte::auth.auth-page', ['auth_type' => 'login'])
|
||||
|
||||
@php( $password_reset_url = View::getSection('password_reset_url') ?? config('adminlte.password_reset_url', 'password/reset') )
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $password_reset_url = $password_reset_url ? route($password_reset_url) : '' )
|
||||
@else
|
||||
@php( $password_reset_url = $password_reset_url ? url($password_reset_url) : '' )
|
||||
@endif
|
||||
|
||||
@section('auth_header', __('adminlte::adminlte.password_reset_message'))
|
||||
|
||||
@section('auth_body')
|
||||
<form action="{{ $password_reset_url }}" method="post">
|
||||
{{ csrf_field() }}
|
||||
|
||||
{{-- Token field --}}
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
|
||||
{{-- Email field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" name="email" class="form-control {{ $errors->has('email') ? 'is-invalid' : '' }}"
|
||||
value="{{ old('email') }}" placeholder="{{ __('adminlte::adminlte.email') }}" autofocus>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('email'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Password field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" name="password"
|
||||
class="form-control {{ $errors->has('password') ? 'is-invalid' : '' }}"
|
||||
placeholder="{{ __('adminlte::adminlte.password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('password'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Password confirmation field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" name="password_confirmation"
|
||||
class="form-control {{ $errors->has('password_confirmation') ? 'is-invalid' : '' }}"
|
||||
placeholder="{{ trans('adminlte::adminlte.retype_password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('password_confirmation'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password_confirmation') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Confirm password reset button --}}
|
||||
<button type="submit" class="btn btn-block {{ config('adminlte.classes_auth_btn', 'btn-flat btn-primary') }}">
|
||||
<span class="fas fa-sync-alt"></span>
|
||||
{{ __('adminlte::adminlte.reset_password') }}
|
||||
</button>
|
||||
|
||||
</form>
|
||||
@stop
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
@extends('adminlte::auth.auth-page', ['auth_type' => 'register'])
|
||||
|
||||
@php( $login_url = View::getSection('login_url') ?? config('adminlte.login_url', 'login') )
|
||||
@php( $register_url = View::getSection('register_url') ?? config('adminlte.register_url', 'register') )
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $login_url = $login_url ? route($login_url) : '' )
|
||||
@php( $register_url = $register_url ? route($register_url) : '' )
|
||||
@else
|
||||
@php( $login_url = $login_url ? url($login_url) : '' )
|
||||
@php( $register_url = $register_url ? url($register_url) : '' )
|
||||
@endif
|
||||
|
||||
@section('auth_header', __('adminlte::adminlte.register_message'))
|
||||
|
||||
@section('auth_body')
|
||||
<form action="{{ $register_url }}" method="post">
|
||||
{{ csrf_field() }}
|
||||
|
||||
{{-- Name field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" name="name" class="form-control {{ $errors->has('name') ? 'is-invalid' : '' }}"
|
||||
value="{{ old('name') }}" placeholder="{{ __('adminlte::adminlte.full_name') }}" autofocus>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-user {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('name'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('name') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Email field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" name="email" class="form-control {{ $errors->has('email') ? 'is-invalid' : '' }}"
|
||||
value="{{ old('email') }}" placeholder="{{ __('adminlte::adminlte.email') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('email'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Password field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" name="password"
|
||||
class="form-control {{ $errors->has('password') ? 'is-invalid' : '' }}"
|
||||
placeholder="{{ __('adminlte::adminlte.password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('password'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Confirm password field --}}
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" name="password_confirmation"
|
||||
class="form-control {{ $errors->has('password_confirmation') ? 'is-invalid' : '' }}"
|
||||
placeholder="{{ __('adminlte::adminlte.retype_password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock {{ config('adminlte.classes_auth_icon', '') }}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if($errors->has('password_confirmation'))
|
||||
<div class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password_confirmation') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Register button --}}
|
||||
<button type="submit" class="btn btn-block {{ config('adminlte.classes_auth_btn', 'btn-flat btn-primary') }}">
|
||||
<span class="fas fa-user-plus"></span>
|
||||
{{ __('adminlte::adminlte.register') }}
|
||||
</button>
|
||||
|
||||
</form>
|
||||
@stop
|
||||
|
||||
@section('auth_footer')
|
||||
<p class="my-0">
|
||||
<a href="{{ $login_url }}">
|
||||
{{ __('adminlte::adminlte.i_already_have_a_membership') }}
|
||||
</a>
|
||||
</p>
|
||||
@stop
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
@extends('adminlte::auth.auth-page', ['auth_type' => 'login'])
|
||||
|
||||
@section('auth_header', __('adminlte::adminlte.verify_message'))
|
||||
|
||||
@section('auth_body')
|
||||
|
||||
@if(session('resent'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('adminlte::adminlte.verify_email_sent') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ __('adminlte::adminlte.verify_check_your_email') }}
|
||||
{{ __('adminlte::adminlte.verify_if_not_recieved') }},
|
||||
|
||||
<form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link p-0 m-0 align-baseline">
|
||||
{{ __('adminlte::adminlte.verify_request_another') }}
|
||||
</button>.
|
||||
</form>
|
||||
|
||||
@stop
|
||||
@@ -0,0 +1,4 @@
|
||||
<button type="{{ $type }}" {{ $attributes->merge(['class' => "btn btn-{$theme}"]) }}>
|
||||
@isset($icon) <i class="{{ $icon }}"></i> @endisset
|
||||
@isset($label) {{ $label }} @endisset
|
||||
</button>
|
||||
@@ -0,0 +1,98 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Date Range Input --}}
|
||||
<input id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
|
||||
@overwrite
|
||||
|
||||
{{-- Add plugin initialization and configuration code --}}
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
let usrCfg = _AdminLTE_DateRange.parseCfg( @json($config) );
|
||||
|
||||
// Check if default set of ranges should be enabled.
|
||||
|
||||
@isset($enableDefaultRanges)
|
||||
usrCfg.ranges = usrCfg.ranges || _AdminLTE_DateRange.defaultRanges;
|
||||
let range = usrCfg.ranges['{{ $enableDefaultRanges }}'];
|
||||
|
||||
if (Array.isArray(range)) {
|
||||
usrCfg.startDate = range[0];
|
||||
usrCfg.endDate = range[1];
|
||||
}
|
||||
@endisset
|
||||
|
||||
$('#{{ $id }}').daterangepicker(usrCfg);
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
{{-- Register Javascript utility class for this component --}}
|
||||
|
||||
@once
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
class _AdminLTE_DateRange {
|
||||
|
||||
/**
|
||||
* A default set of ranges options.
|
||||
*/
|
||||
static defaultRanges = {
|
||||
'Today': [
|
||||
moment(),
|
||||
moment()
|
||||
],
|
||||
'Yesterday': [
|
||||
moment().subtract(1, 'days'),
|
||||
moment().subtract(1, 'days')
|
||||
],
|
||||
'Last 7 Days': [
|
||||
moment().subtract(6, 'days'),
|
||||
moment()
|
||||
],
|
||||
'Last 30 Days': [
|
||||
moment().subtract(29, 'days'),
|
||||
moment()
|
||||
],
|
||||
'This Month': [
|
||||
moment().startOf('month'),
|
||||
moment().endOf('month')
|
||||
],
|
||||
'Last Month': [
|
||||
moment().subtract(1, 'month').startOf('month'),
|
||||
moment().subtract(1, 'month').endOf('month')
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the php plugin configuration and eval the javascript code.
|
||||
*
|
||||
* cfg: A json with the php side configuration.
|
||||
*/
|
||||
static parseCfg(cfg)
|
||||
{
|
||||
for (const prop in cfg) {
|
||||
let v = cfg[prop];
|
||||
|
||||
if (typeof v === 'string' && v.startsWith('js:')) {
|
||||
cfg[prop] = eval(v.slice(3));
|
||||
} else if (typeof v === 'object') {
|
||||
cfg[prop] = _AdminLTE_DateRange.parseCfg(v);
|
||||
}
|
||||
}
|
||||
|
||||
return cfg;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,40 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Input Color --}}
|
||||
<input id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
|
||||
@overwrite
|
||||
|
||||
{{-- Add plugin initialization and configuration code --}}
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
|
||||
// Create a method to set the addon color.
|
||||
|
||||
let setAddonColor = function()
|
||||
{
|
||||
let color = $('#{{ $id }}').data('colorpicker').getValue();
|
||||
|
||||
$('#{{ $id }}').closest('.input-group')
|
||||
.find('.input-group-text > i')
|
||||
.css('color', color);
|
||||
}
|
||||
|
||||
// Init the plugin and register the change event listener.
|
||||
|
||||
$('#{{ $id }}').colorpicker( @json($config) )
|
||||
.on('change', setAddonColor);
|
||||
|
||||
// Set the initial color for the addon.
|
||||
|
||||
setAddonColor();
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,55 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Input Date --}}
|
||||
<input id="{{ $id }}" name="{{ $name }}" data-target="#{{ $id }}" data-toggle="datetimepicker"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
|
||||
@overwrite
|
||||
|
||||
{{-- Add plugin initialization and configuration code --}}
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
let usrCfg = _AdminLTE_InputDate.parseCfg( @json($config) );
|
||||
$('#{{ $id }}').datetimepicker(usrCfg);
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
{{-- Register Javascript utility class for this component --}}
|
||||
|
||||
@once
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
class _AdminLTE_InputDate {
|
||||
|
||||
/**
|
||||
* Parse the php plugin configuration and eval the javascript code.
|
||||
*
|
||||
* cfg: A json with the php side configuration.
|
||||
*/
|
||||
static parseCfg(cfg)
|
||||
{
|
||||
for (const prop in cfg) {
|
||||
let v = cfg[prop];
|
||||
|
||||
if (typeof v === 'string' && v.startsWith('js:')) {
|
||||
cfg[prop] = eval(v.slice(3));
|
||||
} else if (typeof v === 'object') {
|
||||
cfg[prop] = _AdminLTE_InputDate.parseCfg(v);
|
||||
}
|
||||
}
|
||||
|
||||
return cfg;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,70 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
<div class="custom-file">
|
||||
|
||||
{{-- Custom file input --}}
|
||||
<input type="file" id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
|
||||
{{-- Custom file label --}}
|
||||
<label class="custom-file-label text-truncate" for="{{ $id }}"
|
||||
@isset($legend) data-browse="{{ $legend }}" @endisset>
|
||||
{{ $placeholder }}
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
@overwrite
|
||||
|
||||
{{-- Add the plugin initialization code --}}
|
||||
|
||||
@once
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {bsCustomFileInput.init();})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
{{-- Setup the height and font size of the plugin when using sm/lg sizes --}}
|
||||
{{-- NOTE: this may change with newer plugin or Bootstrap versions --}}
|
||||
|
||||
@once
|
||||
@push('css')
|
||||
<style type="text/css">
|
||||
|
||||
{{-- SM size setup --}}
|
||||
.input-group-sm .custom-file-label:after {
|
||||
height: 1.8125rem;
|
||||
line-height: 1.25;
|
||||
}
|
||||
.input-group-sm .custom-file-label {
|
||||
height: calc(1.8125rem + 2px);
|
||||
line-height: 1.25;
|
||||
}
|
||||
.input-group-sm .custom-file {
|
||||
height: calc(1.8125rem + 2px);
|
||||
font-size: .875rem;
|
||||
}
|
||||
|
||||
{{-- LG size setup --}}
|
||||
.input-group-lg .custom-file-label:after {
|
||||
height: 2.875rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.input-group-lg .custom-file-label {
|
||||
height: calc(2.875rem + 2px);
|
||||
line-height: 1.6;
|
||||
}
|
||||
.input-group-lg .custom-file {
|
||||
height: calc(2.875rem + 2px);
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
@endonce
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<div class="{{ $makeFormGroupClass() }}">
|
||||
|
||||
{{-- Input label --}}
|
||||
@isset($label)
|
||||
<label for="{{ $id }}" @isset($labelClass) class="{{ $labelClass }}" @endisset>
|
||||
{{ $label }}
|
||||
</label>
|
||||
@endisset
|
||||
|
||||
{{-- Input group --}}
|
||||
<div class="{{ $makeInputGroupClass() }}">
|
||||
|
||||
{{-- Input prepend slot --}}
|
||||
@isset($prependSlot)
|
||||
<div class="input-group-prepend">{{ $prependSlot }}</div>
|
||||
@endisset
|
||||
|
||||
{{-- Input group item --}}
|
||||
@yield('input_group_item')
|
||||
|
||||
{{-- Input append slot --}}
|
||||
@isset($appendSlot)
|
||||
<div class="input-group-append">{{ $appendSlot }}</div>
|
||||
@endisset
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Error feedback --}}
|
||||
@if($isInvalid() && ! isset($disableFeedback))
|
||||
<span class="invalid-feedback d-block" role="alert">
|
||||
<strong>{{ $errors->first($errorKey) }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Extra style customization for invalid input groups --}}
|
||||
|
||||
@once
|
||||
@push('css')
|
||||
<style type="text/css">
|
||||
|
||||
{{-- Highlight invalid input groups with a box-shadow --}}
|
||||
|
||||
.adminlte-invalid-igroup {
|
||||
box-shadow: 0 .25rem 0.5rem rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
{{-- Setup a red border on elements inside prepend/append add-ons --}}
|
||||
|
||||
.adminlte-invalid-igroup > .input-group-prepend > *,
|
||||
.adminlte-invalid-igroup > .input-group-append > * {
|
||||
border-color: #dc3545 !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,122 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Input Slider --}}
|
||||
<input id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
|
||||
@overwrite
|
||||
|
||||
{{-- Add plugin initialization and configuration code --}}
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
let usrCfg = @json($config);
|
||||
|
||||
// Check for disabled attribute (alternative to data-slider-enable).
|
||||
|
||||
@isset($attributes['disabled'])
|
||||
usrCfg.enabled = false;
|
||||
@endisset
|
||||
|
||||
// Check for min, max and step attributes (alternatives to
|
||||
// data-slider-min, data-slider-max and data-slider-step).
|
||||
|
||||
@isset($attributes['min'])
|
||||
usrCfg.min = {{ $attributes['min'] }};
|
||||
@endisset
|
||||
|
||||
@isset($attributes['max'])
|
||||
usrCfg.max = {{ $attributes['max'] }};
|
||||
@endisset
|
||||
|
||||
@isset($attributes['step'])
|
||||
usrCfg.step = {{ $attributes['step'] }};
|
||||
@endisset
|
||||
|
||||
// Check for value attribute (alternative to data-slider-value).
|
||||
|
||||
@isset($attributes['value'])
|
||||
usrCfg.value = {{ $attributes['value'] }};
|
||||
@endisset
|
||||
|
||||
// Initialize the plugin.
|
||||
|
||||
let slider = $('#{{ $id }}').bootstrapSlider(usrCfg);
|
||||
|
||||
// Fix height conflict when orientation is vertical.
|
||||
|
||||
let or = slider.bootstrapSlider('getAttribute', 'orientation');
|
||||
|
||||
if (or == 'vertical') {
|
||||
$('#' + usrCfg.id).css('height', '210px');
|
||||
slider.bootstrapSlider('relayout');
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
{{-- Add CSS workarounds for the plugin --}}
|
||||
{{-- NOTE: this may change with newer plugin versions --}}
|
||||
|
||||
@push('css')
|
||||
<style type="text/css">
|
||||
|
||||
{{-- Setup plugin color --}}
|
||||
|
||||
@isset($color)
|
||||
|
||||
#{{ $config['id'] }} .slider-handle {
|
||||
background: {{ $color }};
|
||||
}
|
||||
#{{ $config['id'] }} .slider-selection {
|
||||
background: {{ $color }};
|
||||
opacity: 0.5;
|
||||
}
|
||||
#{{ $config['id'] }} .slider-tick.in-selection {
|
||||
background: {{ $color }};
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
@endisset
|
||||
|
||||
{{-- Set flex property when using addons slots --}}
|
||||
|
||||
@if(isset($appendSlot) || isset($prependSlot))
|
||||
|
||||
#{{ $config['id'] }} {
|
||||
flex: 1 1 0;
|
||||
align-self: center;
|
||||
@isset($appendSlot) margin-right: 5px; @endisset
|
||||
@isset($prependSlot) margin-left: 5px; @endisset
|
||||
}
|
||||
|
||||
@endif
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
{{-- Setup custom invalid style --}}
|
||||
{{-- NOTE: this may change with newer plugin versions --}}
|
||||
|
||||
@once
|
||||
@push('css')
|
||||
<style type="text/css">
|
||||
|
||||
.adminlte-invalid-islgroup .slider-track,
|
||||
.adminlte-invalid-islgroup > .input-group-prepend > *,
|
||||
.adminlte-invalid-islgroup > .input-group-append > * {
|
||||
box-shadow: 0 .25rem 0.5rem rgba(255,0,0,.25);
|
||||
}
|
||||
|
||||
.adminlte-invalid-islgroup .slider-vertical {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,60 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Input Switch --}}
|
||||
<input type="checkbox" id="{{ $id }}" name="{{ $name }}" value="true"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
|
||||
@overwrite
|
||||
|
||||
{{-- Add plugin initialization and configuration code --}}
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
$('#{{ $id }}').bootstrapSwitch( @json($config) );
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
{{-- Setup the height/font of the plugin when using sm/lg sizes --}}
|
||||
{{-- NOTE: this may change with newer plugin versions --}}
|
||||
|
||||
@once
|
||||
@push('css')
|
||||
<style type="text/css">
|
||||
|
||||
{{-- MD (default) size setup --}}
|
||||
.input-group .bootstrap-switch-handle-on,
|
||||
.input-group .bootstrap-switch-handle-off {
|
||||
height: 2.25rem !important;
|
||||
}
|
||||
|
||||
{{-- LG size setup --}}
|
||||
.input-group-lg .bootstrap-switch-handle-on,
|
||||
.input-group-lg .bootstrap-switch-handle-off {
|
||||
height: 2.875rem !important;
|
||||
font-size: 1.25rem !important;
|
||||
}
|
||||
|
||||
{{-- SM size setup --}}
|
||||
.input-group-sm .bootstrap-switch-handle-on,
|
||||
.input-group-sm .bootstrap-switch-handle-off {
|
||||
height: 1.8125rem !important;
|
||||
font-size: .875rem !important;
|
||||
}
|
||||
|
||||
{{-- Custom invalid style setup --}}
|
||||
|
||||
.adminlte-invalid-iswgroup > .bootstrap-switch-wrapper,
|
||||
.adminlte-invalid-iswgroup > .input-group-prepend > *,
|
||||
.adminlte-invalid-iswgroup > .input-group-append > * {
|
||||
box-shadow: 0 .25rem 0.5rem rgba(255,0,0,.25);
|
||||
}
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,9 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Input --}}
|
||||
<input id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
|
||||
@overwrite
|
||||
@@ -0,0 +1,23 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Select --}}
|
||||
<select id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
{{ $slot }}
|
||||
</select>
|
||||
|
||||
@overwrite
|
||||
|
||||
{{-- Add plugin initialization and configuration code --}}
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
$('#{{ $id }}').selectpicker( @json($config) );
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,11 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Select --}}
|
||||
<select id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
{{ $slot }}
|
||||
</select>
|
||||
|
||||
@overwrite
|
||||
@@ -0,0 +1,68 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Select --}}
|
||||
<select id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
|
||||
{{ $slot }}
|
||||
</select>
|
||||
|
||||
@overwrite
|
||||
|
||||
{{-- Add plugin initialization and configuration code --}}
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
$('#{{ $id }}').select2( @json($config) );
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
{{-- Setup the height and font size of the plugin when using sm/lg sizes --}}
|
||||
{{-- NOTE: this may change with newer plugin versions --}}
|
||||
|
||||
@once
|
||||
@push('css')
|
||||
<style type="text/css">
|
||||
|
||||
{{-- SM size setup --}}
|
||||
.input-group-sm .select2-selection--single {
|
||||
height: calc(1.8125rem + 2px) !important
|
||||
}
|
||||
.input-group-sm .select2-selection--single .select2-selection__rendered,
|
||||
.input-group-sm .select2-selection--single .select2-selection__placeholder {
|
||||
font-size: .875rem !important;
|
||||
line-height: 2.125;
|
||||
}
|
||||
.input-group-sm .select2-selection--multiple {
|
||||
min-height: calc(1.8125rem + 2px) !important
|
||||
}
|
||||
.input-group-sm .select2-selection--multiple .select2-selection__rendered {
|
||||
font-size: .875rem !important;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
{{-- LG size setup --}}
|
||||
.input-group-lg .select2-selection--single {
|
||||
height: calc(2.875rem + 2px) !important;
|
||||
}
|
||||
.input-group-lg .select2-selection--single .select2-selection__rendered,
|
||||
.input-group-lg .select2-selection--single .select2-selection__placeholder {
|
||||
font-size: 1.25rem !important;
|
||||
line-height: 2.25;
|
||||
}
|
||||
.input-group-lg .select2-selection--multiple {
|
||||
min-height: calc(2.875rem + 2px) !important
|
||||
}
|
||||
.input-group-lg .select2-selection--multiple .select2-selection__rendered {
|
||||
font-size: 1.25rem !important;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,68 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Summernote Textarea --}}
|
||||
<textarea id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}
|
||||
>{{ $slot }}</textarea>
|
||||
|
||||
@overwrite
|
||||
|
||||
{{-- Add plugin initialization and configuration code --}}
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
let usrCfg = @json($config);
|
||||
|
||||
// Check for placeholder attribute.
|
||||
|
||||
@isset($attributes['placeholder'])
|
||||
usrCfg['placeholder'] = "{{ $attributes['placeholder'] }}";
|
||||
@endisset
|
||||
|
||||
// Initialize the plugin.
|
||||
|
||||
$('#{{ $id }}').summernote(usrCfg);
|
||||
|
||||
// Check for disabled attribute.
|
||||
|
||||
@isset($attributes['disabled'])
|
||||
$('#{{ $id }}').summernote('disable');
|
||||
@endisset
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
{{-- Setup the font size of the plugin when using sm/lg sizes --}}
|
||||
{{-- NOTE: this may change with newer plugin versions --}}
|
||||
|
||||
@once
|
||||
@push('css')
|
||||
<style type="text/css">
|
||||
|
||||
{{-- SM size setup --}}
|
||||
.input-group-sm .note-editor {
|
||||
font-size: .875rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
{{-- LG size setup --}}
|
||||
.input-group-lg .note-editor {
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
{{-- Setup custom invalid style --}}
|
||||
|
||||
.adminlte-invalid-itegroup .note-editor {
|
||||
box-shadow: 0 .25rem 0.5rem rgba(0,0,0,.25);
|
||||
border-color: #dc3545 !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,10 @@
|
||||
@extends('adminlte::components.form.input-group-component')
|
||||
|
||||
@section('input_group_item')
|
||||
|
||||
{{-- Textarea --}}
|
||||
<textarea id="{{ $id }}" name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => $makeItemClass()]) }}
|
||||
>{{ $slot }}</textarea>
|
||||
|
||||
@overwrite
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
{{-- Navbar notification --}}
|
||||
|
||||
<li class="{{ $makeListItemClass() }}" id="{{ $id }}">
|
||||
|
||||
{{-- Link --}}
|
||||
<a @if($enableDropdownMode) href="" @endif {{ $attributes->merge($makeAnchorDefaultAttrs()) }}>
|
||||
|
||||
{{-- Icon --}}
|
||||
<i class="{{ $makeIconClass() }}"></i>
|
||||
|
||||
{{-- Badge --}}
|
||||
<span class="{{ $makeBadgeClass() }}">{{ $badgeLabel }}</span>
|
||||
|
||||
</a>
|
||||
|
||||
{{-- Dropdown Menu --}}
|
||||
@if($enableDropdownMode)
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
|
||||
|
||||
{{-- Custom dropdown content provided by external source --}}
|
||||
<div class="adminlte-dropdown-content"></div>
|
||||
|
||||
{{-- Dropdown divider --}}
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
{{-- Dropdown footer with link --}}
|
||||
<a href="{{ $attributes->get('href') }}" class="dropdown-item dropdown-footer">
|
||||
@isset($dropdownFooterLabel)
|
||||
{{ $dropdownFooterLabel }}
|
||||
@else
|
||||
<i class="fas fa-lg fa-search-plus"></i>
|
||||
@endisset
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
</li>
|
||||
|
||||
{{-- If required, update the notification periodically --}}
|
||||
|
||||
@if (! is_null($makeUpdateUrl()) && $makeUpdatePeriod() > 0)
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
|
||||
// Method to get new notification data from the configured url.
|
||||
|
||||
let updateNotification = (nLink) =>
|
||||
{
|
||||
// Make an ajax call to the configured url. The response should be
|
||||
// an object with the new data. The supported properties are:
|
||||
// 'label', 'label_color', 'icon_color' and 'dropdown'.
|
||||
|
||||
$.ajax({
|
||||
url: "{{ $makeUpdateUrl() }}"
|
||||
})
|
||||
.done((data) => {
|
||||
nLink.update(data);
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorThrown) {
|
||||
console.log(jqXHR, textStatus, errorThrown);
|
||||
});
|
||||
};
|
||||
|
||||
// First load of the notification data.
|
||||
|
||||
let nLink = new _AdminLTE_NavbarNotification("{{ $id }}");
|
||||
updateNotification(nLink);
|
||||
|
||||
// Periodically update the notification.
|
||||
|
||||
setInterval(updateNotification, {{ $makeUpdatePeriod() }}, nLink);
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endif
|
||||
|
||||
{{-- Register Javascript utility class for this component --}}
|
||||
|
||||
@once
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
class _AdminLTE_NavbarNotification {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* target: The id of the target notification link.
|
||||
*/
|
||||
constructor(target)
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the notification link.
|
||||
*
|
||||
* data: An object with the new data.
|
||||
*/
|
||||
update(data)
|
||||
{
|
||||
// Check if target and data exists.
|
||||
|
||||
let t = $(`li#${this.target}`);
|
||||
|
||||
if (t.length <= 0 || ! data) {
|
||||
return;
|
||||
}
|
||||
|
||||
let badge = t.find(".navbar-badge");
|
||||
let icon = t.find(".nav-link > i");
|
||||
let dropdown = t.find(".adminlte-dropdown-content");
|
||||
|
||||
// Update the badge label.
|
||||
|
||||
if (data.label && data.label > 0) {
|
||||
badge.html(data.label);
|
||||
} else {
|
||||
badge.empty();
|
||||
}
|
||||
|
||||
// Update the badge color.
|
||||
|
||||
if (data.label_color) {
|
||||
badge.removeClass((idx, classes) => {
|
||||
return (classes.match(/(^|\s)badge-\S+/g) || []).join(' ');
|
||||
}).addClass(`badge-${data.label_color} badge-pill`);
|
||||
}
|
||||
|
||||
// Update the icon color.
|
||||
|
||||
if (data.icon_color) {
|
||||
icon.removeClass((idx, classes) => {
|
||||
return (classes.match(/(^|\s)text-\S+/g) || []).join(' ');
|
||||
}).addClass(`text-${data.icon_color}`);
|
||||
}
|
||||
|
||||
// Update the dropdown content.
|
||||
|
||||
if (data.dropdown && dropdown.length > 0) {
|
||||
dropdown.html(data.dropdown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,60 @@
|
||||
{{-- Table --}}
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="{{ $id }}" style="width:100%" {{ $attributes->merge(['class' => $makeTableClass()]) }}>
|
||||
|
||||
{{-- Table head --}}
|
||||
<thead @isset($headTheme) class="thead-{{ $headTheme }}" @endisset>
|
||||
<tr>
|
||||
@foreach($heads as $th)
|
||||
<th @isset($th['width']) style="width:{{ $th['width'] }}%" @endisset
|
||||
@isset($th['no-export']) dt-no-export @endisset>
|
||||
{{ is_array($th) ? ($th['label'] ?? '') : $th }}
|
||||
</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
{{-- Table body --}}
|
||||
<tbody>{{ $slot }}</tbody>
|
||||
|
||||
{{-- Table footer --}}
|
||||
@isset($withFooter)
|
||||
<tfoot @isset($footerTheme) class="thead-{{ $footerTheme }}" @endisset>
|
||||
<tr>
|
||||
@foreach($heads as $th)
|
||||
<th>{{ is_array($th) ? ($th['label'] ?? '') : $th }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</tfoot>
|
||||
@endisset
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Add plugin initialization and configuration code --}}
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
$('#{{ $id }}').DataTable( @json($config) );
|
||||
})
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
{{-- Add CSS styling --}}
|
||||
|
||||
@isset($beautify)
|
||||
@push('css')
|
||||
<style type="text/css">
|
||||
#{{ $id }} tr td, #{{ $id }} tr th {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
@endisset
|
||||
@@ -0,0 +1,36 @@
|
||||
<div {{ $attributes->merge(['class' => $makeModalClass(), 'id' => $id]) }}
|
||||
@isset($staticBackdrop) data-backdrop="static" data-keyboard="false" @endisset>
|
||||
|
||||
<div class="{{ $makeModalDialogClass() }}">
|
||||
<div class="modal-content">
|
||||
|
||||
{{--Modal header --}}
|
||||
<div class="{{ $makeModalHeaderClass() }}">
|
||||
<h4 class="modal-title">
|
||||
@isset($icon)<i class="{{ $icon }} mr-2"></i>@endisset
|
||||
@isset($title){{ $title }}@endisset
|
||||
</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{-- Modal body --}}
|
||||
@if(! $slot->isEmpty())
|
||||
<div class="modal-body">{{ $slot }}</div>
|
||||
@endif
|
||||
|
||||
{{-- Modal footer --}}
|
||||
<div class="modal-footer">
|
||||
@isset($footerSlot)
|
||||
{{ $footerSlot }}
|
||||
@else
|
||||
<x-adminlte-button class="{{ $makeCloseButtonClass }}"
|
||||
data-dismiss="modal" label="Close"/>
|
||||
@endisset
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
<div {{ $attributes->merge(['class' => $makeAlertClass()]) }}>
|
||||
|
||||
{{-- Dismiss button --}}
|
||||
@isset($dismissable)
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">
|
||||
×
|
||||
</button>
|
||||
@endisset
|
||||
|
||||
{{-- Alert header --}}
|
||||
@if(! empty($title) || ! empty($icon))
|
||||
<h5>
|
||||
@if(! empty($icon))
|
||||
<i class="icon {{ $icon }}"></i>
|
||||
@endif
|
||||
|
||||
@if(! empty($title))
|
||||
{{ $title }}
|
||||
@endif
|
||||
</h5>
|
||||
@endif
|
||||
|
||||
{{-- Alert content --}}
|
||||
{{ $slot }}
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
<div {{ $attributes->merge(['class' => $makeCalloutClass()]) }}>
|
||||
|
||||
{{-- Callout title --}}
|
||||
@if(! empty($title) || ! empty($icon))
|
||||
<h5 @isset($titleClass) class="{{ $titleClass }}" @endisset>
|
||||
@isset($icon) <i class="{{ $icon }} mr-2"></i> @endisset
|
||||
@isset($title) {{ $title }} @endisset
|
||||
</h5>
|
||||
@endif
|
||||
|
||||
{{-- Callout content --}}
|
||||
{{ $slot }}
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,43 @@
|
||||
<div {{ $attributes->merge(['class' => $makeCardClass()]) }}>
|
||||
|
||||
{{-- Card header --}}
|
||||
<div class="{{ $makeCardHeaderClass() }}">
|
||||
|
||||
{{-- Title --}}
|
||||
<h3 class="{{ $makeCardTitleClass() }}">
|
||||
@isset($icon)<i class="{{ $icon }} mr-2"></i>@endisset
|
||||
@isset($title){{ $title }}@endisset
|
||||
</h3>
|
||||
|
||||
{{-- Tools --}}
|
||||
<div class="card-tools">
|
||||
@isset($maximizable)
|
||||
<x-adminlte-button theme="tool" data-card-widget="maximize" icon="fas fa-lg fa-expand"/>
|
||||
@endisset
|
||||
|
||||
@if($collapsible === 'collapsed')
|
||||
<x-adminlte-button theme="tool" data-card-widget="collapse" icon="fas fa-lg fa-plus"/>
|
||||
@elseif (isset($collapsible))
|
||||
<x-adminlte-button theme="tool" data-card-widget="collapse" icon="fas fa-lg fa-minus"/>
|
||||
@endif
|
||||
|
||||
@isset($removable)
|
||||
<x-adminlte-button theme="tool" data-card-widget="remove" icon="fas fa-lg fa-times"/>
|
||||
@endisset
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Card body --}}
|
||||
@if(! $slot->isEmpty())
|
||||
<div class="card-body">{{ $slot }}</div>
|
||||
@endif
|
||||
|
||||
{{-- Card overlay --}}
|
||||
@if($disabled)
|
||||
<div class="overlay">
|
||||
<i class="fas fa-2x fa-ban text-gray"></i>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,102 @@
|
||||
<div {{ $attributes->merge(['class' => $makeBoxClass()]) }}>
|
||||
|
||||
{{-- Box icon --}}
|
||||
@isset($icon)
|
||||
<span class="{{ $makeIconClass() }}">
|
||||
<i class="{{ $icon }}"></i>
|
||||
</span>
|
||||
@endisset
|
||||
|
||||
{{-- Box content --}}
|
||||
<div class="info-box-content">
|
||||
|
||||
{{-- Box title --}}
|
||||
@isset($title)
|
||||
<span class="info-box-text">{{ $title }}</span>
|
||||
@endisset
|
||||
|
||||
{{-- Box short text --}}
|
||||
@isset($text)
|
||||
<span class="info-box-number">{{ $text }}</span>
|
||||
@endisset
|
||||
|
||||
{{-- Box progress bar --}}
|
||||
@if(isset($progress) && isset($attributes['id']))
|
||||
<x-adminlte-progress value="{{ $progress }}" theme="{{ $progressTheme }}"
|
||||
id="progress-{{ $attributes['id'] }}"/>
|
||||
@elseif(isset($progress))
|
||||
<x-adminlte-progress value="{{ $progress }}" theme="{{ $progressTheme }}"/>
|
||||
@endif
|
||||
|
||||
{{-- Box long description --}}
|
||||
@isset($description)
|
||||
<span class="progress-description">{{ $description }}</span>
|
||||
@endisset
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Register Javascript utility class for this component --}}
|
||||
|
||||
@once
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
class _AdminLTE_InfoBox {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* target: The id of the target info box.
|
||||
*/
|
||||
constructor(target)
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the info box.
|
||||
*
|
||||
* data: An object with the new data.
|
||||
*/
|
||||
update(data)
|
||||
{
|
||||
// Check if target and data exists.
|
||||
|
||||
let t = $(`#${this.target}`);
|
||||
|
||||
if (t.length <= 0 || ! data) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update available data.
|
||||
|
||||
if (data.title) {
|
||||
t.find('.info-box-text').html(data.title);
|
||||
}
|
||||
|
||||
if (data.text) {
|
||||
t.find('.info-box-number').html(data.text);
|
||||
}
|
||||
|
||||
if (data.icon) {
|
||||
t.find('.info-box-icon i').attr('class', data.icon);
|
||||
}
|
||||
|
||||
if (data.description) {
|
||||
t.find('.progress-description').html(data.description);
|
||||
}
|
||||
|
||||
// Update progress bar.
|
||||
|
||||
if (data.progress) {
|
||||
let pBar = new _AdminLTE_Progress(`progress-${this.target}`);
|
||||
pBar.setValue(data.progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,32 @@
|
||||
<div {{ $attributes->merge(['class' => "col-{$size}"]) }}>
|
||||
|
||||
<div class="description-block">
|
||||
|
||||
{{-- Icon --}}
|
||||
@isset($icon)
|
||||
<i class="{{ $icon }}"></i>
|
||||
@endisset
|
||||
|
||||
{{-- Header --}}
|
||||
@isset($title)
|
||||
<h5 class="description-header">
|
||||
@if(! empty($url))
|
||||
<a href="{{ $url }}">{{ $title }}</a>
|
||||
@else
|
||||
{{ $title }}
|
||||
@endif
|
||||
</h5>
|
||||
@endisset
|
||||
|
||||
{{-- Text --}}
|
||||
@isset($text)
|
||||
<p class="description-text">
|
||||
<span class="{{ $makeTextWrapperClass() }}">
|
||||
{{ $text }}
|
||||
</span>
|
||||
</p>
|
||||
@endisset
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div {{ $attributes->merge(['class' => "p-0 col-{$size}"]) }}>
|
||||
|
||||
<span class="nav-link">
|
||||
|
||||
{{-- Icon --}}
|
||||
@isset($icon)
|
||||
<i class="{{ $icon }}"></i>
|
||||
@endisset
|
||||
|
||||
{{-- Header --}}
|
||||
@isset($title)
|
||||
@if(! empty($url))
|
||||
<a href="{{ $url }}">{{ $title }}</a>
|
||||
@else
|
||||
{{ $title }}
|
||||
@endif
|
||||
@endisset
|
||||
|
||||
{{-- Text --}}
|
||||
@isset($text)
|
||||
<span class="{{ $makeTextWrapperClass() }}">
|
||||
{{ $text }}
|
||||
</span>
|
||||
@endisset
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,40 @@
|
||||
<div {{ $attributes->merge(['class' => $makeCardClass()]) }}>
|
||||
|
||||
{{-- Profile header --}}
|
||||
<div class="{{ $makeHeaderClass() }}" style="{{ $makeHeaderStyle() }}">
|
||||
|
||||
{{-- User image --}}
|
||||
<div class="widget-user-image">
|
||||
@if(isset($img))
|
||||
<img class="img-circle elevation-2" src="{{ $img }}" alt="User avatar: {{ $name }}">
|
||||
@elseif($layoutType === 'modern')
|
||||
<div class="img-circle elevation-2 d-flex bg-dark" style="width:90px;height:90px;">
|
||||
<i class="fas fa-3x fa-user text-silver m-auto"></i>
|
||||
</div>
|
||||
@elseif($layoutType === 'classic')
|
||||
<div class="img-circle elevation-2 float-left d-flex bg-dark" style="width:65px;height:65px;">
|
||||
<i class="fas fa-2x fa-user text-silver m-auto"></i>
|
||||
</div>
|
||||
@endisset
|
||||
</div>
|
||||
|
||||
{{-- User name --}}
|
||||
@isset($name)
|
||||
<h3 class="widget-user-username mb-0">{{ $name }}</h3>
|
||||
@endisset
|
||||
|
||||
{{-- User description --}}
|
||||
@isset($desc)
|
||||
<h5 class="widget-user-desc">{{ $desc }}</h5>
|
||||
@endisset
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Profile footer / Profile Items --}}
|
||||
@if(! $slot->isEmpty())
|
||||
<div class="{{ $makeFooterClass() }}">
|
||||
<div class="row">{{ $slot }}</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,85 @@
|
||||
<div {{ $attributes->merge(['class' => $makeProgressClass()]) }}>
|
||||
|
||||
{{-- Progress bar --}}
|
||||
<div class="{{ $makeProgressBarClass() }}" role="progressbar"
|
||||
aria-valuenow="{{ $value }}" aria-valuemin="0" aria-valuemax="100"
|
||||
style="{{ $makeProgressBarStyle() }}">
|
||||
|
||||
{{-- Progress bar label --}}
|
||||
@isset($withLabel)
|
||||
{{ $value }}%
|
||||
@else
|
||||
<span class="sr-only">{{ $value }}% Progress</span>
|
||||
@endisset
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Register Javascript utility class for this component --}}
|
||||
|
||||
@once
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
class _AdminLTE_Progress {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* target: The id of the target progress bar.
|
||||
*/
|
||||
constructor(target)
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current progress bar value.
|
||||
*/
|
||||
getValue()
|
||||
{
|
||||
// Check if target exists.
|
||||
|
||||
let t = $(`#${this.target}`);
|
||||
|
||||
if (t.length <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Return the progress bar current value (casted to number).
|
||||
|
||||
return +(t.find('.progress-bar').attr('aria-valuenow'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the new progress bar value.
|
||||
*/
|
||||
setValue(value)
|
||||
{
|
||||
// Check if target exists.
|
||||
|
||||
let t = $(`#${this.target}`);
|
||||
|
||||
if (t.length <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update progress bar.
|
||||
|
||||
value = +value;
|
||||
|
||||
t.find('.progress-bar').css('width', value + '%')
|
||||
.attr('aria-valuenow', value);
|
||||
|
||||
if (t.find('span.sr-only').length > 0) {
|
||||
t.find('span.sr-only').text(value + '% Progress');
|
||||
} else {
|
||||
t.find('.progress-bar').text(value + '%');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endonce
|
||||
@@ -0,0 +1,113 @@
|
||||
<div {{ $attributes->merge(['class' => $makeBoxClass()]) }}>
|
||||
|
||||
{{-- Box title and description --}}
|
||||
<div class="inner">
|
||||
@isset($title)
|
||||
<h3>{{ $title }}</h3>
|
||||
@endisset
|
||||
|
||||
@isset($text)
|
||||
<h5>{{ $text }}</h5>
|
||||
@endisset
|
||||
</div>
|
||||
|
||||
{{-- Box icon --}}
|
||||
@isset($icon)
|
||||
<div class="icon">
|
||||
<i class="{{ $icon }}"></i>
|
||||
</div>
|
||||
@endisset
|
||||
|
||||
{{-- Box link --}}
|
||||
@isset($url)
|
||||
<a href="{{ $url }}" class="small-box-footer">
|
||||
|
||||
@if(! empty($urlText))
|
||||
{{ $urlText }}
|
||||
@endif
|
||||
|
||||
<i class="fas fa-lg fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
@endisset
|
||||
|
||||
{{-- Box overlay --}}
|
||||
<div class="{{ $makeOverlayClass() }}">
|
||||
<i class="fas fa-2x fa-spin fa-sync-alt text-gray"></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Register Javascript utility class for this component --}}
|
||||
|
||||
@once
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
class _AdminLTE_SmallBox {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* target: The id of the target small box.
|
||||
*/
|
||||
constructor(target)
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the small box.
|
||||
*
|
||||
* data: An object with the new data.
|
||||
*/
|
||||
update(data)
|
||||
{
|
||||
// Check if target and data exists.
|
||||
|
||||
let t = $(`#${this.target}`);
|
||||
|
||||
if (t.length <= 0 || ! data) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update available data.
|
||||
|
||||
if (data.title) {
|
||||
t.find('.inner h3').html(data.title);
|
||||
}
|
||||
|
||||
if (data.text) {
|
||||
t.find('.inner h5').html(data.text);
|
||||
}
|
||||
|
||||
if (data.icon) {
|
||||
t.find('.icon i').attr('class', data.icon);
|
||||
}
|
||||
|
||||
if (data.url) {
|
||||
t.find('.small-box-footer').attr('href', data.url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the loading animation of the small box.
|
||||
*/
|
||||
toggleLoading()
|
||||
{
|
||||
// Check if target exists.
|
||||
|
||||
let t = $(`#${this.target}`);
|
||||
|
||||
if (t.length <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Toggle the loading overlay.
|
||||
|
||||
t.find('.overlay').toggleClass('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endonce
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
|
||||
{{-- Base Meta Tags --}}
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
{{-- Custom Meta Tags --}}
|
||||
@yield('meta_tags')
|
||||
|
||||
{{-- Title --}}
|
||||
<title>
|
||||
@yield('title_prefix', config('adminlte.title_prefix', ''))
|
||||
@yield('title', config('adminlte.title', 'AdminLTE 3'))
|
||||
@yield('title_postfix', config('adminlte.title_postfix', ''))
|
||||
</title>
|
||||
|
||||
{{-- Custom stylesheets (pre AdminLTE) --}}
|
||||
@yield('adminlte_css_pre')
|
||||
|
||||
{{-- Base Stylesheets --}}
|
||||
@if(!config('adminlte.enabled_laravel_mix'))
|
||||
<link rel="stylesheet" href="{{ asset('vendor/fontawesome-free/css/all.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/overlayScrollbars/css/OverlayScrollbars.min.css') }}">
|
||||
|
||||
{{-- Configured Stylesheets --}}
|
||||
@include('adminlte::plugins', ['type' => 'css'])
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('vendor/adminlte/dist/css/adminlte.min.css') }}">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
||||
@else
|
||||
<link rel="stylesheet" href="{{ mix(config('adminlte.laravel_mix_css_path', 'css/app.css')) }}">
|
||||
@endif
|
||||
|
||||
{{-- Livewire Styles --}}
|
||||
@if(config('adminlte.livewire'))
|
||||
@if(app()->version() >= 7)
|
||||
@livewireStyles
|
||||
@else
|
||||
<livewire:styles />
|
||||
@endif
|
||||
@endif
|
||||
|
||||
{{-- Custom Stylesheets (post AdminLTE) --}}
|
||||
@yield('adminlte_css')
|
||||
|
||||
{{-- Favicon --}}
|
||||
@if(config('adminlte.use_ico_only'))
|
||||
<link rel="shortcut icon" href="{{ asset('favicons/favicon.ico') }}" />
|
||||
@elseif(config('adminlte.use_full_favicon'))
|
||||
<link rel="shortcut icon" href="{{ asset('favicons/favicon.ico') }}" />
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="{{ asset('favicons/apple-icon-57x57.png') }}">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="{{ asset('favicons/apple-icon-60x60.png') }}">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="{{ asset('favicons/apple-icon-72x72.png') }}">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="{{ asset('favicons/apple-icon-76x76.png') }}">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="{{ asset('favicons/apple-icon-114x114.png') }}">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="{{ asset('favicons/apple-icon-120x120.png') }}">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="{{ asset('favicons/apple-icon-144x144.png') }}">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="{{ asset('favicons/apple-icon-152x152.png') }}">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('favicons/apple-icon-180x180.png') }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('favicons/favicon-16x16.png') }}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicons/favicon-32x32.png') }}">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="{{ asset('favicons/favicon-96x96.png') }}">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="{{ asset('favicons/android-icon-192x192.png') }}">
|
||||
<link rel="manifest" href="{{ asset('favicons/manifest.json') }}">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="{{ asset('favicon/ms-icon-144x144.png') }}">
|
||||
@endif
|
||||
|
||||
</head>
|
||||
|
||||
<body class="@yield('classes_body')" @yield('body_data')>
|
||||
|
||||
{{-- Body Content --}}
|
||||
@yield('body')
|
||||
|
||||
{{-- Base Scripts --}}
|
||||
@if(!config('adminlte.enabled_laravel_mix'))
|
||||
<script src="{{ asset('vendor/jquery/jquery.min.js') }}"></script>
|
||||
<script src="{{ asset('vendor/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
||||
<script src="{{ asset('vendor/overlayScrollbars/js/jquery.overlayScrollbars.min.js') }}"></script>
|
||||
|
||||
{{-- Configured Scripts --}}
|
||||
@include('adminlte::plugins', ['type' => 'js'])
|
||||
|
||||
<script src="{{ asset('vendor/adminlte/dist/js/adminlte.min.js') }}"></script>
|
||||
@else
|
||||
<script src="{{ mix(config('adminlte.laravel_mix_js_path', 'js/app.js')) }}"></script>
|
||||
@endif
|
||||
|
||||
{{-- Livewire Script --}}
|
||||
@if(config('adminlte.livewire'))
|
||||
@if(app()->version() >= 7)
|
||||
@livewireScripts
|
||||
@else
|
||||
<livewire:scripts />
|
||||
@endif
|
||||
@endif
|
||||
|
||||
{{-- Custom Scripts --}}
|
||||
@yield('adminlte_js')
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
@extends('adminlte::master')
|
||||
|
||||
@inject('layoutHelper', 'JeroenNoten\LaravelAdminLte\Helpers\LayoutHelper')
|
||||
|
||||
@if($layoutHelper->isLayoutTopnavEnabled())
|
||||
@php( $def_container_class = 'container' )
|
||||
@else
|
||||
@php( $def_container_class = 'container-fluid' )
|
||||
@endif
|
||||
|
||||
@section('adminlte_css')
|
||||
@stack('css')
|
||||
@yield('css')
|
||||
@stop
|
||||
|
||||
@section('classes_body', $layoutHelper->makeBodyClasses())
|
||||
|
||||
@section('body_data', $layoutHelper->makeBodyData())
|
||||
|
||||
@section('body')
|
||||
<div class="wrapper">
|
||||
|
||||
{{-- Top Navbar --}}
|
||||
@if($layoutHelper->isLayoutTopnavEnabled())
|
||||
@include('adminlte::partials.navbar.navbar-layout-topnav')
|
||||
@else
|
||||
@include('adminlte::partials.navbar.navbar')
|
||||
@endif
|
||||
|
||||
{{-- Left Main Sidebar --}}
|
||||
@if(!$layoutHelper->isLayoutTopnavEnabled())
|
||||
@include('adminlte::partials.sidebar.left-sidebar')
|
||||
@endif
|
||||
|
||||
{{-- Content Wrapper --}}
|
||||
<div class="content-wrapper {{ config('adminlte.classes_content_wrapper') ?? '' }}">
|
||||
|
||||
{{-- Content Header --}}
|
||||
@hasSection('content_header')
|
||||
<div class="content-header">
|
||||
<div class="{{ config('adminlte.classes_content_header') ?: $def_container_class }}">
|
||||
@yield('content_header')
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Main Content --}}
|
||||
<div class="content">
|
||||
<div class="{{ config('adminlte.classes_content') ?: $def_container_class }}">
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Footer --}}
|
||||
@hasSection('footer')
|
||||
@include('adminlte::partials.footer.footer')
|
||||
@endif
|
||||
|
||||
{{-- Right Control Sidebar --}}
|
||||
@if(config('adminlte.right_sidebar'))
|
||||
@include('adminlte::partials.sidebar.right-sidebar')
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('adminlte_js')
|
||||
@stack('js')
|
||||
@yield('js')
|
||||
@stop
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
@inject('layoutHelper', 'JeroenNoten\LaravelAdminLte\Helpers\LayoutHelper')
|
||||
|
||||
@php( $dashboard_url = View::getSection('dashboard_url') ?? config('adminlte.dashboard_url', 'home') )
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $dashboard_url = $dashboard_url ? route($dashboard_url) : '' )
|
||||
@else
|
||||
@php( $dashboard_url = $dashboard_url ? url($dashboard_url) : '' )
|
||||
@endif
|
||||
|
||||
<a href="{{ $dashboard_url }}"
|
||||
@if($layoutHelper->isLayoutTopnavEnabled())
|
||||
class="navbar-brand logo-switch {{ config('adminlte.classes_brand') }}"
|
||||
@else
|
||||
class="brand-link logo-switch {{ config('adminlte.classes_brand') }}"
|
||||
@endif>
|
||||
|
||||
{{-- Small brand logo --}}
|
||||
<img src="{{ asset(config('adminlte.logo_img', 'vendor/adminlte/dist/img/AdminLTELogo.png')) }}"
|
||||
alt="{{ config('adminlte.logo_img_alt', 'AdminLTE') }}"
|
||||
class="{{ config('adminlte.logo_img_class', 'brand-image-xl') }} logo-xs">
|
||||
|
||||
{{-- Large brand logo --}}
|
||||
<img src="{{ asset(config('adminlte.logo_img_xl')) }}"
|
||||
alt="{{ config('adminlte.logo_img_alt', 'AdminLTE') }}"
|
||||
class="{{ config('adminlte.logo_img_xl_class', 'brand-image-xs') }} logo-xl">
|
||||
|
||||
</a>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
@inject('layoutHelper', 'JeroenNoten\LaravelAdminLte\Helpers\LayoutHelper')
|
||||
|
||||
@php( $dashboard_url = View::getSection('dashboard_url') ?? config('adminlte.dashboard_url', 'home') )
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $dashboard_url = $dashboard_url ? route($dashboard_url) : '' )
|
||||
@else
|
||||
@php( $dashboard_url = $dashboard_url ? url($dashboard_url) : '' )
|
||||
@endif
|
||||
|
||||
<a href="{{ $dashboard_url }}"
|
||||
@if($layoutHelper->isLayoutTopnavEnabled())
|
||||
class="navbar-brand {{ config('adminlte.classes_brand') }}"
|
||||
@else
|
||||
class="brand-link {{ config('adminlte.classes_brand') }}"
|
||||
@endif>
|
||||
|
||||
{{-- Small brand logo --}}
|
||||
<img src="{{ asset(config('adminlte.logo_img', 'vendor/adminlte/dist/img/AdminLTELogo.png')) }}"
|
||||
alt="{{ config('adminlte.logo_img_alt', 'AdminLTE') }}"
|
||||
class="{{ config('adminlte.logo_img_class', 'brand-image img-circle elevation-3') }}"
|
||||
style="opacity:.8">
|
||||
|
||||
{{-- Brand text --}}
|
||||
<span class="brand-text font-weight-light {{ config('adminlte.classes_brand_text') }}">
|
||||
{!! config('adminlte.logo', '<b>Admin</b>LTE') !!}
|
||||
</span>
|
||||
|
||||
</a>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<footer class="main-footer">
|
||||
@yield('footer')
|
||||
</footer>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<li @isset($item['id']) id="{{ $item['id'] }}" @endisset>
|
||||
|
||||
<a class="dropdown-item" href="{{ $item['href'] }}"
|
||||
@isset($item['target']) target="{{ $item['target'] }}" @endisset
|
||||
{!! $item['data-compiled'] ?? '' !!}>
|
||||
|
||||
{{-- Icon (optional) --}}
|
||||
@isset($item['icon'])
|
||||
<i class="{{ $item['icon'] ?? '' }} {{
|
||||
isset($item['icon_color']) ? 'text-' . $item['icon_color'] : ''
|
||||
}}"></i>
|
||||
@endisset
|
||||
|
||||
{{-- Text --}}
|
||||
{{ $item['text'] }}
|
||||
|
||||
{{-- Label (optional) --}}
|
||||
@isset($item['label'])
|
||||
<span class="badge badge-{{ $item['label_color'] ?? 'primary' }}">
|
||||
{{ $item['label'] }}
|
||||
</span>
|
||||
@endisset
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<li @isset($item['id']) id="{{ $item['id'] }}" @endisset class="dropdown-submenu dropdown-hover">
|
||||
|
||||
{{-- Menu toggler --}}
|
||||
<a class="dropdown-item dropdown-toggle" href="" data-toggle="dropdown"
|
||||
{!! $item['data-compiled'] ?? '' !!}>
|
||||
|
||||
{{-- Icon (optional) --}}
|
||||
@isset($item['icon'])
|
||||
<i class="{{ $item['icon'] ?? '' }} {{
|
||||
isset($item['icon_color']) ? 'text-' . $item['icon_color'] : ''
|
||||
}}"></i>
|
||||
@endisset
|
||||
|
||||
{{-- Text --}}
|
||||
{{ $item['text'] }}
|
||||
|
||||
{{-- Label (optional) --}}
|
||||
@isset($item['label'])
|
||||
<span class="badge badge-{{ $item['label_color'] ?? 'primary' }}">
|
||||
{{ $item['label'] }}
|
||||
</span>
|
||||
@endisset
|
||||
|
||||
</a>
|
||||
|
||||
{{-- Menu items --}}
|
||||
<ul class="dropdown-menu border-0 shadow">
|
||||
@each('adminlte::partials.navbar.dropdown-item', $item['submenu'], 'item')
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
@inject('navbarItemHelper', 'JeroenNoten\LaravelAdminLte\Helpers\NavbarItemHelper')
|
||||
|
||||
@if ($navbarItemHelper->isSubmenu($item))
|
||||
|
||||
{{-- Dropdown submenu --}}
|
||||
@include('adminlte::partials.navbar.dropdown-item-submenu')
|
||||
|
||||
@elseif ($navbarItemHelper->isLink($item))
|
||||
|
||||
{{-- Dropdown link --}}
|
||||
@include('adminlte::partials.navbar.dropdown-item-link')
|
||||
|
||||
@endif
|
||||
Vendored
Executable
+31
@@ -0,0 +1,31 @@
|
||||
<li @isset($item['id']) id="{{ $item['id'] }}" @endisset class="nav-item dropdown">
|
||||
|
||||
{{-- Menu toggler --}}
|
||||
<a class="nav-link dropdown-toggle" href=""
|
||||
data-toggle="dropdown" {!! $item['data-compiled'] ?? '' !!}>
|
||||
|
||||
{{-- Icon (optional) --}}
|
||||
@isset($item['icon'])
|
||||
<i class="{{ $item['icon'] }} {{
|
||||
isset($item['icon_color']) ? 'text-' . $item['icon_color'] : ''
|
||||
}}"></i>
|
||||
@endisset
|
||||
|
||||
{{-- Text --}}
|
||||
{{ $item['text'] }}
|
||||
|
||||
{{-- Label (optional) --}}
|
||||
@isset($item['label'])
|
||||
<span class="badge badge-{{ $item['label_color'] ?? 'primary' }}">
|
||||
{{ $item['label'] }}
|
||||
</span>
|
||||
@endisset
|
||||
|
||||
</a>
|
||||
|
||||
{{-- Menu items --}}
|
||||
<ul class="dropdown-menu border-0 shadow">
|
||||
@each('adminlte::partials.navbar.dropdown-item', $item['submenu'], 'item')
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
Vendored
Executable
+86
@@ -0,0 +1,86 @@
|
||||
@php( $logout_url = View::getSection('logout_url') ?? config('adminlte.logout_url', 'logout') )
|
||||
@php( $profile_url = View::getSection('profile_url') ?? config('adminlte.profile_url', 'logout') )
|
||||
|
||||
@if (config('adminlte.usermenu_profile_url', false))
|
||||
@php( $profile_url = Auth::user()->adminlte_profile_url() )
|
||||
@endif
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $profile_url = $profile_url ? route($profile_url) : '' )
|
||||
@php( $logout_url = $logout_url ? route($logout_url) : '' )
|
||||
@else
|
||||
@php( $profile_url = $profile_url ? url($profile_url) : '' )
|
||||
@php( $logout_url = $logout_url ? url($logout_url) : '' )
|
||||
@endif
|
||||
|
||||
<li class="nav-item dropdown user-menu">
|
||||
|
||||
{{-- User menu toggler --}}
|
||||
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
|
||||
@if(config('adminlte.usermenu_image'))
|
||||
<img src="{{ Auth::user()->adminlte_image() }}"
|
||||
class="user-image img-circle elevation-2"
|
||||
alt="{{ Auth::user()->name }}">
|
||||
@endif
|
||||
<span @if(config('adminlte.usermenu_image')) class="d-none d-md-inline" @endif>
|
||||
{{ Auth::user()->name }}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
{{-- User menu dropdown --}}
|
||||
<ul class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
|
||||
|
||||
{{-- User menu header --}}
|
||||
@if(!View::hasSection('usermenu_header') && config('adminlte.usermenu_header'))
|
||||
<li class="user-header {{ config('adminlte.usermenu_header_class', 'bg-primary') }}
|
||||
@if(!config('adminlte.usermenu_image')) h-auto @endif">
|
||||
@if(config('adminlte.usermenu_image'))
|
||||
<img src="{{ Auth::user()->adminlte_image() }}"
|
||||
class="img-circle elevation-2"
|
||||
alt="{{ Auth::user()->name }}">
|
||||
@endif
|
||||
<p class="@if(!config('adminlte.usermenu_image')) mt-0 @endif">
|
||||
{{ Auth::user()->name }}
|
||||
@if(config('adminlte.usermenu_desc'))
|
||||
<small>{{ Auth::user()->adminlte_desc() }}</small>
|
||||
@endif
|
||||
</p>
|
||||
</li>
|
||||
@else
|
||||
@yield('usermenu_header')
|
||||
@endif
|
||||
|
||||
{{-- Configured user menu links --}}
|
||||
@each('adminlte::partials.navbar.dropdown-item', $adminlte->menu("navbar-user"), 'item')
|
||||
|
||||
{{-- User menu body --}}
|
||||
@hasSection('usermenu_body')
|
||||
<li class="user-body">
|
||||
@yield('usermenu_body')
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- User menu footer --}}
|
||||
<li class="user-footer">
|
||||
@if($profile_url)
|
||||
<a href="{{ $profile_url }}" class="btn btn-default btn-flat">
|
||||
<i class="fa fa-fw fa-user"></i>
|
||||
{{ __('adminlte::menu.profile') }}
|
||||
</a>
|
||||
@endif
|
||||
<a class="btn btn-default btn-flat float-right @if(!$profile_url) btn-block @endif"
|
||||
href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
|
||||
<i class="fa fa-fw fa-power-off"></i>
|
||||
{{ __('adminlte::adminlte.log_out') }}
|
||||
</a>
|
||||
<form id="logout-form" action="{{ $logout_url }}" method="POST" style="display: none;">
|
||||
@if(config('adminlte.logout_method'))
|
||||
{{ method_field(config('adminlte.logout_method')) }}
|
||||
@endif
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-widget="fullscreen" href="#" role="button">
|
||||
<i class="fas fa-expand-arrows-alt"></i>
|
||||
</a>
|
||||
</li>
|
||||
Vendored
Executable
+15
@@ -0,0 +1,15 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-widget="pushmenu" href="#"
|
||||
@if(config('adminlte.sidebar_collapse_remember'))
|
||||
data-enable-remember="true"
|
||||
@endif
|
||||
@if(!config('adminlte.sidebar_collapse_remember_no_transition'))
|
||||
data-no-transition-after-reload="false"
|
||||
@endif
|
||||
@if(config('adminlte.sidebar_collapse_auto_size'))
|
||||
data-auto-collapse-size="{{ config('adminlte.sidebar_collapse_auto_size') }}"
|
||||
@endif>
|
||||
<i class="fas fa-bars"></i>
|
||||
<span class="sr-only">{{ __('adminlte::adminlte.toggle_navigation') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<li @isset($item['id']) id="{{ $item['id'] }}" @endisset class="nav-item">
|
||||
|
||||
<a class="nav-link {{ $item['class'] }}" href="{{ $item['href'] }}"
|
||||
@isset($item['target']) target="{{ $item['target'] }}" @endisset
|
||||
{!! $item['data-compiled'] ?? '' !!}>
|
||||
|
||||
{{-- Icon (optional) --}}
|
||||
@isset($item['icon'])
|
||||
<i class="{{ $item['icon'] }} {{
|
||||
isset($item['icon_color']) ? 'text-' . $item['icon_color'] : ''
|
||||
}}"></i>
|
||||
@endisset
|
||||
|
||||
{{-- Text --}}
|
||||
{{ $item['text'] }}
|
||||
|
||||
{{-- Label (optional) --}}
|
||||
@isset($item['label'])
|
||||
<span class="badge badge-{{ $item['label_color'] ?? 'primary' }}">
|
||||
{{ $item['label'] }}
|
||||
</span>
|
||||
@endisset
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
@php( $logout_url = View::getSection('logout_url') ?? config('adminlte.logout_url', 'logout') )
|
||||
|
||||
@if (config('adminlte.use_route_url', false))
|
||||
@php( $logout_url = $logout_url ? route($logout_url) : '' )
|
||||
@else
|
||||
@php( $logout_url = $logout_url ? url($logout_url) : '' )
|
||||
@endif
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
|
||||
<i class="fa fa-fw fa-power-off"></i>
|
||||
{{ __('adminlte::adminlte.log_out') }}
|
||||
</a>
|
||||
<form id="logout-form" action="{{ $logout_url }}" method="POST" style="display: none;">
|
||||
@if(config('adminlte.logout_method'))
|
||||
{{ method_field(config('adminlte.logout_method')) }}
|
||||
@endif
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
</li>
|
||||
Vendored
Executable
+14
@@ -0,0 +1,14 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" data-widget="control-sidebar"
|
||||
@if(!config('adminlte.right_sidebar_slide'))
|
||||
data-controlsidebar-slide="false"
|
||||
@endif
|
||||
@if(config('adminlte.right_sidebar_scrollbar_theme', 'os-theme-light') != 'os-theme-light')
|
||||
data-scrollbar-theme="{{ config('adminlte.right_sidebar_scrollbar_theme') }}"
|
||||
@endif
|
||||
@if(config('adminlte.right_sidebar_scrollbar_auto_hide', 'l') != 'l')
|
||||
data-scrollbar-auto-hide="{{ config('adminlte.right_sidebar_scrollbar_auto_hide') }}"
|
||||
@endif>
|
||||
<i class="{{ config('adminlte.right_sidebar_icon') }}"></i>
|
||||
</a>
|
||||
</li>
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<li class="nav-item">
|
||||
|
||||
{{-- Search toggle button --}}
|
||||
<a class="nav-link" data-widget="navbar-search" href="#" role="button">
|
||||
<i class="fas fa-search"></i>
|
||||
</a>
|
||||
|
||||
{{-- Search bar --}}
|
||||
<div class="navbar-search-block">
|
||||
<form class="form-inline" action="{{ $item['href'] }}" method="{{ $item['method'] }}">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="input-group">
|
||||
|
||||
{{-- Search input --}}
|
||||
<input class="form-control form-control-navbar" type="search"
|
||||
@isset($item['id']) id="{{ $item['id'] }}" @endisset
|
||||
name="{{ $item['input_name'] }}"
|
||||
placeholder="{{ $item['text'] }}"
|
||||
aria-label="{{ $item['text'] }}">
|
||||
|
||||
{{-- Search buttons --}}
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-navbar" type="submit">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
<button class="btn btn-navbar" type="button" data-widget="navbar-search">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
@inject('navbarItemHelper', 'JeroenNoten\LaravelAdminLte\Helpers\NavbarItemHelper')
|
||||
|
||||
@if ($navbarItemHelper->isSearch($item))
|
||||
|
||||
{{-- Search form --}}
|
||||
@include('adminlte::partials.navbar.menu-item-search-form')
|
||||
|
||||
@elseif ($navbarItemHelper->isNotification($item))
|
||||
|
||||
{{-- Notification link (using blade component) --}}
|
||||
<x-adminlte-navbar-notification
|
||||
:id="$item['id']"
|
||||
:href="$item['href']"
|
||||
:icon="$item['icon']"
|
||||
:icon-color="$item['icon_color'] ?? null"
|
||||
:badge-label="$item['label'] ?? null"
|
||||
:badge-color="$item['label_color'] ?? null"
|
||||
:update-cfg="$item['update_cfg'] ?? null"
|
||||
:enable-dropdown-mode="$item['dropdown_mode'] ?? null"
|
||||
:dropdown-footer-label="$item['dropdown_flabel'] ?? null"
|
||||
/>
|
||||
|
||||
@elseif ($navbarItemHelper->isFullscreen($item))
|
||||
|
||||
{{-- Fullscreen toggle widget --}}
|
||||
@include('adminlte::partials.navbar.menu-item-fullscreen-widget')
|
||||
|
||||
@elseif ($navbarItemHelper->isSubmenu($item))
|
||||
|
||||
{{-- Dropdown menu --}}
|
||||
@include('adminlte::partials.navbar.menu-item-dropdown-menu')
|
||||
|
||||
@elseif ($navbarItemHelper->isLink($item))
|
||||
|
||||
{{-- Link --}}
|
||||
@include('adminlte::partials.navbar.menu-item-link')
|
||||
|
||||
@endif
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<nav class="main-header navbar
|
||||
{{ config('adminlte.classes_topnav_nav', 'navbar-expand-md') }}
|
||||
{{ config('adminlte.classes_topnav', 'navbar-white navbar-light') }}">
|
||||
|
||||
<div class="{{ config('adminlte.classes_topnav_container', 'container') }}">
|
||||
|
||||
{{-- Navbar brand logo --}}
|
||||
@if(config('adminlte.logo_img_xl'))
|
||||
@include('adminlte::partials.common.brand-logo-xl')
|
||||
@else
|
||||
@include('adminlte::partials.common.brand-logo-xs')
|
||||
@endif
|
||||
|
||||
{{-- Navbar toggler button --}}
|
||||
<button class="navbar-toggler order-1" type="button" data-toggle="collapse" data-target="#navbarCollapse"
|
||||
aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
{{-- Navbar collapsible menu --}}
|
||||
<div class="collapse navbar-collapse order-3" id="navbarCollapse">
|
||||
{{-- Navbar left links --}}
|
||||
<ul class="nav navbar-nav">
|
||||
{{-- Configured left links --}}
|
||||
@each('adminlte::partials.navbar.menu-item', $adminlte->menu('navbar-left'), 'item')
|
||||
|
||||
{{-- Custom left links --}}
|
||||
@yield('content_top_nav_left')
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{-- Navbar right links --}}
|
||||
<ul class="navbar-nav ml-auto order-1 order-md-3 navbar-no-expand">
|
||||
{{-- Custom right links --}}
|
||||
@yield('content_top_nav_right')
|
||||
|
||||
{{-- Configured right links --}}
|
||||
@each('adminlte::partials.navbar.menu-item', $adminlte->menu('navbar-right'), 'item')
|
||||
|
||||
{{-- User menu link --}}
|
||||
@if(Auth::user())
|
||||
@if(config('adminlte.usermenu_enabled'))
|
||||
@include('adminlte::partials.navbar.menu-item-dropdown-user-menu')
|
||||
@else
|
||||
@include('adminlte::partials.navbar.menu-item-logout-link')
|
||||
@endif
|
||||
@endif
|
||||
|
||||
{{-- Right sidebar toggler link --}}
|
||||
@if(config('adminlte.right_sidebar'))
|
||||
@include('adminlte::partials.navbar.menu-item-right-sidebar-toggler')
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<nav class="main-header navbar
|
||||
{{ config('adminlte.classes_topnav_nav', 'navbar-expand') }}
|
||||
{{ config('adminlte.classes_topnav', 'navbar-white navbar-light') }}">
|
||||
|
||||
{{-- Navbar left links --}}
|
||||
<ul class="navbar-nav">
|
||||
{{-- Left sidebar toggler link --}}
|
||||
@include('adminlte::partials.navbar.menu-item-left-sidebar-toggler')
|
||||
|
||||
{{-- Configured left links --}}
|
||||
@each('adminlte::partials.navbar.menu-item', $adminlte->menu('navbar-left'), 'item')
|
||||
|
||||
{{-- Custom left links --}}
|
||||
@yield('content_top_nav_left')
|
||||
</ul>
|
||||
|
||||
{{-- Navbar right links --}}
|
||||
<ul class="navbar-nav ml-auto">
|
||||
{{-- Custom right links --}}
|
||||
@yield('content_top_nav_right')
|
||||
|
||||
{{-- Configured right links --}}
|
||||
@each('adminlte::partials.navbar.menu-item', $adminlte->menu('navbar-right'), 'item')
|
||||
|
||||
{{-- User menu link --}}
|
||||
@if(Auth::user())
|
||||
@if(config('adminlte.usermenu_enabled'))
|
||||
@include('adminlte::partials.navbar.menu-item-dropdown-user-menu')
|
||||
@else
|
||||
@include('adminlte::partials.navbar.menu-item-logout-link')
|
||||
@endif
|
||||
@endif
|
||||
|
||||
{{-- Right sidebar toggler link --}}
|
||||
@if(config('adminlte.right_sidebar'))
|
||||
@include('adminlte::partials.navbar.menu-item-right-sidebar-toggler')
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<aside class="main-sidebar {{ config('adminlte.classes_sidebar', 'sidebar-dark-primary elevation-4') }}">
|
||||
|
||||
{{-- Sidebar brand logo --}}
|
||||
@if(config('adminlte.logo_img_xl'))
|
||||
@include('adminlte::partials.common.brand-logo-xl')
|
||||
@else
|
||||
@include('adminlte::partials.common.brand-logo-xs')
|
||||
@endif
|
||||
|
||||
{{-- Sidebar menu --}}
|
||||
<div class="sidebar">
|
||||
<nav class="pt-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column {{ config('adminlte.classes_sidebar_nav', '') }}"
|
||||
data-widget="treeview" role="menu"
|
||||
@if(config('adminlte.sidebar_nav_animation_speed') != 300)
|
||||
data-animation-speed="{{ config('adminlte.sidebar_nav_animation_speed') }}"
|
||||
@endif
|
||||
@if(!config('adminlte.sidebar_nav_accordion'))
|
||||
data-accordion="false"
|
||||
@endif>
|
||||
{{-- Configured sidebar links --}}
|
||||
@each('adminlte::partials.sidebar.menu-item', $adminlte->menu('sidebar'), 'item')
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
</aside>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<li @isset($item['id']) id="{{ $item['id'] }}" @endisset class="nav-header {{ $item['class'] ?? '' }}">
|
||||
|
||||
{{ is_string($item) ? $item : $item['header'] }}
|
||||
|
||||
</li>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<li @isset($item['id']) id="{{ $item['id'] }}" @endisset class="nav-item">
|
||||
|
||||
<a class="nav-link {{ $item['class'] }} @isset($item['shift']) {{ $item['shift'] }} @endisset"
|
||||
href="{{ $item['href'] }}" @isset($item['target']) target="{{ $item['target'] }}" @endisset
|
||||
{!! $item['data-compiled'] ?? '' !!}>
|
||||
|
||||
<i class="{{ $item['icon'] ?? 'far fa-fw fa-circle' }} {{
|
||||
isset($item['icon_color']) ? 'text-'.$item['icon_color'] : ''
|
||||
}}"></i>
|
||||
|
||||
<p>
|
||||
{{ $item['text'] }}
|
||||
|
||||
@isset($item['label'])
|
||||
<span class="badge badge-{{ $item['label_color'] ?? 'primary' }} right">
|
||||
{{ $item['label'] }}
|
||||
</span>
|
||||
@endisset
|
||||
</p>
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
Vendored
Executable
+25
@@ -0,0 +1,25 @@
|
||||
<li>
|
||||
|
||||
<form class="form-inline my-2" action="{{ $item['href'] }}" method="{{ $item['method'] }}">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="input-group">
|
||||
|
||||
{{-- Search input --}}
|
||||
<input class="form-control form-control-sidebar" type="search"
|
||||
@isset($item['id']) id="{{ $item['id'] }}" @endisset
|
||||
name="{{ $item['input_name'] }}"
|
||||
placeholder="{{ $item['text'] }}"
|
||||
aria-label="{{ $item['text'] }}">
|
||||
|
||||
{{-- Search button --}}
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-sidebar" type="submit">
|
||||
<i class="fas fa-fw fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</li>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<li>
|
||||
|
||||
<div class="form-inline my-2">
|
||||
<div class="input-group" data-widget="sidebar-search" data-arrow-sign="»">
|
||||
|
||||
{{-- Search input --}}
|
||||
<input class="form-control form-control-sidebar" type="search"
|
||||
@isset($item['id']) id="{{ $item['id'] }}" @endisset
|
||||
placeholder="{{ $item['text'] }}"
|
||||
aria-label="{{ $item['text'] }}">
|
||||
|
||||
{{-- Search button --}}
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-sidebar">
|
||||
<i class="fas fa-fw fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user