aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-08-08 17:50:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-29 13:56:39 +0100
commit6f0cb9d106129eb496a4c009d95b0727378e97c1 (patch)
tree18e51ed09c4c0163e2777fe8631fed11e65c5027
parent6618613c9210fb44d36d90f5f2404b435f10dfc8 (diff)
downloadbitbake-6f0cb9d106129eb496a4c009d95b0727378e97c1.tar.gz
toaster: create project section navigation structure
We create the navigation structure for the project section. This includes adding URLs for configuration, builds, all layers, layer details and all targets pages. Changes to existing pages to exemplify navigation links. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
-rw-r--r--lib/toaster/toastergui/templates/newproject.html5
-rw-r--r--lib/toaster/toastergui/templates/project.html47
-rw-r--r--lib/toaster/toastergui/urls.py11
-rwxr-xr-xlib/toaster/toastergui/views.py48
4 files changed, 85 insertions, 26 deletions
diff --git a/lib/toaster/toastergui/templates/newproject.html b/lib/toaster/toastergui/templates/newproject.html
index 8f1867a94..6ee27d12d 100644
--- a/lib/toaster/toastergui/templates/newproject.html
+++ b/lib/toaster/toastergui/templates/newproject.html
@@ -28,8 +28,9 @@
<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">
- <!-- TODO: XHR data from http://layers.openembedded.org/layerindex/branch/master/layers/ -->
- <option value="master" {%if projectversion == "master" %}selected{%endif%}>master</option>
+ {% for br in branches %}
+ <option value="{{br.id}}"{%if projectversion == br.id %} selected{%endif%}>{{br.name}} ({{br.short_description}})</option>
+ {% endfor %}
</select>
</fieldset>
diff --git a/lib/toaster/toastergui/templates/project.html b/lib/toaster/toastergui/templates/project.html
index c859f6bcd..0ddfeb31a 100644
--- a/lib/toaster/toastergui/templates/project.html
+++ b/lib/toaster/toastergui/templates/project.html
@@ -71,10 +71,29 @@ function postEditAjaxRequest(reqdata) {
})
}
+
+
+
$(document).ready(function () {
setEventHandlers();
+
+ /* Provide XHR calls for the "build" buttons.*/
+ $("button#build-all-button").click( function (evt) {
+ var ajax = $.ajax({
+ type:"POST",
+ url:"{% url 'xhr_projectbuild' project.id %}",
+ headers: { 'X-CSRFToken': $.cookie("csrftoken")},
+ success: function (data, textstatus) {
+ if (data.error != "ok") {
+ alert("XHR fail: " + data.error );
+ }
+ },
+ error: function (jqXHR, textstatus, error) { alert("XHR errored:" + error + "(" + textstatus + ")"); },
+ })
+ });
});
+
</script>
@@ -97,23 +116,7 @@ $(document).ready(function () {
<input class="huge input-xxlarge" placeholder="Or enter the target you want to build" autocomplete="off" data-minlength="1" data-autocomplete="off" data-provide="typeahead" data-source="" type="text">
<button id="build-button" class="btn btn-large" disabled="">Build</button>
</div>
- <script>
-/* Provide XHR calls for the "build" buttons.*/
-$("button#build-all-button").click( function (evt) {
- var ajax = $.ajax({
- type:"POST",
- url:"{% url 'xhr_projectbuild' project.id %}",
- headers: { 'X-CSRFToken': $.cookie("csrftoken")},
- success: function (data, textstatus) {
- if (data.error != "ok") {
- alert("XHR fail: " + data.error );
- }
- },
- error: function (jqXHR, textstatus, error) { alert("XHR errored:" + error + "(" + textstatus + ")"); },
- })
-});
- </script>
<!--span class="help-inline">This target is not provided <br />by any of your added layers
<i class="icon-question-sign get-help get-help-red" title="Review your list of added layers to make sure one of them provides core-image-xyz. Clicking on a layer name will give you all the information Toaster has about the layer"></i>
</span>
@@ -255,7 +258,7 @@ $("button#build-all-button").click( function (evt) {
<button id="add-layer-dependencies" class="btn btn-info add-layer">Add layers</button>
</div>
- <p><a href="#">Import your layer</a> | <a href="#">View all layers</a></p>
+ <p><a href="{% url 'importlayer' %}">Import your layer</a> | <a href="{% url 'layers'%}">View all layers</a></p>
</form>
<h4 class="air">
@@ -286,7 +289,7 @@ $("button#build-all-button").click( function (evt) {
<button id="add-target-button" class="btn" type="button">Add</button>
</div>
- <p><a href="#" class="link">View all targets</a></p>
+ <p><a href="{% url 'targets' %}" class="link">View all targets</a></p>
</form>
<h4 class="air">
Added targets
@@ -328,10 +331,10 @@ $("button#build-all-button").click( function (evt) {
{{distro}}
<i title="" data-original-title="" class="icon-pencil"></i>
</p>
- <p class="localconf">
- <a href="#" class="link">Edit the <code>local.conf</code> file</a>
- <i data-original-title="The <code>local.conf</code> file is where other project configuration options are set. Pretty much any configuration option can be set in this file. Each option, like everything else in the build system, is a variable - value pair" class="icon-question-sign get-help heading-help" title=""></i>
- </p>
+ <p class="link-action">
+ <a href="{% url 'projectconf' project.id %}" class="link">Edit configuration variables</a>
+ <i class="icon-question-sign get-help heading-help" title="You can set other project configuration options here. Each option, like everything else in the build system, is a variable - value pair"></i>
+ </p>
</div>
</div>
diff --git a/lib/toaster/toastergui/urls.py b/lib/toaster/toastergui/urls.py
index 7c4f894b9..30f006348 100644
--- a/lib/toaster/toastergui/urls.py
+++ b/lib/toaster/toastergui/urls.py
@@ -63,12 +63,21 @@ urlpatterns = patterns('toastergui.views',
# urls not linked from the dashboard
- url(r'^layers/$', 'layer', name='all-layers'),
url(r'^layerversions/(?P<layerversion_id>\d+)/recipes/.*$', 'layer_versions_recipes', name='layer_versions_recipes'),
# project URLs
url(r'^newproject/$', 'newproject', name='newproject'),
+ url(r'^importlayer/$', 'importlayer', name='importlayer'),
+
+ url(r'^layers/$', 'layers', name='layers'),
+ url(r'^layer/(?P<layerid>\d+)/$', 'layerdetails', name='layerdetails'),
+ url(r'^targets/$', 'targets', name='targets'),
+ url(r'^machines/$', 'machines', name='machines'),
+
url(r'^project/(?P<pid>\d+)/$', 'project', name='project'),
+ url(r'^project/(?P<pid>\d+)/configuration$', 'projectconf', name='projectconf'),
+ url(r'^project/(?P<pid>\d+)/builds$', 'projectbuilds', name='projectbuild'),
+
url(r'^xhr_projectbuild/(?P<pid>\d+)/$', 'xhr_projectbuild', name='xhr_projectbuild'),
url(r'^xhr_projectedit/(?P<pid>\d+)/$', 'xhr_projectedit', name='xhr_projectedit'),
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index bd65c08b0..cad23570f 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -1772,6 +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 bldcontrol.models import BuildRequest
import traceback
@@ -1791,6 +1792,8 @@ 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"),
+ 'defaultbranch': ToasterSetting.objects.get(name = "DEFAULT_RELEASE").value,
}
@@ -1816,7 +1819,7 @@ if toastermain.settings.MANAGED:
# save the project
prj = Project.objects.create_project(name = request.POST['projectname'],
- branch = request.POST['projectversion'].split(" ")[0],
+ branch = Branch.objects.get(pk = request.POST['projectversion'].split(" ")[0]),
short_description=request.POST['projectversion'].split(" ")[1:])
prj.user_id = request.user.pk
prj.save()
@@ -1919,6 +1922,26 @@ if toastermain.settings.MANAGED:
except Exception as e:
return HttpResponse(json.dumps({"error":str(e) + "\n" + traceback.format_exc()}), content_type = "application/json")
+ def importlayer(request):
+ raise Exception("TODO: implement page #6595")
+
+ def layers(request):
+ raise Exception("TODO: implement page #6590")
+
+ def layerdetails(request, layerid):
+ raise Exception("TODO: implement page #6591")
+
+ def targets(request):
+ raise Exception("TODO: implement page #6592")
+
+ def machines(request):
+ raise Exception("TODO: implement page #6593")
+
+ def projectconf(request, pid):
+ raise Exception("TODO: implement page #6588")
+
+ def projectbuilds(request, pid):
+ raise Exception("TODO: implement page #6589")
else:
# these are pages that are NOT available in interactive mode
@@ -1940,3 +1963,26 @@ else:
def xhr_projectedit(request, pid):
raise Exception("page not available in interactive mode")
+ def importlayer(request):
+ raise Exception("page not available in interactive mode")
+
+ def layers(request):
+ raise Exception("page not available in interactive mode")
+
+ def layerdetails(request):
+ raise Exception("page not available in interactive mode")
+
+ def targets(request):
+ raise Exception("page not available in interactive mode")
+
+ def targetdetails(request):
+ raise Exception("page not available in interactive mode")
+
+ def machines(request):
+ raise Exception("page not available in interactive mode")
+
+ def projectconf(request):
+ raise Exception("page not available in interactive mode")
+
+ def projectbuilds(request):
+ raise Exception("page not available in interactive mode")