{% extends "layout.html" %}

{% block title %}
    邵武一中新闻部摄影大赛-投票系统
{% endblock %}

{% block content %}
{% if hadvoted %}
<div class="panel panel-primary">
  <div class="panel-heading">
    <h3 class="panel-title">我已投票的作品 - {{vrobj.target.title}}</h3>
  </div>
    <table class="table table-striped">
      <tbody>
        <tr>
          <th>标题</th>
          <td>{{vrobj.target.title}}</td>
        </tr>
        <tr>
          <th>目前票数</th>
          <td>{{vrobj.target.score}}</td>
        </tr>
        <tr>
          <th>作品描述</th>
          <td>{{vrobj.target.desc}}</td>
        </tr>
        <tr>
          <th>投票理由</th>
          <td>
            {{vrobj.comment}}
          </td>
        </tr>
        <tr>
          <th>投票时间</th>
          <td>
            {{vrobj.time | date:"Y-m-d H:i:s"}}
          </td>
        </tr>
      </tbody>
    </table>

</div>
<div class="panel panel-primary">
  <div class="panel-heading">
    <h3 class="panel-title">查看作品</h3>
  </div>
  <div class="panel-body">
    <img class="img-responsive" src="{{pwurl}}{{vrobj.target.filename}}.{{vrobj.target.fileext}}" />
  </div>
</div>
{% else %}
<div class="jumbotron">
  <h1>您还未曾投过票</h1>
  <p>请前往欣赏作品并投票吧</p>
  <p><a class="btn btn-primary btn-lg" href="{% url 'pwflist' %}" role="button">前往&gt;&gt;</a></p>
</div>
{% endif %}
{% endblock %}