mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-15 23:54:27 -04:00
cleanup templates and views
This commit is contained in:
parent
ed13ec7655
commit
a98298103d
34 changed files with 179 additions and 259 deletions
|
@ -28,20 +28,20 @@ from ..util import base_url, ansi_to_html
|
|||
from ..index.html import snapshot_icons
|
||||
|
||||
|
||||
class MainIndex(View):
|
||||
template = 'main_index.html'
|
||||
|
||||
class HomepageView(View):
|
||||
def get(self, request):
|
||||
if request.user.is_authenticated:
|
||||
return redirect('/admin/core/snapshot/')
|
||||
|
||||
if PUBLIC_INDEX:
|
||||
return redirect('public-index')
|
||||
return redirect('/public')
|
||||
|
||||
return redirect(f'/admin/login/?next={request.path}')
|
||||
|
||||
|
||||
class LinkDetails(View):
|
||||
class SnapshotView(View):
|
||||
# render static html index from filesystem archive/<timestamp>/index.html
|
||||
|
||||
def get(self, request, path):
|
||||
# missing trailing slash -> redirect to index
|
||||
if '/' not in path:
|
||||
|
@ -91,8 +91,8 @@ class LinkDetails(View):
|
|||
status=404,
|
||||
)
|
||||
|
||||
class PublicArchiveView(ListView):
|
||||
template = 'snapshot_list.html'
|
||||
class PublicIndexView(ListView):
|
||||
template_name = 'public_index.html'
|
||||
model = Snapshot
|
||||
paginate_by = 100
|
||||
ordering = ['title']
|
||||
|
@ -122,7 +122,7 @@ class PublicArchiveView(ListView):
|
|||
|
||||
|
||||
class AddView(UserPassesTestMixin, FormView):
|
||||
template_name = "add_links.html"
|
||||
template_name = "add.html"
|
||||
form_class = AddLinkForm
|
||||
|
||||
def get_initial(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue