diff options
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/base.html | 4 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 14 |
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 @@ <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> {% endif %} </span> - {% if request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %} + {% if BUILD_MODE and request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %} <ul class="nav"> - <li {% if request.resolver_match.url_name == 'all-builds' %} + <li {% if request.resolver_match.url_name == 'all-builds' %} class="active" {% endif %}> <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): # all new sessions should come through the landing page; # determine in which mode we are running in, and redirect appropriately def landing(request): + # in build mode, we redirect to the command-line builds page + # if there are any builds for the default (cli builds) project + default_project = Project.objects.get_default_project() + default_project_builds = Build.objects.filter(project = default_project) + + if (not toastermain.settings.BUILD_MODE) and default_project_builds.count() > 0: + args = (default_project.id,) + return redirect(reverse('projectbuilds', args = args), permanent = False) + # we only redirect to projects page if there is a user-generated project + num_builds = Build.objects.all().count() user_projects = Project.objects.filter(is_default = False) has_user_project = user_projects.count() > 0 - if Build.objects.count() == 0 and has_user_project: + if num_builds == 0 and has_user_project: return redirect(reverse('all-projects'), permanent = False) - if Build.objects.all().count() > 0: + if num_builds > 0: return redirect(reverse('all-builds'), permanent = False) context = {'lvs_nos' : Layer_Version.objects.all().count()} |