Skip to content

Commit

Permalink
chore: code cleanup (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichi3227 authored May 24, 2024
1 parent aa867b4 commit 8da54c1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 37 deletions.
4 changes: 0 additions & 4 deletions src/handlers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@


class ApiHandler(RequestHandler):
@reqenv
async def get(self):
pass

@reqenv
async def post(self):
reqtype = str(self.get_argument('reqtype'))
Expand Down
4 changes: 0 additions & 4 deletions src/handlers/pro.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ async def get(self):
isadmin=self.acct.is_kernel(),
)

@reqenv
async def post(self):
pass


class ProStaticHandler(RequestHandler):
@reqenv
Expand Down
4 changes: 2 additions & 2 deletions src/static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ var index = new function() {

$(document).on('keypress', 'input', function(e) {
let idx;
var j_next;
let j_next;

if (e.which == 13) {
idx = parseInt($(this).attr('tabindex'));
Expand Down Expand Up @@ -172,7 +172,7 @@ var index = new function() {
};

$.fn.print = function(msg, succ) {
var j_e = this;
let j_e = this;

j_e.text(msg);

Expand Down
35 changes: 8 additions & 27 deletions src/static/templ/rank.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<script type="text/javascript">
function init() {

}
</script>
<body>
Expand All @@ -45,44 +45,25 @@ <h3>RankList of <a style="font-size:26px;" href="/oj/pro/{{pro_id}}/">{{pro_id}}
</thead>
<tbody>
{% set rank = 1 %}
{% set rank_display_class = "" %}
{% for chal in chal_list %}
{% if rank == 1 %}
<tr class="rank-gold">
<td>{{ rank }}</td>
<td><a href="/oj/chal/{{chal['chal_id']}}/">{{ chal['chal_id']}}</a></td>
<td><a href="/oj/acct/{{chal['acct_id']}}/">{{ chal['acct_name']}}</a></td>
<td>{{ chal['runtime'] }}</td>
<td>{{ round(chal['memory'] / 1024) }}</td>
<td>{{ chal['timestamp'].strftime('%Y-%m-%d %H:%M:%S') }}</td>
</tr>
{% set rank_display_class = "rank-gold" %}
{% elif rank == 2 %}
<tr class="rank-silver">
<td>{{ rank }}</td>
<td><a href="/oj/chal/{{chal['chal_id']}}/">{{ chal['chal_id']}}</a></td>
<td><a href="/oj/acct/{{chal['acct_id']}}/">{{ chal['acct_name']}}</a></td>
<td>{{ chal['runtime'] }}</td>
<td>{{ round(chal['memory'] / 1024) }}</td>
<td>{{ chal['timestamp'].strftime('%Y-%m-%d %H:%M:%S') }}</td>
</tr>
{% set rank_display_class = "rank-silver" %}
{% elif rank == 3 %}
<tr class="rank-copper">
<td>{{ rank }}</td>
<td><a href="/oj/chal/{{chal['chal_id']}}/">{{ chal['chal_id']}}</a></td>
<td><a href="/oj/acct/{{chal['acct_id']}}/">{{ chal['acct_name']}}</a></td>
<td>{{ chal['runtime'] }}</td>
<td>{{ round(chal['memory'] / 1024) }}</td>
<td>{{ chal['timestamp'].strftime('%Y-%m-%d %H:%M:%S') }}</td>
</tr>
{% set rank_display_class = "rank-copper" %}
{% else %}
<tr>
{% set rank_display_class = "" %}
{% end %}
<tr class="{{ rank_display_class }}">
<td>{{ rank }}</td>
<td><a href="/oj/chal/{{chal['chal_id']}}/">{{ chal['chal_id']}}</a></td>
<td><a href="/oj/acct/{{chal['acct_id']}}/">{{ chal['acct_name']}}</a></td>
<td>{{ chal['runtime'] }}</td>
<td>{{ round(chal['memory'] / 1024) }}</td>
<td>{{ chal['timestamp'].strftime('%Y-%m-%d %H:%M:%S') }}</td>
</tr>
{% end %}
{% set rank = rank + 1 %}
{% end %}
</tbody>
Expand Down

0 comments on commit 8da54c1

Please sign in to comment.