Open bodsch opened 2 years ago
I totally support that! Just being able to write up a CSS file (maybe even with a nice explanatory tutorial) and dropping that into the themes folder would be a good approach I think. Not sure how doable that is, but I feel like we should look into that :)
Disadvantages: duplicate logic for loading CSS, image path routing. Similar but duplicated CLI commands, extra work for documentation and compatibility. It's perfectly legal to have theme-only-modules since 2.0, and CLI commands to enable them are already there.
Said all this, I do not consider this being an enhancement. Where is the benefit?
There should be a clear structure and separation of the two areas. As an example:
These are two areas that are technically hard to separate from each other.
As far as duplicating code is concerned - and without knowing the code - I assume that this should be limited with OOP and derived classes (which PHP also offers).
I'm fully on @Thomas-Gelf's side here. Especially if we're talking about static assets (images) or Javascript. It's all there, as part of the module integration. You even have the possibility to define version requirements, a theme might not be compatible with every Icinga Web 2 version after all.
I cannot see any benefit here, why we should separate anything in this regard.
Is your feature request related to a problem? Please describe.
At present, themes are treated like modules and displayed accordingly. The same applies to the installation, the (de)activation and the storage location.
The logic should be adapted so that themes can be (de)installed with their own CLI parameter. Furthermore, these should be stored in a separate directory.