Browse Source

Show edit time if edited, add expiry on nice columns

Dashie der otter 2 months ago
parent
commit
d0f06320f1
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
5 changed files with 8 additions and 11 deletions
  1. 0
    1
      TODO.org
  2. 2
    1
      conf/locale/locale_en-US.ini
  3. 1
    0
      conf/locale/locale_fr-FR.ini
  4. 2
    0
      routers/gitxt/gitxt.go
  5. 3
    9
      templates/gitxt/view.tmpl

+ 0
- 1
TODO.org View File

@@ -6,7 +6,6 @@
6 6
 ** TODO xorm update, breaking changes
7 7
 *** migrate to gorm ?
8 8
 
9
-** TODO Add edit time on view gist
10 9
 ** TODO Add line-break option
11 10
 ** TODO Add more checks for <nil> fields wrongly used, like issue with non existant file
12 11
 ** TODO Add pictures from git with zz_.png; Edit web interface, and add file; wrong duplicate !!

+ 2
- 1
conf/locale/locale_en-US.ini View File

@@ -93,8 +93,9 @@ show_uploads_for = "Show uploads for %s"
93 93
 show_all_uploads = "Show all uploads"
94 94
 edit = "Edit"
95 95
 delete = "Delete"
96
-expiry_on = "Expiry on:"
96
+expiry_on = "Expires on:"
97 97
 created_on = "Created on:"
98
+updated_on = "Updated on:"
98 99
 raw_file = "raw file"
99 100
 file_too_big = "File is too big and can't be displayed."
100 101
 over_page_size = "Page size limit exceeded and file won't me displayed."

+ 1
- 0
conf/locale/locale_fr-FR.ini View File

@@ -95,6 +95,7 @@ edit = "Editer"
95 95
 delete = "Supprimer"
96 96
 expiry_on = "Expire le:"
97 97
 created_on = "Crée le:"
98
+updated_on = "Mis-à-jour le:"
98 99
 raw_file = "fichier brut"
99 100
 file_too_big = "Le fichier trop gros et ne peut être affiché."
100 101
 over_page_size = "Limite de taille pour la page atteinte et le fichier ne sera pas affiché."

+ 2
- 0
routers/gitxt/gitxt.go View File

@@ -260,6 +260,8 @@ func View(ctx *context.Context) {
260 260
 	ctx.Data["expiry"] = ctx.Gitxt.Gitxt.ExpiryHours
261 261
 	ctx.Data["expiryOn"] = ctx.Gitxt.Gitxt.Expiry
262 262
 	ctx.Data["createdOn"] = ctx.Gitxt.Gitxt.Created
263
+	ctx.Data["updated"] = (ctx.Gitxt.Gitxt.UpdatedUnix > ctx.Gitxt.Gitxt.CreatedUnix)
264
+	ctx.Data["updatedOn"] = ctx.Gitxt.Gitxt.Updated
263 265
 
264 266
 	// Get the files from git
265 267
 	var repoSpec = "HEAD"

+ 3
- 9
templates/gitxt/view.tmpl View File

@@ -37,15 +37,9 @@
37 37
 
38 38
 <div class="row">
39 39
     <div class="col-lg-12">
40
-        <div class="gitxt_description">
41
-            {{.i18n.Tr "gitxt_view.created_on"}} <time datetime="{{DateFmtLong .createdOn}}">{{DateFmtLong .createdOn}}</time>
42
-            {{if .expiry}}
43
-                {{if eq .expiry 0}}
44
-                {{else}}
45
-                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{.i18n.Tr "gitxt_view.expiry_on"}} <time datetime="{{DateFmtLong .expiryOn}}">{{DateFmtLong .expiryOn}}</time>
46
-                {{end}}
47
-            {{end}}
48
-        </div>
40
+        <div class="col-md-4">{{.i18n.Tr "gitxt_view.created_on"}} <time datetime="{{DateFmtLong .createdOn}}">{{DateFmtLong .createdOn}}</time></div>
41
+        <div class="col-md-4">{{if .updated}}{{.i18n.Tr "gitxt_view.updated_on"}} <time datetime="{{DateFmtLong .updatedOn}}">{{DateFmtLong .updatedOn}}</time>{{end}}</div>
42
+        <div class="col-md-4">{{if .expiry}}{{if eq .expiry 0}}{{else}}{{.i18n.Tr "gitxt_view.expiry_on"}} <time datetime="{{DateFmtLong .expiryOn}}">{{DateFmtLong .expiryOn}}</time>{{end}}{{end}}</div>
49 43
     </div>
50 44
 </div>
51 45
 

Loading…
Cancel
Save