mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-26 23:07:24 +00:00
bugs
This commit is contained in:
parent
75f06f9b62
commit
fd490bd685
@ -11,6 +11,7 @@ urlpatterns = patterns('',
|
|||||||
url(r"^(\d+.\d+.\d+.\d+)/$", jlist_ip),
|
url(r"^(\d+.\d+.\d+.\d+)/$", jlist_ip),
|
||||||
url(r'^idc_add/$', add_idc),
|
url(r'^idc_add/$', add_idc),
|
||||||
url(r'^idc_list/$', list_idc),
|
url(r'^idc_list/$', list_idc),
|
||||||
|
url(r'^idc_edit/$', edit_idc),
|
||||||
url(r'^idc_detail/$', detail_idc),
|
url(r'^idc_detail/$', detail_idc),
|
||||||
url(r'^idc_del/(\w+)/$', del_idc),
|
url(r'^idc_del/(\w+)/$', del_idc),
|
||||||
url(r'^jgroup_add/$', add_group),
|
url(r'^jgroup_add/$', add_group),
|
||||||
|
@ -143,6 +143,14 @@ def batch_host_edit(request):
|
|||||||
def list_host(request):
|
def list_host(request):
|
||||||
header_title, path1, path2 = u'查看主机', u'资产管理', u'查看主机'
|
header_title, path1, path2 = u'查看主机', u'资产管理', u'查看主机'
|
||||||
login_types = {'L': 'LDAP', 'S': 'SSH_KEY', 'P': 'PASSWORD', 'M': 'MAP'}
|
login_types = {'L': 'LDAP', 'S': 'SSH_KEY', 'P': 'PASSWORD', 'M': 'MAP'}
|
||||||
|
keyword = request.GET.get('keyword', '')
|
||||||
|
if keyword:
|
||||||
|
posts = Asset.objects.filter(Q(ip__contains=keyword) | Q(idc__name__contains=keyword) |
|
||||||
|
Q(bis_group__name__contains=keyword) | Q(comment__contains=keyword)).distinct().order_by('ip')
|
||||||
|
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
|
||||||
|
|
||||||
|
return render_to_response('jasset/host_list.html', locals(), context_instance=RequestContext(request))
|
||||||
|
else:
|
||||||
posts = Asset.objects.all().order_by('ip')
|
posts = Asset.objects.all().order_by('ip')
|
||||||
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
|
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
|
||||||
|
|
||||||
@ -250,6 +258,34 @@ def list_idc(request):
|
|||||||
return render_to_response('jasset/idc_list.html', locals(), context_instance=RequestContext(request))
|
return render_to_response('jasset/idc_list.html', locals(), context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
|
def edit_idc(request):
|
||||||
|
header_title, path1, path2 = u'编辑IDC', u'资产管理', u'编辑IDC'
|
||||||
|
edit = 1
|
||||||
|
idc_id = request.GET.get('id')
|
||||||
|
j_idc = IDC.objects.get(id=idc_id)
|
||||||
|
default = IDC.objects.get(name='默认').asset_set.all()
|
||||||
|
eposts = contact_list = Asset.objects.filter(idc=j_idc).order_by('ip')
|
||||||
|
posts = [g for g in default if g not in eposts]
|
||||||
|
if request.method == 'POST':
|
||||||
|
j_group = request.POST.get('j_idc')
|
||||||
|
j_hosts = request.POST.getlist('j_hosts')
|
||||||
|
j_comment = request.POST.get('j_comment')
|
||||||
|
idc_default = request.POST.getlist('idc_default')
|
||||||
|
|
||||||
|
for host in j_hosts:
|
||||||
|
g = Asset.objects.get(id=host)
|
||||||
|
Asset.objects.filter(id=host).update(idc=j_idc)
|
||||||
|
|
||||||
|
for host in idc_default:
|
||||||
|
g = Asset.objects.get(id=host)
|
||||||
|
i = IDC.objects.get(name='默认')
|
||||||
|
Asset.objects.filter(id=host).update(idc=i)
|
||||||
|
|
||||||
|
return HttpResponseRedirect('/jasset/idc_detail/?id=%s' % idc_id)
|
||||||
|
|
||||||
|
return render_to_response('jasset/idc_add.html', locals(), context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
def del_idc(request, offset):
|
def del_idc(request, offset):
|
||||||
if offset == 'multi':
|
if offset == 'multi':
|
||||||
len_list = request.POST.get("len_list")
|
len_list = request.POST.get("len_list")
|
||||||
@ -374,8 +410,6 @@ def group_del(request, offset):
|
|||||||
return HttpResponseRedirect('/jasset/jgroup_list/')
|
return HttpResponseRedirect('/jasset/jgroup_list/')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def host_search(request):
|
def host_search(request):
|
||||||
keyword = request.GET.get('keyword')
|
keyword = request.GET.get('keyword')
|
||||||
login_types = {'L': 'LDAP', 'S': 'SSH_KEY', 'P': 'PASSWORD', 'M': 'MAP'}
|
login_types = {'L': 'LDAP', 'S': 'SSH_KEY', 'P': 'PASSWORD', 'M': 'MAP'}
|
||||||
|
@ -18,6 +18,7 @@ CONF.read('%s/jumpserver.conf' % BASE_DIR)
|
|||||||
|
|
||||||
def log_list_online(request):
|
def log_list_online(request):
|
||||||
header_title, path1, path2 = u'查看日志', u'查看日志', u'在线用户'
|
header_title, path1, path2 = u'查看日志', u'查看日志', u'在线用户'
|
||||||
|
keyword = request.GET.get('keyword')
|
||||||
web_socket_host = CONF.get('websocket', 'web_socket_host')
|
web_socket_host = CONF.get('websocket', 'web_socket_host')
|
||||||
posts = Log.objects.filter(is_finished=0).order_by('-start_time')
|
posts = Log.objects.filter(is_finished=0).order_by('-start_time')
|
||||||
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
|
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
|
||||||
@ -27,6 +28,7 @@ def log_list_online(request):
|
|||||||
|
|
||||||
def log_list_offline(request):
|
def log_list_offline(request):
|
||||||
header_title, path1, path2 = u'查看日志', u'查看日志', u'历史记录'
|
header_title, path1, path2 = u'查看日志', u'查看日志', u'历史记录'
|
||||||
|
keyword = request.GET.get('keyword')
|
||||||
web_socket_host = CONF.get('websocket', 'web_socket_host')
|
web_socket_host = CONF.get('websocket', 'web_socket_host')
|
||||||
posts = Log.objects.filter(is_finished=1).order_by('-start_time')
|
posts = Log.objects.filter(is_finished=1).order_by('-start_time')
|
||||||
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
|
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
|
||||||
|
@ -45,7 +45,7 @@ def getDaysByNum(num):
|
|||||||
for i in range(0, num):
|
for i in range(0, num):
|
||||||
today = today-oneday
|
today = today-oneday
|
||||||
li_date.append(today)
|
li_date.append(today)
|
||||||
li_str.append(str(today)[0:10])
|
li_str.append(str(today)[5:10])
|
||||||
li_date.reverse()
|
li_date.reverse()
|
||||||
li_str.reverse()
|
li_str.reverse()
|
||||||
t = (li_date, li_str)
|
t = (li_date, li_str)
|
||||||
@ -103,8 +103,6 @@ def index(request):
|
|||||||
return render_to_response('index.html', locals(), context_instance=RequestContext(request))
|
return render_to_response('index.html', locals(), context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def skin_config(request):
|
def skin_config(request):
|
||||||
return render_to_response('skin_config.html')
|
return render_to_response('skin_config.html')
|
||||||
|
|
||||||
|
@ -58,12 +58,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="top10" style="width:100%;height:400px;"></div>
|
<div class="row">
|
||||||
<div id="usertop10" style="width:100%;height:400px;margin-top:170px"></div>
|
<div class="col-lg-6" id="top10" style="width:50%;height:400px;"></div>
|
||||||
<br/>
|
<div class="col-lg-6" id="usertop10" style="width:50%;height:400px;"></div>
|
||||||
<div id="hosttop10" style="width:100%;height:400px;"></div>
|
</div>
|
||||||
<br/>
|
<div class="row">
|
||||||
<div id="dynamic" style="width:100%;height:400px;"></div>
|
<div class="col-lg-6" id="hosttop10" style="width:50%;height:400px; margin-top: 20px"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -71,8 +72,11 @@
|
|||||||
var cate = {{ li_str|safe }};
|
var cate = {{ li_str|safe }};
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#top10').highcharts({
|
$('#top10').highcharts({
|
||||||
|
chart: {
|
||||||
|
type: 'column'
|
||||||
|
},
|
||||||
title: {
|
title: {
|
||||||
text: '数据总览',
|
text: '一周数据总览',
|
||||||
x: -20 //center
|
x: -20 //center
|
||||||
},
|
},
|
||||||
subtitle: {
|
subtitle: {
|
||||||
@ -101,12 +105,6 @@ $(function () {
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
valueSuffix: '次'
|
valueSuffix: '次'
|
||||||
},
|
},
|
||||||
legend: {
|
|
||||||
layout: 'vertical',
|
|
||||||
align: 'right',
|
|
||||||
verticalAlign: 'middle',
|
|
||||||
borderWidth: 0
|
|
||||||
},
|
|
||||||
navigation: {
|
navigation: {
|
||||||
buttonOptions: {
|
buttonOptions: {
|
||||||
align: 'right'
|
align: 'right'
|
||||||
@ -149,12 +147,6 @@ $(function () {
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
valueSuffix: '次'
|
valueSuffix: '次'
|
||||||
},
|
},
|
||||||
legend: {
|
|
||||||
layout: 'vertical',
|
|
||||||
align: 'right',
|
|
||||||
verticalAlign: 'middle',
|
|
||||||
borderWidth: 0
|
|
||||||
},
|
|
||||||
series: [
|
series: [
|
||||||
{% for k,v in user_dic.items %}
|
{% for k,v in user_dic.items %}
|
||||||
{
|
{
|
||||||
@ -192,12 +184,6 @@ $(function () {
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
valueSuffix: '次'
|
valueSuffix: '次'
|
||||||
},
|
},
|
||||||
legend: {
|
|
||||||
layout: 'vertical',
|
|
||||||
align: 'right',
|
|
||||||
verticalAlign: 'middle',
|
|
||||||
borderWidth: 0
|
|
||||||
},
|
|
||||||
series: [
|
series: [
|
||||||
{% for k,v in host_dic.items %}
|
{% for k,v in host_dic.items %}
|
||||||
{
|
{
|
||||||
@ -227,7 +213,7 @@ $(function () {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
setInterval(update, 1000); //5秒钟执行一次
|
setInterval(update, 5000); //5秒钟执行一次
|
||||||
update();
|
update();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -88,6 +88,9 @@
|
|||||||
<a href="#">Previous</a>
|
<a href="#">Previous</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% ifequal show_first 1 %}
|
||||||
|
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?id={{ group_id }}&page=1" title="第1页">1...</a></li>
|
||||||
|
{% endifequal %}
|
||||||
{% for page in page_range %}
|
{% for page in page_range %}
|
||||||
{% ifequal current_page page %}
|
{% ifequal current_page page %}
|
||||||
<li class="paginate_button active" aria-controls="editable" tabindex="0"><a href="?id={{ group_id }}&page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
<li class="paginate_button active" aria-controls="editable" tabindex="0"><a href="?id={{ group_id }}&page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
||||||
@ -95,6 +98,9 @@
|
|||||||
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?id={{ group_id }}&page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?id={{ group_id }}&page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% ifequal show_end 1 %}
|
||||||
|
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?id={{ group_id }}&page={{ p.num_pages }}" title="第{{ page }}页">...{{ p.num_pages }}</a></li>
|
||||||
|
{% endifequal %}
|
||||||
{% if contacts.has_next %}
|
{% if contacts.has_next %}
|
||||||
<li class="paginate_button next" aria-controls="editable" tabindex="0" id="editable_next">
|
<li class="paginate_button next" aria-controls="editable" tabindex="0" id="editable_next">
|
||||||
<a href="?id={{ group_id }}&page={{ contacts.next_page_number }}">Next</a>
|
<a href="?id={{ group_id }}&page={{ contacts.next_page_number }}">Next</a>
|
||||||
|
@ -40,7 +40,45 @@
|
|||||||
<input type="button" id="del_button" class="btn btn-danger btn-sm" name="del_button" value="删除" onclick="del('contents_form')" />
|
<input type="button" id="del_button" class="btn btn-danger btn-sm" name="del_button" value="删除" onclick="del('contents_form')" />
|
||||||
<input type="button" id="alter_button" class="btn btn-warning btn-sm" name="alter_button" value="修改" onclick="alter('contents_form')" />
|
<input type="button" id="alter_button" class="btn btn-warning btn-sm" name="alter_button" value="修改" onclick="alter('contents_form')" />
|
||||||
</div>
|
</div>
|
||||||
{% include 'paginator.html' %}
|
<div class="col-sm-6">
|
||||||
|
<div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
|
||||||
|
<ul class="pagination" style="margin-top: 0; float: right">
|
||||||
|
|
||||||
|
{% if contacts.has_previous %}
|
||||||
|
<li class="paginate_button previous" aria-controls="editable" tabindex="0" id="editable_previous">
|
||||||
|
<a href="?page={{ contacts.previous_page_number }}">Previous</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="paginate_button previous disabled" aria-controls="editable" tabindex="0" id="editable_previous">
|
||||||
|
<a href="#">Previous</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% ifequal show_first 1 %}
|
||||||
|
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?page=1" title="第1页">1...</a></li>
|
||||||
|
{% endifequal %}
|
||||||
|
{% for page in page_range %}
|
||||||
|
{% ifequal current_page page %}
|
||||||
|
<li class="paginate_button active" aria-controls="editable" tabindex="0"><a href="?keyword={{ keyword }}&page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
||||||
|
{% else %}
|
||||||
|
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?keyword={{ keyword }}&page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
||||||
|
{% endifequal %}
|
||||||
|
{% endfor %}
|
||||||
|
{% ifequal show_end 1 %}
|
||||||
|
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?page={{ p.num_pages }}" title="第{{ page }}页">...{{ p.num_pages }}</a></li>
|
||||||
|
{% endifequal %}
|
||||||
|
{% if contacts.has_next %}
|
||||||
|
<li class="paginate_button next" aria-controls="editable" tabindex="0" id="editable_next">
|
||||||
|
<a href="?page={{ contacts.next_page_number }}">Next</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="paginate_button next disabled" aria-controls="editable" tabindex="0" id="editable_next">
|
||||||
|
<a href="#">Next</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -35,14 +35,43 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<form id="assetForm" method="post" class="form-horizontal">
|
<form id="assetForm" method="post" class="form-horizontal">
|
||||||
<div class="form-group"><label class="col-sm-2 control-label"> IDC名 </label>
|
<div class="form-group"><label class="col-sm-2 control-label"> IDC名 </label>
|
||||||
<div class="col-sm-8"><input type="text" value="{{ j_ip }}" placeholder="北京联通" name="j_idc" class="form-control"></div>
|
<div class="col-sm-8"><input type="text" value="{{ j_idc.name }}" placeholder="北京联通" name="j_idc" class="form-control"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<div class="form-group"><label class="col-sm-2 control-label"> 备注 </label>
|
<div class="form-group"><label class="col-sm-2 control-label"> 备注 </label>
|
||||||
<div class="col-sm-8"><input type="text" value="{{ s_port }}" placeholder="核心联通机房" name="j_comment" class="form-control"></div>
|
<div class="col-sm-8"><input type="text" value="{{ j_idc.comment }}" placeholder="核心联通机房" name="j_comment" class="form-control"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if edit %}
|
||||||
|
<div class="hr-line-dashed"></div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="groups" class="col-lg-2 control-label">主机</label>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<select id="groups" name="idc_default" size="12" class="form-control m-b" multiple>
|
||||||
|
{% for post in posts %}
|
||||||
|
<option value="{{ post.id }}">{{ post.ip }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1">
|
||||||
|
<div class="btn-group" style="margin-top: 50px;">
|
||||||
|
<button type="button" class="btn btn-white" onclick="move('groups', 'groups_selected')"><i class="fa fa-chevron-right"></i></button>
|
||||||
|
<button type="button" class="btn btn-white" onclick="move_left('groups_selected', 'groups')"><i class="fa fa-chevron-left"></i> </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<div>
|
||||||
|
<select id="groups_selected" name="j_hosts" class="form-control m-b" size="12" multiple>
|
||||||
|
{% for post in eposts %}
|
||||||
|
<option value="{{ post.id }}">{{ post.ip }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-4 col-sm-offset-5">
|
<div class="col-sm-4 col-sm-offset-5">
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
<td class="text-center"> {{ post.comment }} </td>
|
<td class="text-center"> {{ post.comment }} </td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a href="/jasset/idc_detail/?id={{ post.id }}" class="iframe btn btn-xs btn-primary">详情</a>
|
<a href="/jasset/idc_detail/?id={{ post.id }}" class="iframe btn btn-xs btn-primary">详情</a>
|
||||||
|
<a href="/jasset/idc_edit/?id={{ post.id }}" class="btn btn-xs btn-info">编辑</a>
|
||||||
<a href="/jasset/idc_del/{{ post.id }}" class="btn btn-xs btn-danger">删除</a>
|
<a href="/jasset/idc_del/{{ post.id }}" class="btn btn-xs btn-danger">删除</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -97,8 +97,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6"></div>
|
||||||
</div>
|
|
||||||
{% include 'paginator.html' %}
|
{% include 'paginator.html' %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,25 +23,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6 col-sm-offset-6">
|
<div class="col-sm-6 "></div>
|
||||||
<div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
|
{% include 'paginator.html' %}
|
||||||
<ul class="pagination" style="margin-top: 0; float: right">
|
|
||||||
|
|
||||||
{% if contacts.has_previous %}
|
|
||||||
<li><a href="?page={{ contacts.previous_page_number }}">«</a></li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% for page in p.page_range %}
|
|
||||||
{% ifequal offset1 page %}
|
|
||||||
<li class="active"><a href="?page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
|
||||||
{% else %}
|
|
||||||
<li><a href="?page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
|
||||||
{% endifequal %}
|
|
||||||
{% endfor %}
|
|
||||||
{% if contacts.has_next %}
|
|
||||||
<li><a href="?page={{ contacts.next_page_number }}">»</a></li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -1,7 +1,40 @@
|
|||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
|
<div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
|
||||||
<ul class="pagination" style="margin-top: 0; float: right">
|
<ul class="pagination" style="margin-top: 0; float: right">
|
||||||
|
{% if keyword %}
|
||||||
|
{% if contacts.has_previous %}
|
||||||
|
<li class="paginate_button previous" aria-controls="editable" tabindex="0" id="editable_previous">
|
||||||
|
<a href="?keyword={{ keyword }}&page={{ contacts.previous_page_number }}">Previous</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="paginate_button previous disabled" aria-controls="editable" tabindex="0" id="editable_previous">
|
||||||
|
<a href="#">Previous</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% ifequal show_first 1 %}
|
||||||
|
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?keyword={{ keyword }}&ppage=1" title="第1页">1...</a></li>
|
||||||
|
{% endifequal %}
|
||||||
|
{% for page in page_range %}
|
||||||
|
{% ifequal current_page page %}
|
||||||
|
<li class="paginate_button active" aria-controls="editable" tabindex="0"><a href="?keyword={{ keyword }}&page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
||||||
|
{% else %}
|
||||||
|
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?keyword={{ keyword }}&page={{ page }}" title="第{{ page }}页">{{ page }}</a></li>
|
||||||
|
{% endifequal %}
|
||||||
|
{% endfor %}
|
||||||
|
{% ifequal show_end 1 %}
|
||||||
|
<li class="paginate_button" aria-controls="editable" tabindex="0"><a href="?keyword={{ keyword }}&page={{ p.num_pages }}" title="第{{ page }}页">...{{ p.num_pages }}</a></li>
|
||||||
|
{% endifequal %}
|
||||||
|
{% if contacts.has_next %}
|
||||||
|
<li class="paginate_button next" aria-controls="editable" tabindex="0" id="editable_next">
|
||||||
|
<a href="?keyword={{ keyword }}&page={{ contacts.next_page_number }}">Next</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="paginate_button next disabled" aria-controls="editable" tabindex="0" id="editable_next">
|
||||||
|
<a href="#">Next</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
{% if contacts.has_previous %}
|
{% if contacts.has_previous %}
|
||||||
<li class="paginate_button previous" aria-controls="editable" tabindex="0" id="editable_previous">
|
<li class="paginate_button previous" aria-controls="editable" tabindex="0" id="editable_previous">
|
||||||
<a href="?page={{ contacts.previous_page_number }}">Previous</a>
|
<a href="?page={{ contacts.previous_page_number }}">Previous</a>
|
||||||
@ -33,6 +66,7 @@
|
|||||||
<a href="#">Next</a>
|
<a href="#">Next</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user