refactor: Move export into separate app

This commit is contained in:
James Graham
2020-04-01 16:00:22 +01:00
parent 76270c4572
commit d02f865952
17 changed files with 188 additions and 128 deletions

View File

@@ -77,6 +77,7 @@ THIRD_PARTY_APPS = [
FIRST_PARTY_APPS = [
'people',
'activities',
'export',
]
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + FIRST_PARTY_APPS

View File

@@ -79,7 +79,7 @@
{% if request.user.is_superuser %}
<li class="nav-item">
<a href="{% url 'export' %}" class="nav-link">Export</a>
<a href="{% url 'export:index' %}" class="nav-link">Export</a>
</li>
<li class="nav-item">

View File

@@ -1,43 +0,0 @@
{% extends 'base.html' %}
{% block content %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page">Export Data</li>
</ol>
</nav>
<hr>
<table class="table table-borderless">
<thead>
<tr>
<th>Type</th>
<th>Records</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>People</td>
<td></td>
<td>
<a class="btn btn-info"
href="{% url 'people:person.export' %}">Export</a>
</td>
</tr>
<tr>
<td>Relationships</td>
<td></td>
<td>
<a class="btn btn-info"
href="{% url 'people:relationship.export' %}">Export</a>
</td>
</tr>
</tbody>
</table>
{% endblock %}

View File

@@ -28,9 +28,8 @@ urlpatterns = [
views.IndexView.as_view(),
name='index'),
path('export',
views.ExportListView.as_view(),
name='export'),
path('',
include('export.urls')),
path('',
include('people.urls')),

View File

@@ -4,13 +4,8 @@ Views belonging to the core of the project.
These views don't represent any of the models in the apps.
"""
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView
class IndexView(TemplateView):
template_name = 'index.html'
class ExportListView(LoginRequiredMixin, TemplateView):
template_name = 'export.html'