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 @@ | |||
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 |
73 | def landing(request): | 73 | def 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()} |