Browse Source

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

zry 8 years ago
parent
commit
15ad90c006
5 changed files with 66 additions and 2 deletions
  1. 1 1
      templates/leftmenu.html
  2. 48 0
      templates/vote/pw.plist.html
  3. 1 1
      templates/vote/vr.flist.html
  4. 1 0
      vote/urls.py
  5. 15 0
      vote/views.py

+ 1 - 1
templates/leftmenu.html

@@ -20,7 +20,7 @@
             </tr>
             <tr>
                 <td>
-                    <span class="glyphicon glyphicon-camera btn-xs"></span><a href="{% url 'changepasswordurl' %}">我的作品</a>
+                    <span class="glyphicon glyphicon-camera btn-xs"></span><a href="{% url 'mypwlist' %}">我的作品</a>
                 </td>
             </tr>
         </tbody></table>

+ 48 - 0
templates/vote/pw.plist.html

@@ -0,0 +1,48 @@
+{% extends "layout.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>
+<br />
+<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>
+<div>{% include "common/paginator.html" %}</div>
+{% endblock %}

+ 1 - 1
templates/vote/vr.flist.html

@@ -8,7 +8,7 @@
 {% if hadvoted %}
 <div class="panel panel-primary">
   <div class="panel-heading">
-    <h3 class="panel-title">我已投票的作品 - {{pwobj.title}}</h3>
+    <h3 class="panel-title">我已投票的作品 - {{vrobj.target.title}}</h3>
   </div>
     <table class="table table-striped">
       <tbody>

+ 1 - 0
vote/urls.py

@@ -15,6 +15,7 @@ urlpatterns = patterns('vote.views',
 
     url(r'^user/view/(?P<uuid>\w*-\w*-\w*-\w*-\w*)/$', 'ViewPhotoWorks', name='pwview'),
     url(r'^user/list/$', 'FrontListPhotoWorks', name='pwflist'),
+    url(r'^user/mypw/list/$', 'ListPersonalPW', name='mypwlist'),
     url(r'^user/vote/do/(?P<uuid>\w*-\w*-\w*-\w*-\w*)/$', 'VotePhotoWorks', name='votephoto'),
     url(r'^user/vote/view/$', 'PersonalVoteRec', name='vrflist'),
 

+ 15 - 0
vote/views.py

@@ -125,6 +125,21 @@ def ListTopPhotoWorks(request):
 
 	return render_to_response('vote/pw.toplist.html',kwvars,RequestContext(request))
 
+@login_required
+@PermissionVerify()
+def ListPersonalPW(request):
+	mList = PhotoWorks.objects.filter(author__user=request.user)
+
+	#分页功能
+	lst = SelfPaginator(request,mList, 20)
+
+	kwvars = {
+		'lPage':lst,
+		'request':request
+	}
+
+	return render_to_response('vote/pw.plist.html',kwvars,RequestContext(request))
+
 @login_required
 @PermissionVerify()
 def DeletePhotoWorks(request,ID):