Browse Source

Sort tags by color

pull/6/head
Menci 8 years ago
parent
commit
23be54a4bf
  1. 2
      models/problem.js
  2. 2
      views/problems.ejs

2
models/problem.js

@ -388,7 +388,7 @@ class Problem extends Model {
}); });
res.sort((a, b) => { res.sort((a, b) => {
return a.name > b.name ? 1 : -1; return a.color > b.color ? 1 : -1;
}); });
return res; return res;

2
views/problems.ejs

@ -12,7 +12,7 @@ if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id);
<% if (typeof tags !== 'undefined') { %> <% if (typeof tags !== 'undefined') { %>
<% <%
tags.sort((a, b) => { tags.sort((a, b) => {
return a.name > b.name ? 1 : -1; return a.color > b.color ? 1 : -1;
}); });
%> %>
<% for (let tag of tags) { %> <% for (let tag of tags) { %>

Loading…
Cancel
Save