Semantic UI for SQLFROM.grid

79 views
Skip to first unread message

Najtsirk

unread,
May 26, 2017, 9:35:02 AM5/26/17
to web2py-users
Hi,

I would like to have Semantic UI in my application. However the SQLFORM.grid has Bootstrap by default. Is there "the right" way to implement SQLFORM.grid with SemanticUI?

Can somebody point me into the right direction?

Thanks,
Kristjan

Massimo Di Pierro

unread,
May 29, 2017, 7:08:12 PM5/29/17
to web2py-users
Big can of worms. Look into sqlhtml.py where the bootstrap3 logic is defined (just search for bootstrap3). You can see how the style "adapter" for bootstrap 2 vs the one for bootstrap 3 are designed. You can than make your own for semantic. You can put it in your own code.

In web3py I am planning to move away from sqlform and have the forms generated in JS, not in Python since it is odd that one has to write Python code to adapt to different CSS. In my opinion, this is not a web2py problem but a problem of the way people create CSS for forms. They do not style individual element nor they style elements by proximity. They style them in a hierarchical manner this imposing an HTML structure.

Massimo

Richard Vézina

unread,
May 31, 2017, 1:14:10 PM5/31/17
to web2py-users
I think you are rigth about the root of the issue... It maybe because styling is so painfull, so we try to avoid it as much as possible...

:)

Richard

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paolo Caruccio

unread,
Jun 4, 2017, 4:57:03 PM6/4/17
to web2py-users
Yes it's diffcult but not impossible.

With CSS preprocessors, for example, we can write adaptive rules by extending a class defined in choiced css library to a HTML element generated by web2py having a different css class or a specific identifier.

web2py, in my opinion, it's flexibile enough in order to obtain a soddisfacent result since it adds an identifier or class to (almost) all html components.

For example (please be aware the code -  although it's working - is only for demostration!) just applying the attached file (of course compiled) to our layout.html we will obtain that shown in the following image  (the grid come from estore3 by Massimo Di Pierro)

w2p_sui_adapter.less
Reply all
Reply to author
Forward
0 new messages