diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-04-10 18:15:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-08 17:42:05 +0100 |
commit | ed26a06a07a75c8039f2a9b251b350331c7474aa (patch) | |
tree | ebb2d88d75b51a856322c0a26ab89570a9954276 /bitbake/lib/toaster/toastergui/templates/base.html | |
parent | 4b59ba1bbb61fe60f500ad742a6515227b22397d (diff) | |
download | poky-ed26a06a07a75c8039f2a9b251b350331c7474aa.tar.gz |
bitbake: toaster: Move project context variables to common scope
We have a bunch of context data which are used in multiple pages so it
makes more sense to have this in a single place libtoaster.ctx that's
accessible from each page rather than request it from every page.
(Bitbake rev: 4ef2774a2f683929c700550a9acc7b8f6074195b)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/base.html')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/base.html | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html index 58392b36f5..25933a1e90 100644 --- a/bitbake/lib/toaster/toastergui/templates/base.html +++ b/bitbake/lib/toaster/toastergui/templates/base.html | |||
@@ -26,20 +26,27 @@ | |||
26 | libtoaster.debug = true; | 26 | libtoaster.debug = true; |
27 | </script> | 27 | </script> |
28 | {% endif %} | 28 | {% endif %} |
29 | <script> | ||
30 | libtoaster.ctx = { | ||
31 | projectId : {{project.id|default:'undefined'}}, | ||
32 | xhrDataTypeaheadUrl : "{% url 'xhr_datatypeahead' %}", | ||
33 | {% if project.id %} | ||
34 | xhrProjectEditUrl : "{% url 'xhr_projectedit' project.id %}", | ||
35 | projectPageUrl : "{% url 'project' project.id %}", | ||
36 | projectName : "{{project.name}}", | ||
37 | {% endif %} | ||
38 | }; | ||
39 | </script> | ||
29 | <script src="{% static 'js/base.js' %}"></script> | 40 | <script src="{% static 'js/base.js' %}"></script> |
30 | {%if MANAGED %} | 41 | {%if MANAGED %} |
31 | <script> | 42 | <script> |
32 | $(document).ready(function () { | 43 | $(document).ready(function () { |
33 | /* Vars needed for base.js */ | 44 | /* Vars needed for base.js */ |
34 | var ctx = {}; | 45 | var ctx = {}; |
35 | ctx.xhrDataTypeaheadUrl = "{% url 'xhr_datatypeahead' %}"; | ||
36 | ctx.projectBuildUrl = "{% url 'xhr_build' %}"; | 46 | ctx.projectBuildUrl = "{% url 'xhr_build' %}"; |
37 | ctx.projectPageUrl = "{% url 'base_project' %}"; | 47 | ctx.projectBasePageUrl = "{% url 'base_project' %}"; |
38 | ctx.projectInfoUrl = "{% url 'xhr_projectinfo' %}"; | 48 | ctx.projectInfoUrl = "{% url 'xhr_projectinfo' %}"; |
39 | ctx.numProjects = {{projects|length}}; | 49 | ctx.numProjects = {{projects|length}}; |
40 | {% if project %} | ||
41 | ctx.projectId = {{project.id}}; | ||
42 | {% endif %} | ||
43 | ctx.currentUrl = "{{request.path|escapejs}}"; | 50 | ctx.currentUrl = "{{request.path|escapejs}}"; |
44 | 51 | ||
45 | basePageInit(ctx); | 52 | basePageInit(ctx); |