From: Michael Wood <michael.g.wood@intel.com>
To: "toaster@yoctoproject.org" <toaster@yoctoproject.org>
Subject: [RFC] Tables rework - michaelw/toaster-tables-poc
Date: Thu, 26 Mar 2015 18:21:39 +0000 [thread overview]
Message-ID: <55144E33.9020103@intel.com> (raw)
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
next reply other threads:[~2015-03-26 18:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 18:21 Michael Wood [this message]
2015-03-27 11:44 ` [RFC] Tables rework - michaelw/toaster-tables-poc Barros Pena, Belen
2015-03-27 13:51 ` Michael Wood
2015-04-14 15:52 ` Damian, Alexandru
2015-04-15 11:37 ` Michael Wood
2015-04-28 17:38 ` Michael Wood
2015-04-29 12:36 ` Barros Pena, Belen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55144E33.9020103@intel.com \
--to=michael.g.wood@intel.com \
--cc=toaster@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.