[bitbake-devel] [PATCH 18/18] toaster: importlayer Tidy up the page initialisation

Alex DAMIAN alexandru.damian at intel.com
Fri Dec 12 11:45:17 UTC 2014


From: Michael Wood <michael.g.wood at intel.com>

Tidy up the page initialisation and change the error logging so that
it's consistent with other pages.

Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
 lib/toaster/toastergui/templates/importlayer.html | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/lib/toaster/toastergui/templates/importlayer.html b/lib/toaster/toastergui/templates/importlayer.html
index c92e552..a4d8ee1 100644
--- a/lib/toaster/toastergui/templates/importlayer.html
+++ b/lib/toaster/toastergui/templates/importlayer.html
@@ -12,19 +12,20 @@
                   <script src="{% static 'js/importlayer.js' %}"></script>
                   <script>
                     $(document).ready(function (){
-                      var ctx = {};
-                      ctx.xhrDataTypeaheadUrl = "{% url 'xhr_datatypeahead' %}";
-                      ctx.layerDetailsUrl = "{% url 'layerdetails' %}";
-                      ctx.xhrImportLayerUrl = "{% url 'xhr_importlayer' %}";
-                      ctx.xhrEditProjectUrl = "{% url 'xhr_projectedit' project.id %}";
-                      ctx.projectPageUrl = "{% url 'project' project.id %}";
-                      ctx.projectId = {{project.id}};
+                      var ctx = {
+                        xhrDataTypeaheadUrl : "{% url 'xhr_datatypeahead' %}",
+                        layerDetailsUrl : "{% url 'layerdetails' %}",
+                        xhrImportLayerUrl : "{% url 'xhr_importlayer' %}",
+                        xhrEditProjectUrl : "{% url 'xhr_projectedit' project.id %}",
+                        projectPageUrl : "{% url 'project' project.id %}",
+                        projectId : {{project.id}}
+                      };
 
                       try {
                         importLayerPageInit(ctx);
-                      } catch(e) {
-                        document.write(e.stack);
-                        console.log(e);
+                      } catch (e) {
+                        document.write("Sorry, An error has occurred loading this page");
+                        console.warn(e);
                       }
                     });
                   </script>
-- 
1.9.1




More information about the bitbake-devel mailing list