diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-06-26 15:21:42 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-14 14:10:03 +0100 |
commit | cff19351a8b9d6267177dc548d994e3f28590391 (patch) | |
tree | f8fba60b5b395035c534f2169b3f3ea1e08905f9 /bitbake/lib/toaster/toastergui/views.py | |
parent | 6b62a0fd6eb9a609f71857f5793b0696f7a790b4 (diff) | |
download | poky-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/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 38 |
1 files changed, 38 insertions, 0 deletions
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 | |||
1762 | import toastermain.settings | ||
1763 | def 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 | ||
1769 | if 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 | |||
1792 | else: | ||
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") | ||