Pepperminty-Wiki
Pepperminty-Wiki copied to clipboard
Mega Enhancement: Settings GUI
Gogs has a gui upon first run that allows you to configure the software's settings. It would be seriously cool if we could have something similar.
It is, however, a very difficult problem. Firstly, we need to abstract our settings into a separate file in something like JSON or INI. Furthermore, our data structure is complex - the default CSS theme would need to have its own file, and I can't even start to imagine what we'd have to do with the users array.
Only then can we consider a GUI for the settings.
Actually, the user list would be quite trivial in JSON - we could use an array. I guess that rules out INI then.
I'd love to use cson or hjson, but I can't find a parser in PHP - so I'd have to write my own. That doesn't sound fun at all.
Right. I can't take it any more! I have to deal with this problem once and for all. It's a huge usability issue because it makes it extremely difficult to upgrade to the next version of Pepperminty Wiki properly.
The first order of business is to create a settings file. The default settings should be stored/packed (compactly it should be added) into Pepperminty Wiki itself and then get overridden on load by the settings loaded from the JSON file. That way if new settings aren't present upon upgrade it won't be a huge.
The comments currently next to each option should be moved to a separate JSON file. THen we can use it to generate a GUI for the settings automatically later on down the line.
The settings GUI may not make it into this release though - that all depends on how we get on. I do, however, intend to make as many of the breaking changes as possible in this release. Then we can just bolt on the settings GUI (which will have it's own separate issue) in the next release with no problem at all!
That took absolutely ages. Right now we currently have all the settings stored in a JSON file. Some minor changes to the data structure had to be made in order to get it work work though - like the $admindetails
array, for instance.
Although everything is in place to start work on the first-run gui, I don't think it's going to make it into this release. It's a complex piece of work, and requires re-working the settings slightly again, which is a nasty complicated task - considering all the things that depend on it.
That JSON file for the settings is totally worth it - instantly it's making dealing with the settings a whole ton easier - as expected :D
We've now got an initial settings GUI online, as of d4fe19d..16f5e8f. I'm not stopping there though - oh no. Next, I'm going to also tackle user management / preferences in #127. Then, I'm also planning on tackling user preferences (such as changing one's own password!) in #128.
#128 is dealt with - #127 is still to go.
That's #127 done! I think we can safely say that we've (mostly) dealt with this issue now. Still to go are the navigation bar links etc.
I'm still not actually particularly happy with the more menu actually - I might change that up a bit, so I'm not sure whether dealing with adding a configuration GUI for that is a particularly good idea right now.
We now have a new mega-menu style more menu! Now we might be able to create a UI for it - but that's going to be rather unpleasantly complicated I suspect :-/