aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-03-31 20:38:30 +0100
committerPaul Eggleton <paul.eggleton@linux.intel.com>2013-03-31 20:38:30 +0100
commitce1775db31d7c9c2c776774f7747c2d53e2f511b (patch)
treefa712dd559a22f0b9234e85d79cf5fa666135868 /layerindex
parent6ec84fb7f50647b4be72dc5c0b22e07cf4ec8eaf (diff)
downloadopenembedded-core-contrib-ce1775db31d7c9c2c776774f7747c2d53e2f511b.tar.gz
Add basic change history page
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex')
-rw-r--r--layerindex/urls.py6
-rw-r--r--layerindex/views.py8
2 files changed, 13 insertions, 1 deletions
diff --git a/layerindex/urls.py b/layerindex/urls.py
index 1113f43443..fa50322b75 100644
--- a/layerindex/urls.py
+++ b/layerindex/urls.py
@@ -8,7 +8,7 @@ from django.conf.urls.defaults import *
from django.views.generic import TemplateView, DetailView, ListView
from django.views.defaults import page_not_found
from layerindex.models import LayerItem, Recipe
-from layerindex.views import LayerListView, LayerReviewListView, LayerReviewDetailView, RecipeSearchView, MachineSearchView, PlainTextListView, LayerDetailView, edit_layer_view, delete_layer_view, edit_layernote_view, delete_layernote_view, switch_branch_view
+from layerindex.views import LayerListView, LayerReviewListView, LayerReviewDetailView, RecipeSearchView, MachineSearchView, PlainTextListView, LayerDetailView, edit_layer_view, delete_layer_view, edit_layernote_view, delete_layernote_view, switch_branch_view, HistoryListView
urlpatterns = patterns('',
url(r'^$',
@@ -67,6 +67,10 @@ urlpatterns = patterns('',
context_object_name='recipe_list',
template_name='layerindex/rawrecipes.txt'),
name='recipe_list_raw'),
+ url(r'^history/$',
+ HistoryListView.as_view(
+ template_name='layerindex/history.html'),
+ name='history_list'),
url(r'^about$',
TemplateView.as_view(
template_name='layerindex/about.html'),
diff --git a/layerindex/views.py b/layerindex/views.py
index 26cd22fec1..fc46da09f2 100644
--- a/layerindex/views.py
+++ b/layerindex/views.py
@@ -21,6 +21,7 @@ from django.template.loader import get_template
from django.template import Context
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
+from reversion.models import Revision
import simplesearch
import settings
@@ -310,3 +311,10 @@ class PlainTextListView(ListView):
template = get_template(self.template_name)
return HttpResponse(template.render(Context(context)),
content_type='text/plain')
+
+class HistoryListView(ListView):
+ context_object_name = "revisions"
+ paginate_by = 50
+
+ def get_queryset(self):
+ return Revision.objects.all().order_by('-date_created')