소스 검색

Add <meta refresh> to mailbox view

This causes the mailbox to automatically reload the page every 60
seconds, without JavaScript.

This also updates the base template data to include the full URL, and
replaces the earlier "Path" field with a pre-split array of path
components, which is more immediately useful to most templates given the
limitations of string munging with text/template primitives.
master
Drew DeVault 4 년 전
committed by Simon Ser
부모
커밋
1cf95af41e
No known key found for this signature in database GPG 키 ID: FDE7BE0E88F5E48
26개의 변경된 파일34개의 추가작업 그리고 27개의 파일을 삭제
  1. +1
    -1
      plugins/base/public/compose.html
  2. +1
    -1
      plugins/base/public/login.html
  3. +1
    -1
      plugins/base/public/mailbox.html
  4. +1
    -1
      plugins/base/public/message.html
  5. +1
    -1
      plugins/base/public/settings.html
  6. +1
    -1
      plugins/caldav/public/calendar.html
  7. +1
    -1
      plugins/caldav/public/event.html
  8. +1
    -1
      plugins/carddav/public/address-book.html
  9. +1
    -1
      plugins/carddav/public/address-object.html
  10. +1
    -1
      plugins/carddav/public/update-address-object.html
  11. +6
    -2
      renderer.go
  12. +1
    -1
      themes/alps/compose.html
  13. +3
    -0
      themes/alps/head.html
  14. +1
    -1
      themes/alps/login.html
  15. +2
    -2
      themes/alps/mailbox.html
  16. +1
    -1
      themes/alps/message.html
  17. +1
    -1
      themes/alps/messages-header.html
  18. +1
    -1
      themes/sourcehut/address-book.html
  19. +1
    -1
      themes/sourcehut/address-object.html
  20. +1
    -1
      themes/sourcehut/calendar.html
  21. +1
    -1
      themes/sourcehut/compose.html
  22. +1
    -1
      themes/sourcehut/event.html
  23. +1
    -1
      themes/sourcehut/login.html
  24. +1
    -1
      themes/sourcehut/mailbox.html
  25. +1
    -1
      themes/sourcehut/message.html
  26. +1
    -1
      themes/sourcehut/settings.html

+ 1
- 1
plugins/base/public/compose.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 1
- 1
plugins/base/public/login.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 1
- 1
plugins/base/public/mailbox.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 1
- 1
plugins/base/public/message.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 1
- 1
plugins/base/public/settings.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 1
- 1
plugins/caldav/public/calendar.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 1
- 1
plugins/caldav/public/event.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 1
- 1
plugins/carddav/public/address-book.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 1
- 1
plugins/carddav/public/address-object.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 1
- 1
plugins/carddav/public/update-address-object.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}

<h1>alps</h1>



+ 6
- 2
renderer.go 파일 보기

@@ -5,7 +5,9 @@ import (
"html/template"
"io"
"io/ioutil"
"net/url"
"os"
"strings"

"github.com/labstack/echo/v4"
)
@@ -14,7 +16,8 @@ const themesDir = "themes"

// GlobalRenderData contains data available in all templates.
type GlobalRenderData struct {
Path string
Path []string
URL *url.URL

LoggedIn bool

@@ -71,7 +74,8 @@ func NewBaseRenderData(ctx *Context) *BaseRenderData {
global.Username = ctx.Session.username
}

global.Path = ctx.Request().URL.String()
global.URL = ctx.Request().URL
global.Path = strings.Split(global.URL.Path, "/")[1:]

return &BaseRenderData{
GlobalData: global,


+ 1
- 1
themes/alps/compose.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}
{{template "nav.html" .}}




+ 3
- 0
themes/alps/head.html 파일 보기

@@ -4,6 +4,9 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
{{- if eq (index .GlobalData.Path 0) "mailbox"}}
<meta id="refresh" http-equiv="refresh" content="60">
{{end -}}
<title>Webmail</title>
<link rel="stylesheet" href="/themes/alps/assets/style.css">
</head>


+ 1
- 1
themes/alps/login.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}
<h1>alps webmail</h1>

<form method="post" action="/login">


+ 2
- 2
themes/alps/mailbox.html 파일 보기

@@ -1,5 +1,5 @@
{{template "head.html"}}
{{template "nav.html" . }}
{{template "head.html" .}}
{{template "nav.html" .}}

<div class="page-wrap">
<aside>


+ 1
- 1
themes/alps/message.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .}}
{{template "nav.html" .}}

<div class="page-wrap">


+ 1
- 1
themes/alps/messages-header.html 파일 보기

@@ -21,7 +21,7 @@
{{ end }}

&nbsp;&nbsp;
<a href="{{ .GlobalData.Path }}" class="button-link">Refresh</a>
<a href="{{ .GlobalData.URL.String }}" class="button-link">Refresh</a>
</div>

<form action="" method="post" class="actions-search">


+ 1
- 1
themes/sourcehut/address-book.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .Global}}
{{template "nav.html" .Global}}

<div class="container-fluid">


+ 1
- 1
themes/sourcehut/address-object.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .Global}}
{{template "nav.html" .Global}}

{{$fn := .AddressObject.Card.Value "FN"}}


+ 1
- 1
themes/sourcehut/calendar.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .Global}}
{{template "nav.html" .Global}}

<div class="container-fluid">


+ 1
- 1
themes/sourcehut/compose.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .Global}}
{{template "nav.html" .Global}}

<div class="container-fluid">


+ 1
- 1
themes/sourcehut/event.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .Global}}
{{template "nav.html" .Global}}

{{$event := index .Event.Data.Events 0}}


+ 1
- 1
themes/sourcehut/login.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .Global}}
{{template "nav.html" .Global}}

<div class="container">


+ 1
- 1
themes/sourcehut/mailbox.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .Global}}
{{template "nav.html" .Global}}

<!-- TODO: Share tabs if reasonable -->


+ 1
- 1
themes/sourcehut/message.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .Global}}
{{template "nav.html" .Global}}

<div class="container-fluid">


+ 1
- 1
themes/sourcehut/settings.html 파일 보기

@@ -1,4 +1,4 @@
{{template "head.html"}}
{{template "head.html" .Global}}
{{template "nav.html" .Global}}

<div class="container-fluid">


불러오는 중...
취소
저장