shikasta-net / labbook Goto Github PK
View Code? Open in Web Editor NEWLab book on web2py
License: Apache License 2.0
Lab book on web2py
License: Apache License 2.0
To imporve robustness (if possible) content should belong to only one container and containers only have one content associated.
Should be possible with existing database structure.
This might help address situations raised with issue #2
Mathjax now pops up a message that it no longer loads a config file by default. This was working on branches thumbnail and sectiontree prior to merge.
Choice about storage of text, images and other user page content.
Options:
The advantage of 1 is that the user can find files they want to extract. This has risks of users altering files directly. It is also not easy for a user to navigate becuase finding a file requires knowing the page and container ID it is located in. Versioning requires separate implementation from the page and container tables in the main program.
Since versioning of tables can now be done easily within Web2Py it seems appealing to use option 2 as mention in iss #5. This may result in an oversized table, long export times and some files may have problems being stored in their native format in this way. However, it seems more robust and streamlined with the rest of the application.
When creating boxes there maybe use for layout templates which create a number of boxes with default dimensions and positions. Similar to power point page layout templates.
4 and 6 box grids are obvious choices. Perhaps large image and caption box.
Oval and arrow tools to highlight aspects and thought processes.
Using SVG image of arrow or oval which fits to an invisible annotation box diagonally. Thus orientation and sizing should be trivial.
In addressing #13 the return type was forced to be a list of dictionaries rather than Row objects. This means entry.attribute now has to be entry['attribute']. Other methods in the model should probably be brought in-line to return a standardised output type.
For single return actions, simply append .as_list() to the .select() statement.
Also clean up:
myrecord = db(db.mytable.id==id).select().first()
to
myrecord = db.mytable[id]
The page layout needs standardising
This will be important for table versioning.
Currently we need to import a lot of libraries from the internet (MAthJax, PDF.JS, jQuery etc). I think we discussed this before, and agreed not for this release, but eventually some way to provide offline libraries (like we do with MathJax) should be formalised. Maybe an import controller, which either redirects to local URLs if local import is active or external URLS if not?
I hate to add a new feature, but I think this one is important.
Having tried a clean LabBook install on my new computer, I note that there are a couple of things needed on install. It'd be good to have a page which can check if these conditions are met, e.g.
The current version will be a temporary measure, as we don't know what we want the startup screen to look like yet. But I think it could be useful.
The ability to include small calculations where the method is worth keeping on record along with the result.
eg. a mini spread sheet or iPython notebook.
Look at implementing sectioning details below the first two levels by having 'stacks' of pages as well as single pages.
Dragging a file over a content box produces
crossElement.position() is null
var x = crossElement.position().left; line 53 of crossbox.js
PostgreSQL may provide better database handling for our needs than SQLite.
Open source and supported by web2py.
It reduces RAM overhead by storing BLOB data in a separate table and is able to handle bigger files.
Provides backup support as part of the database.
Drag and drop of images fails to capture event fully. Box becomes corrupt with unknown box type. Probable upload address issue as was the case with the text editor (need standard address and port settings).
Error message is displayed but browser loads image file before it can be read.
Probably reproducible on master from which thumbnails branched.
Steps to reproduce:
Notes:
Related to Issue 1?
Requires issue #21
Implement transparent mouse over buttons for all containers with Cut, Copy and Paste, and Delete container as default.
Extendible with other buttons later.
At some point the ability to move images around inside their boxes (double-click to activate/deactivate) disappeared. I think it must have been when we moved to the render controller for rendering pages. No worries, I think I can restore it...
Part of issue #12. Allow the rendering of various components of the LabBook interface (e.g. a single box, a single page, a single section) through a separate view/controller interface. For example,
http://127.0.0.1:8000/LabBook/render/page/1/
would return the html for page_id = 1 (can be visited in browser or fetched with AJAX)
http://127.0.0.1:8000/LabBook/render/box_content/1/
would return the html for the content of box_id = 1 (note that rendering the actual box, rather than the content, doesn't seem to make sense without a page to render it on, as the x and y coordinates would not be defined)
This interface can then be used to render page components e.g. in treeview style.
I removed any way of sectioning pages when I updated the master branch to use a single box table.
The section table will need to be uncommented, to allow attaching metadata to sections (e.g. titles and colours). Clearly pages and sections need to be ordered on an arbitrary basis.
I can see two ways of implementing sectioning with page numbering in the pages table:
parent_section
(type reference section
) and page_number
(type integer
) to the pages table and a section_number
field to the sections table. This choice is database intensive for updating but not querying, as when inserting/moving/deleting pages every page_number
after the modified record will have to be updated. However, querying is simple since one can just select page records by parent_section
and order by page_number
.parent_section
(type reference section
) and next_page
(reference pages
) to the pages and sections tables. Updating is now simple (max 1 update) but querying complex, since all pages need to be strung together to establish page ordering. One possible scheme for doing this (e.g. in python): pages_in_section = db(db.pages.parent_section == section.id).select()
ordered_pages = [None] // None is to terminate while when reaching end of section
for page in pages_in_section:
temp_list = [page]
while temp_list[-1].next_page is not in ordered_pages: temp_list.append(temp_list[-1].next_page)
ordered_pages = temp_list + ordered_pages
del ordered_pages[-1]
I guess we'd have to do this for the section table as well.
If we weren't going to version the page numberings, I'd go for option 1, since it's easier to understand. However, with versioning, we'd need to store a row in the versioning table for every row updated, so every time a page number is updated, we'd need to write new rows into the versioning table. For this reason, I propose we go with the second route, and hide the details in a function in the model.
Currently pages are ordered by page number correctly in the pageview branch, but sections and subsections are not.
Export of part or all of a labbook to PDF, or equivalently printing of said sections.
In a similar way to getters and setters for OOP, perform database (model) operations through functions; adding abstraction in this way will allow more independence of work on the model vs controllers and views.
Waiting on thumbnails branch to be merged into master branch.
Improvements to the layout and additional functionality
Tree layout:
Page layout:
Implement rendering of PDF files on labbook pages.
The page view should scale to fit whatever iframe it is put into
Steps to reproduce:
Notes:
Maybe it would be better to define the type of content box by looking at its children, as returned from the server
Related to Issue 1?
Replace the current system of keeping one hard copy backup of user content files with a version controlled file tree, with appropriate interface to allow reverting of changes (?)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.