Patchwork [bitbake-devel,35/94] bitbake: webhob: clean up URL structure

login
register
mail settings
Submitter Alexandru DAMIAN
Date Sept. 24, 2013, 4:52 p.m.
Message ID <618a4ca399aa451cba8cf8ab19a7967ef2dd2976.1380041477.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/58881/
State New
Headers show

Comments

Alexandru DAMIAN - Sept. 24, 2013, 4:52 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

We clean up the URL structure.
* default redirect to GUI version
* basic HTML interface now available at /simple/
* clear-up simple/ paths towards object-type URLs

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bitbake/lib/webhob/bldviewer/urls.py | 6 ++++--
 bitbake/lib/webhob/whbmain/urls.py   | 5 ++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

Patch

diff --git a/bitbake/lib/webhob/bldviewer/urls.py b/bitbake/lib/webhob/bldviewer/urls.py
index 8d5dc6e..756b3fa 100644
--- a/bitbake/lib/webhob/bldviewer/urls.py
+++ b/bitbake/lib/webhob/bldviewer/urls.py
@@ -1,8 +1,10 @@ 
 from django.conf.urls import patterns, include, url
+from django.views.generic.simple import redirect_to
 
 
 urlpatterns = patterns('bldviewer.views',
-        url(r'^$', 'build', name='build'),
+        url(r'^build/$', 'build', name='build'),
         url(r'^layers/$', 'layer', name='layer'),
-        url(r'^(?P<build_id>\d+)/$', 'task', name='task'),
+        url(r'^build/(?P<build_id>\d+)/task/$', 'task', name='task'),
+        url(r'^$', redirect_to, {'url': 'build/'}),
 )
diff --git a/bitbake/lib/webhob/whbmain/urls.py b/bitbake/lib/webhob/whbmain/urls.py
index 14345f6..0e15eda 100644
--- a/bitbake/lib/webhob/whbmain/urls.py
+++ b/bitbake/lib/webhob/whbmain/urls.py
@@ -1,13 +1,16 @@ 
 from django.conf.urls import patterns, include, url
+from django.views.generic.simple import redirect_to
+
 
 # Uncomment the next two lines to enable the admin:
 # from django.contrib import admin
 # admin.autodiscover()
 
 urlpatterns = patterns('',
-    url(r'^build/', include('bldviewer.urls')),
+    url(r'^simple/', include('bldviewer.urls')),
     url(r'^api/1.0/', include('bldviewer.api')),
     url(r'^gui/', include('whbgui.urls')),
+    url(r'^$', redirect_to, {'url': '/gui/'}),
     # Examples:
     # url(r'^webhob/', include('webhob.foo.urls')),