item_meta.html 5.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {{ define "item_meta" }}
  2. <div class="item-meta">
  3. <ul class="item-meta-info">
  4. <li class="item-meta-info-title">
  5. <a href="{{ route "feedEntries" "feedID" .entry.Feed.ID }}" title="{{ .entry.Feed.SiteURL }}" data-feed-link="true">{{ truncate .entry.Feed.Title 35 }}</a>
  6. </li>
  7. <li class="item-meta-info-timestamp">
  8. <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .user.Timezone .entry.Date }}</time>
  9. </li>
  10. {{ if and .user.ShowReadingTime (gt .entry.ReadingTime 0) }}
  11. <li class="item-meta-info-reading-time">
  12. <span>
  13. {{ plural "entry.estimated_reading_time" .entry.ReadingTime .entry.ReadingTime }}
  14. </span>
  15. </li>
  16. {{ end }}
  17. </ul>
  18. <ul class="item-meta-icons">
  19. <li class="item-meta-icons-read">
  20. <a href="#"
  21. role="button"
  22. aria-describedby="entry-title-{{ .entry.ID }}"
  23. title="{{ t "entry.status.title" }}"
  24. data-toggle-status="true"
  25. data-label-loading="{{ t "entry.state.saving" }}"
  26. data-label-read="{{ t "entry.status.read" }}"
  27. data-label-unread="{{ t "entry.status.unread" }}"
  28. data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
  29. >{{ if eq .entry.Status "read" }}{{ icon "unread" }}{{ else }}{{ icon "read" }}{{ end }}<span class="icon-label">{{ if eq .entry.Status "read" }}{{ t "entry.status.unread" }}{{ else }}{{ t "entry.status.read" }}{{ end }}</span></a>
  30. </li>
  31. <li class="item-meta-icons-star">
  32. <a href="#"
  33. role="button"
  34. aria-describedby="entry-title-{{ .entry.ID }}"
  35. data-toggle-bookmark="true"
  36. data-bookmark-url="{{ route "toggleBookmark" "entryID" .entry.ID }}"
  37. data-label-loading="{{ t "entry.state.saving" }}"
  38. data-label-star="{{ t "entry.bookmark.toggle.on" }}"
  39. data-label-unstar="{{ t "entry.bookmark.toggle.off" }}"
  40. data-value="{{ if .entry.Starred }}star{{ else }}unstar{{ end }}"
  41. >{{ if .entry.Starred }}{{ icon "unstar" }}{{ else }}{{ icon "star" }}{{ end }}<span class="icon-label">{{ if .entry.Starred }}{{ t "entry.bookmark.toggle.off" }}{{ else }}{{ t "entry.bookmark.toggle.on" }}{{ end }}</span></a>
  42. </li>
  43. {{ if .entry.ShareCode }}
  44. <li class="item-meta-icons-share">
  45. <a href="{{ route "sharedEntry" "shareCode" .entry.ShareCode }}"
  46. role="button"
  47. aria-describedby="entry-title-{{ .entry.ID }}"
  48. title="{{ t "entry.shared_entry.title" }}"
  49. target="_blank">{{ icon "share" }}<span class="icon-label">{{ t "entry.shared_entry.label" }}</span></a>
  50. </li>
  51. <li class="item-meta-icons-delete">
  52. <a href="#"
  53. role="button"
  54. aria-describedby="entry-title-{{ .entry.ID }}"
  55. data-confirm="true"
  56. data-url="{{ route "unshareEntry" "entryID" .entry.ID }}"
  57. data-label-question="{{ t "confirm.question" }}"
  58. data-label-yes="{{ t "confirm.yes" }}"
  59. data-label-no="{{ t "confirm.no" }}"
  60. data-label-loading="{{ t "confirm.loading" }}">{{ icon "delete" }}<span class="icon-label">{{ t "entry.unshare.label" }}</span></a>
  61. </li>
  62. {{ end }}
  63. {{ if .hasSaveEntry }}
  64. <li>
  65. <a href="#"
  66. role="button"
  67. aria-describedby="entry-title-{{ .entry.ID }}"
  68. title="{{ t "entry.save.title" }}"
  69. data-save-entry="true"
  70. data-save-url="{{ route "saveEntry" "entryID" .entry.ID }}"
  71. data-label-loading="{{ t "entry.state.saving" }}"
  72. data-label-done="{{ t "entry.save.completed" }}"
  73. >{{ icon "save" }}<span class="icon-label">{{ t "entry.save.label" }}</span></a>
  74. </li>
  75. {{ end }}
  76. <li class="item-meta-icons-external-url">
  77. <a href="{{ .entry.URL | safeURL }}"
  78. aria-describedby="entry-title-{{ .entry.ID }}"
  79. target="_blank"
  80. rel="noopener noreferrer"
  81. referrerpolicy="no-referrer"
  82. data-original-link="{{ .user.MarkReadOnView }}">{{ icon "external-link" }}<span class="icon-label">{{ t "entry.external_link.label" }}</span></a>
  83. </li>
  84. {{ if .entry.CommentsURL }}
  85. <li class="item-meta-icons-comments">
  86. <a href="{{ .entry.CommentsURL | safeURL }}"
  87. aria-describedby="entry-title-{{ .entry.ID }}"
  88. title="{{ t "entry.comments.title" }}"
  89. target="_blank"
  90. rel="noopener noreferrer"
  91. referrerpolicy="no-referrer"
  92. data-comments-link="true">{{ icon "comment" }}<span class="icon-label">{{ t "entry.comments.label" }}</span></a>
  93. </li>
  94. {{ end }}
  95. </ul>
  96. </div>
  97. {{ end }}