Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
unhide status, add author column, and black out notes for #10
Browse files Browse the repository at this point in the history
  • Loading branch information
rawxfish committed Feb 28, 2022
1 parent 7dbb387 commit 61678a2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions puzzle_editing/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ def ordered_hints(self):
def has_answer(self):
return self.answers.count() > 0

def get_authors(self):
return UserProfile.html_user_list_of(self.authors.all(), True)


@receiver(pre_save, sender=Puzzle)
def set_status_mtime(sender, instance, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion puzzle_editing/static/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,10 @@ blockquote > p:last-child {
display: block;
}

a.spoiler {
a.spoiler, div.spoiler {
background: #333333;
border-radius: 0.2em;
cursor: pointer;
}

.hide-assignments:checked ~ div > table .assignment-spoiler {
Expand Down
16 changes: 11 additions & 5 deletions puzzle_editing/templates/round.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ <h2> Current Answers </h2>
{% endif %}
<th>Answer</th>
<th>Puzzle</th>
<th>Authors</th>
<th>Status</th>
<th>Notes</th>
</tr>
Expand All @@ -43,11 +44,10 @@ <h2> Current Answers </h2>
</button>
</form>
</td>
{% endif %}

<td rowspan="{{ answer.puzzles|length }}">
<a class="spoiler" title="Click to reveal" onclick="this.classList.remove('spoiler');" href="#">{{ answer.answer }}</a>
</td>
{% endif %}

<td>
<a href="{% url 'puzzle' puzzle.id %}">
Expand All @@ -56,12 +56,18 @@ <h2> Current Answers </h2>
</a>
</td>
<td>
<span class="assignment-spoiler">{{ puzzle.get_status_display }}</span>
<span class="assignment-unspoiler">(hidden)</span>
{{ puzzle.get_authors }}
</td>
<td>
{{ puzzle.get_status_display }}
</td>
{% if forloop.first %}
<td rowspan="{{ answer.puzzles|length }}" class="small-md">
{% if answer.notes %}{{ answer.notes|markdown }}{% endif %}
{% if answer.notes %}
<div class="spoiler" title="Click to reveal" onclick="this.classList.remove('spoiler');" href="#">
{{ answer.notes|markdown }}
</div>
{% endif %}
</td>
{% endif %}
</tr>
Expand Down

0 comments on commit 61678a2

Please sign in to comment.