diff options
| author | Bobby <[email protected]> | 2025-07-18 17:07:23 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-07-18 17:07:23 +0530 |
| commit | aa0405ee98c45a9bb25dd9959d899bbd56bc1b02 (patch) | |
| tree | c6b75124708f3a3ab5fecbdb454eb5f530dd2ffa /templates/posts | |
| parent | 821773b12c07a4bc23628e7d98ac4b34da1eb9e1 (diff) | |
| download | imageboard-aa0405ee98c45a9bb25dd9959d899bbd56bc1b02.tar.xz imageboard-aa0405ee98c45a9bb25dd9959d899bbd56bc1b02.zip | |
favourite system and ∂etails on single page
Diffstat (limited to 'templates/posts')
| -rw-r--r-- | templates/posts/list.django | 4 | ||||
| -rw-r--r-- | templates/posts/single.django | 57 |
2 files changed, 57 insertions, 4 deletions
diff --git a/templates/posts/list.django b/templates/posts/list.django index 3aca8d2..bafd27e 100644 --- a/templates/posts/list.django +++ b/templates/posts/list.django @@ -9,8 +9,8 @@ {% if Posts %} <div class="post-list"> {% for image in Posts %} - <a href="/posts/{{ image.ID }}" class="post-item"> - <img src="{{ CDNURL }}/thumbnail/{{ image.FileName }}" alt="{{ image.Title }}" width="{{ image.GetThumbnailSize.Width }}" height="{{ image.GetThumbnailSize.Height }}" /> + <a href="/posts/{{ image.ID }}" class="post-item" width="{{ image.Sizes.1.Width }}" height="{{ image.Sizes.1.Height }}"> + <img src="{{ CDNURL }}/thumbnail/{{ image.FileName }}" alt="{{ image.Title }}" width="{{ image.Sizes.1.Width }}" height="{{ image.Sizes.1.Height }}" /> <div class="post-overlay"> <div class="post-overlay-top"> <div class="post-id">ID: {{ image.ID }}</div> diff --git a/templates/posts/single.django b/templates/posts/single.django index ef6bc35..b805af8 100644 --- a/templates/posts/single.django +++ b/templates/posts/single.django @@ -82,6 +82,9 @@ <a href="javascript:void(0);" onclick="switchSize('medium');">Medium</a> <a href="javascript:void(0);" onclick="switchSize('large');">Large</a> <a href="javascript:void(0);" onclick="switchSize('original');">Original</a> + {% if Post.Uploader.Username == User.Username or User.CanEditTags %} + | <a href="/posts/edit/{{ Post.ID }}#tags">Edit Post</a> + {% endif %} </div> </div> <div class="post-image-container"> @@ -98,11 +101,61 @@ </div> <div class="post-detail-item"> <span class="post-detail-label">Created:</span> - <span class="post-detail-value">{{ Post.CreatedAt|naturaltime }}</span> + <span class="post-detail-value"><a href="/posts?date={{ Post.CreatedAt|date:'2006-01-02' }}">{{ Post.CreatedAt|naturaltime }}</a></span> </div> <div class="post-detail-item"> <span class="post-detail-label">Original Size:</span> - <span class="post-detail-value">{{ Post.GetOriginalSize.Width }}x{{ Post.GetOriginalSize.Height }} ({{ Post.GetOriginalSize.GetFileSizeFormatted }})</span> + <span class="post-detail-value"><a href="{{ CDNURL }}/original/{{ Post.FileName }}" target="_blank">{{ Post.GetOriginalSize.Width }}x{{ Post.GetOriginalSize.Height }} ({{ Post.GetOriginalSize.GetFileSizeFormatted }})</a></span> + </div> + <div class="post-detail-item"> + <span class="post-detail-label">Favourites:</span> + <span class="post-detail-value post-favourite-actions"> + {{ Post.FavouriteCount }} + <form action="/posts/{{ Post.ID }}/favourite" method="post"> + <input type="hidden" name="next" value="{{ Request.Path }}" /> + <button type="submit" class="icon-button" title="{{ IsUserFavourited|yesno:'Unfavourite this post,Favourite this post' }}"> + {% if IsUserFavourited %} + <svg viewBox="0 0 24 24"> + <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" /> + </svg> + {% else %} + <svg viewBox="0 0 24 24"> + <path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z" /> + </svg> + {% endif %} + </button> + </form> + </span> + </div> + <div class="post-detail-item"> + <span class="post-detail-label">Rating:</span> + <span class="post-detail-value post-rating {{ Post.Rating }}">{{ Post.Rating }}</span> + </div> + </div> + <div class="post-details"> + <div class="post-detail-item"> + <span class="post-detail-label">Source:</span> + <span class="post-detail-value"> + {% if Post.SourceURL %} + <a href="{{ Post.SourceURL }}" target="_blank">{{ Post.SourceURL }}</a> + {% else %} + N/A + {% endif %} + </span> + </div> + </div> + <div class="post-details"> + <div class="post-detail-item"> + <span class="post-detail-label">Tags:</span> + <span class="post-detail-value"> + {% if Post.Tags %} + {% for tag in Post.Tags %} + <a href="/posts?tags={{ tag.Name }}" style="color: {{ tag.Type.Color }};" class="post-tag">{{ tag.Name }} <span class="tag-count">({{ tag.Count }})</span></a> + {% endfor %} + {% else %} + No tags + {% endif %} + </span> </div> </div> </div> |
