Skip to content

Commit

Permalink
[查看历史工单]页,增加功能:当某个分页的数据条数< PAGE_LIMIT时,不显示后面的分页链接
Browse files Browse the repository at this point in the history
  • Loading branch information
liujing committed Apr 18, 2017
1 parent d9f4126 commit a932512
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sql/static/allWorkflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<li class="active">
<a href="/allworkflow/?pageNo={{pageNo|add:"0"}}&navStatus={{navStatus}}">{{pageNo|add:"1"}}</a>
</li>
{% if listWorkflow|length >= PAGE_LIMIT %}
<li>
<a href="/allworkflow/?pageNo={{pageNo|add:"1"}}&navStatus={{navStatus}}">{{pageNo|add:"2"}}</a>
</li>
Expand All @@ -117,6 +118,7 @@
<li>
<a href="/allworkflow/?pageNo={{pageNo|add:"1"}}&navStatus={{navStatus}}">后一页</a>
</li>
{% endif %}
</ul>
</div>
{% endblock content%}
4 changes: 2 additions & 2 deletions sql/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def authenticate(request):
#首页,也是查看所有SQL工单页面,具备翻页功能
def allworkflow(request):
#一个页面展示
PAGE_LIMIT = 12
PAGE_LIMIT = 2

pageNo = 0
navStatus = ''
Expand Down Expand Up @@ -118,7 +118,7 @@ def allworkflow(request):
return render(request, 'error.html', context)


context = {'currentMenu':'allworkflow', 'listWorkflow':listWorkflow, 'pageNo':pageNo, 'navStatus':navStatus}
context = {'currentMenu':'allworkflow', 'listWorkflow':listWorkflow, 'pageNo':pageNo, 'navStatus':navStatus, 'PAGE_LIMIT':PAGE_LIMIT}
return render(request, 'allWorkflow.html', context)

#提交SQL的页面
Expand Down

0 comments on commit a932512

Please sign in to comment.