]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toastergui: switch projects/ view to ToasterTable
authorElliot Smith <elliot.smith@intel.com>
Fri, 15 Jan 2016 11:00:47 +0000 (13:00 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 Jan 2016 16:28:33 +0000 (16:28 +0000)
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]

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>
lib/toaster/toastergui/tables.py
lib/toaster/toastergui/urls.py
lib/toaster/toastergui/views.py

index cc9b5aef4031baae43e5df348a0bb802eec1aecf..2e3c8a69565910acc7621a762c9a08415ab006a7 100644 (file)
@@ -638,7 +638,7 @@ class ProjectsTable(ToasterTable):
 
     def __init__(self, *args, **kwargs):
         super(ProjectsTable, self).__init__(*args, **kwargs)
-        self.default_orderby = 'updated'
+        self.default_orderby = '-updated'
         self.title = 'All projects'
         self.static_context_extra['Build'] = Build
 
index da97a311333b0e8558ac93440c42c833f77b0963..b5e9a0554dd0c5fd32aeafac8a86a31fc8e7a7ff 100644 (file)
@@ -74,14 +74,9 @@ urlpatterns = patterns('toastergui.views',
         # project URLs
         url(r'^newproject/$', 'newproject', name='newproject'),
 
-
-        # TODO remove when new toaster table is ready
-        url(r'^projects/$', 'projects', name='all-projects'),
-
-        # TODO move to /projects/ when new toaster table is ready
-        url(r'^projects-new/$',
+        url(r'^projects/$',
             tables.ProjectsTable.as_view(template_name="projects-toastertable.html"),
-            name='all-projects-new'),
+            name='all-projects'),
 
         url(r'^project/(?P<pid>\d+)/$', 'project', name='project'),
         url(r'^project/(?P<pid>\d+)/configuration$', 'projectconf', name='projectconf'),
index 8148623a8b403f6010c4eca4c2ad5845a0ebbf46..a79261de96afe0ff52c4d9b23781aeaf92d4cf7b 100755 (executable)
@@ -2990,9 +2990,7 @@ if True:
             }
             return render(request, "unavailable_artifact.html", context)
 
-
-
-
+    """
     @_template_renderer("projects.html")
     def projects(request):
         (pagesize, orderby) = _get_parameters_values(request, 10, 'updated:-')
@@ -3034,7 +3032,24 @@ if True:
         # translate the project's build target strings
         fstypes_map = {};
         for project in project_info:
-            fstypes_map[project.id] = project.get_last_build_extensions()
+            try:
+                targets = Target.objects.filter( build_id = project.get_last_build_id() )
+                comma = "";
+                extensions = "";
+                for t in targets:
+                    if ( not t.is_image ):
+                        continue
+                    tif = Target_Image_File.objects.filter( target_id = t.id )
+                    for i in tif:
+                        s=re.sub('.*tar.bz2', 'tar.bz2', i.file_name)
+                        if s == i.file_name:
+                            s=re.sub('.*\.', '', i.file_name)
+                        if None == re.search(s,extensions):
+                            extensions += comma + s
+                            comma = ", "
+                fstypes_map[project.id]=extensions
+            except (Target.DoesNotExist,IndexError):
+                fstypes_map[project.id]=project.get_last_imgfiles
 
         context = {
                 'mru' : build_mru,
@@ -3092,3 +3107,4 @@ if True:
 
         _set_parameters_values(pagesize, orderby, request)
         return context
+    """