upload 1/4

This commit is contained in:
2025-04-01 13:46:03 +07:00
parent 30ebfb6644
commit 5529e9ff1f
14 changed files with 646 additions and 655 deletions

View File

@@ -0,0 +1,170 @@
<div class="w-[100%] mb-[50px]">
<div class="text-sm breadcrumbs ml-[10px]">
<ul>
<li><a href="/admin/distributor">Danh sách đại lý</a></li>
<li class="text-[#0041E8]">Form thêm/sửa danh sách</li>
</ul>
</div>
<div class="w-[1140px] my-0 mx-auto">
<div class="bg-white p-[10px] rounded-[10px] shadow-[0_1px_1px_0px_#0000001A] my-[15px]">
<div class="flex items-center justify-between">
<h1 class="text-[20px] font-[700]">Form đại lý</h1>
<div class="flex items-center">
<a href="/admin/distributor/form"
class="group flex items-center border-[1px] border-[#ECECEC] rounded-[4px] p-[5px_10px_5px_10px] hover:bg-blue-700">
<span
class="w-[14.5px] group-hover:text-white group-hover:border-white h-[14.5px] border-[1px] rounded-[50%] border-[#6B7280] text-center leading-[10.5px] mr-[5px] text-[#6B7280]">+</span>
<span class="text-[#6B7280] group-hover:text-white">Thêm đại lý</span>
</a>
</div>
</div>
<p class="text-gray-500">Nhà Thuốc Hiệp Phát</p>
</div>
<div class="flex">
<div class="left w-[270px] mr-[10px]">
<div class="list-tab">
<a href="/admin/distributor/form"
class="item block w-[100%] h-[36px] text-white bg-[#0041E8] rounded-[10px] text-[13px] leading-[35px] px-[20px]">Thông
tin</a>
</div>
</div>
<div class="right w-[860px]">
<div
class="bg-white p-[10px] rounded-[10px_10px_0_0] shadow-[0_-1px_1px_0px_#0000001A] border-b-[6px] border-[#FAFAFB]">
<b class="block text-[20px] font-bold my-[10px]">Cập nhật lại</b>
<table class="">
<tr>
<td>Tên gọi</td>
<td>
<input type="text" name="" value="" placeholder="Têm gọi"
class="w-full input input-md input-bordered h-[35px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]">
</td>
</tr>
<tr>
<td class="align-top">Mô tả</td>
<td>
<textarea type="text" name="" value="" placeholder="Nội dung tóm tắt (nếu có)"
class="w-full textarea h-[70px] input-bordered rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]"></textarea>
</td>
</tr>
<tr>
<td>Tọa độ bản đồ</td>
<td>
<div class="grid grid-cols-2 gap-[30px]">
<div class="flex items-center">
<p class="whitespace-nowrap">Kinh độ</p>
<input type="text" name="" value="" placeholder="Kinh độ"
class="w-[200px] ml-[10px] input input-md input-bordered h-[35px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]">
</div>
<div class="flex items-center">
<p class="whitespace-nowrap">Vĩ độ</p>
<input type="text" name="" value="" placeholder="Vĩ độ"
class="w-[200px] ml-[10px] input input-md input-bordered h-[35px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]">
</div>
</div>
</td>
</tr>
<tr>
<td>Tỉnh/TP</td>
<td>
<select name=''
class="w-[50%] mr-[15px] select select-bordered h-[38px] min-h-[38px] rounded-[4px]">
<option value='' selected>Tỉnh/TP</option>
<option value=''>Hà nội</option>
</select>
</td>
</tr>
<tr>
<td>Quận huyện</td>
<td>
<select name=''
class="w-[50%] mr-[15px] select select-bordered h-[38px] min-h-[38px] rounded-[4px]">
<option value='' selected>Quận huyện</option>
<option value=''>Thị xã Đông Hòa</option>
</select>
</td>
</tr>
<tr>
<td class="align-top">Địa chỉ</td>
<td>
<textarea type="text" name="" value="" placeholder="Địa chỉ"
class="w-full textarea h-[70px] input-bordered rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]"></textarea>
</td>
</tr>
<tr>
<td>Điện thoại</td>
<td>
<input type="text" name="" value="" placeholder="Điện thoại"
class="w-full input input-md input-bordered h-[35px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]">
</td>
</tr>
<tr>
<td>Website</td>
<td>
<input type="text" name="" value="" placeholder=""
class="w-full input input-md input-bordered h-[35px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]">
</td>
</tr>
<tr>
<td>Người liên hệ</td>
<td>
<input type="text" name="" value="Nguyễn Thị Hiệp" placeholder=""
class="w-full input input-md input-bordered h-[35px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]">
</td>
</tr>
<tr>
<td>Email liên hệ</td>
<td>
<input type="text" name="" value="" placeholder=""
class="w-full input input-md input-bordered h-[35px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]">
</td>
</tr>
<tr>
<td>STT</td>
<td>
<input type="text" name="" value="" placeholder=""
class="w-[35%] input input-md input-bordered h-[35px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]">
</td>
</tr>
<tr>
<td>STT</td>
<td>
<input type="text" name="" value="" placeholder=""
class="w-[35%] input input-md input-bordered h-[35px] rounded-[4px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12)] mr-[10px]">
</td>
</tr>
<tr>
<td>Trạng thái</td>
<td>
<div class="flex items-center">
<label class="inline-flex items-center cursor-pointer relative mr-[34px]">
<input type="radio" value="0" name="info[status]"
class="radio checked:bg-blue-500" checked="">
<span class="label-text ml-[10px]"> Hiển thị </span>
</label>
<label class="inline-flex items-center cursor-pointer relative pl-[30px] mr-[34px]">
<input type="radio" value="1" name="info[status]"
class="radio checked:bg-blue-500">
<span class="label-text ml-[10px]"> Ẩn hiển thị </span>
</label>
</div>
</td>
</tr>
</table>
</div>
<div class="bg-white p-[10px] rounded-[0_0_10px_10px] shadow-[0_1px_1px_0px_#0000001A]">
<input
class="btn w-[95px] h-[35px] min-h-[35px] bg-[#0041E8] rounded-[4px] mt-[10px] text-white cursor-pointer"
name="submit" type="submit" value="Cập nhật">
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,106 @@
<div class="w-[100%]">
<div
class="bg-white m-[16px] p-[20px_16px] rounded-[15px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)] leading-[20px]">
<h1 class="leading-[30px] mb-[13px] font-bold text-[24px]"> Danh sách đại lý </h1>
<form method="get" enctype="multipart/form-data" action="/admin/"
class="border border-[#F6F6F6] m-[12px_0_16px] p-[15px] bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)]">
<input type="text" name="q" id="keyword" value="" placeholder=""
class="w-[375px] h-[36px] border border-[#D8D8D8] m-[0_10px_0_0] p-[0_10px] bg-white rounded-[4px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)] ">
<input type="submit" value="Tìm kiếm"
class="h-[36px] bg-[#0041E8] text-[#fff] font-[500] p-[0_8px] cursor-pointer rounded-[4px]">
</form>
<div class="flex items-center justify-between mb-[15px]">
<div class="flex items-center">
<p class="mr-[10px]">Lựa chọn ngôn ngữ</p>
<select
class="min-w-[160px] h-[36px] min-h-[36px] select select-bordered rounded-[4px] mr-[15px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)]">
<option value=""> Chọn ngôn ngữ </option>
<option value=""> Tiếng việt </option>
</select>
</div>
<div class="flex items-center">
<a href="/admin/distributor/form"
class="block w-[155px] m-[auto_0_auto_auto] items-center whitespace-nowrap border border-[#0041E8] rounded-[4px] bg-[#F5F7FF] text-[#0041E8] p-[0_12px] font-[500] leading-[35px] group hover:bg-[#0041E8] hover:text-[#fff]">
<span
class="inline-block border-[1px] border-[#0041E8] h-[14px] w-[14px] leading-[10.5px] text-center rounded-[50%] mr-1 group-hover:border-[#fff]">+</span>
<span>Thêm đại lý mới</span>
</a>
<a href=""
class="ml-[10px] group leading-[35px] border border-[#0041E8] rounded-[4px] bg-white p-[0_15px] font-[500] text-[#0041E8] hover:bg-[#0041E8] hover:text-[#fff]">
<i class="fa-solid fa-file-arrow-down text-[#0041E8] group-hover:text-white mr-[5px]"></i>
<span>Upload Excel</span>
</a>
</div>
</div>
<table class="mt-[20px]">
<thead class="bg-[#f6f6f6] font-bold">
<tr>
<td>STT</td>
<td>Đại lý</td>
<td>NGười liên hệ</td>
<td>Địa chỉ</td>
<td>Tỉnh</td>
<td>Điện thoại</td>
<td>Lựa chọn</td>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Nhà Thuốc Hiệp Phát</td>
<td>Nguyễn Thị Hiệp</td>
<td>Thửa đất số 126, Tờ BĐS 53, KP Phú Lạc, P.Hòa Hiệp Nam, TX Đông Hòa, PY</td>
<td>Phú yên</td>
<td>0982483346</td>
<td>
<div class="flex items-center">
<a href="" title="Form sản phẩm"
class="w-[32px] h-[32px] border-[1px] border-[#0041e8] rounded-[4px] text-center leading-[32px] flex items-center justify-center mr-[5px]">
<i class="icons icon-edit"></i>
</a>
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="fa-regular fa-eye-slash text-[#9E9E9E]"></i>
</a>
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="icons icon-remove"></i>
</a>
</div>
</td>
</tr>
<tr>
<td>1</td>
<td>Nhà Thuốc Hiệp Phát</td>
<td>Nguyễn Thị Hiệp</td>
<td>Thửa đất số 126, Tờ BĐS 53, KP Phú Lạc, P.Hòa Hiệp Nam, TX Đông Hòa, PY</td>
<td>Phú yên</td>
<td>0982483346</td>
<td>
<div class="flex items-center">
<a href="" title="Form sản phẩm"
class="w-[32px] h-[32px] border-[1px] border-[#0041e8] rounded-[4px] text-center leading-[32px] flex items-center justify-center mr-[5px]">
<i class="icons icon-edit"></i>
</a>
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="fa-regular fa-eye-slash text-[#9E9E9E]"></i>
</a>
<a href=""
class="w-[32px] h-[32px] border-[1px] border-[#9E9E9E] rounded-[4px] text-center leading-[30px] flex items-center justify-center mr-[5px]">
<i class="icons icon-remove"></i>
</a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>

View File

@@ -0,0 +1,83 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/monaco-editor@0.34.1/min/vs/editor/editor.main.css">
<script src="https://cdn.jsdelivr.net/npm/monaco-editor@0.34.1/min/vs/loader.js"></script>
<script>
require.config({ paths: { 'vs': 'https://cdn.jsdelivr.net/npm/monaco-editor@0.34.1/min/vs' } });
require(['vs/editor/editor.main'], function () {
monaco.editor.defineTheme('myCustomTheme', {
base: 'vs',
inherit: true,
rules: [
{ token: 'tag', foreground: '4CAF50', fontStyle: 'bold' }, // Màu cam cho thẻ HTML
{ token: 'attribute.name', foreground: 'e00000' }, // Màu xanh lá cho thuộc tính
{ token: 'attribute.value', foreground: 'e00000' }, // Màu vàng cho giá trị thuộc tính
{ token: 'string', foreground: 'e00000' }, // Màu xanh dương cho chuỗi
{ token: 'comment', foreground: '#4CAF50', fontStyle: 'italic' },
],
colors: {
'editor.foreground': '#000000',
'editorGutter.background': '#f6f6f6',
'editor.lineNumber.foreground': '#000000',
}
})
monaco.editor.create(document.getElementById('tpl_editor'), {
value: `<section class= "section-breakcrumb routing py-12 line-clamp" >
<div class="global-breadcrumb container">
<ol itemscope="" itemtype="http://schema.org/BreadcrumbList" class="list-style-none
d- flex">
<li class="routing-link" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
<a href="/" itemprop="item" class="nopad-l">
<span itemprop="name">Trang chủ</span>
</a>
<meta itemprop="position" content="1">
</li>
<li class="routing-link" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a href="{{ path.url }}" itemprop="item" class="nopad-l">
<span itemprop="name"> {{ path.name }} </span>
</a>
<meta itemprop="position" content="{{ counter }}" />
</li>
</ol>
<ol itemscope="" itemtype="http://schema.org/BreadcrumbList" class="list-style-none d-flex">
<li class="routing-link" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
<a href="/" itemprop="item" class="nopad-l">
<span itemprop="name">Trang chủ</span>
</a>
<meta itemprop="position" content="1">
</li>
`,
language: 'html',
theme: 'myCustomTheme',
automaticLayout: true,
minimap: { enabled: false },
autoClosingBrackets: true,
autoClosingQuotes: true,
autoIndent: true,
wordWrap: 'on',
});
});
function open_template_list(id) {
var $template = $('#template_list_' + id)
if ($template.prop('open')) {
$('#template_list_' + id).prop('open', false);
} else {
$('#template_list_' + id).prop('open', true);
}
}
function show_older_version() {
$('#older_version').toggle()
}
</script>

View File

@@ -34,4 +34,8 @@
{% include javascript/page %}
{% elsif global.module == 'template' and global.view == 'edit-template' %}
{% include javascript/edit_template %}
{% endif %}

View File

@@ -0,0 +1,227 @@
<div class="w-[100%] template-edit">
<div class="global-breadcrumb-container">
<a href="/admin/template"> Sửa file template </a>
<a href=""> Sửa nội dung template, giao diện </a>
</div>
<div class="max-w-[1141px] m-[0_auto_16px_auto]">
<div
class="w-[100%] p-[11px_16px] bg-white m-[0_0_16px] rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)] leading-[18px]">
<p class="font-bold text-[20px] leading-[26px] block"> Cập nhật template file, giao diện </p>
<p class="text-[#6B7280] block mt-[5px]">web_mau</p>
</div>
<div class="flex">
<div class="w-[275px] m-[0_16px_0_0] font-[500] leading-[24px] overflow-hidden">
<div class="bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)] pb-[5px]">
<details class="collapse tab-edit rounded-[10px]" id="template_list_mobile"
onclick="open_template_list('pc')">
<summary class="collapse-title p-[10px] min-h-[30px] rounded-[10px] border-none bg-blue-700">
<div class="flex items-center justify-between">
<p class="text-white">Giao diện mobile</p>
<i class="fa-solid fa-chevron-down text-white"></i>
</div>
</summary>
<div class="collapse-content text-sm">
<div class="mt-[10px] max-h-[350px] overflow-y-auto">
<div class="item">
<b>other</b>
<ul>
<li class="active"><a href="">breadcrumbs</a></li>
<li><a href="">footer</a></li>
<li><a href="">header</a></li>
</ul>
</div>
<div class="item">
<b>other</b>
<ul>
<li><a href="">breadcrumbs</a></li>
<li><a href="">footer</a></li>
<li><a href="">header</a></li>
</ul>
</div>
<div class="item">
<b>other</b>
<ul>
<li><a href="">breadcrumbs</a></li>
<li><a href="">footer</a></li>
<li><a href="">header</a></li>
</ul>
</div>
<div class="item">
<b>other</b>
<ul>
<li class="active"><a href="">breadcrumbs</a></li>
<li><a href="">footer</a></li>
<li><a href="">header</a></li>
</ul>
</div>
<div class="item">
<b>other</b>
<ul>
<li><a href="">breadcrumbs</a></li>
<li><a href="">footer</a></li>
<li><a href="">header</a></li>
</ul>
</div>
<div class="item">
<b>other</b>
<ul>
<li><a href="">breadcrumbs</a></li>
<li><a href="">footer</a></li>
<li><a href="">header</a></li>
</ul>
</div>
</div>
</div>
</details>
<details class="collapse tab-edit rounded-[10px]" onclick="open_template_list('mobile')"
id="template_list_pc" open>
<summary class="collapse-title p-[10px] min-h-[30px] rounded-[10px] border-none bg-blue-700">
<div class="flex items-center justify-between">
<p class="text-white">Giao diện pc</p>
<i class="fa-solid fa-chevron-down text-white"></i>
</div>
</summary>
<div class="collapse-content text-sm">
<div class="mt-[10px]">
<div class="item">
<b>other</b>
<ul>
<li><a href="">breadcrumbs</a></li>
<li><a href="">footer</a></li>
<li><a href="">header</a></li>
</ul>
</div>
<div class="item">
<b>other</b>
<ul>
<li><a href="">breadcrumbs</a></li>
<li><a href="">footer</a></li>
<li><a href="">header</a></li>
</ul>
</div>
<div class="item">
<b>other</b>
<ul>
<li><a href="">breadcrumbs</a></li>
<li><a href="">footer</a></li>
<li><a href="">header</a></li>
</ul>
</div>
</div>
</div>
</details>
</div>
<div class="bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)] mt-[10px]">
<details class="collapse tab-edit rounded-[10px]" open>
<summary class=" collapse-title p-[10px] min-h-[30px] rounded-[10px] border-none bg-blue-700">
<div class="flex items-center justify-between">
<p class="text-white">Giao diện Website</p>
<i class="fa-solid fa-chevron-down text-white"></i>
</div>
</summary>
<div class="collapse-content text-sm">
<a href="/admin/template/set/default" class="py-[10px] block text-blue-700 font-bold">Quản
template</a>
</div>
</details>
</div>
<div class="bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)] mt-[10px]">
<details class="collapse tab-edit rounded-[10px]" open>
<summary class=" collapse-title p-[10px] min-h-[30px] rounded-[10px] border-none bg-blue-700">
<div class="flex items-center justify-between">
<p class="text-white">File .js & .css</p>
<i class="fa-solid fa-chevron-down text-white"></i>
</div>
</summary>
<div class="collapse-content text-sm">
<div class="item mt-[10px]">
<ul>
<li><a href="">style-pc.css</a></li>
<li><a href="">style-pc.css</a></li>
<li><a href="">style-pc.css</a></li>
</ul>
</div>
<a href="javascript:void(0)" onclick="add_template_form('script')"
class="py-[10px] text-blue-700 font-bold">Thêm
file .js, .css</a>
</div>
</details>
</div>
<div class="bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)] mt-[10px]">
<details class="collapse tab-edit rounded-[10px]" open>
<summary class=" collapse-title p-[10px] min-h-[30px] rounded-[10px] border-none bg-blue-700">
<div class="flex items-center justify-between">
<p class="text-white">Ảnh giao diện</p>
<i class="fa-solid fa-chevron-down text-white"></i>
</div>
</summary>
<div class="collapse-content text-sm">
<div class="item mt-[10px]">
<a href="/admin/ajax/upload_template_file.php?set=xstore"
class="py-[10px] text-blue-700 font-bold block">Thêm hoặc thay ảnh</a>
<a href="/admin/ajax/view_template_image.php?set=xstore"
class="py-[10px] text-blue-700 font-bold">Xem danh sách </a>
</div>
</div>
</details>
</div>
</div>
<div class="w-[850px] overflow-hidden">
<div class="bg-white rounded-[10px] shadow-[0px_1px_1px_0px_rgba(0,0,0,0.10)]">
<div class="flex items-center p-[20px_20px_0_20px]">
<h3 id="asset-title" class="text-lg mr-[10px] font-bold">about_us</h3>
<a href="javascript:show_older_version('about_us')"
class="border border-blue-700 rounded-[5px] p-[5px_10px] text-blue-700">Xem các bản
</a>
</div>
<div id="older_version" class="p-[20px_20px_0_20px] hidden"><b>Chọn xem phiên bản</b>
<select onchange="view_older_template('product_save',this.value)"
class="select select-bordered h-[40px] min-h-[40px]">
<option value="0">Chọn xem</option>
<option value="15">v15 - 08-10-2021, 4:45 pm - 0</option>
<option value="14">v14 - 08-10-2021, 4:44 pm - 0</option>
<option value="13">v13 - 08-10-2021, 4:44 pm - 0</option>
<option value="12">v12 - 08-10-2021, 4:44 pm - 0</option>
<option value="11">v11 - 08-10-2021, 4:40 pm - 0</option>
<option value="10">v10 - 08-10-2021, 4:40 pm - 0</option>
<option value="9">v9 - 08-10-2021, 4:40 pm - 0</option>
<option value="8">v8 - 08-10-2021, 4:39 pm - 0</option>
<option value="7">v7 - 08-10-2021, 4:39 pm - 0</option>
<option value="6">v6 - 08-10-2021, 4:39 pm - 0</option>
<option value="5">v5 - 08-10-2021, 4:38 pm - 0</option>
<option value="4">v4 - 08-10-2021, 4:38 pm - 0</option>
<option value="3">v3 - 08-10-2021, 4:37 pm - 0</option>
<option value="2">v2 - 08-10-2021, 4:37 pm - 0</option>
<option value="1">v1 - 08-10-2021, 4:37 pm - 0</option>
</select>
- Hoặc nhập phiên bản: <input type="text" size="5"
class="input input-bordered min-h-[40px] h-[40px] min-h-[35px]" value=""
id="js-select-version">
<input type="button" value="Xem" class="input input-bordered h-[40px] min-h-[40px]"
onclick="showTemplateVersion.call(this)" data-tpl="product_save">
</div>
<div class="p-[20px]">
<div id="tpl_editor" name="tpl_editor" style="width: 800px; height: 700px;">
<!-- Lưu code ở dây -->
</div>
<input
class="btn w-[95px] h-[35px] mt-[15px] min-h-[35px] bg-[#0041E8] rounded-[4px] mt-[10px] text-white cursor-pointer"
name="submit" type="submit" value="Lưu lại">
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -17,6 +17,7 @@
</head>
<body>
<div id="overlay" onclick="clickBackground()"></div>
<div class="admin-global-container">