summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-10-17 10:45:53 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-27 07:24:31 +0000
commit78f935df8fafa0ded4decfd89e9bfac52bf5fab2 (patch)
tree678e8feb04d3b7e2890fb2bf63f2017634facc35 /bitbake
parentc5f147b4ab194606266d3478c3784518d3ec66c9 (diff)
downloadpoky-78f935df8fafa0ded4decfd89e9bfac52bf5fab2.tar.gz
bitbake: toaster: Remove all navigation when not in build mode
The user is redirected to the all builds page or all projects page from the landing page, regardless of mode. In build mode, this makes sense; but in analysis mode, we are restricting the view to just the cli builds project. This means that "all projects" and "all builds" only contains items relating to this one project. Modify the landing page so it redirects to the project builds page for the cli builds project when not in build mode. Also remove navigation elements which are irrelevant when not in build mode. [YOCTO #8514] (Bitbake rev: ae754655fa1bc5168f43e8821773e7b7b9440a5d) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/base.html4
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py14
2 files changed, 14 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html
index 073c34243c..dfa6bba70f 100644
--- a/bitbake/lib/toaster/toastergui/templates/base.html
+++ b/bitbake/lib/toaster/toastergui/templates/base.html
@@ -91,9 +91,9 @@
91 <i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i> 91 <i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i>
92 {% endif %} 92 {% endif %}
93 </span> 93 </span>
94 {% if request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %} 94 {% if BUILD_MODE and request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
95 <ul class="nav"> 95 <ul class="nav">
96 <li {% if request.resolver_match.url_name == 'all-builds' %} 96 <li {% if request.resolver_match.url_name == 'all-builds' %}
97 class="active" 97 class="active"
98 {% endif %}> 98 {% endif %}>
99 <a href="{% url 'all-builds' %}"> 99 <a href="{% url 'all-builds' %}">
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index d675f4f2d2..6ebb6a927a 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -71,14 +71,24 @@ class MimeTypeFinder(object):
71# all new sessions should come through the landing page; 71# all new sessions should come through the landing page;
72# determine in which mode we are running in, and redirect appropriately 72# determine in which mode we are running in, and redirect appropriately
73def landing(request): 73def landing(request):
74 # in build mode, we redirect to the command-line builds page
75 # if there are any builds for the default (cli builds) project
76 default_project = Project.objects.get_default_project()
77 default_project_builds = Build.objects.filter(project = default_project)
78
79 if (not toastermain.settings.BUILD_MODE) and default_project_builds.count() > 0:
80 args = (default_project.id,)
81 return redirect(reverse('projectbuilds', args = args), permanent = False)
82
74 # we only redirect to projects page if there is a user-generated project 83 # we only redirect to projects page if there is a user-generated project
84 num_builds = Build.objects.all().count()
75 user_projects = Project.objects.filter(is_default = False) 85 user_projects = Project.objects.filter(is_default = False)
76 has_user_project = user_projects.count() > 0 86 has_user_project = user_projects.count() > 0
77 87
78 if Build.objects.count() == 0 and has_user_project: 88 if num_builds == 0 and has_user_project:
79 return redirect(reverse('all-projects'), permanent = False) 89 return redirect(reverse('all-projects'), permanent = False)
80 90
81 if Build.objects.all().count() > 0: 91 if num_builds > 0:
82 return redirect(reverse('all-builds'), permanent = False) 92 return redirect(reverse('all-builds'), permanent = False)
83 93
84 context = {'lvs_nos' : Layer_Version.objects.all().count()} 94 context = {'lvs_nos' : Layer_Version.objects.all().count()}