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:
@ -0,0 +1,39 @@
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modalSection" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel1"><?= lang('Wiki.new_section') ?></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="formSection">
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-2">
|
||||
<label for="section-name" class="form-label"><?= lang('Wiki.name') ?></label>
|
||||
<input type="text" id="section-name" name="title" placeholder="<?= lang('Wiki.section_placeholder') ?>" name="name" class="form-control" required />
|
||||
</div>
|
||||
<div class="col-12 mb-2">
|
||||
<label for="section-icon" class="form-label"><?= lang('Wiki.icon') ?></label>
|
||||
<input type="text" id="section-icon" name="icon" placeholder="<?= lang('Wiki.section_icon_placeholder') ?>" name="name" class="form-control" required />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.global_come_back') ?></button>
|
||||
<?php if (auth()->user()->inGroup('admin')) { ?>
|
||||
<button type="button" id="submit-new-section" class="btn btn-primary d-none"><?= lang('App.global_save') ?></button>
|
||||
<button type="button" id="submit-update-section" class="btn btn-primary d-none"><?= lang('App.global_save') ?></button>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,8 +1,16 @@
|
||||
|
||||
<!-- Messages -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('showWikiPage','intro') ?>" class="menu-link">
|
||||
<?php if(auth()->user()->inGroup('admin')):?>
|
||||
<a href="<?= route_to('showWikiPage','intro-admin') ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-books"></i>
|
||||
<?= lang("Wiki") ?>
|
||||
</a>
|
||||
<?php endif;?>
|
||||
<?php if(auth()->user()->inGroup('cliente-editor')):?>
|
||||
<a href="<?= route_to('showWikiPage','presupuesto-cliente') ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-books"></i>
|
||||
<?= lang("Wiki") ?>
|
||||
</a>
|
||||
<?php endif;?>
|
||||
</li>
|
||||
@ -109,16 +109,16 @@ $picture = "/assets/img/default-user.png";
|
||||
|
||||
<!-- Iterate throught sections -->
|
||||
<?php foreach ($wiki_sections as $key => $value) : ?>
|
||||
<li class="menu-item <?= $value->slug == $slug ? 'active' : "" ?>">
|
||||
<!-- Check if user can view the section link -->
|
||||
<?php if (auth()->user()->inGroup($value->role) || auth()->user()->inGroup('admin') ): ?>
|
||||
<a href="<?= site_url("wiki/view/".$value->slug) ?>" class="menu-link" >
|
||||
<?php if (auth()->user()->inGroup($value->role) || auth()->user()->inGroup('admin')): ?>
|
||||
<li class="menu-item <?= $value->slug == $slug ? 'active' : "" ?>">
|
||||
<!-- Check if user can view the section link -->
|
||||
<a href="<?= site_url("wiki/view/" . $value->slug) ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons <?= $value->icon ?>"></i>
|
||||
<?= lang("Wiki.".$value->slug) ?>
|
||||
<?= lang("Wiki." . $value->slug) ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ul>
|
||||
</aside>
|
||||
@ -135,9 +135,20 @@ $picture = "/assets/img/default-user.png";
|
||||
<i class="ti ti-menu-2 ti-sm"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-nav-left d-flex align-items-center" id="navbar-collapse">
|
||||
|
||||
<ul class="navbar-nav flex-row justify-content-start align-items-center ms-auto">
|
||||
<div>
|
||||
<a class="nav-link" href="<?= route_to("home") ?>">
|
||||
<i class="ti ti-home rounded-circle me-1 fs-3"></i>
|
||||
</a>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
|
||||
|
||||
<ul class="navbar-nav flex-row align-items-center ms-auto">
|
||||
<ul class="navbar-nav flex-row justify-content-start align-items-center ms-auto">
|
||||
|
||||
<!-- Language -->
|
||||
<li class="nav-item dropdown-language dropdown me-2 me-xl-0">
|
||||
@ -145,6 +156,7 @@ $picture = "/assets/img/default-user.png";
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="fi <?= getCurrentLanguageFlag(); ?> fis rounded-circle me-1 fs-3"></i>
|
||||
</a>
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<a class="dropdown-item" href="<?= site_url('lang/es'); ?>" data-language="es">
|
||||
|
||||
@ -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