feat: version and back button

This commit is contained in:
httpjamesm 2022-12-28 11:33:26 -05:00
parent 3398ba637b
commit 504144c94b
6 changed files with 43 additions and 8 deletions

3
config/version.go Normal file
View File

@ -0,0 +1,3 @@
package config
var Version = "1.1"

View File

@ -90,6 +90,15 @@ img {
font-size: .8rem;
}
.logo-link {
text-decoration: none;
}
.logo {
width: 2rem;
height: 2rem;
}
@media only screen and (max-width: 800px) {
body {
padding-left: 1rem;

View File

@ -1,6 +1,7 @@
package routes
import (
"anonymousoverflow/config"
"fmt"
"strings"
@ -8,7 +9,9 @@ import (
)
func GetHome(c *gin.Context) {
c.HTML(200, "home.html", gin.H{})
c.HTML(200, "home.html", gin.H{
"version": config.Version,
})
}
type urlConversionRequest struct {

View File

@ -141,10 +141,10 @@ func ViewQuestion(c *gin.Context) {
answers = append(answers, template.HTML(answerBodyHTML))
})
imagePolicy := "https:"
imagePolicy := "'self' https:"
if c.MustGet("disable_images").(bool) {
imagePolicy = "'none'"
imagePolicy = "'self'"
}
c.HTML(200, "question.html", gin.H{

View File

@ -12,12 +12,19 @@
<link rel="icon" href="/static/codecircles.png" />
<meta name="theme-color" content="#8CFFC1" />
<meta name="og:image" content="/static/codecircles.png" />
<meta name="description" content="View StackOverflow threads in privacy and without the clutter." />
<meta
name="description"
content="View StackOverflow threads in privacy and without the clutter."
/>
</head>
<body>
<div class="container">
<div class="title">
<img class="logo" src="/static/codecircles.png" alt="4 circles with alternating colors between green and white" />
<img
class="logo"
src="/static/codecircles.png"
alt="4 circles with alternating colors between green and white"
/>
<h1>AnonymousOverflow</h1>
</div>
<h2>Get programming help without compromising your privacy.</h2>
@ -63,6 +70,7 @@
rel="noopener noreferrer"
>Source</a
>
• Version {{ .version }}
</p>
</div>
</body>

View File

@ -16,12 +16,24 @@
</head>
<body>
<div class="parent">
<a href="/" class="logo-link">
<img
class="logo"
src="/static/codecircles.png"
alt="4 circles with alternating colors between green and white"
/>
</a>
<div class="card">
<div class="card-header">
<h1>{{ .title }}</h1>
<p class="timestamp">
Asked {{ .timestamp }} by
<a href="https://stackoverflow.com{{ .authorURL }}" target="_blank" rel="noopener noreferrer">{{ .author }}</a>.
<a
href="https://stackoverflow.com{{ .authorURL }}"
target="_blank"
rel="noopener noreferrer"
>{{ .author }}</a
>.
</p>
</div>
<div class="card-body">{{ .body }}</div>