diff options
author | Belen Barros Pena <belen.barros.pena@linux.intel.com> | 2016-06-08 18:00:06 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-15 08:35:05 +0100 |
commit | 1a00cdbcb17510ad5d492fa0feb92f6666c1ab73 (patch) | |
tree | ad81f28e8a631d51cb7f2f81741a845c3eb6c052 /bitbake | |
parent | a7d498dfd3929eafb87274f27b487ef2fe1e7e68 (diff) | |
download | poky-1a00cdbcb17510ad5d492fa0feb92f6666c1ab73.tar.gz |
bitbake: toaster: build data Fix left navigation
Make sure the current page is always highlighted in the left navigation.
(Bitbake rev: 3d7f5d6ae843bcc3b5af1a9414ab5cb2759d0853)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
4 files changed, 22 insertions, 15 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html index d9adcd77f8..856259a69d 100644 --- a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html +++ b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html | |||
@@ -23,6 +23,9 @@ | |||
23 | {% block localbreadcrumb %}{% endblock %} | 23 | {% block localbreadcrumb %}{% endblock %} |
24 | </ul> | 24 | </ul> |
25 | <script> | 25 | <script> |
26 | |||
27 | var configVarUrl = "{% url 'configvars' build.id %}"; | ||
28 | |||
26 | $(document).ready(function(){ | 29 | $(document).ready(function(){ |
27 | $('#breadcrumb > li').append('<span class="divider">→</span>'); | 30 | $('#breadcrumb > li').append('<span class="divider">→</span>'); |
28 | $('#breadcrumb > li:last').addClass("active"); | 31 | $('#breadcrumb > li:last').addClass("active"); |
@@ -30,10 +33,18 @@ | |||
30 | 33 | ||
31 | $("#build-menu li a").each(function(){ | 34 | $("#build-menu li a").each(function(){ |
32 | /* Set the page active state in the Build menu */ | 35 | /* Set the page active state in the Build menu */ |
33 | if (window.location.href.split('?')[0] === $(this).prop("href")){ | 36 | var currentUrl = window.location.href.split('?')[0]; |
37 | if (currentUrl === $(this).prop("href")){ | ||
34 | $(this).parent().addClass("active"); | 38 | $(this).parent().addClass("active"); |
35 | } else { | 39 | } else { |
36 | $(this).parent().removeClass("active"); | 40 | /* Special case the configvar as this is part of configuration |
41 | * page but is a separate url | ||
42 | */ | ||
43 | if (window.location.pathname === configVarUrl){ | ||
44 | $("#menu-configuration").addClass("active"); | ||
45 | } else { | ||
46 | $(this).parent().removeClass("active"); | ||
47 | } | ||
37 | } | 48 | } |
38 | }); | 49 | }); |
39 | }); | 50 | }); |
@@ -55,15 +66,12 @@ | |||
55 | <li class="nav-header">Images</li> | 66 | <li class="nav-header">Images</li> |
56 | {% block nav-target %} | 67 | {% block nav-target %} |
57 | {% for t in build.get_sorted_target_list %} | 68 | {% for t in build.get_sorted_target_list %} |
58 | <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li> | 69 | <li id="menu-{{t.target}}"><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li> |
59 | {% endfor %} | 70 | {% endfor %} |
60 | {% endblock %} | 71 | {% endblock %} |
61 | {% endif %} | 72 | {% endif %} |
62 | <li class="nav-header">Build</li> | 73 | <li class="nav-header">Build</li> |
63 | {% block nav-configuration %} | 74 | <li id="menu-configuration"><a href="{% url 'configuration' build.pk %}">Configuration</a></li> |
64 | <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li> | ||
65 | {% endblock %} | ||
66 | |||
67 | <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li> | 75 | <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li> |
68 | <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li> | 76 | <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li> |
69 | <li><a href="{% url 'packages' build.pk %}">Packages</a></li> | 77 | <li><a href="{% url 'packages' build.pk %}">Packages</a></li> |
diff --git a/bitbake/lib/toaster/toastergui/templates/configuration.html b/bitbake/lib/toaster/toastergui/templates/configuration.html index 1032ebe903..1d0ec3f484 100644 --- a/bitbake/lib/toaster/toastergui/templates/configuration.html +++ b/bitbake/lib/toaster/toastergui/templates/configuration.html | |||
@@ -6,10 +6,6 @@ | |||
6 | <li>Configuration</li> | 6 | <li>Configuration</li> |
7 | {% endblock %} | 7 | {% endblock %} |
8 | 8 | ||
9 | {% block nav-configuration %} | ||
10 | <li class="active"><a href="{% url 'configuration' build.pk %}">Configuration</a></li> | ||
11 | {% endblock %} | ||
12 | |||
13 | {% block buildinfomain %} | 9 | {% block buildinfomain %} |
14 | <!-- page title --> | 10 | <!-- page title --> |
15 | <div class="col-md-10"> | 11 | <div class="col-md-10"> |
diff --git a/bitbake/lib/toaster/toastergui/templates/configvars.html b/bitbake/lib/toaster/toastergui/templates/configvars.html index 89d2fa446d..ca2e1eab39 100644 --- a/bitbake/lib/toaster/toastergui/templates/configvars.html +++ b/bitbake/lib/toaster/toastergui/templates/configvars.html | |||
@@ -6,10 +6,6 @@ | |||
6 | <li>Configuration</li> | 6 | <li>Configuration</li> |
7 | {% endblock %} | 7 | {% endblock %} |
8 | 8 | ||
9 | {% block nav-configuration %} | ||
10 | <li class="active"><a href="{% url 'configuration' build.pk %}">Configuration</a></li> | ||
11 | {% endblock %} | ||
12 | |||
13 | {% block buildinfomain %} | 9 | {% block buildinfomain %} |
14 | <!-- page title --> | 10 | <!-- page title --> |
15 | <div class="col-md-10"> | 11 | <div class="col-md-10"> |
diff --git a/bitbake/lib/toaster/toastergui/templates/dirinfo.html b/bitbake/lib/toaster/toastergui/templates/dirinfo.html index 458e933685..ab89e279fa 100644 --- a/bitbake/lib/toaster/toastergui/templates/dirinfo.html +++ b/bitbake/lib/toaster/toastergui/templates/dirinfo.html | |||
@@ -18,6 +18,13 @@ | |||
18 | {% load projecttags %} | 18 | {% load projecttags %} |
19 | 19 | ||
20 | <script type='text/javascript'> | 20 | <script type='text/javascript'> |
21 | var ctx = {}; | ||
22 | ctx.target = "{{target.target}}"; | ||
23 | |||
24 | $(document).ready(function(){ | ||
25 | $("#menu-"+ctx.target).addClass("active"); | ||
26 | }); | ||
27 | |||
21 | function setupTreetable() { | 28 | function setupTreetable() { |
22 | $("#dirtable").treetable({ | 29 | $("#dirtable").treetable({ |
23 | expandable: true, | 30 | expandable: true, |