aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorYarden Shoham <git@yardenshoham.com>2023-04-15 14:01:54 +0300
committerGitHub <noreply@github.com>2023-04-15 13:01:54 +0200
commitb4e952545b95953056f2645b38aa17d15bcd58ab (patch)
treed5e84c516c743a15bc39a548ca1a7caf1cf81569 /templates
parent35e562d7bd5e984a5cb97f74f5753d2a9998c1d3 (diff)
downloadgitea-b4e952545b95953056f2645b38aa17d15bcd58ab.tar.gz
gitea-b4e952545b95953056f2645b38aa17d15bcd58ab.zip
Remove untranslatable `on_date` key (#24106)
- Follows #23988 - Fixes: #24074 by removing this key GitHub's `relative-time` elements allow us to force their rendering to `auto`, `past`, or `future` tense. We will never show an absolute date `on ...` in `TimeSince` ## Before ![image](https://user-images.githubusercontent.com/20454870/231735872-048c7bf3-6aa1-4113-929d-75a985c9922c.png) ## After ![image](https://user-images.githubusercontent.com/20454870/231736116-6ad47b63-77f4-4d3f-82a2-ee9a46ba2bd1.png) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/devtest/gitea-ui.tmpl49
-rw-r--r--templates/package/view.tmpl6
2 files changed, 47 insertions, 8 deletions
diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl
index c5ab863d00..1ab9ae7b7c 100644
--- a/templates/devtest/gitea-ui.tmpl
+++ b/templates/devtest/gitea-ui.tmpl
@@ -1,12 +1,51 @@
{{template "base/head" .}}
-<div class="page-content devtest">
+<div class="page-content devtest ui container">
+
<div>
- <gitea-origin-url data-url="test/url"></gitea-origin-url>
- <gitea-origin-url data-url="/test/url"></gitea-origin-url>
+ <h1>Tooltip</h1>
+ <div><span data-tooltip-content="test tooltip">text with tooltip</span></div>
+ <div><span data-tooltip-content="test tooltip" data-tooltip-interactive="true">text with interactive tooltip</span></div>
</div>
+
<div>
- <span data-tooltip-content="test tooltip">text with tooltip</span>
+ <h1>GiteaOriginUrl</h1>
+ <div><gitea-origin-url data-url="test/url"></gitea-origin-url></div>
+ <div><gitea-origin-url data-url="/test/url"></gitea-origin-url></div>
</div>
- {{template "shared/combomarkdowneditor" .}}
+
+ <div>
+ <h1>LocaleNumber</h1>
+ <div>{{LocaleNumber 1}}</div>
+ <div>{{LocaleNumber 12}}</div>
+ <div>{{LocaleNumber 123}}</div>
+ <div>{{LocaleNumber 1234}}</div>
+ <div>{{LocaleNumber 12345}}</div>
+ <div>{{LocaleNumber 123456}}</div>
+ <div>{{LocaleNumber 1234567}}</div>
+ </div>
+
+ <div>
+ <h1>TimeSince</h1>
+ <div>Now: {{TimeSince .TimeNow $.locale}}</div>
+ <div>5s past: {{TimeSince .TimePast5s $.locale}}</div>
+ <div>5s future: {{TimeSince .TimeFuture5s $.locale}}</div>
+ <div>2m past: {{TimeSince .TimePast2m $.locale}}</div>
+ <div>2m future: {{TimeSince .TimeFuture2m $.locale}}</div>
+ <div>1y past: {{TimeSince .TimePast1y $.locale}}</div>
+ <div>1y future: {{TimeSince .TimeFuture1y $.locale}}</div>
+ </div>
+
+ <div>
+ <h1>ComboMarkdownEditor</h1>
+ <div>ps: no JS code attached, so just a layout</div>
+ {{template "shared/combomarkdowneditor" .}}
+ </div>
+
+ <style>
+ h1 {
+ margin: 0;
+ padding: 10px 0;
+ }
+ </style>
</div>
{{template "base/footer" .}}
diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl
index 9677b8eb09..7c622a91b3 100644
--- a/templates/package/view.tmpl
+++ b/templates/package/view.tmpl
@@ -84,9 +84,9 @@
<a class="ui right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{.locale.Tr "packages.versions.view_all"}}</a>
<div class="ui relaxed list">
{{range .LatestVersions}}
- <div class="item">
- <a href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .LowerVersion}}">{{.Version}}</a>
- <span class="text small">{{$.locale.Tr "on_date"}} {{.CreatedUnix.FormatDate}}</span>
+ <div class="item gt-df">
+ <a class="gt-f1" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .LowerVersion}}">{{.Version}}</a>
+ <span class="text small">{{template "shared/datetime/short" (dict "Datetime" (.CreatedUnix.FormatDate) "Fallback" (.CreatedUnix.FormatDate))}}</span>
</div>
{{end}}
</div>