summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-06-26 15:21:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-14 14:10:03 +0100
commitcff19351a8b9d6267177dc548d994e3f28590391 (patch)
treef8fba60b5b395035c534f2169b3f3ea1e08905f9 /bitbake/lib/toaster/toastergui
parent6b62a0fd6eb9a609f71857f5793b0696f7a790b4 (diff)
downloadpoky-cff19351a8b9d6267177dc548d994e3f28590391.tar.gz
bitbake: toaster: add project pages
We add the new project and project page skeletons. In the process, we add an identifier in the settings.py to detect whenever Toaster is running in managed mode, and a context processor to make this value available to the template processor. (Bitbake rev: 927a27c68e24cfe13f62ca5f0e60878b04fa4e24) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/base.html13
-rw-r--r--bitbake/lib/toaster/toastergui/templates/newproject.html41
-rw-r--r--bitbake/lib/toaster/toastergui/templates/project.html6
-rw-r--r--bitbake/lib/toaster/toastergui/urls.py5
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py38
5 files changed, 103 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html
index 9ca9c9ac3b..1407d641d5 100644
--- a/bitbake/lib/toaster/toastergui/templates/base.html
+++ b/bitbake/lib/toaster/toastergui/templates/base.html
@@ -58,6 +58,19 @@ function reload_params(params) {
58 <div class="navbar-inner"> 58 <div class="navbar-inner">
59 <a class="brand logo" href="#"><img src="{% static 'img/logo.png' %}" class="" alt="Yocto logo project"/></a> 59 <a class="brand logo" href="#"><img src="{% static 'img/logo.png' %}" class="" alt="Yocto logo project"/></a>
60 <a class="brand" href="/">Toaster</a> 60 <a class="brand" href="/">Toaster</a>
61 {%if MANAGED %}
62 <div class="btn-group pull-right">
63 <a class="btn" href="{% url 'newproject' %}">New project</a>
64 <button class="btn dropdown-toggle" data-toggle="dropdown">
65 <i class="icon-caret-down"></i>
66 </button>
67 <ul class="dropdown-menu">
68 <li><a href="#">Clone project</a></li>
69 <li><a href="#">Export project</a></li>
70 <li><a href="#">Import project</a></li>
71 </ul>
72 </div>
73 {%endif%}
61 <a class="pull-right manual" target="_blank" href="http://www.yoctoproject.org/documentation/toaster-manual"> 74 <a class="pull-right manual" target="_blank" href="http://www.yoctoproject.org/documentation/toaster-manual">
62 <i class="icon-book"></i> 75 <i class="icon-book"></i>
63 Toaster manual 76 Toaster manual
diff --git a/bitbake/lib/toaster/toastergui/templates/newproject.html b/bitbake/lib/toaster/toastergui/templates/newproject.html
new file mode 100644
index 0000000000..e5a6551967
--- /dev/null
+++ b/bitbake/lib/toaster/toastergui/templates/newproject.html
@@ -0,0 +1,41 @@
1{% extends "base.html" %}
2{% load projecttags %}
3{% load humanize %}
4{% block pagecontent %}
5<div class="row-fluid">
6 <div class="span6">
7 <div class="page-header">
8 <h1>Create a new project</h1>
9 </div>
10 <form>
11 <fieldset>
12 <label>Project name <span class="muted">(required)</span></label>
13 <input type="text" class="input-xlarge" required name="projectname">
14 <label class="project-form">
15 Project owner
16 <i class="icon-question-sign get-help" title="The go-to person for this project"></i>
17 </label>
18 <form method="POST">
19 <input type="text">
20 <label class="project-form">Owner's email</label>
21 <input type="email" class="input-large" name="email">
22 <label class="project-form">
23 Yocto Project version
24 <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>
25 </label>
26 <select>
27 <option>Yocto Project 1.7 "D?"</option>
28 <option>Yocto Project 1.6 "Daisy"</option>
29 <option>Yocto Project 1.5 "Dora"</option>
30 </select>
31 </form>
32 </fieldset>
33
34 <div class="form-actions">
35 <a href="project-with-targets.html" class="btn btn-primary btn-large">Create project</a>
36 </div>
37 </form>
38 </div>
39 </div>
40 </div>
41{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html
new file mode 100644
index 0000000000..71adb54431
--- /dev/null
+++ b/bitbake/lib/toaster/toastergui/templates/project.html
@@ -0,0 +1,6 @@
1{% extends "base.html" %}
2{% load projecttags %}
3{% load humanize %}
4{% block pagecontent %}
5
6{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py
index 9b583f217b..bba4fda074 100644
--- a/bitbake/lib/toaster/toastergui/urls.py
+++ b/bitbake/lib/toaster/toastergui/urls.py
@@ -65,6 +65,11 @@ urlpatterns = patterns('toastergui.views',
65 # urls not linked from the dashboard 65 # urls not linked from the dashboard
66 url(r'^layers/$', 'layer', name='all-layers'), 66 url(r'^layers/$', 'layer', name='all-layers'),
67 url(r'^layerversions/(?P<layerversion_id>\d+)/recipes/.*$', 'layer_versions_recipes', name='layer_versions_recipes'), 67 url(r'^layerversions/(?P<layerversion_id>\d+)/recipes/.*$', 'layer_versions_recipes', name='layer_versions_recipes'),
68
69 # project URLs
70 url(r'^newproject/$', 'newproject', name='newproject'),
71 url(r'^project/$', 'project', name='project'),
72
68 # default redirection 73 # default redirection
69 url(r'^$', RedirectView.as_view( url= 'builds/')), 74 url(r'^$', RedirectView.as_view( url= 'builds/')),
70) 75)
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 1f3e11d57c..7dc0108393 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -1758,3 +1758,41 @@ def image_information_dir(request, build_id, target_id, packagefile_id):
1758 # stubbed for now 1758 # stubbed for now
1759 return redirect(builds) 1759 return redirect(builds)
1760 1760
1761
1762import toastermain.settings
1763def managedcontextprocessor(request):
1764 return { "MANAGED" : toastermain.settings.MANAGED }
1765
1766
1767# we have a set of functions if we're in managed mode, or
1768# a default "page not available" simple functions for interactive mode
1769if toastermain.settings.MANAGED:
1770
1771 # new project
1772 def newproject(request):
1773 template = "newproject.html"
1774 context = {}
1775 if request.method == "GET":
1776 # render new project page
1777 return render(request, template, context)
1778 elif request.method == "POST":
1779 if request.method:
1780 return redirect(project)
1781 else:
1782 return render(request, template, context)
1783 raise Exception("Invalid HTTP method for this page")
1784
1785 # Shows the edit project page
1786 def project(request):
1787 template = "project.html"
1788 context = {}
1789 return render(request, template, context)
1790
1791
1792else:
1793 # these are pages that are NOT available in interactive mode
1794 def newproject(request):
1795 raise Exception("page not available in interactive mode")
1796
1797 def project(request):
1798 raise Exception("page not available in interactive mode")