@@ -440,4 +453,5 @@ angular.element(document).ready(function() { }); +{% endif %} {# from lvs_nos check #} {% endblock %} diff --git a/bitbake/lib/toaster/toastergui/templates/projectbuilds.html b/bitbake/lib/toaster/toastergui/templates/projectbuilds.html index 2a8bd58f34..02d166341f 100644 --- a/bitbake/lib/toaster/toastergui/templates/projectbuilds.html +++ b/bitbake/lib/toaster/toastergui/templates/projectbuilds.html @@ -9,8 +9,8 @@ {% block projectinfomain %} {% if objects.paginator.count == 0 %} + {% if request.GET.filter or request.GET.search %}
@@ -34,6 +35,17 @@
+ {% else %} +
+

+ Toaster has not target information. To generate target information you can:
+

+

+
+ {% endif %} {% else %} diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 338b8c36f2..b5ff9b1d53 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -43,13 +43,22 @@ import json # all new sessions should come through the landing page; # determine in which mode we are running in, and redirect appropriately def landing(request): - if toastermain.settings.MANAGED and Build.objects.count() == 0 and Project.objects.count() > 0: - return redirect(reverse('all-projects'), permanent = False) + if toastermain.settings.MANAGED: + from bldcontrol.models import BuildRequest + if BuildRequest.objects.count() == 0 and Project.objects.count() > 0: + return redirect(reverse('all-projects'), permanent = False) - if Build.objects.all().count() > 0: - return redirect(reverse('all-builds'), permanent = False) + if BuildRequest.objects.all().count() > 0: + return redirect(reverse('all-builds'), permanent = False) + else: + if Build.objects.all().count() > 0: + return redirect(reverse('all-builds'), permanent = False) - return render(request, 'landing.html') + context = {} + if toastermain.settings.MANAGED: + context['lvs_nos'] = Layer_Version.objects.all().count() + + return render(request, 'landing.html', context) # returns a list for most recent builds; for use in the Project page, xhr_ updates, and other places, as needed def _project_recent_build_list(prj): @@ -2035,6 +2044,7 @@ if toastermain.settings.MANAGED: context = { "project" : prj, + "lvs_nos" : Layer_Version.objects.all().count(), "completedbuilds": BuildRequest.objects.filter(project_id = pid).exclude(state__lte = BuildRequest.REQ_INPROGRESS).exclude(state=BuildRequest.REQ_DELETED), "prj" : {"name": prj.name, "release": { "id": prj.release.pk, "name": prj.release.name, "desc": prj.release.description}}, #"buildrequests" : prj.buildrequest_set.filter(state=BuildRequest.REQ_QUEUED),