From 4004aebb1b505967410494ed152b44eab0bf6cb4 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Mon, 9 Mar 2015 11:57:08 +0000 Subject: [PATCH] bitbake: toastergui: bring back base URLs for pages that need them Some URLs, although invalid on their own, are used in JS to build valid page pointers. Previous patch removed two of these URLs, breaking the display of several patches. This patch re-adds these URLs with different names, and returns 400 Bad Request empty pages on them, which is consistent with the intended usage of these URLs. (Bitbake rev: 73afee5ddb2e89dcec65854639b19b8860232d89) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/templates/base.html | 2 +- bitbake/lib/toaster/toastergui/templates/importlayer.html | 2 +- bitbake/lib/toaster/toastergui/templates/layerdetails.html | 2 +- bitbake/lib/toaster/toastergui/templates/project.html | 2 +- bitbake/lib/toaster/toastergui/urls.py | 4 ++++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html index 62cc7ad94c..a781224ea1 100644 --- a/bitbake/lib/toaster/toastergui/templates/base.html +++ b/bitbake/lib/toaster/toastergui/templates/base.html @@ -34,7 +34,7 @@ var ctx = {}; ctx.xhrDataTypeaheadUrl = "{% url 'xhr_datatypeahead' %}"; ctx.projectBuildUrl = "{% url 'xhr_build' %}"; - ctx.projectPageUrl = "{% url 'project' %}"; + ctx.projectPageUrl = "{% url 'base_project' %}"; ctx.projectInfoUrl = "{% url 'xhr_projectinfo' %}"; ctx.numProjects = {{projects|length}}; {% if project %} diff --git a/bitbake/lib/toaster/toastergui/templates/importlayer.html b/bitbake/lib/toaster/toastergui/templates/importlayer.html index 19d2fc4af8..6b2111a1f4 100644 --- a/bitbake/lib/toaster/toastergui/templates/importlayer.html +++ b/bitbake/lib/toaster/toastergui/templates/importlayer.html @@ -14,7 +14,7 @@ $(document).ready(function (){ var ctx = { xhrDataTypeaheadUrl : "{% url 'xhr_datatypeahead' %}", - layerDetailsUrl : "{% url 'layerdetails' %}", + layerDetailsUrl : "{% url 'base_layerdetails' %}", xhrImportLayerUrl : "{% url 'xhr_importlayer' %}", xhrEditProjectUrl : "{% url 'xhr_projectedit' project.id %}", projectPageUrl : "{% url 'project' project.id %}", diff --git a/bitbake/lib/toaster/toastergui/templates/layerdetails.html b/bitbake/lib/toaster/toastergui/templates/layerdetails.html index c3a50dff29..67033b1e07 100644 --- a/bitbake/lib/toaster/toastergui/templates/layerdetails.html +++ b/bitbake/lib/toaster/toastergui/templates/layerdetails.html @@ -17,7 +17,7 @@ $(document).ready(function (){ var ctx = { projectBuildUrl : "{% url 'xhr_build' %}", - layerDetailsUrl : "{% url 'layerdetails' %}", + layerDetailsUrl : "{% url 'base_layerdetails' %}", projectPageUrl : "{% url 'project' project.id %}", xhrEditProjectUrl : "{% url 'xhr_projectedit' project.id %}", xhrDataTypeaheadUrl : "{% url 'xhr_datatypeahead' %}", diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html index a8cb917c6d..58b524eaa8 100644 --- a/bitbake/lib/toaster/toastergui/templates/project.html +++ b/bitbake/lib/toaster/toastergui/templates/project.html @@ -426,7 +426,7 @@ angular.element(document).ready(function() { scope.urls.layers = "{% url 'layers' %}"; scope.urls.targets = "{% url 'targets' %}"; scope.urls.importlayer = "{% url 'importlayer'%}"; - scope.urls.layer = "{% url 'layerdetails' %}"; + scope.urls.layer = "{% url 'base_layerdetails' %}"; scope.project = {{prj|json}}; scope.builds = {{builds|json}}; scope.layers = {{layers|json}}; diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index 64f790293a..8a7fef1dee 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py @@ -19,6 +19,8 @@ from django.conf.urls import patterns, include, url from django.views.generic import RedirectView +from django.http import HttpResponseBadRequest + urlpatterns = patterns('toastergui.views', # landing page url(r'^landing/$', 'landing', name='landing'), @@ -78,11 +80,13 @@ urlpatterns = patterns('toastergui.views', url(r'^layers/$', 'layers', name='layers'), url(r'^layer/(?P\d+)/$', 'layerdetails', name='layerdetails'), + url(r'^layer/$', lambda x: HttpResponseBadRequest(), name='base_layerdetails'), url(r'^targets/$', 'targets', name='all-targets'), url(r'^machines/$', 'machines', name='machines'), url(r'^projects/$', 'projects', name='all-projects'), + url(r'^project/$', lambda x: HttpResponseBadRequest(), name='base_project'), url(r'^project/(?P\d+)/$', 'project', name='project'), url(r'^project/(?P\d+)/configuration$', 'projectconf', name='projectconf'), url(r'^project/(?P\d+)/builds$', 'projectbuilds', name='projectbuilds'),