Giải pháp chuyển đổi số trọn gói cho doanh nghiệp Việt

Tạo một layout cho list cars - Xây dựng giao diện backend của hệ thống quản lý admin.adayroi.online

Xây dựng giao diện backend của hệ thống quản lý admin.adayroi.online

← Toàn bộ tài liệu


Bước 13.1: Tạo một layout cho list cars

Bài 28/33 Xem dạng sách

Trong thư mục apps/ecommerce/views/cars

Tạo một folder có tên là tmpl

Sau đó tạo một file có tên là list.js

Nội dung file

 

<main role="main" class="view-cars-list col-md-9 col-md-offset-2 ml-sm-auto col-lg-12">
<div class="col-sm-12">
<h2>Cars</h2>
</div>

<div class="col-sm-12">
{{{htmltoobar}}}
<form action="/task" class="form-vertical" name="admin-form" id="admin-form" method="post"
data-toggle="validator">
<table class="list-cars table table-bordered">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Year</th>
<th>Image</th>
<th>Category</th>
<th>Status</th>
<th>Is feature</th>
<th>Note</th>
</tr>
</thead>
<tbody>
{{#each list_item}}
<tr>
<td>{{this._id}}</td>
<td><a href="/cars/form/{{this._id}}">{{this.name}}</a></td>
<td>{{this.year}}</td>
<td><img src="/{{this.image}}" style="width: 100px"></td>
<td>{{this.category}}</td>
<td>{{> (render_item_html_backend "yesno") value=this.status}}</td>
<td>{{> (render_item_html_backend "yesno") value=this.is_featured}}</td>
<td>{{this.note}}</td>
</tr>
{{/each}}
</tbody>
</table>
<input type="hidden" id="carsPerPage" value="{{carsPerPage}}">
<input type="hidden" id="pageNum" value="{{pageNum}}">
<input type="hidden" id="totalProductCount" value="{{totalProductCount}}">
<input type="hidden" id="paginateUrl" value="{{paginateUrl}}">
<div class="col-md-12">
<div id="pager" class="d-flex justify-content-center"></div>
</div>
</form>
</div>
</main>
<script>
jQuery(document).ready(function ($) {
$('.view-cars-list').view_cars_list({
});
});
</script>
















Sơ đồ quan hệ các bảng

Table Name: {{table.name}}
Num Name Type
{{field_index+1}}
{{field.name}} {{field.type}}

Hỏi đáp

Gửi với tên {{comment_full_name}}

Chưa có câu hỏi nào cho bài này.

Zalo 0936.006.058 Hotline 0936.006.058