summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-08-26 15:39:14 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-29 13:56:50 +0100
commit25a715a1191bae2ac20e598555f49203f59c88b0 (patch)
tree9de7bc08b839343f30fabc19a62a8ef34c3f046f /bitbake
parentee250eb7e4be2c2964bbeeada93dfff7b8d5e72f (diff)
downloadast2050-yocto-poky-25a715a1191bae2ac20e598555f49203f59c88b0.zip
ast2050-yocto-poky-25a715a1191bae2ac20e598555f49203f59c88b0.tar.gz
bitbake: toatergui: update pages to match project models
We update pages and queries to match the new project models. (Bitbake rev: 8f47ec259106da714260c7388cee75a6c1f4622d) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/newproject.html4
-rw-r--r--bitbake/lib/toaster/toastergui/templates/project.html4
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py13
3 files changed, 10 insertions, 11 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/newproject.html b/bitbake/lib/toaster/toastergui/templates/newproject.html
index 6ee27d1..12c4e9f 100644
--- a/bitbake/lib/toaster/toastergui/templates/newproject.html
+++ b/bitbake/lib/toaster/toastergui/templates/newproject.html
@@ -28,8 +28,8 @@
<i class="icon-question-sign get-help" title="This sets the branch for the Yocto Project core layers (meta, meta-yocto and meta-yocto-bsp), and for the layers you use from the OpenEmbedded Metadata Index"></i>
</label>
<select name="projectversion" id="projectversion">
- {% for br in branches %}
- <option value="{{br.id}}"{%if projectversion == br.id %} selected{%endif%}>{{br.name}} ({{br.short_description}})</option>
+ {% for release in releases %}
+ <option value="{{release.id}}"{%if projectversion == release.id %} selected{%endif%}>{{release.name}} ({{release.description}})</option>
{% endfor %}
</select>
</fieldset>
diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html
index 0ddfeb3..3c59fcf 100644
--- a/bitbake/lib/toaster/toastergui/templates/project.html
+++ b/bitbake/lib/toaster/toastergui/templates/project.html
@@ -269,7 +269,7 @@ $(document).ready(function () {
<ul class="unstyled configuration-list">
{% for pl in project.projectlayer_set.all %}
<li>
- <a href="#">{{pl.name}} (<span class="layer-version">{{pl.giturl}}</span>)</a>
+ <a href="#">{{pl.layercommit.layer.name}} (<span class="layer-version">{{pl.layercommit.layer.layer_index_url}}</span>)</a>
{% if pl.optional %}
<i title="" data-original-title="" class="icon-trash" id="del-layer-icon" x-data="{{pl.pk}}"></i>
{% endif %}
@@ -358,7 +358,7 @@ $(document).ready(function () {
</p>
<h3>Yocto Project version</h3>
<p class="lead">
- {{project.branch}} - {{project.short_description}}
+ {{project.release}} - {{project.short_description}}
<i title="" data-original-title="" class="icon-pencil"></i>
</p>
</div>
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 5b23365..e68f8b0 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -1772,7 +1772,7 @@ if toastermain.settings.MANAGED:
from django.contrib.auth.decorators import login_required
from orm.models import Project, ProjectLayer, ProjectTarget, ProjectVariable
- from orm.models import Branch, LayerSource, ToasterSetting
+ from orm.models import Branch, LayerSource, ToasterSetting, Release
from bldcontrol.models import BuildRequest
import traceback
@@ -1792,7 +1792,7 @@ if toastermain.settings.MANAGED:
context = {
'email': request.user.email if request.user.is_authenticated() else '',
'username': request.user.username if request.user.is_authenticated() else '',
- 'branches': Branch.objects.order_by("-up_id"),
+ 'releases': Release.objects.order_by("id"),
'defaultbranch': ToasterSetting.objects.get(name = "DEFAULT_RELEASE").value,
}
@@ -1819,15 +1819,14 @@ if toastermain.settings.MANAGED:
# save the project
prj = Project.objects.create_project(name = request.POST['projectname'],
- branch = Branch.objects.get(pk = request.POST['projectversion'].split(" ")[0]),
- short_description=request.POST['projectversion'].split(" ")[1:])
+ release = Release.objects.get(pk = request.POST['projectversion']))
prj.user_id = request.user.pk
prj.save()
return redirect(reverse(project, args = (prj.pk,)))
except (IntegrityError, BadParameterException) as e:
# fill in page with previously submitted values
- map(lambda x: context.__setitem__(x, request.POST[x]), mandatory_fields)
+ map(lambda x: context.__setitem__(x, request.POST.get(x, "-- missing")), mandatory_fields)
if isinstance(e, IntegrityError) and "username" in str(e):
context['alert'] = "Your chosen username is already used"
else:
@@ -1917,7 +1916,7 @@ if toastermain.settings.MANAGED:
# return all project settings
return HttpResponse(json.dumps( {
"error": "ok",
- "layers": map(lambda x: (x.name, x.giturl), prj.projectlayer_set.all()),
+ "layers": map(lambda x: (x.layercommit.layer.name, x.layercommit.layer.layer_index_url), prj.projectlayer_set.all()),
"targets" : map(lambda x: {"target" : x.target, "task" : x.task, "pk": x.pk}, prj.projecttarget_set.all()),
"variables": map(lambda x: (x.name, x.value), prj.projectvariable_set.all()),
}), content_type = "application/json")
@@ -1945,7 +1944,7 @@ if toastermain.settings.MANAGED:
queryset_all = Layer_Version.objects.all()
if 'project' in request.session:
- queryset_all = queryset_all.filter(up_branch = request.session['project'].branch)
+ queryset_all = queryset_all.filter(up_branch__in = Branch.objects.filter(name = request.session['project'].release.name))
queryset_with_search = _get_queryset(Layer_Version, queryset_all, None, search_term, ordering_string, '-layer__name')
queryset = _get_queryset(Layer_Version, queryset_all, filter_string, search_term, ordering_string, '-layer__name')
OpenPOWER on IntegriCloud