summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-01-15 13:00:47 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-15 16:29:59 +0000
commitef93dce7e164e2b9ff764937d4365a9748a03c83 (patch)
tree4915d2124827962dea21f6ede49ddbf2165e8e5f
parent417f1d3f5306c668e30f2223048b542a46dd5d59 (diff)
downloadpoky-ef93dce7e164e2b9ff764937d4365a9748a03c83.tar.gz
bitbake: toastergui: switch projects/ view to ToasterTable
Remove the old projects page and replace with the new ToasterTable-based version. NB although the projects.html template is no longer required, it's been left in as there will be changes applied to it for the new theme. These changes will have to then be transferred from the projects.html template to projects-toastertable.html. Similarly, the code for the projects page in views.py has been retained. [YOCTO #8738] (Bitbake rev: ebe7831ef65e78a9d100f29a63311518577fc838) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py2
-rw-r--r--bitbake/lib/toaster/toastergui/urls.py9
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py24
3 files changed, 23 insertions, 12 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index cc9b5aef40..2e3c8a6956 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -638,7 +638,7 @@ class ProjectsTable(ToasterTable):
638 638
639 def __init__(self, *args, **kwargs): 639 def __init__(self, *args, **kwargs):
640 super(ProjectsTable, self).__init__(*args, **kwargs) 640 super(ProjectsTable, self).__init__(*args, **kwargs)
641 self.default_orderby = 'updated' 641 self.default_orderby = '-updated'
642 self.title = 'All projects' 642 self.title = 'All projects'
643 self.static_context_extra['Build'] = Build 643 self.static_context_extra['Build'] = Build
644 644
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py
index da97a31133..b5e9a0554d 100644
--- a/bitbake/lib/toaster/toastergui/urls.py
+++ b/bitbake/lib/toaster/toastergui/urls.py
@@ -74,14 +74,9 @@ urlpatterns = patterns('toastergui.views',
74 # project URLs 74 # project URLs
75 url(r'^newproject/$', 'newproject', name='newproject'), 75 url(r'^newproject/$', 'newproject', name='newproject'),
76 76
77 77 url(r'^projects/$',
78 # TODO remove when new toaster table is ready
79 url(r'^projects/$', 'projects', name='all-projects'),
80
81 # TODO move to /projects/ when new toaster table is ready
82 url(r'^projects-new/$',
83 tables.ProjectsTable.as_view(template_name="projects-toastertable.html"), 78 tables.ProjectsTable.as_view(template_name="projects-toastertable.html"),
84 name='all-projects-new'), 79 name='all-projects'),
85 80
86 url(r'^project/(?P<pid>\d+)/$', 'project', name='project'), 81 url(r'^project/(?P<pid>\d+)/$', 'project', name='project'),
87 url(r'^project/(?P<pid>\d+)/configuration$', 'projectconf', name='projectconf'), 82 url(r'^project/(?P<pid>\d+)/configuration$', 'projectconf', name='projectconf'),
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 8148623a8b..a79261de96 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2990,9 +2990,7 @@ if True:
2990 } 2990 }
2991 return render(request, "unavailable_artifact.html", context) 2991 return render(request, "unavailable_artifact.html", context)
2992 2992
2993 2993 """
2994
2995
2996 @_template_renderer("projects.html") 2994 @_template_renderer("projects.html")
2997 def projects(request): 2995 def projects(request):
2998 (pagesize, orderby) = _get_parameters_values(request, 10, 'updated:-') 2996 (pagesize, orderby) = _get_parameters_values(request, 10, 'updated:-')
@@ -3034,7 +3032,24 @@ if True:
3034 # translate the project's build target strings 3032 # translate the project's build target strings
3035 fstypes_map = {}; 3033 fstypes_map = {};
3036 for project in project_info: 3034 for project in project_info:
3037 fstypes_map[project.id] = project.get_last_build_extensions() 3035 try:
3036 targets = Target.objects.filter( build_id = project.get_last_build_id() )
3037 comma = "";
3038 extensions = "";
3039 for t in targets:
3040 if ( not t.is_image ):
3041 continue
3042 tif = Target_Image_File.objects.filter( target_id = t.id )
3043 for i in tif:
3044 s=re.sub('.*tar.bz2', 'tar.bz2', i.file_name)
3045 if s == i.file_name:
3046 s=re.sub('.*\.', '', i.file_name)
3047 if None == re.search(s,extensions):
3048 extensions += comma + s
3049 comma = ", "
3050 fstypes_map[project.id]=extensions
3051 except (Target.DoesNotExist,IndexError):
3052 fstypes_map[project.id]=project.get_last_imgfiles
3038 3053
3039 context = { 3054 context = {
3040 'mru' : build_mru, 3055 'mru' : build_mru,
@@ -3092,3 +3107,4 @@ if True:
3092 3107
3093 _set_parameters_values(pagesize, orderby, request) 3108 _set_parameters_values(pagesize, orderby, request)
3094 return context 3109 return context
3110 """