core/api/modules/a_bib_edit/index.html

242 lines
12 KiB
HTML
Raw Normal View History

2023-08-14 09:15:58 +05:00
{include file=$header_admin h1="Библиотека" title="Библиотека"}
<input type="hidden" id="parent_id" value="{$smarty.get.id}"> {* вышестоящая категория, если она есть *}
<input type="hidden" id="del_id" value="">{* Ид удаляемого контента *} {if ($categoryInfo[0].title)}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/admin/">Главная</a></li>
<li class="breadcrumb-item"><a href="/page_all/">Библиотека</a></li>
<li class="breadcrumb-item active" aria-current="page">{$categoryInfo[0].title}</li>
</ol>
</nav>
<h1>{$title}</h1>
{else}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/admin/">Главная</a></li>
<li class="breadcrumb-item active" aria-current="page">Библиотека</li>
</ol>
</nav>
{/if}
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" data-link="/a_bib_edit/" class="btn btn-primary"><i class="far fa-file"
style="margin-right: 7px;"></i>Создать книгу</button>
<button type="button" class="btn btn-primary" id="showDivNewCat"><i class="fas fa-plus"
style="margin-right: 7px;"></i> Новая категория</button>
</div>
<div class="mt-2 mb-2 p-3 hidden" style="border: 1px solid lightgray;" id="divNewCat">
<input type="text" placeholder="Наименование" id="categoryTitle" class="form-control">
<select class="form-control mt-2 mb-2" name="parentCategory" id="parentCategory">
<option value="0">Нет</option>
{section name=customer loop=$all_cat} {if $all_cat[customer].id}
<option value="{$all_cat[customer].id}">{$all_cat[customer].txt}</option>
{/if} {/section}
</select>
<div class="btn-group" role="group" aria-label="Basic example">
<button id="createNewCategory" class="btn btn-primary">Сохранить</button>
<button id="cancelNewSaveMeta" class="btn btn-primary">Отмена</button>
</div>
</div>
<div class="ibox">
<div class="ibox-head">
<div class="ibox-title">Библиотека</div>
<ul class="nav nav-tabs tabs-line pull-right">
<li class="nav-item">
<a class="nav-link active" href="#tab-8-1" data-toggle="tab"><i class="fa-sharp fa-solid fa-list"></i>
Основная информация</a>
</li>
{if ($smarty.get.id)}
<li class="nav-item">
<a class="nav-link" href="#tab-8-2" data-toggle="tab"><i class="fa-sharp fa-solid fa-image"></i>
Файлы</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab-8-3" data-toggle="tab"><i class="fa-sharp fa-solid fa-gears"></i> СЕО</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab-8-4" data-toggle="tab"><i class="fa-sharp fa-solid fa-chart-simple"></i>
SEO-статистика</a>
</li>
{/if}
</ul>
</div>
<div class="ibox-body">
<div class="tab-content">
<div class="tab-pane fade show active" id="tab-8-1">
<form>
<div class="mb-3">
<label for="txt" class="form-label">Наименование</label>
<input type="text" class="form-control" id="txt" aria-describedby="emailHelp" name="txt">
{*<div id="emailHelp" class="form-text">Мы никогда никому не передадим вашу электронную почту.
</div>*}
</div>
<div class="mb-3">
<label for="exampleInputPassword1" class="form-label">Описание</label>
<textarea class="form-control" id="exampleInputPassword1" style="height: 300px;"></textarea>
</div>
<div class="mb-3">
<label for="exampleInputPassword1" class="form-label">Категория</label>
<select class="form-control mt-2 mb-2" name="parentCategory" id="parentCategory">
<option value="0">Нет</option>
{section name=customer loop=$all_cat} {if $all_cat[customer].id}
<option value="{$all_cat[customer].id}">{$all_cat[customer].txt}</option>
{/if} {/section}
</select>
</div>
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Год издания</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Количество страниц</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
<div class="mb-3">
<label for="exampleInputPassword1" class="form-label">Формат</label>
<select class="form-control mt-2 mb-2" name="parentCategory" id="parentCategory">
<option value="PDF">PDF</option>
{section name=customer loop=$all_cats} {if $all_cats[customer].id}
{/if} {/section}
</select>
</div>
{*<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Проверить меня</label>
</div>*}
<div class="form-check" style="padding-top: 5px; margin-left: 17px;">
<input type="checkbox" class="form-check-input" id="status" name="status" {if
$categoryInfo[0].status==1}checked{/if}>
<label class="form-check-label" for="public">Публиковать</label>
</div>
<button type="submit" class="btn btn-primary">Создать</button>
</form>
</div>
<div class="tab-pane" id="tab-8-2">
<form method="post" enctype="multipart/form-data" id="upload">
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Файл книги</label>
<input type="file" class="form-control" id="filebook" name="filebook" aria-describedby="emailHelp">
</div>
<div class="mb-3">
<label for="link" class="form-label">ИЛИ ссылка на внешний ресурс</label>
<input type="text" class="form-control" id="link" aria-describedby="emailHelp" name="link">
</div>
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Обложка</label>
<input type="file" class="form-control" id="img" aria-describedby="emailHelp" name="img">
</div>
<input type="submit" class="btn btn-primary" name="ok" value="Загрузить">
</form>
<!--div id="drop-area" class="container mt-2">
<form class="my-form">
<p>Загрузите фотографии</p>
<input type="file" id="fileElem" multiple accept="image/*" onchange="handleFiles(this.files)">
<label class="button" for="fileElem">Выбрать файлы</label>
</form>
<progress id="progress-bar" max=100 value=0></progress>
<div id="gallery"></div>
</div-->
{section name=customer loop=$imgs} {if $imgs[customer].id}
<div class="card mb-3 mt-3" style="max-width: 90%;" id="{$imgs[customer].id}">
<div class="row g-0">
<div class="col-md-4">
<img src="/img/tovar/{$imgs[customer].fileName}.jpg" class="img-fluid rounded-start"
alt="...">
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title">Имя файла: {$imgs[customer].fileName}</h5>
<p class="card-text"><input type="text" class="form-control" name="alt"
placeholder="alt"></p>
<p class="card-text"><input type="text" class="form-control" name="title"
placeholder="Title"></p>
<p class="card-text"><small class="text-muted delImg" data-id="{$imgs[customer].id}"
style="cursor: pointer;">Удалить</small></p>
</div>
</div>
</div>
</div>
{/if} {/section}
</div>
<div class="tab-pane" id="tab-8-3">
<div class="mt-2 mb-2 p-3" style="border: 1px solid lightgray;">
<input type="text" placeholder="Наименование" id="title" class="form-control"
value="{$categoryInfo[0].title}">
<input type="text" placeholder="keywords" id="keywords" class="form-control mt-2"
value="{$categoryInfo[0].keywords}">
<input type="text" placeholder="description" id="description" class="form-control mt-2"
value="{$categoryInfo[0].description}">
<input type="hidden" id="id" value="{$smarty.get.id}">
<select class="form-control mt-2 mb-2" name="category" id="category">
<option value="0">Нет</option>
{section name=customer loop=$all_cat} {if $all_cat[customer].id}
<option value="{$all_cat[customer].id}" {if
($categoryInfo[0].category==$all_cat[customer].id)} selected{/if}>
{$all_cat[customer].txt}</option>
{/if} {/section}
</select>
<div class="btn-group mt-3" role="group" aria-label="Basic example">
<button id="saveMeta" class="btn btn-primary">Сохранить</button>
<button type="button" class="btn btn-primary">Удалить</button>
</div>
<div class="mt-2 p-3" id="div-log" style="border: 1px solid lightgray;" title="log"></div>
</div>
</div>
<div class="tab-pane" id="tab-8-4">
</div>
</div>
</div>
</div>
<!-- Футер -->
{include file=$footer_admin}