Browse Source

Show edit time if edited, add expiry on nice columns

master
Dashie der otter 6 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 @@
** TODO xorm update, breaking changes
*** migrate to gorm ?

** TODO Add edit time on view gist
** TODO Add line-break option
** TODO Add more checks for <nil> fields wrongly used, like issue with non existant file
** 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"
show_all_uploads = "Show all uploads"
edit = "Edit"
delete = "Delete"
expiry_on = "Expiry on:"
expiry_on = "Expires on:"
created_on = "Created on:"
updated_on = "Updated on:"
raw_file = "raw file"
file_too_big = "File is too big and can't be displayed."
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"
delete = "Supprimer"
expiry_on = "Expire le:"
created_on = "Crée le:"
updated_on = "Mis-à-jour le:"
raw_file = "fichier brut"
file_too_big = "Le fichier trop gros et ne peut être affiché."
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) {
ctx.Data["expiry"] = ctx.Gitxt.Gitxt.ExpiryHours
ctx.Data["expiryOn"] = ctx.Gitxt.Gitxt.Expiry
ctx.Data["createdOn"] = ctx.Gitxt.Gitxt.Created
ctx.Data["updated"] = (ctx.Gitxt.Gitxt.UpdatedUnix > ctx.Gitxt.Gitxt.CreatedUnix)
ctx.Data["updatedOn"] = ctx.Gitxt.Gitxt.Updated

// Get the files from git
var repoSpec = "HEAD"

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

@@ -37,15 +37,9 @@

<div class="row">
<div class="col-lg-12">
<div class="gitxt_description">
{{.i18n.Tr "gitxt_view.created_on"}} <time datetime="{{DateFmtLong .createdOn}}">{{DateFmtLong .createdOn}}</time>
{{if .expiry}}
{{if eq .expiry 0}}
{{else}}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{.i18n.Tr "gitxt_view.expiry_on"}} <time datetime="{{DateFmtLong .expiryOn}}">{{DateFmtLong .expiryOn}}</time>
{{end}}
{{end}}
</div>
<div class="col-md-4">{{.i18n.Tr "gitxt_view.created_on"}} <time datetime="{{DateFmtLong .createdOn}}">{{DateFmtLong .createdOn}}</time></div>
<div class="col-md-4">{{if .updated}}{{.i18n.Tr "gitxt_view.updated_on"}} <time datetime="{{DateFmtLong .updatedOn}}">{{DateFmtLong .updatedOn}}</time>{{end}}</div>
<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>
</div>
</div>


Loading…
Cancel
Save