mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
ee250eb7e4
commit
25a715a119
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user