Themes #162
No reviewers
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha!162
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "themes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Initial introduction of themes.
Partial solution for #23.
Code looks ok, but I'm not entirely convinced this is heading in the right direction.
datadirectory, and let all files that need to be written to live indata, to simplify permission handling.Probably something to discuss this afternoon.
What is the meaning of
$srchere? Also, couldn't we just do something likeHypha::$data->css->url_pathor something?I left a few more comments inline. I'm still missing the "new theme" option, but it would be fine to add that later. Now that you can edit the current theme, I think this PR should be complete and (nearly) mergeable (after resolving my comments).
I suspect that this (and probably in the previous commit already) should allow serving of all themes, regardless of the selected theme. This makes the check simpler, but also allows one theme to include another (e.g. have a theme that overrides stuff in the default theme rather than replacing it entirely).
@ -68,3 +67,2 @@if (strpos($hyphaQuery, 'data/css/') === 0) serveFile($hyphaQuery, false);if (strpos($hyphaQuery, 'data/fonts/') === 0) serveFile($hyphaQuery, false);if (startsWith($hyphaQuery, 'data/themes/')) serveFile($hyphaQuery, 'data/themes');if (startsWith($hyphaQuery, 'system/wymeditor')) serveFile($hyphaQuery, 'system/wymeditor');Did you intentionally remove support for fonts here? Or is the idea to put these inside the themes directory?
I would recommend using
htmlspecialcharshere, since$themecan (and should be allowed to) contain any characaters.I second you on having no git-tracked files in data. Maybe the default theme should reside somewhere in core and be not-editable.
Yes, in due time there should be a mechanism to copy the default theme to the theme dir and work from there. But since this partial solution already would lighten the work for working on themes, I would propose this go ahead.
@ -68,3 +67,2 @@if (strpos($hyphaQuery, 'data/css/') === 0) serveFile($hyphaQuery, false);if (strpos($hyphaQuery, 'data/fonts/') === 0) serveFile($hyphaQuery, false);if (startsWith($hyphaQuery, 'data/themes/')) serveFile($hyphaQuery, 'data/themes');if (startsWith($hyphaQuery, 'system/wymeditor')) serveFile($hyphaQuery, 'system/wymeditor');If fonts are outside of the theme directory, it will be more difficult to transfer a theme from one installation to another.
Althought this may lead to some duplification of font files, I think the ease of installing would win here.
@ -68,3 +67,2 @@if (strpos($hyphaQuery, 'data/css/') === 0) serveFile($hyphaQuery, false);if (strpos($hyphaQuery, 'data/fonts/') === 0) serveFile($hyphaQuery, false);if (startsWith($hyphaQuery, 'data/themes/')) serveFile($hyphaQuery, 'data/themes');if (startsWith($hyphaQuery, 'system/wymeditor')) serveFile($hyphaQuery, 'system/wymeditor');Sounds good, let's indeed keep fonts inside of the theme. I'll add a note to the commit message.
I just fixed this locally.
Fixed locally.
I also noticed that hypha.html was converted from dos to unix line endings. Now that the default theme is no longer intended to be edited, this makes sense, but it should be in a separate commit. I refrained from this for now, to prevent conflicts with #172.
I also added a "cancel" button to the theme switch settings dialog.
Finally, I cleaned up a few other things. I just pushed these changes to this PR.
I added #175 for some additional improvements on this PR.