Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 57 additions & 76 deletions templates/home.html
Original file line number Diff line number Diff line change
@@ -1,81 +1,62 @@
<!DOCTYPE html>
<html data-theme="{{ .theme }}">
<head>
<title>AnonymousOverflow - Private frontend for StackOverflow</title>
<link rel="stylesheet" href="/static/home.css" />
<meta
http-equiv="Content-Security-Policy"
content="default-src 'none'; style-src 'self'; script-src 'none'; img-src 'self';"
/>
<link rel="icon" href="/static/codecircles.webp" />
<meta
name="description"
content="View StackOverflow threads in privacy and without the clutter."
/>
{{ template "sharedHead.html" }}
</head>
<body>
<div class="container">
<div class="title">
<img
class="logo"
src="/static/codecircles.webp"
alt="4 circles with alternating colors between green and white"
/>
<h1>Anonymous&shy;Overflow</h1>
</div>
<h2>Get programming help without compromising your privacy.</h2>
<p>
AnonymousOverflow allows you to view StackOverflow threads
without the cluttered interface and exposing your IP address,
browsing habits and other browser fingerprint data to
StackOverflow.
</p>
{{ if .successMessage }}
<div class="success">
<p><b>Success</b>: {{ .successMessage }}</p>
</div>
{{ else}} {{ if .errorMessage }}
<div class="error">
<p><b>Error</b>: {{ .errorMessage }}</p>

<head>
<title>AnonymousOverflow - Private frontend for StackOverflow</title>
<link rel="stylesheet" href="/static/home.css" />
<meta http-equiv="Content-Security-Policy"
content="default-src 'none'; style-src 'self'; script-src 'none'; img-src 'self';" />
<link rel="icon" href="/static/codecircles.webp" />
<meta name="description" content="View StackOverflow threads in privacy and without the clutter." />
{{ template "sharedHead.html" }}
</head>

<body>
<div class="container">
<div class="title">
<img class="logo" src="/static/codecircles.webp" alt="" />
<h1>Anonymous&shy;Overflow</h1>
</div>
<h2>Get programming help without compromising your privacy.</h2>
<p>
AnonymousOverflow allows you to view StackOverflow threads
without the cluttered interface and exposing your IP address,
browsing habits and other browser fingerprint data to
StackOverflow.
</p>
{{ if .successMessage }}
<div class="success">
<p><b>Success</b>: {{ .successMessage }}</p>
</div>
{{ else}} {{ if .errorMessage }}
<div class="error">
<p><b>Error</b>: {{ .errorMessage }}</p>
</div>
{{end}} {{ end }}
<form method="POST" action="/">
<div class="view-form">
<input class="view-input" type="text" name="url"
placeholder="https://stackoverflow.com/questions/123456/example-url" />
<button class="view-button" type="submit">View</button>
</div>
{{end}} {{ end }}
<form method="POST" action="/">
<div class="view-form">
<input
class="view-input"
type="text"
name="url"
placeholder="https://stackoverflow.com/questions/123456/example-url"
/>
<button class="view-button" type="submit">View</button>
</div>
</form>
<div class="options">
<div class="icon">
<a href="/options/images">
<img src="/static/icons/image.svg" alt="Toggle theme" />
</a>
</div>
{{ template "themeSwitcher.html" .}}
</form>
<div class="options">
<div class="icon">
<a href="/options/images">
<img src="/static/icons/image.svg" alt="Toggle theme" />
</a>
</div>
<p class="footer">
Brought to you by
<a
href="https://github.com/WhateverLabs"
target="_blank"
rel="noopener noreferrer"
>Whatever Labs</a
>
<a
href="https://github.com/httpjamesm/AnonymousOverflow"
target="_blank"
rel="noopener noreferrer"
>Source</a
>
• Version {{ .version }}
</p>
{{ template "themeSwitcher.html" .}}
</div>
</body>
</html>
<p class="footer">
Brought to you by
<a href="https://github.com/WhateverLabs" target="_blank" rel="noopener noreferrer">Whatever Labs</a>
<a href="https://github.com/httpjamesm/AnonymousOverflow" target="_blank"
rel="noopener noreferrer">Source</a>
• Version {{ .version }}
</p>
</div>
</body>

</html>
163 changes: 74 additions & 89 deletions templates/question.html
Original file line number Diff line number Diff line change
@@ -1,84 +1,73 @@
<!DOCTYPE html>
<html data-theme="{{ .theme }}">
<head>
<title>{{ .question.Title }} | AnonymousOverflow</title>
<link rel="stylesheet" href="/static/question.css" />
<link rel="stylesheet" href="/static/syntax.css" />
<link rel="stylesheet" href="/static/comments.css" />
<meta
http-equiv="Content-Security-Policy"
content="default-src 'none'; style-src 'self'; script-src 'self'; img-src {{ .imagePolicy }}; font-src 'self';"
/>
<meta name="description" content="{{ .question.ShortenedBody }}..." />
{{ template "sharedHead.html" }}
<link rel="stylesheet" href="/static/katex/katex.min.css">

<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="/static/katex/katex.min.js"></script>
<head>
<title>{{ .question.Title }} | AnonymousOverflow</title>
<link rel="stylesheet" href="/static/question.css" />
<link rel="stylesheet" href="/static/syntax.css" />
<link rel="stylesheet" href="/static/comments.css" />
<meta http-equiv="Content-Security-Policy"
content="default-src 'none'; style-src 'self'; script-src 'self'; img-src {{ .imagePolicy }}; font-src 'self';" />
<meta name="description" content="{{ .question.ShortenedBody }}..." />
{{ template "sharedHead.html" }}
<link rel="stylesheet" href="/static/katex/katex.min.css">

<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="/static/katex/contrib/auto-render.min.js"></script>
<script defer src="/static/question.js" type="text/javascript"></script>
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="/static/katex/katex.min.js"></script>

<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="/static/katex/contrib/auto-render.min.js"></script>
<script defer src="/static/question.js" type="text/javascript"></script>
</head>
<body>
<div class="header">
<a href="/" class="logo-link">
<img
class="logo"
src="/static/codecircles.webp"
alt="4 circles with alternating colors between green and white"
/>
</a>
{{ template "themeSwitcher.html" . }}

<body>
<div class="header">
<a href="/" class="logo-link">
<img class="logo" src="/static/codecircles.webp" alt="AnonymousOverflow home" />
</a>
{{ template "themeSwitcher.html" . }}
</div>
<div class="card">
<div class="card-header">
<h1>{{ .question.Title }}</h1>
<p class="timestamp">
Asked {{ .question.Timestamp }} by
<a href="{{ .question.AuthorURL }}" target="_blank" rel="noopener noreferrer">{{ .question.AuthorName
}}</a>.
</p>
</div>
<div class="card">
<div class="card-header">
<h1>{{ .question.Title }}</h1>
<p class="timestamp">
Asked {{ .question.Timestamp }} by
<a
href="{{ .question.AuthorURL }}"
target="_blank"
rel="noopener noreferrer"
>{{ .question.AuthorName }}</a
>.
</p>
</div>
<div class="card-body">{{ .question.Body }}</div>
<div class="card-tags">
{{ range .question.Tags }}
<div class="tag">{{ . }}</div>
{{ end }}
</div>
{{ if .question.Comments }} {{ template "comments.html"
.question }} {{end}}
<div class="card-body">{{ .question.Body }}</div>
<div class="card-tags">
{{ range .question.Tags }}
<div class="tag">{{ . }}</div>
{{ end }}
</div>
<hr class="post-divider" />
<div class="answers-header">
<h2>Answers</h2>
<div class="sorting">
<form>
<select name="sort_by">
<option disabled value="">Sort answers by...</option>
<option value="votes"{{ if eq .sortValue "votes" }} selected{{ end }}>Votes</option>
<option value="trending"{{ if eq .sortValue "trending" }} selected{{ end }}>Trending</option>
<option value="newest"{{ if eq .sortValue "newest" }} selected{{ end }}>Date modified (newest first)</option>
<option value="oldest"{{ if eq .sortValue "oldest" }} selected{{ end }}>Date created (oldest first)</option>
</select>
<button type="submit">
<img
src="/static/icons/sort.svg"
alt="Sieve icon"
/>
</button>
</form>
</div>
{{ if .question.Comments }} {{ template "comments.html"
.question }} {{end}}
</div>
<hr class="post-divider" />
<div class="answers-header">
<h2>Answers</h2>
<div class="sorting">
<form>
<select name="sort_by">
<option disabled value="">Sort answers by...</option>
<option value="votes" {{ if eq .sortValue "votes" }} selected{{ end }}>Votes</option>
<option value="trending" {{ if eq .sortValue "trending" }} selected{{ end }}>Trending</option>
<option value="newest" {{ if eq .sortValue "newest" }} selected{{ end }}>Date modified (newest
first)</option>
<option value="oldest" {{ if eq .sortValue "oldest" }} selected{{ end }}>Date created (oldest first)
</option>
</select>
<button type="submit">
<img src="/static/icons/sort.svg" alt="Sieve icon" />
</button>
</form>
</div>
{{ range $answer := .answers }}
<div class="answer" id="{{ $answer.ID }}">
<div
class="answer-meta{{ if $answer.IsAccepted }} accepted{{end}}"
>
</div>
{{ range $answer := .answers }}
<div class="answer" id="{{ $answer.ID }}">
<div class="answer-meta{{ if $answer.IsAccepted }} accepted{{end}}">
<p>
{{ if $answer.IsAccepted }} Accepted - {{ end }}
{{$answer.Upvotes}} Votes
Expand All @@ -89,21 +78,17 @@ <h2>Answers</h2>
</div>
</a>
</div>
{{ $answer.Body }}
<div class="answer-author-parent">
<div class="answer-author">
Answered {{ $answer.Timestamp }} by
<a
href="{{ $answer.AuthorURL }}"
target="_blank"
rel="noopener noreferrer"
>{{ $answer.AuthorName }}</a
>
</div>
{{ $answer.Body }}
<div class="answer-author-parent">
<div class="answer-author">
Answered {{ $answer.Timestamp }} by
<a href="{{ $answer.AuthorURL }}" target="_blank" rel="noopener noreferrer">{{ $answer.AuthorName }}</a>
</div>
{{ if $answer.Comments }} {{ template "comments.html" $answer }}
{{end}}
</div>
{{ end }}
</body>
</html>
{{ if $answer.Comments }} {{ template "comments.html" $answer }}
{{end}}
</div>
{{ end }}
</body>

</html>