Skip to content

Commit

Permalink
[fix] handle missing user id in bookmark view
Browse files Browse the repository at this point in the history
  • Loading branch information
asciimoo committed Jan 26, 2022
1 parent 1a64408 commit f61560f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/view_bookmark.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<p class="is-size-7 has-text-grey has-text-weight-normal">{{ Truncate .Bookmark.URL 100 }}</p>
</h4>
<p>{{ .Bookmark.Notes }}</p>
{{ $uid := 0 }}
{{ if .User }}{{ $uid = .User.ID }}{{ end }}
{{ if .Bookmark.Tags }}
{{ $uid := 0 }}
{{ if .User }}{{ $uid = .User.ID }}{{ end }}
{{ range .Bookmark.Tags }}
<a href="{{ if ne $uid $.Bookmark.UserID }}{{ BaseURL "/bookmarks" }}{{ else }}{{ BaseURL "/my_bookmarks" }}{{ end }}?tag={{ .Text }}"><span class="tag is-info">{{ .Text }}</span></a>
{{ end }}
{{ end }}
{{ block "snapshots" KVData "Snapshots" .Bookmark.Snapshots "IsOwn" (eq .Bookmark.UserID .User.ID ) }}{{ end }}
{{ block "snapshots" KVData "Snapshots" .Bookmark.Snapshots "IsOwn" (eq .Bookmark.UserID $uid ) }}{{ end }}
{{ .Bookmark.CreatedAt | ToDate }} {{ if .Bookmark.Public }}Public{{ else }}Private{{ end }}
{{ if .User }}
{{ if eq .User.ID .Bookmark.UserID }}
Expand Down

0 comments on commit f61560f

Please sign in to comment.