From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B7196E00832; Thu, 26 Mar 2015 11:21:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.171 listed in list.dnswl.org] Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 78325E0056E for ; Thu, 26 Mar 2015 11:21:41 -0700 (PDT) Received: by wibgn9 with SMTP id gn9so97650015wib.1 for ; Thu, 26 Mar 2015 11:21:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=fdnuoRk1aakxa/FzRG7LkOwplg3Uugzp5XZkLD1B8OA=; b=bwvLT7FG+SKFwJo0yAzis875hMJ8zV1yNwQs9SJ7boX2ZZTdU3jO6GO/ufY8ylt9iZ cY21b+uZlMZyE0ROs5Dwry2RezVYAfZuvQ17yrj/WohWNb/FuTyAWM1iSFUKKC8tVG0i YHmCnJepXbKcnLa+tw5SrpwJFO+DQn27xRw5lcOCSNdJ2HBaYj4YqDfvbhkex4bafgo8 l46i1BM4vl5Ns8TKX+uVRiTG/VCg6gN6DkTcmgOUQJ7NAtS+lOXnNqLUiCv+p9TCbJqm b4mMGvFIdd82iteXkg9jL5ILEyyeLIsb6pl17xBPDLA0eByEuk+Tu/6BPN/JKvBHIbgr DrHg== X-Gm-Message-State: ALoCoQmpSYVsej3PCc2d9Lo7lwA5/jL1K8zxDOUu7SwXijv6PzURaYTuKkGiMZVkOjKOC9l6d1eU X-Received: by 10.180.187.67 with SMTP id fq3mr27381389wic.59.1427394100812; Thu, 26 Mar 2015 11:21:40 -0700 (PDT) Received: from [192.168.2.131] ([83.217.123.106]) by mx.google.com with ESMTPSA id ev7sm9455275wjb.47.2015.03.26.11.21.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 11:21:40 -0700 (PDT) Message-ID: <55144E33.9020103@intel.com> Date: Thu, 26 Mar 2015 18:21:39 +0000 From: Michael Wood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "toaster@yoctoproject.org" Subject: [RFC] Tables rework - michaelw/toaster-tables-poc X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Mar 2015 18:21:51 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Here is the current WIP of the proof of concept of the Tables widget for toaster http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=michaelw/toaster-tables-poc ( http://tinyurl.com/op63pgj ) I've tried to prefix/postfix 'poc' to make it easier to identify which are for the proof of concept Brief overview of the files/changes: ---------------------- poc_view.py: Table(View): - Handles the HTTP requests to get the table data - Adds some basic caching (future - this can be tied into the request but for now is just global) ToasterTable(object): - Adds a base class for common table functionality - A lot of this is bringing in all the parts we already have in views.py and standardising them in a single class - In many tables we have what I've named "static data" this is where we have a column that contains html data, for example a button. - Outputs the data for the page requested as a JSON document RecipeTable(ToasterTable): - Example of a table which has static data LayersTable(ToasterTable): - Example of a simple table ---------------------- tables.js: - This consumes the table data - Adds handlers for all the table chrome buttons - Implements the add/remove columns - Implements paging ---------------------- table-poc.html: - Template that just contains the html for the table layout (i.e. search bar, table, buttons etc) - can be considered the same as conflating the "basetable_top.html" + "basetable_bottom.html" templates ---------------------- generic-table-page-poc.html: - This is a normal table page in toaster with navigation, zone alert and which includes the table-poc.html template the context variable table_name is passed into this template to select which table to display ---------------------- two-tables-poc.html: - Exactly the same as generic-table-page-poc.html (above) but has two tables in it. ---------------------- changes to urls.py: - Add the poc-table this calls into to Table(View) to handle the requests made from the ajax calls (could be renamed xhr_table for consistency) - Add urls for the test pages: /layers-poc/ and /recipes-poc/ and /two-tables-poc/ note that they don't need their own views defined because the only thing changing is the table_name and that's passed in. ---------------------- Notes: The whole lot is 642 lines which means the maintenance burden shouldn't be too high There's a fairly easy path to switching our existing tables - one at a time if needed There are bugs and features missing - This is just the proof of concept! Thanks, Michael