python学习
This commit is contained in:
@@ -104,6 +104,10 @@
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="hidden hidden_layout_wrap">
|
||||
<input name="domain" value="{{ config.APP.domain }}">
|
||||
<input name="prefix_url" value="{{ config.UPLOAD.prefix_url }}">
|
||||
</div>
|
||||
|
||||
<script src="{{ buildStaticUrl('/plugins/jquery-2.1.1.js') }}"></script>
|
||||
<script src="{{ buildStaticUrl('/bootstrap/bootstrap.min.js') }}"></script>
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
{% extends "common/layout_main.html" %}
|
||||
{% block content %}
|
||||
<div class="row border-bottom">
|
||||
<div class="col-lg-12">
|
||||
<div class="tab_title">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="current">
|
||||
<a href="{{ buildUrl('/food/index') }}">美食列表</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ buildUrl('/food/cat') }}">分类列表</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include "common/tab_food.html" %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<form class="form-inline wrap_search">
|
||||
@@ -21,19 +8,23 @@
|
||||
<div class="form-group">
|
||||
<select name="status" class="form-control inline">
|
||||
<option value="-1">请选择状态</option>
|
||||
<option value="1">正常</option>
|
||||
<option value="0">已删除</option>
|
||||
{% for tmp_key in status_mapping %}
|
||||
<option value="{{ tmp_key }}" {% if tmp_key == search_con['status'] %} selected {% endif %}>{{ status_mapping[ tmp_key ] }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select name="cat_id" class="form-control inline">
|
||||
<option value="0">请选择分类</option>
|
||||
<option value="1">111</option>
|
||||
{% for tmp_key in cat_mapping %}
|
||||
<option value="{{ tmp_key }}" {% if tmp_key|string == search_con['cat_id'] %} selected {% endif %} >{{ cat_mapping[ tmp_key].name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<input type="text" name="mix_kw" placeholder="请输入关键字" class="form-control" value="">
|
||||
<input type="text" name="mix_kw" placeholder="请输入关键字" class="form-control" value="{{ search_con['mix_kw'] }}">
|
||||
<input type="hidden" name="p" value="{{ search_con['p'] }}">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-primary search">
|
||||
<i class="fa fa-search"></i>搜索
|
||||
@@ -64,35 +55,44 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if list %}
|
||||
{% for item in list %}
|
||||
<tr>
|
||||
<td>小鸡炖蘑菇</td>
|
||||
<td>东北菜</td>
|
||||
<td>0.02</td>
|
||||
<td>27</td>
|
||||
<td>好吃</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ cat_mapping[ item.cat_id].name }}</td>
|
||||
<td>{{ item.price }}</td>
|
||||
<td>{{ item.stock }}</td>
|
||||
<td>{{ item.tags }}</td>
|
||||
<td>
|
||||
<a href="{{ buildUrl('/food/info') }}">
|
||||
<a href="{{ buildUrl('/food/info') }}?id={{ item.id }}">
|
||||
<i class="fa fa-eye fa-lg"></i>
|
||||
</a>
|
||||
<a class="m-l" href="{{ buildUrl('/food/set') }}">
|
||||
{% if item.status == 1 %}
|
||||
<a class="m-l" href="{{ buildUrl('/food/set') }}?id={{ item.id }}">
|
||||
<i class="fa fa-edit fa-lg"></i>
|
||||
</a>
|
||||
|
||||
<a class="m-l remove" href="javascript:void(0);" data="3">
|
||||
<a class="m-l remove" href="javascript:void(0);" data="{{ item.id }}">
|
||||
<i class="fa fa-trash fa-lg"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a class="m-l recover" href="javascript:void(0);" data="{{ item.id }}">
|
||||
<i class="fa fa-rotate-left fa-lg"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr><td colspan="6">暂无数据~~</td></tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<span class="pagination_count" style="line-height: 40px;">共1条记录 | 每页50条</span>
|
||||
<ul class="pagination pagination-lg pull-right" style="margin: 0 0 ;">
|
||||
<li class="active"><a href="javascript:void(0);">1</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--分页代码已被封装到统一模板文件中-->
|
||||
{% include 'common/pagenation.html' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
<script src="{{ buildStaticUrl('/js/food/index.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
{% extends "common/layout_main.html" %}
|
||||
{% block content %}
|
||||
<div class="row border-bottom">
|
||||
<div class="col-lg-12">
|
||||
<div class="tab_title">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="current">
|
||||
<a href="{{ buildUrl('/food/index') }}">美食列表</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ buildUrl('/food/cat') }}">分类列表</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include "common/tab_food.html" %}
|
||||
<div class="row mg-t20 wrap_food_set" style="">
|
||||
<div class="col-lg-12" style="">
|
||||
<h2 class="text-center">设置</h2>
|
||||
@@ -24,7 +11,9 @@
|
||||
<select name="cat_id" class="form-control select2-hidden-accessible" tabindex="-1"
|
||||
aria-hidden="true">
|
||||
<option value="0">请选择分类</option>
|
||||
<option value="8">111</option>
|
||||
{% for item in cat_list %}
|
||||
<option value="{{ item.id }}" {% if item.id == info.cat_id %} selected {% endif %}>{{ item.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,14 +21,14 @@
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">名称:</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" placeholder="请输入名称" name="name" value="">
|
||||
<input type="text" class="form-control" placeholder="请输入名称" name="name" value="{{ info.name }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">价格:</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" placeholder="请输入售价" name="price" value="">
|
||||
<input type="text" class="form-control" placeholder="请输入售价" name="price" value="{{ info.price }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
@@ -51,6 +40,12 @@
|
||||
<i class="fa fa-upload fa-2x"></i>
|
||||
<input type="file" name="pic" accept="image/png, image/jpeg, image/jpg,image/gif">
|
||||
</div>
|
||||
{% if info and info.main_image %}
|
||||
<span class="pic-each">
|
||||
<img src="{{ buildImageUrl( info.main_image ) }}"/>
|
||||
<span class="fa fa-times-circle del del_image" data="{{ info.main_image }}"></span>
|
||||
</span>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,32 +53,50 @@
|
||||
<div class="form-group" style="">
|
||||
<label class="col-lg-2 control-label">描述:</label>
|
||||
<div class="col-lg-10">
|
||||
<textarea id="editor" name="summary" style="height: 300px;"></textarea>
|
||||
<textarea id="editor" name="summary" style="height: 300px;">{{ info.summary }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">库存:</label>
|
||||
<div class="col-lg-2">
|
||||
<input type="text" name="stock" class="form-control" value="1">
|
||||
<input type="text" name="stock" class="form-control" value="{{ info.stock }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">标签:</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="tags" value="">
|
||||
<input type="text" class="form-control" name="tags" value="{{ info.tags }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-4 col-lg-offset-2">
|
||||
<input type="hidden" name="id" value="0">
|
||||
<input type="hidden" name="id" value="{{ info.id }}">
|
||||
<button class="btn btn-w-m btn-outline btn-primary save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<iframe name="upload_file" class="hide"></iframe>
|
||||
{% endblock %}
|
||||
{% block css %}
|
||||
<link href="{{ buildStaticUrl( '/plugins/select2/select2.min.css' ) }}" rel="stylesheet">
|
||||
<link href="{{ buildStaticUrl( '/plugins/tagsinput/jquery.tagsinput.min.css' ) }}" rel="stylesheet">
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
<script src="{{ buildStaticUrl( '/plugins/ueditor/ueditor.config.js' ) }}"></script>
|
||||
<script src="{{ buildStaticUrl( '/plugins/ueditor/ueditor.all.min.js' ) }}"></script>
|
||||
<script src="{{ buildStaticUrl( '/plugins/ueditor/lang/zh-cn/zh-cn.js' ) }}"></script>
|
||||
|
||||
<script src="{{ buildStaticUrl( '/plugins/select2/select2.pinyin.js' ) }}"></script>
|
||||
<script src="{{ buildStaticUrl( '/plugins/select2/zh-CN.js' ) }}"></script>
|
||||
<script src="{{ buildStaticUrl( '/plugins/select2/pinyin.core.js' ) }}"></script>
|
||||
|
||||
<script src="{{ buildStaticUrl( '/plugins/tagsinput/jquery.tagsinput.min.js' ) }}"></script>
|
||||
|
||||
|
||||
<script src="{{ buildStaticUrl( '/js/food/set.js' ) }}"></script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user