fix public index missing template context

This commit is contained in:
Nick Sweeting 2020-11-28 01:29:34 -05:00
parent 7d7ce3a790
commit fde65c3b7d
3 changed files with 14 additions and 6 deletions

View file

@ -19,7 +19,9 @@ from ..config import (
OUTPUT_DIR, OUTPUT_DIR,
PUBLIC_INDEX, PUBLIC_INDEX,
PUBLIC_SNAPSHOTS, PUBLIC_SNAPSHOTS,
PUBLIC_ADD_VIEW PUBLIC_ADD_VIEW,
VERSION,
FOOTER_INFO,
) )
from main import add from main import add
from ..util import base_url, ansi_to_html from ..util import base_url, ansi_to_html
@ -93,6 +95,13 @@ class PublicArchiveView(ListView):
model = Snapshot model = Snapshot
paginate_by = 100 paginate_by = 100
def get_context_data(self, **kwargs):
return {
**super().get_context_data(**kwargs),
'VERSION': VERSION,
'FOOTER_INFO': FOOTER_INFO,
}
def get_queryset(self, **kwargs): def get_queryset(self, **kwargs):
qs = super().get_queryset(**kwargs) qs = super().get_queryset(**kwargs)
query = self.request.GET.get('q') query = self.request.GET.get('q')

View file

@ -271,10 +271,9 @@
<br /> <br />
<center> <center>
<small> <small>
Archive created using <a href="https://github.com/ArchiveBox/ArchiveBox" title="Github">ArchiveBox</a> &nbsp; | Archive created using <a href="https://github.com/ArchiveBox/ArchiveBox" title="Github">ArchiveBox</a> version
&nbsp; <a href="https://github.com/ArchiveBox/ArchiveBox/releases" title="Releases">v{{VERSION}}</a>.
Download index as <a href="index.json" title="JSON summary of archived links.">JSON</a> <br/><br/>
<br /><br />
{{FOOTER_INFO}} {{FOOTER_INFO}}
</small> </small>
</center> </center>

View file

@ -204,7 +204,7 @@
<center> <center>
<small> <small>
Created using <a href="https://github.com/ArchiveBox/ArchiveBox" title="Github">ArchiveBox</a> Created using <a href="https://github.com/ArchiveBox/ArchiveBox" title="Github">ArchiveBox</a>
version <a href="https://github.com/ArchiveBox/ArchiveBox/tree/v$version" title="Git commit">v$version</a>. version <a href="https://github.com/ArchiveBox/ArchiveBox/releases" title="Releases">v$version</a>.
<br/><br/> <br/><br/>
$footer_info $footer_info
</small> </small>