Add submission time to applymsg.

This commit is contained in:
zhuyj17 2016-09-25 17:17:34 +08:00
parent af90488927
commit 8dfe21acd4
3 changed files with 9 additions and 3 deletions

View File

@ -247,12 +247,14 @@ class ApplyMsg(db.Model):
number = db.Column(db.Integer)
reason = db.Column(db.String(600))
status = db.Column(db.String(10))
time = db.Column(db.String(10))
def __init__(self,username, number, reason):
self.username = username
self.number = number
self.reason = reason
self.status = "Processing"
self.time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
def __repr__(self):
return "{\"id\":\"%d\", \"username\":\"%s\", \"number\": \"%d\", \"reason\":\"%s\", \"status\":\"%s\"}" % (self.id, self.username, self.number, self.reason, self.status)
return "{\"id\":\"%d\", \"username\":\"%s\", \"number\": \"%d\", \"reason\":\"%s\", \"status\":\"%s\", \"time\":\"%s\"}" % (self.id, self.username, self.number, self.reason, self.status, self.time)

View File

@ -35,7 +35,7 @@
</div>
<div class="box-body">
<p>
<button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#AddApplication"><i class="fa fa-plus"></i> Add Application</button>
<button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#AddApplication"><i class="fa fa-plus"></i> Apply For Beans</button>
</p>
<div class="modal inmodal" id="AddApplication" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
@ -74,6 +74,7 @@
<th>Application ID</th>
<th>Username</th>
<th>Number</th>
<th>Submission Time</th>
<th>Reason</th>
<th>Status</th>
</tr>
@ -83,7 +84,8 @@
<tr>
<td>{{ application.id }}</td>
<td>{{ application.username }}</td>
<td>{{ application.number }} beans</td>
<td>{{ application.number }} <img src='/static/img/bean.png'></td>
<td>{{ application.time }}</td>
<td>{{ application.reason }}</td>
<td>{{ application.status }}</td>
</tr>

View File

@ -227,6 +227,7 @@
<th>Application ID</th>
<th>Username</th>
<th>Number</th>
<th>Submission Time</th>
<th>Reason</th>
<th>Command</th>
</tr>
@ -237,6 +238,7 @@
<td>{{ application.id }}</td>
<td>{{ application.username }}</td>
<td>{{ application.number }} beans</td>
<td>{{ application.time }}</td>
<td>{{ application.reason }}</td>
<td><a class="btn btn-xs btn-info" href="/beans/admin/{{ application.id }}/agree/">Agree</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a class="btn btn-xs btn-danger" href="/beans/admin/{{ application.id }}/reject/">Reject</a></td>