summaryrefslogtreecommitdiffstats
path: root/welco
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-04-13 12:12:59 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-04-24 06:30:38 (GMT)
commitf9f922656ce8078ff7b3697297c998079f81c3c7 (patch)
tree420f55daf02806c40bc6e1eadb69556683beae55 /welco
parent43c19c2a67aa471c54c3eae8047fe74a8bda5a6d (diff)
downloadwelco-master.zip
welco-master.tar.gz
welco-master.tar.bz2
misc: remove django-reversion dependency (#41641)HEADv0.76master
Diffstat (limited to 'welco')
-rw-r--r--welco/kb/models.py2
-rw-r--r--welco/kb/templates/kb/page_detail.html1
-rw-r--r--welco/kb/templates/kb/page_history.html24
-rw-r--r--welco/kb/templates/kb/page_version.html26
-rw-r--r--welco/kb/views.py39
-rw-r--r--welco/settings.py2
-rw-r--r--welco/urls.py2
7 files changed, 0 insertions, 96 deletions
diff --git a/welco/kb/models.py b/welco/kb/models.py
index e89c720..1e3b817 100644
--- a/welco/kb/models.py
+++ b/welco/kb/models.py
@@ -19,11 +19,9 @@ from django.db import models
from django.utils.translation import ugettext_lazy as _
from ckeditor.fields import RichTextField
-import reversion
from taggit.managers import TaggableManager
-@reversion.register
class Page(models.Model):
title = models.CharField(_('Title'), max_length=200)
slug = models.SlugField(_('Slug'))
diff --git a/welco/kb/templates/kb/page_detail.html b/welco/kb/templates/kb/page_detail.html
index 9fb7842..34b9c3f 100644
--- a/welco/kb/templates/kb/page_detail.html
+++ b/welco/kb/templates/kb/page_detail.html
@@ -5,7 +5,6 @@
<h2>{% trans 'Knowledge Base' %} - {{ object.title }}</h2>
{% if can_manage %}
<a rel="popup" href="{% url 'kb-page-delete' slug=object.slug %}">{% trans 'Delete' %}</a>
-<a href="{% url 'kb-page-history' slug=object.slug %}">{% trans 'History' %}</a>
<a href="{% url 'kb-page-edit' slug=object.slug %}">{% trans 'Edit' %}</a>
{% endif %}
{% endblock %}
diff --git a/welco/kb/templates/kb/page_history.html b/welco/kb/templates/kb/page_history.html
deleted file mode 100644
index 46a1276..0000000
--- a/welco/kb/templates/kb/page_history.html
+++ /dev/null
@@ -1,24 +0,0 @@
-{% extends "kb/page_detail.html" %}
-{% load i18n %}
-
-{% block appbar %}
-<h2>{% trans 'Knowledge Base' %} - {{ object.title }}</h2>
-<a href="{% url 'kb-page-view' slug=object.slug %}">{% trans 'Back to page' %}</a>
-{% endblock %}
-
-{% block breadcrumb %}
-{{ block.super }}
-<a href=".">{% trans 'History' %}</a>
-{% endblock %}
-
-{% block content %}
-
-<div id="page-history">
-<ul>
-{% for version in versions_list %}
-<li>{{ version.revision.date_created }}, <a href="{% url 'kb-page-version' slug=object.slug version=version.id %}">{% trans 'view' %}</a></li>
-{% endfor %}
-</ul>
-</div>
-
-{% endblock %}
diff --git a/welco/kb/templates/kb/page_version.html b/welco/kb/templates/kb/page_version.html
deleted file mode 100644
index 106745c..0000000
--- a/welco/kb/templates/kb/page_version.html
+++ /dev/null
@@ -1,26 +0,0 @@
-{% extends "kb/page_detail.html" %}
-{% load i18n %}
-
-{% block appbar %}
-<h2>{% trans 'Knowledge Base' %} - {{ object.title }}</h2>
-<a href="{% url 'kb-page-view' slug=object.slug %}">{% trans 'Back to page' %}</a>
-<a href="{% url 'kb-page-history' slug=object.slug %}">{% trans 'History' %}</a>
-{% endblock %}
-
-{% block content %}
-
-<div class="old-version warning-notice">
-<p>
-{% trans 'Warning: this is an old version of this page.' %}
-</p>
-
-<form method="POST">
- {% csrf_token %}
- <button>{% trans 'Revert to this version' %}</button>
-</form>
-</div>
-
-{{block.super}}
-
-{% endblock %}
-
diff --git a/welco/kb/views.py b/welco/kb/views.py
index 4c21b7c..b2010d2 100644
--- a/welco/kb/views.py
+++ b/welco/kb/views.py
@@ -31,7 +31,6 @@ from django.views.generic import (DetailView, CreateView, UpdateView,
from haystack.forms import SearchForm
from haystack.generic_views import SearchView
from haystack.query import SearchQuerySet
-from reversion.models import Version
from taggit.models import Tag
from .models import Page
@@ -134,44 +133,6 @@ class PageSearchView(SearchView):
page_search = login_required(PageSearchView.as_view())
-class PageHistoryView(DetailView):
- model = Page
- template_name = 'kb/page_history.html'
-
- def dispatch(self, request, *args, **kwargs):
- check_request_perms(request)
- return super(PageHistoryView, self).dispatch(request, *args, **kwargs)
-
- def get_context_data(self, **kwargs):
- context = super(PageHistoryView, self).get_context_data(**kwargs)
- context['versions_list'] = Version.objects.get_for_object(self.get_object())
- return context
-
-page_history = login_required(PageHistoryView.as_view())
-
-
-class PageVersionView(DetailView):
- model = Page
- template_name = 'kb/page_version.html'
-
- def dispatch(self, request, *args, **kwargs):
- check_request_perms(request)
- return super(PageVersionView, self).dispatch(request, *args, **kwargs)
-
- def get_context_data(self, **kwargs):
- context = super(PageVersionView, self).get_context_data(**kwargs)
- context['object'] = Version.objects.get(id=self.kwargs.get('version')).object
- self.kwargs.get('version')
- return context
-
- def post(self, request, *args, **kwargs):
- version = Version.objects.get(id=self.kwargs.get('version'))
- version.revision.revert()
- return HttpResponseRedirect(self.get_object().get_absolute_url())
-
-page_version = login_required(PageVersionView.as_view())
-
-
class KbZone(TemplateView):
template_name = 'kb/zone.html'
diff --git a/welco/settings.py b/welco/settings.py
index d307d42..03f93d1 100644
--- a/welco/settings.py
+++ b/welco/settings.py
@@ -41,7 +41,6 @@ INSTALLED_APPS = (
'django.contrib.staticfiles',
'ckeditor',
'haystack',
- 'reversion',
'taggit',
'welco.sources.counter',
'welco.sources.mail',
@@ -61,7 +60,6 @@ MIDDLEWARE = (
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
- 'reversion.middleware.RevisionMiddleware',
)
ROOT_URLCONF = 'welco.urls'
diff --git a/welco/urls.py b/welco/urls.py
index 6350ef8..0ea3085 100644
--- a/welco/urls.py
+++ b/welco/urls.py
@@ -53,8 +53,6 @@ urlpatterns = [
url(r'^ajax/kb/(?P<slug>[\w-]+)/$', welco.kb.views.page_detail_fragment, name='kb-page-fragment'),
url(r'^kb/(?P<slug>[\w-]+)/edit$', welco.kb.views.page_edit, name='kb-page-edit'),
url(r'^kb/(?P<slug>[\w-]+)/delete$', welco.kb.views.page_delete, name='kb-page-delete'),
- url(r'^kb/(?P<slug>[\w-]+)/history$', welco.kb.views.page_history, name='kb-page-history'),
- url(r'^kb/(?P<slug>[\w-]+)/version/(?P<version>\w+)/$', welco.kb.views.page_version, name='kb-page-version'),
url(r'^ajax/contacts$', welco.contacts.views.zone, name='contacts-zone'),
url(r'^contacts/search/json/$', welco.contacts.views.search_json, name='contacts-search-json'),