|
1 | 1 | {% extends "base.html" %} |
2 | 2 | {% load static %} |
3 | 3 | {% load webfinger_image %} |
| 4 | + |
4 | 5 | {% block title %} |
5 | 6 | Note page |
6 | 7 | {% endblock %} |
7 | | -{% block extra-head %} |
8 | | -<script src="{% static 'js/vote.js' %}"></script> |
| 8 | + |
| 9 | +{% block scripts %} |
| 10 | +<script src="{% static 'js/vote.js' %}" defer></script> |
9 | 11 | {% endblock %} |
| 12 | + |
10 | 13 | {% block content %} |
11 | 14 | <div class="columns"> |
12 | 15 | <div class="column"> |
13 | 16 | </div> |
14 | | - <div class="column is-four-fifths box"> |
| 17 | + <div class="column is-four-fifths box px-6 py-6"> |
15 | 18 |
|
16 | 19 | <article class="media"> |
17 | 20 | <figure class="media-left"> |
18 | 21 | <p class="image is-64x64"> |
19 | | - <img src="{{ note.acct | get_pkg_image }}" alt="purl-image"> |
| 22 | + <img src="{{ note.acct | get_pkg_image }}" alt="purl-image"> |
20 | 23 | </p> |
21 | 24 | </figure> |
22 | 25 | <form class="ml-5 mr-5" name="vote-notes"> |
23 | | - <span class="icon ml-1"> |
24 | | - <button name="vote-up" class="button is-rounded is-white" value="{{ note.id }}" type="submit">▲</button> |
25 | | - </span> |
26 | | - <p class="ml-3 mt-1 mb-1" name="{{ note.id }}">{{ note.reputation_value }}</p> |
27 | | - <span class="icon ml-1"> |
28 | | - <button name="vote-down" class="button is-rounded is-white" value="{{ note.id }}" type="submit">▼</button> |
29 | | - </span> |
| 26 | + <span class="icon ml-1"> |
| 27 | + <button name="vote-up" class="button is-rounded is-white" value="{{ note.id }}" type="submit">▲</button> |
| 28 | + </span> |
| 29 | + <p class="ml-3 mt-1 mb-1" name="{{ note.id }}">{{ note.reputation_value }}</p> |
| 30 | + <span class="icon ml-1"> |
| 31 | + <button name="vote-down" class="button is-rounded is-white" value="{{ note.id }}" type="submit">▼</button> |
| 32 | + </span> |
30 | 33 | </form> |
31 | 34 |
|
32 | 35 | <div class="media-content"> |
33 | 36 | <div class="content"> |
34 | 37 | <p> |
35 | 38 | <a href="{% url 'purl-profile' note.username %}">{{ note.acct }}</a> |
36 | 39 | <br> |
37 | | - <pre class="has-text-black">{{ note.content }}</pre> |
| 40 | + <pre class="has-text-black">{{ note.content }}</pre> |
38 | 41 | </p> |
39 | 42 | </div> |
40 | 43 | </div> |
41 | 44 |
|
42 | 45 | <div class="media-right"> |
43 | | - <small>last update: {{ note.updated_at }}</small> |
| 46 | + <small>last update: {{ note.updated_at }}</small> |
44 | 47 | </div> |
45 | 48 | </article> |
46 | 49 |
|
47 | 50 | {% for note_r in note.replies.all %} |
48 | | - <article class="media ml-5"> |
49 | | - <div class="media-content"> |
50 | | - <div class="content"> |
51 | | - <p> |
52 | | - <a href="{% url 'user-profile' note_r.username %}">@{{ note_r.acct }}</a> |
53 | | - <p>{{ note_r.content }}</p> |
54 | | - </p> |
55 | | - </div> |
56 | | - </div> |
57 | | - <div class="media-right"> |
58 | | - <small>last update: {{ note.updated_at }}</small> |
59 | | - </div> |
60 | | - </article> |
| 51 | + <article class="media"> |
| 52 | + <figure class="media-left"> |
| 53 | + <p class="image is-64x64"> |
| 54 | + <img class="is-rounded" src="{{ note_r.acct_avatar }}"> |
| 55 | + </p> |
| 56 | + </figure> |
| 57 | + <div class="media-content"> |
| 58 | + <div class="content"> |
| 59 | + <p> |
| 60 | + <a href="{% url 'user-profile' note_r.username %}">@{{ note_r.acct }}</a> |
| 61 | + <p class="title is-6 has-text-weight-normal">{{ note_r.content }}</p> |
| 62 | + </p> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + <div class="media-right"> |
| 66 | + <small>last update: {{ note_r.updated_at }}</small> |
| 67 | + </div> |
| 68 | + </article> |
61 | 69 | {% endfor %} |
62 | 70 |
|
63 | 71 | <article class="media"> |
64 | 72 |
|
65 | 73 | <figure class="media-left"> |
66 | 74 | <p class="image is-64x64"> |
67 | | - <img class="is-rounded" src="{{ user.person.avatar.url }}" > |
| 75 | + <img class="is-rounded" src="{{ user.person.avatar }}"> |
68 | 76 | </p> |
69 | 77 | </figure> |
70 | 78 | <div class="media-content"> |
71 | | - <form method="POST" action=""> |
72 | | - <div class="field"> |
73 | | - <p class="control"> |
74 | | - {% csrf_token %} |
75 | | - {{ form }} |
76 | | - </p> |
77 | | - </div> |
78 | | - <div class="field"> |
79 | | - <p class="control"> |
80 | | - <button class="button" type="submit">Post comment</button> |
81 | | - </p> |
| 79 | + <form method="POST" action=""> |
| 80 | + <div class="field"> |
| 81 | + <p class="control"> |
| 82 | + {% csrf_token %} |
| 83 | + <div class="columns"> |
| 84 | + <div class="column is-three-quarters"> |
| 85 | + {{ form }} |
| 86 | + </div> |
82 | 87 | </div> |
83 | | - </form> |
| 88 | + </p> |
| 89 | + </div> |
| 90 | + <div class="field"> |
| 91 | + <p class="control"> |
| 92 | + <button class="button is-info" type="submit">Post comment</button> |
| 93 | + </p> |
| 94 | + </div> |
| 95 | + </form> |
84 | 96 | </div> |
85 | 97 | </article> |
86 | 98 | </div> |
|
0 commit comments