Browse Source

New UI for problem's uploader and publicizer

pull/6/head
Menci 7 years ago
parent
commit
83c496e03a
  1. 91
      views/problem.ejs

91
views/problem.ejs

@ -28,29 +28,50 @@ if (contest) {
<% } %>
</h1>
</div>
<div class="row" style="margin-top: -15px">
<span class="ui label">内存限制: <%= problem.memory_limit %> MiB</span>
<span class="ui label">时间限制: <%= problem.time_limit %> ms</span>
</div>
<div class="row" style="margin-top: -23px">
<% if (problem.file_io) { %>
<span class="ui label">输入文件: <%= problem.file_io_input_name %></span>
<span class="ui label">输出文件: <%= problem.file_io_output_name %></span>
<% } else { %>
<span class="ui label">标准输入输出</span>
<% } %>
</div>
<% if (contest) { %>
<div class="row" style="margin-top: -15px">
<span class="ui label">内存限制:<%= problem.memory_limit %> MiB</span>
<span class="ui label">时间限制:<%= problem.time_limit %> ms</span>
</div>
<div class="row" style="margin-top: -23px">
<% if (problem.file_io) { %>
<span class="ui label">输入文件:<%= problem.file_io_input_name %></span>
<span class="ui label">输出文件:<%= problem.file_io_output_name %></span>
<% } else { %>
<span class="ui label">标准输入输出</span>
<% } %>
</div>
<% } else { %>
<div class="row" style="margin-top: -15px">
<span class="ui label">内存限制:<%= problem.memory_limit %> MiB</span>
<span class="ui label">时间限制:<%= problem.time_limit %> ms</span>
<% if (problem.file_io) { %>
<span class="ui label">输入文件: <%= problem.file_io_input_name %></span>
<span class="ui label">输出文件: <%= problem.file_io_output_name %></span>
<% } else { %>
<span class="ui label">标准输入输出</span>
<% } %>
</div>
<div class="row" style="margin-top: -23px">
<span class="ui label">上传者:
<% if (problem.is_anonymous && !problem.allowedManage) { %>
匿名
<% } else { %>
<a href="<%= syzoj.utils.makeUrl(['user', problem.user_id]) %>"><%= problem.user.username %></a>
<% } %>
</span>
<% if (problem.allowedManage) { %>
<span class="ui label">公开者:
<% if (problem.publicizer) { %>
<a href="<%= syzoj.utils.makeUrl(['user', problem.publicizer_id]) %>"><%= problem.publicizer.username %></a>
<% } else { %>
未知
<% } %>
</span>
<% } %>
</div>
<% } %>
</div>
<!--<p>
<img style="vertical-align: middle;" src="//cn.gravatar.com/avatar/098be10e0980598d81978267ac70c1fd?s=64&amp;d=mm" width="32" height="32">
<a href="/user/1">Menci</a>
上传
,由
<img style="vertical-align: middle;" src="//cn.gravatar.com/avatar/7d3767f80c1d98af3197062a55d1a6ee?s=64&amp;d=mm" width="32" height="32">
<a href="/user/1">samzhang</a>
公开
</p>-->
<div class="ui grid">
<div class="row">
<div class="column">
@ -84,30 +105,6 @@ if (contest) {
<% } %>
<% } %>
</div>
<div class="ui large labels" style="float: right; vertical-align: middle">
<div class="ui basic image label" style="font-size: 1.1em; margin-right: 0.3em;">
<% if (problem.is_anonymous && !problem.allowedManage) { %>
<img src="<%= syzoj.utils.gravatar('', 64) %>">
<a>匿名用户</a>
<% } else { %>
<img src="<%= syzoj.utils.gravatar(problem.user.email, 64) %>">
<a href="<%= syzoj.utils.makeUrl(['user', problem.user_id]) %>"><%= problem.user.username %></a>
<% } %>
<div class="detail">上传</div>
</div>
<% if (problem.is_public) { %>
<div class="ui basic image label" style="font-size: 1.1em; margin-right: <% if (problem.allowedEdit || problem.allowedManage) { %>0.3em<% } else { %>0<% } %>;">
<% if (problem.publicizer) { %>
<img src="<%= syzoj.utils.gravatar(problem.publicizer.email, 64) %>">
<a href="<%= syzoj.utils.makeUrl(['user', problem.publicizer_id]) %>"><%= problem.publicizer.username %></a>
<% } else { %>
<img src="<%= syzoj.utils.gravatar('', 64) %>">
<a>LibreOJ 管理员</a>
<% } %>
<div class="detail">公开</div>
</div>
<% } %>
</div>
<% } %>
</div>
</div>
@ -215,7 +212,7 @@ if (contest) {
</div>
</div>
<div class="ui center aligned vertical segment" style="padding-bottom: 0; "><button type="submit" class="ui button">提交</button></div>
</form>
</form>
</div>
</div>
<% } %>

Loading…
Cancel
Save