Skip to content

Commit

Permalink
添加后台友情链接管理功能,增加审核、排序、隐藏功能
Browse files Browse the repository at this point in the history
  • Loading branch information
livisky committed Jan 23, 2017
1 parent 834595e commit 5f4ecf6
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 8 deletions.
5 changes: 3 additions & 2 deletions view/admin/inc/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<dd>
<ul>
<li><a _href="/admin/topic/index" data-title="社区管理" href="javascript:void(0)">主题列表</a></li>
<li><a _href="/admin/topictag/index" data-title="社区管理" href="javascript:void(0)">主题标签管理</a></li>
<li><a _href="/admin/topictag/index" data-title="社区管理" href="javascript:void(0)">标签管理</a></li>
</ul>
</dd>
</dl>
Expand All @@ -80,6 +80,7 @@
<dd>
<ul>
<li><a _href="/admin/links/index" data-title="用户管理" href="javascript:void(0)">申请列表</a></li>
<li><a _href="/admin/links/list" data-title="用户管理" href="javascript:void(0)">链接管理</a></li>
</ul>
</dd>
</dl>
Expand All @@ -103,4 +104,4 @@
</dd>
</dl>
</div>
</aside>
</aside>
6 changes: 5 additions & 1 deletion view/admin/links_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
<input type="checkbox" name="" value="">
</th>
<th width="80" class="sorting_desc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="descending" aria-label="ID: 升序排列" style="width: 80px;">ID</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 247px;">网址</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 247px;">网站名称</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 247px;">链接</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 247px;">logo</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 247px;">联系qq</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 100px;">是否通过</th>
<th class="sorting_disabled" rowspan="1" colspan="1" aria-label="操作" style="width: 120px;">操作</th>
</tr>
</thead>
Expand All @@ -31,7 +32,10 @@
<td>{{item.link}}</td>
<td>{{item.logo}}</td>
<td>{{item.qq}}</td>
<td>{{'通过' if item.flag=='1' else '未通过'}}</td>
<td class="f-14 td-manage">
{% if item.flag=="0" %}
<span class="label label-success radius toshow" tid="{{item.id}}" tval="0" style="cursor:pointer">通过</span> {%endif%}
<a style="text-decoration:none" class="ml-5 delete" del-id="{{item.id}}" title="删除"><i class="Hui-iconfont"></i></a>
</td>
</tr>
Expand Down
53 changes: 53 additions & 0 deletions view/admin/links_item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{% extends "../admin/inc/admin_base.html" %} {% block head %} {{ super() }} {% endblock %} {% block content %}
<form class="form form-horizontal" id="form-article-add">
<input type="hidden" value="" id="aid" />
<div class="row cl">
<input type="hidden" value="{{item.id}}" id="tid" />
<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>网站名称:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text domain" value="{{item.domain}}" placeholder="友情链接关键字" id="" name="">
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>链接:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text link" value="{{item.link}}" placeholder="请输入完整的地址,如:https://www.baidu.com" id="" name="">
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">logo:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text logo" value="{{item.logo}}" placeholder="logo为图片地址" id="" name="">
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">联系qq:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text qq" value="{{item.qq}}" placeholder="" id="" name="">
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">审核:</label>
<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
<select name="" class="select" id="tagselect">
<option value="1" selected>通过</option>
<option value="0">不通过</option>
</select>
</span> </div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">显示顺序:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text orders" value="{{item.orders}}" placeholder="请输入整数,默认为0" id="" name="">
</div>
</div>
<div class="row cl">
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
<button class="btn btn-secondary radius" id="savetag" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
<button onClick="window.location.href='/admin/{{action}}'" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
</div>
</div>
</form>
{% endblock %} {% block footer_other %}
<script type="text/javascript" src="/static/admin/js/admin/{{action}}.js"></script>
{% endblock %}
57 changes: 57 additions & 0 deletions view/admin/links_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{% extends "../admin/inc/admin_base.html" %} {% block head %} {{ super() }} {% endblock %} {% block content %}
<div class="cl pd-5 bg-1 bk-gray mt-20" style="margin-bottom: 15px;">
<span class="l">
<a class="btn btn-primary radius" data-title="添加链接" href="/admin/{{action}}/item">
<i class="Hui-iconfont"></i> 添加链接
</a>
<a href="javascript:;" onclick="delsome()" class="btn btn-danger radius">
<i class="Hui-iconfont"></i> 批量删除
</a>
</span>
<span class="r">共有数据:<strong>{{pageData.count}}</strong></span>
</div>
<div class="dataTables_wrapper no-footer">
<table class="table table-border table-bordered table-bg table-hover table-sort dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
<thead>
<tr class="text-c" role="row">
<th width="25" class="sorting_disabled" rowspan="1" colspan="1" aria-label="" style="width: 25px;">
<input type="checkbox" name="" value="">
</th>
<th width="80" class="sorting_desc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="descending" aria-label="ID: 升序排列" style="width: 80px;">ID</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 247px;">网站名称</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 347px;">链接</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 247px;">logo</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 147px;">联系qq</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 100px;">是否通过</th>
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="标题: 升序排列" style="width: 100px;">显示顺序</th>
<th class="sorting_disabled" rowspan="1" colspan="1" aria-label="操作" style="width: 120px;">操作</th>
</tr>
</thead>
<tbody>
{% for item in itemList %}
<tr class="text-c odd" role="row">
<td><input type="checkbox" value="{{item.id}}" name=""></td>
<td>{{item.id}}</td>
<td>{{item.domain}}</td>
<td>{{item.link}}</td>
<td>{{item.logo}}</td>
<td>{{item.qq}}</td>
<td>{{'通过' if item.flag=='1' else '未通过'}}</td>
<td>{{item.orders}}</td>
<td class="f-14 td-manage">
{% if item.flag=="1" %}
<span class="label label-defaunt radius tohide" tid="{{item.id}}" tval="0" style="cursor:pointer">隐藏</span> {%endif%}
<a style="text-decoration:none" class="ml-5 edit" href="/admin/links/item/{{item.id}}" title="编辑">
<i class="Hui-iconfont"></i>
</a>
<a style="text-decoration:none" class="ml-5 delete" del-id="{{item.id}}" title="删除"><i class="Hui-iconfont"></i></a>
</td>
</tr>
{%endfor%}
</tbody>
</table>
{% if pageData.count>10 %} {% include "../admin/inc/pagination.html" %} {%endif%}
</div>
{% endblock %} {% block footer_other %}
<script type="text/javascript" src="/static/admin/js/admin/{{action}}.js"></script>
{% endblock %}
5 changes: 0 additions & 5 deletions view/admin/system_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
<input type="text" class="input-text theme" value="{{sysdata.theme}}" placeholder="" id="" name="">
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>友情链接:</label>
<div class="formControls col-xs-8 col-sm-9">
<textarea class="form-control textarea links" name="link" rows="4" cols="50" placeholder="友情链接" style="width: 100%; height: 98px;resize:none">{{_web.links}}</textarea></div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>统计代码:</label>
<div class="formControls col-xs-8 col-sm-9">
Expand Down

0 comments on commit 5f4ecf6

Please sign in to comment.