From d2d8b9012cfbf2c785ba857e9e1d55cc08d9d973 Mon Sep 17 00:00:00 2001 From: George Lacey Date: Mon, 10 May 2021 20:17:56 +0100 Subject: [PATCH] Move forms to own directory --- borg-client/borgclient.py | 6 +++--- borgweb/borg/templates/borg/{ => post}/archive.html | 0 borgweb/borg/templates/borg/{ => post}/error.html | 0 borgweb/borg/templates/borg/{ => post}/repo.html | 0 borgweb/borg/urls.py | 6 +++--- borgweb/borg/views.py | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) rename borgweb/borg/templates/borg/{ => post}/archive.html (100%) rename borgweb/borg/templates/borg/{ => post}/error.html (100%) rename borgweb/borg/templates/borg/{ => post}/repo.html (100%) diff --git a/borg-client/borgclient.py b/borg-client/borgclient.py index a4aecef..eb5fd1e 100644 --- a/borg-client/borgclient.py +++ b/borg-client/borgclient.py @@ -35,16 +35,16 @@ class BorgClient(object): return post_responce def post_error(self, post_data): - url = f"{self.url}/error" + url = f"{self.url}/post/error" return self.__post(url, post_data).text def post_repo(self, post_data): - url = f"{self.url}/repo" + url = f"{self.url}/post/repo" return self.__post(url, post_data).text def post_archive_and_cache(self, post_data): - url = f"{self.url}/archive" + url = f"{self.url}/post/archive" return self.__post(url, post_data).text diff --git a/borgweb/borg/templates/borg/archive.html b/borgweb/borg/templates/borg/post/archive.html similarity index 100% rename from borgweb/borg/templates/borg/archive.html rename to borgweb/borg/templates/borg/post/archive.html diff --git a/borgweb/borg/templates/borg/error.html b/borgweb/borg/templates/borg/post/error.html similarity index 100% rename from borgweb/borg/templates/borg/error.html rename to borgweb/borg/templates/borg/post/error.html diff --git a/borgweb/borg/templates/borg/repo.html b/borgweb/borg/templates/borg/post/repo.html similarity index 100% rename from borgweb/borg/templates/borg/repo.html rename to borgweb/borg/templates/borg/post/repo.html diff --git a/borgweb/borg/urls.py b/borgweb/borg/urls.py index 10b924e..eff5865 100644 --- a/borgweb/borg/urls.py +++ b/borgweb/borg/urls.py @@ -4,7 +4,7 @@ from . import views urlpatterns = [ path('', views.index, name='index'), - path('repo', views.get_repo, name='repo'), - path('archive', views.get_archive, name='archive'), - path('error', views.get_error, name='error'), + path('post/repo', views.get_repo, name='repo'), + path('post/archive', views.get_archive, name='archive'), + path('post/error', views.get_error, name='error'), ] diff --git a/borgweb/borg/views.py b/borgweb/borg/views.py index 18dd5bb..9f9bdcb 100644 --- a/borgweb/borg/views.py +++ b/borgweb/borg/views.py @@ -60,7 +60,7 @@ def get_repo(request): else: form = RepoForm() - return render(request, 'borg/repo.html', {'form': form}) + return render(request, 'borg/post/repo.html', {'form': form}) @permission_required("borg.add_archive") @@ -88,7 +88,7 @@ def get_archive(request): else: form = ArchiveForm() - return render(request, 'borg/archive.html', {'form': form}) + return render(request, 'borg/post/archive.html', {'form': form}) @permission_required("borg.add_error") @@ -106,4 +106,4 @@ def get_error(request): else: form = ErrorForm() - return render(request, 'borg/error.html', {'form': form}) + return render(request, 'borg/post/error.html', {'form': form})