Wednesday, June 15, 2016

Themes support in ExtJS 6

Hamza added the possibility of selecting the “theme” by setting the site attribute lino_extjs6.extjs6.Plugin.theme_name (PR #38). I added the different names to He wrote “It is really funny to see Lino under so many themes.”

Hamza, I don’t agree with you ;-) This is not only funny. It is awesome, great, exciting!

The most exciting for me is to have the proof that it is so easy. (I knew that before, but there are different types of knowledge).

Code review: in the index.html template I replaced the block

{%- if not extjs.theme_name == '' -%}
    {%- set theme = extjs.theme_name  -%}
{%- else -%}
    {%- set theme ='ext-theme-neptune-lino'  -%}
{%- endif -%}

by a single line

{%- set theme = extjs.theme_name  -%}

because it is redundant to define a default value at two places.

A question: Hamza, can’t we change the name ext-theme-neptune-lino to theme-neptune-lino in order to be consistent with the existing naming system?

And a remark. While all this is funny, great and exciting, I suggest to concentrate on the classic theme at first. Because I know my customers: they are very resistent against changes. The classic theme has some quite visible layout problem in the detail window.

The free_events attribute of an enrolment

I continued to fiddle with the demo fixtures in order to write testable specs about invoicing in Lino Voga. There are a lot of enrolments for different situations, which generated some invoices, and until now I did not test these.

I noticed for example that the max_date of an invoicing plan was being ignored when generating invoices. As a result, the demo database contained invoices about enrolments in the future.

I moved the sales bookings from lino_xl.lib.ledger.fixtures.demo_bookings into a separate fixture lino_xl.lib.sales.fixtures.demo_bookings. This fixture is not being used by Lino Voga (where they don’t have “simple” sales of products without enrolments).

Die Ehrenamtlichen können die List memberships nicht sehen. Müssen sie aber.

I removed the SuggestedCoursesByPupil panel from the PupilDetail.

Variable row height in a grid

Hamza and I had a two hours voice session with shared screen about #977. We used SuggestionsByBankStatement as an example for our tests.

Result: Lino now has a new attribute row_height for tables.

Files modified:

modified:   lino/modlib/extjs/
modified:   lino/modlib/extjs/linoweb.js
modified:   lino/modlib/extjs/static/extjs/lino.css

Hamza, note that I afterwards decided to not remove the variable_row_height feature because I realized that there are maybe places where we want it (and where the fact that it breaks pagination is not a big problem). But also with variable_row_height the calculatePageSize() function no longer creates a fake row in order to call its getHeight() method.