Browse Source

Signed-off-by: zry <admin@z-touhou.org>

zry 8 years ago
parent
commit
4976656fd6
4 changed files with 65 additions and 3 deletions
  1. 3 3
      templates/sidebar.html
  2. 46 0
      templates/vote/pw.toplist.html
  3. 1 0
      vote/urls.py
  4. 15 0
      vote/views.py

+ 3 - 3
templates/sidebar.html

@@ -70,14 +70,14 @@
             </tr>
             <tr>
                 <td>
-                    <span class="glyphicon glyphicon-camera btn-xs"></span>
+                    <span class="glyphicon glyphicon-th-list btn-xs"></span>
                     <a href="{% url 'vrlist' %}">查看投票记录</a>
                 </td>
             </tr>
             <tr>
                 <td>
-                    <span class="glyphicon glyphicon-camera btn-xs"></span>
-                    <a href="{% url 'pwlist' %}">得票排行榜</a>
+                    <span class="glyphicon glyphicon-star btn-xs"></span>
+                    <a href="{% url 'pwtoplist' %}">得票排行榜</a>
                 </td>
             </tr>
             <tr>

+ 46 - 0
templates/vote/pw.toplist.html

@@ -0,0 +1,46 @@
+{% extends "base.html" %}
+
+{% block title %}
+    得票排行榜
+{% endblock %}
+
+{% block content %}
+<div class="section section-breadcrumbs section-breadcrumbs-backend">
+    <div class="container">
+        <div class="row">
+            <div class="col-md-12">
+                <h1>得票排行榜</h1>
+            </div>
+        </div>
+    </div>
+</div>
+
+<hr/>
+<div>{% include "common/paginator.html" %}</div>
+<table class="table table-hover table-striped  table-bordered table-condensed">
+    <tr>
+        <th>作品ID</th>
+        <th>标题</th>
+        <th>参赛者账号</th>
+        <th>参赛者姓名</th>
+        <th>导入批号</th>
+        <th>得票数</th>
+        <th>操作</th>
+    </tr>
+    {% for i in lPage %}
+    <tr style="font-size: 13px;">
+        <td>{{ i.uuid }}</td>
+        <td>{{ i.title }}</td>
+        <td>{{ i.author.user.username }}</td>
+        <td>{{ i.author.user.nickname  }}</td>
+        <td>{{ i.importid }}</td>
+        <td>{{ i.score }}</td>
+        <td class="host_buttom">
+            <a class="btn btn-warning btn-xs"  href={% url "pwview" i.uuid %} target="_blank">查看</a>
+        </td>
+    </tr>
+    {% endfor %}
+</table>
+
+<div>{% include "common/paginator.html" %}</div>
+{% endblock %}

+ 1 - 0
vote/urls.py

@@ -6,6 +6,7 @@ urlpatterns = patterns('vote.views',
     url(r'^admin/contestant/delete/id/(?P<ID>\d+)/$', 'DeleteContestant', name='ctdel'),
     url(r'^admin/photoworks/emptyxls/gen$', 'GenEmptyXLS', name='pwemptyxlsgen'),
     url(r'^admin/photoworks/list/$', 'ListPhotoWorks', name='pwlist'),
+    url(r'^admin/photoworks/toplist/$', 'ListTopPhotoWorks', name='pwtlist'),
     url(r'^admin/photoworks/delete/id/(?P<ID>\d+)/$', 'DeletePhotoWorks', name='pwdel'),
     url(r'^admin/photoworks/delete/ipid/(?P<ID>\d+)/$', 'RemovePW_ByIpid', name='pwipidrm'),
     url(r'^admin/photoworks/delete/veip/(?P<ID>\d+)/$', 'ExpPW_ByIpid', name='pwipidv'),

+ 15 - 0
vote/views.py

@@ -110,6 +110,21 @@ def ListPhotoWorks(request):
 
 	return render_to_response('vote/pw.list.html',kwvars,RequestContext(request))
 
+@login_required
+@PermissionVerify()
+def ListTopPhotoWorks(request):
+	mList = PhotoWorks.objects.all().by('-score')
+
+	#分页功能
+	lst = SelfPaginator(request,mList, 20)
+
+	kwvars = {
+		'lPage':lst,
+		'request':request
+	}
+
+	return render_to_response('vote/pw.toplist.html',kwvars,RequestContext(request))
+
 @login_required
 @PermissionVerify()
 def DeletePhotoWorks(request,ID):