From 9cd08101aeb5596581fec8a73dd37e37dccc2be2 Mon Sep 17 00:00:00 2001 From: Belen Barros <[email protected]> Date: Tue, 4 Feb 2014 15:02:13 +0000 Subject: [PATCH] bitbake: toaster: Implement the minimum tables as per design specification
Each Toaster table has a set of minimum columns that cannot be hidden by users. The checkboxes for such columns are disabled in the "Edit columns" menu. This patch sets the disabled checkboxes for the tasks and builds tables to match the design specification. A new attribute 'min' is set to True for table columns that are part of the minimum table in views.py. The basetable_top.html template then checks if a column has the 'min' attribute set and disables its checkbox accordingly. Signed-off-by: Belen Barros <[email protected]> --- .../toastergui/templates/basetable_top.html | 2 +- bitbake/lib/toaster/toastergui/views.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/toastergui/templates/basetable_top.html b/bitbake/lib/toaster/toastergui/templates/basetable_top.html index 67a1d10..a372b85 100644 --- a/bitbake/lib/toaster/toastergui/templates/basetable_top.html +++ b/bitbake/lib/toaster/toastergui/templates/basetable_top.html @@ -49,7 +49,7 @@ <ul class="dropdown-menu">{% for i in tablecols|sortcols %} <li> <label class="checkbox"> - <input type="checkbox" class="chbxtoggle" {% if i.clclass %}id="{{i.clclass}}" value="ct{{i.name}}" {% if not i.hidden %}checked="checked"{%endif%} onchange="showhideTableColumn($(this).attr('id'), $(this).is(':checked'))" {%else%} checked disabled{% endif %}/> {{i.name}} + <input type="checkbox" class="chbxtoggle" {% if i.clclass %}id="{{i.clclass}}" value="ct{{i.name}}" {% if not i.hidden %}checked="checked"{%endif%} onchange="showhideTableColumn($(this).attr('id'), $(this).is(':checked'))" {%else%} checked {% if i.min == True %} disabled {% endif %} {% endif %}/> {{i.name}} </label> </li>{% endfor %} </ul> diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 37e2af2..3525f36 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -240,6 +240,7 @@ def builds(request): {'name': 'Outcome ', # column with a single filter 'qhelp' : "The outcome tells you if a build completed successfully or failed", # the help button content 'dclass' : "span2", # indication about column width; comes from the design + 'min' : True, 'orderfield': _get_toggle_order(request, "outcome"), # adds ordering by the field value; default ascending unless clicked from ascending into descending # filter field will set a filter on that column with the specs in the filter description # the class field in the filter has no relation with clclass; the control different aspects of the UI @@ -254,10 +255,12 @@ def builds(request): }, {'name': 'Target ', # default column, disabled box, with just the name in the list 'qhelp': "This is the build target(s): one or more recipes or image recipes", + 'min': True, 'orderfield': _get_toggle_order(request, "target__target"), }, {'name': 'Machine ', 'qhelp': "The machine is the hardware for which you are building", + 'min': True, 'orderfield': _get_toggle_order(request, "machine"), 'dclass': 'span3' }, # a slightly wider column @@ -275,6 +278,7 @@ def builds(request): }, {'name': 'Completed on ', 'qhelp': "The date and time the build finished", + 'min': True, 'orderfield': _get_toggle_order(request, "completed_on", True), 'filter' : {'class' : 'completed_on', 'label': 'Show:', @@ -430,12 +434,14 @@ def tasks(request, build_id): { 'name':'Order', 'qhelp':'The running sequence of each task in the build', + 'min': True, 'orderfield': _get_toggle_order(request, "order"), 'ordericon':_get_toggle_order_icon(request, "order"), }, { 'name':'Recipe', 'qhelp':'The name of the recipe to which each task applies', + 'min': True, 'orderfield': _get_toggle_order(request, "recipe"), 'ordericon':_get_toggle_order_icon(request, "recipe"), }, @@ -448,6 +454,7 @@ def tasks(request, build_id): { 'name':'Task', 'qhelp':'The name of the task', + 'min': True, 'orderfield': _get_toggle_order(request, "task_name"), 'ordericon':_get_toggle_order_icon(request, "task_name"), }, -- 1.7.9.5
_______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
