mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
editor form
This commit is contained in:
@ -3,15 +3,44 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend('themes/vuexy/wiki/layout') ?>
|
||||
<?php
|
||||
|
||||
use CodeIgniter\I18n\Time;
|
||||
?>
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-md-6 d-flex flex-row flex-wrap justify-content-start align-items-center pb-2 gap-2">
|
||||
<?php if ($section->content()?->published_data): ?>
|
||||
<span class="badge badge-center rounded-pill text-bg-success"><i class="ti ti-check"></i></span>
|
||||
<strong><?= lang('Wiki.published') ?></strong>
|
||||
<strong><?= $section->content()->published_at ? Time::createFromFormat('Y-m-d H:i:s', $section->content()->published_at)->format('d/m/Y H:i') : "" ?></strong>
|
||||
<strong class="text-secondary"><?= $section->content()->publish_by() ?></strong>
|
||||
|
||||
<?php else: ?>
|
||||
<span class="badge badge-center rounded-pill text-bg-danger"><i class="ti ti-alert-circle"></i></span>
|
||||
<strong><?= lang('Wiki.not_published') ?></strong>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-6 d-flex flex-row flex-wrap justify-content-end align-items-stretch pb-2 gap-2">
|
||||
<?php if (auth()->user()->inGroup('admin')): ?>
|
||||
<button type="button" class="btn btn-success btn-xs col-xs-12 " id="new-section"><i class="icon-base ti ti-plus icon-xs me-2"></i><?= lang('Wiki.new_section') ?></button>
|
||||
<button type="button" class="btn btn-warning btn-xs col-auto " id="edit-section"><i class="icon-base ti ti-pencil icon-xs me-2"></i><?= lang('Wiki.edit_section') ?></button>
|
||||
<button type="button" class="btn btn-primary btn-xs col-auto " id="save-editor"><i class="icon-base ti ti-device-floppy icon-xs me-2"></i><?= lang('App.global_save') ?></button>
|
||||
<button type="button" class="btn btn-danger btn-xs col-auto " id="release-editor"><i class="icon-base ti ti-upload icon-xs me-2"></i>Publicar</button>
|
||||
<button type="button" class="btn btn-secondary btn-xs d-none col-auto " id="preview-editor"><i class="icon-base ti ti-eye icon-xs me-2"></i>Vista previa</button>
|
||||
<button type="button" class="btn btn-warning btn-xs col-auto " id="edit-editor"><i class="icon-base ti ti-pencil icon-xs me-2"></i>Editar</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div><!--//.card-header -->
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form action="POST" id="form-wiki">
|
||||
@ -20,37 +49,9 @@
|
||||
<input type="hidden" name="wiki_page_id" id="wiki-page-id">
|
||||
<input type="hidden" name="wiki_page_id" id="wiki-content-id">
|
||||
</form>
|
||||
<?php if (auth()->user()->inGroup('admin')): ?>
|
||||
|
||||
<div class="col-md-12 d-flex flex-row justify-content-between align-items-center pb-2">
|
||||
<div class="d-flex flex-row gap-2 justify-content-start align-items-center">
|
||||
<?php if ($section->content()?->published_data): ?>
|
||||
<span class="badge badge-center rounded-pill text-bg-success"><i class="ti ti-check"></i></span>
|
||||
<strong><?= lang('Wiki.published') ?></strong>
|
||||
<?php else: ?>
|
||||
<span class="badge badge-center rounded-pill text-bg-danger"><i class="ti ti-alert-circle"></i></span>
|
||||
<strong><?= lang('Wiki.not_published') ?></strong>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm" role="group">
|
||||
<button type="button" class="btn btn-primary" id="save-editor"><i class="icon-base ti ti-device-floppy icon-xs me-2"></i><?= lang('App.global_save') ?></button>
|
||||
<button type="button" class="btn btn-danger" id="release-editor"><i class="icon-base ti ti-upload icon-xs me-2"></i>Publicar</button>
|
||||
<button type="button" class="btn btn-secondary d-none" id="preview-editor"><i class="icon-base ti ti-eye icon-xs me-2"></i>Vista previa</button>
|
||||
<button type="button" class="btn btn-warning" id="edit-editor"><i class="icon-base ti ti-pencil icon-xs me-2"></i>Editar</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div id="editorjs"></div>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div id="editorjs"></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div id="editorjs"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
@ -59,6 +60,8 @@
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= view("themes/vuexy/components/modals/modalSection") ?>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
@ -68,6 +71,10 @@
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/wiki/home.js') ?>"></script>
|
||||
<?php if (auth()->user()->inGroup('admin')) : ?>
|
||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/wiki/home.js') ?>"></script>
|
||||
<?php else : ?>
|
||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/wiki/viewOnly.js') ?>"></script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
Reference in New Issue
Block a user