130 lines
5.8 KiB
PHP
130 lines
5.8 KiB
PHP
{{col("col-12 d-none","")}}
|
|
<div class="btn btn-outline-success" onclick="$('#new-modal').modal()"><i class="fa fa-plus"></i> {{e2($newTitle)}} </div>
|
|
<?php if(isset($topButtons)) {
|
|
foreach($topButtons AS $topButton) {
|
|
|
|
?>
|
|
<a href="{{$topButton['href']}}" class="btn {{isset($topButton['class']) ? $topButton['class'] : 'btn-outline-primary'}}"><?php echo $topButton['html'] ?></a>
|
|
<?php } ?>
|
|
|
|
<?php
|
|
} ?>
|
|
{{_col()}}
|
|
|
|
<div class="modal " id="new-modal">
|
|
<form action="{{url("admin/create/$tableName")}}" method="post" class="new-form">
|
|
<div class="modal-dialog modal-lg modal-dialog-scrollable border-rounded">
|
|
<div class="modal-content rounded">
|
|
|
|
<!-- Modal Header -->
|
|
<div class="modal-header bg-primary">
|
|
<h4 class="modal-title text-white">{{$newTitle}}</h4>
|
|
<button type="button" class="close btn-close btn text-white" data-dismiss="modal">×</button>
|
|
</div>
|
|
|
|
<!-- Modal body -->
|
|
<div class="modal-body block-header-default">
|
|
<?php if(getisset("detail")) {
|
|
$listData = db($tableName)->where("id", get("detail"))->first();
|
|
?>
|
|
<script>
|
|
$(function() {
|
|
$("#new-modal").modal();
|
|
$(".btn-save").hide();
|
|
$(".modal-title").html("#{{get("detail")}} {{$title}}");
|
|
$(".btn-close").on("click", function() {
|
|
//window.location.replace(location.pathname);
|
|
});
|
|
});
|
|
</script>
|
|
|
|
|
|
<?php
|
|
} ?>
|
|
<?php $rowName = "new-form"; ?>
|
|
|
|
@csrf
|
|
<div class="row {{$rowName}}">
|
|
<?php if(isset($blockGroup)) {
|
|
foreach($blockGroup AS $blockTitle => $blockColumns) {
|
|
|
|
$slug = str_slug($blockTitle);
|
|
$class = "col-12 border-1";
|
|
$color = -1;
|
|
if(isset($columnRedesign[$slug]['class'])) {
|
|
$class = $columnRedesign[$slug]['class'];
|
|
}
|
|
if(isset($columnRedesign[$slug]['color'])) {
|
|
$color = $columnRedesign[$slug]['color'];
|
|
}
|
|
$options['no-options'] = true;
|
|
|
|
if(isset($columnRedesign[$slug]['border'])) $options['border'] = true;
|
|
if(isset($columnRedesign[$slug]['content-class'])) $options['content-class'] = $columnRedesign[$slug]['content-class'];
|
|
?>
|
|
|
|
<div class="{{$class . " " . $slug}}">
|
|
<div class="block block-rounded border">
|
|
<div class="block-header">
|
|
<h3 class="block-title">{{e2($blockTitle)}}</h3>
|
|
</div>
|
|
<div class="block-content">
|
|
<div class="row">
|
|
<?php foreach($blockColumns AS $column) {
|
|
// dd($columnsList[$column]);
|
|
$column = $columnsList[$column];
|
|
$columnClass = "col-md-3";
|
|
|
|
if(isset($columnRedesign[$column['name']]['class']))
|
|
$columnClass = $columnRedesign[$column['name']]['class'];
|
|
?>
|
|
<div class="{{$columnClass}}">
|
|
{{e2($column['name'])}}
|
|
@include("components.columns.{$column['type']}")
|
|
</div>
|
|
<?php
|
|
} ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--
|
|
{{col($class . " " . $slug, $blockTitle, $color, $options)}}
|
|
|
|
{{_col()}}
|
|
-->
|
|
<?php
|
|
}
|
|
} else {
|
|
?>
|
|
<?php foreach($columnsList AS $column) {
|
|
|
|
?>
|
|
<div class="col-md-3">
|
|
{{e2($column['name'])}}
|
|
|
|
@include("components.columns.{$column['type']}")
|
|
</div>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
<div class="col-12 text-center">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<!-- Modal footer -->
|
|
<div class="modal-footer">
|
|
|
|
<button class="btn btn-outline-success btn-save" onclick=""><i class="fa fa-save"></i> {{e2("Save")}}</button>
|
|
|
|
<button type="button" class="btn btn-outline-danger btn-close" data-dismiss="modal">{{e2("Close")}}</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|