aboutsummaryrefslogtreecommitdiffhomepage
path: root/template/html
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-02-04 14:37:42 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-02-04 14:37:42 -0800
commitb5b1930599190e2d7a6613db8779d9bbb970a1f7 (patch)
treec7a9bb8a7e64b04ed23ac1f052f49ec0c79cb34f /template/html
parent61bc012a6284f90001b2339ecfdfb5b96e38be10 (diff)
Take timezone into consideration when calculating relative time
Diffstat (limited to 'template/html')
-rw-r--r--template/html/category_entries.html2
-rw-r--r--template/html/common/item_meta.html18
-rw-r--r--template/html/edit_feed.html2
-rw-r--r--template/html/entry.html2
-rw-r--r--template/html/feed_entries.html2
-rw-r--r--template/html/feeds.html2
-rw-r--r--template/html/history.html2
-rw-r--r--template/html/sessions.html2
-rw-r--r--template/html/starred.html2
-rw-r--r--template/html/unread.html2
-rw-r--r--template/html/users.html2
11 files changed, 19 insertions, 19 deletions
diff --git a/template/html/category_entries.html b/template/html/category_entries.html
index d7ce9d9..8910f22 100644
--- a/template/html/category_entries.html
+++ b/template/html/category_entries.html
@@ -27,7 +27,7 @@
</span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div>
- {{ template "item_meta" . }}
+ {{ template "item_meta" dict "user" $.user "entry" . }}
</article>
{{ end }}
</div>
diff --git a/template/html/common/item_meta.html b/template/html/common/item_meta.html
index 668a5d2..5b00d9a 100644
--- a/template/html/common/item_meta.html
+++ b/template/html/common/item_meta.html
@@ -2,32 +2,32 @@
<div class="item-meta">
<ul>
<li>
- <a href="{{ route "feedEntries" "feedID" .Feed.ID }}" title="{{ .Feed.Title }}">{{ domain .Feed.SiteURL }}</a>
+ <a href="{{ route "feedEntries" "feedID" .entry.Feed.ID }}" title="{{ .entry.Feed.Title }}">{{ domain .entry.Feed.SiteURL }}</a>
</li>
<li>
- <time datetime="{{ isodate .Date }}" title="{{ isodate .Date }}">{{ elapsed .Date }}</time>
+ <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .user.Timezone .entry.Date }}</time>
</li>
<li>
<a href="#"
title="{{ t "Save this article" }}"
data-save-entry="true"
- data-save-url="{{ route "saveEntry" "entryID" .ID }}"
+ data-save-url="{{ route "saveEntry" "entryID" .entry.ID }}"
data-label-loading="{{ t "Saving..." }}"
data-label-done="{{ t "Done!" }}"
>{{ t "Save" }}</a>
</li>
<li>
- <a href="{{ .URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a>
+ <a href="{{ .entry.URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ t "Original" }}</a>
</li>
<li>
<a href="#"
data-toggle-bookmark="true"
- data-bookmark-url="{{ route "toggleBookmark" "entryID" .ID }}"
+ data-bookmark-url="{{ route "toggleBookmark" "entryID" .entry.ID }}"
data-label-loading="{{ t "Saving..." }}"
data-label-star="☆ {{ t "Star" }}"
data-label-unstar="★ {{ t "Unstar" }}"
- data-value="{{ if .Starred }}star{{ else }}unstar{{ end }}"
- >{{ if .Starred }}★ {{ t "Unstar" }}{{ else }}☆ {{ t "Star" }}{{ end }}</a>
+ data-value="{{ if .entry.Starred }}star{{ else }}unstar{{ end }}"
+ >{{ if .entry.Starred }}★ {{ t "Unstar" }}{{ else }}☆ {{ t "Star" }}{{ end }}</a>
</li>
<li>
<a href="#"
@@ -35,8 +35,8 @@
data-toggle-status="true"
data-label-read="✔ {{ t "Read" }}"
data-label-unread="✘ {{ t "Unread" }}"
- data-value="{{ if eq .Status "read" }}read{{ else }}unread{{ end }}"
- >{{ if eq .Status "read" }}✘ {{ t "Unread" }}{{ else }}✔ {{ t "Read" }}{{ end }}</a>
+ data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
+ >{{ if eq .entry.Status "read" }}✘ {{ t "Unread" }}{{ else }}✔ {{ t "Read" }}{{ end }}</a>
</li>
</ul>
</div>
diff --git a/template/html/edit_feed.html b/template/html/edit_feed.html
index 888a2c0..e5bb60a 100644
--- a/template/html/edit_feed.html
+++ b/template/html/edit_feed.html
@@ -67,7 +67,7 @@
<div class="panel">
<ul>
- <li><strong>{{ t "Last checked:" }} </strong><time datetime="{{ isodate .feed.CheckedAt }}" title="{{ isodate .feed.CheckedAt }}">{{ elapsed .feed.CheckedAt }}</time></li>
+ <li><strong>{{ t "Last checked:" }} </strong><time datetime="{{ isodate .feed.CheckedAt }}" title="{{ isodate .feed.CheckedAt }}">{{ elapsed $.user.Timezone .feed.CheckedAt }}</time></li>
<li><strong>{{ t "ETag header:" }} </strong>{{ if .feed.EtagHeader }}{{ .feed.EtagHeader }}{{ else }}{{ t "None" }}{{ end }}</li>
<li><strong>{{ t "LastModified header:" }} </strong>{{ if .feed.LastModifiedHeader }}{{ .feed.LastModifiedHeader }}{{ else }}{{ t "None" }}{{ end }}</li>
</ul>
diff --git a/template/html/entry.html b/template/html/entry.html
index 66d08fb..237acf4 100644
--- a/template/html/entry.html
+++ b/template/html/entry.html
@@ -59,7 +59,7 @@
</span>
</div>
<div class="entry-date">
- <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .entry.Date }}</time>
+ <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed $.user.Timezone .entry.Date }}</time>
</div>
</header>
{{ if gt (len .entry.Content) 120 }}
diff --git a/template/html/feed_entries.html b/template/html/feed_entries.html
index ebd8ea7..bbc8d79 100644
--- a/template/html/feed_entries.html
+++ b/template/html/feed_entries.html
@@ -38,7 +38,7 @@
</span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div>
- {{ template "item_meta" . }}
+ {{ template "item_meta" dict "user" $.user "entry" . }}
</article>
{{ end }}
</div>
diff --git a/template/html/feeds.html b/template/html/feeds.html
index 5500c92..db89872 100644
--- a/template/html/feeds.html
+++ b/template/html/feeds.html
@@ -42,7 +42,7 @@
<a href="{{ .SiteURL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ domain .SiteURL }}</a>
</li>
<li>
- {{ t "Last check:" }} <time datetime="{{ isodate .CheckedAt }}" title="{{ isodate .CheckedAt }}">{{ elapsed .CheckedAt }}</time>
+ {{ t "Last check:" }} <time datetime="{{ isodate .CheckedAt }}" title="{{ isodate .CheckedAt }}">{{ elapsed $.user.Timezone .CheckedAt }}</time>
</li>
</ul>
<ul>
diff --git a/template/html/history.html b/template/html/history.html
index 892f183..3b806da 100644
--- a/template/html/history.html
+++ b/template/html/history.html
@@ -27,7 +27,7 @@
</span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div>
- {{ template "item_meta" . }}
+ {{ template "item_meta" dict "user" $.user "entry" . }}
</article>
{{ end }}
</div>
diff --git a/template/html/sessions.html b/template/html/sessions.html
index f6d74c2..6e639d6 100644
--- a/template/html/sessions.html
+++ b/template/html/sessions.html
@@ -33,7 +33,7 @@
</tr>
{{ range .sessions }}
<tr {{ if eq .Token $.currentSessionToken }}class="row-highlighted"{{ end }}>
- <td class="column-20" title="{{ isodate .CreatedAt }}">{{ elapsed .CreatedAt }}</td>
+ <td class="column-20" title="{{ isodate .CreatedAt }}">{{ elapsed $.user.Timezone .CreatedAt }}</td>
<td class="column-20" title="{{ .IP }}">{{ .IP }}</td>
<td title="{{ .UserAgent }}">{{ .UserAgent }}</td>
<td class="column-20">
diff --git a/template/html/starred.html b/template/html/starred.html
index b16b9e7..e2a2407 100644
--- a/template/html/starred.html
+++ b/template/html/starred.html
@@ -20,7 +20,7 @@
</span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div>
- {{ template "item_meta" . }}
+ {{ template "item_meta" dict "user" $.user "entry" . }}
</article>
{{ end }}
</div>
diff --git a/template/html/unread.html b/template/html/unread.html
index e88c847..c8e0a8e 100644
--- a/template/html/unread.html
+++ b/template/html/unread.html
@@ -30,7 +30,7 @@
</span>
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
</div>
- {{ template "item_meta" . }}
+ {{ template "item_meta" dict "user" $.user "entry" . }}
</article>
{{ end }}
</div>
diff --git a/template/html/users.html b/template/html/users.html
index 7fd7e47..8bffc2f 100644
--- a/template/html/users.html
+++ b/template/html/users.html
@@ -39,7 +39,7 @@
<td>{{ if eq .IsAdmin true }}{{ t "Yes" }}{{ else }}{{ t "No" }}{{ end }}</td>
<td>
{{ if .LastLoginAt }}
- <time datetime="{{ isodate .LastLoginAt }}" title="{{ isodate .LastLoginAt }}">{{ elapsed .LastLoginAt }}</time>
+ <time datetime="{{ isodate .LastLoginAt }}" title="{{ isodate .LastLoginAt }}">{{ elapsed $.user.Timezone .LastLoginAt }}</time>
{{ else }}
{{ t "Never" }}
{{ end }}