New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Next-Level Flavours And Skins For Mastodon™ #229

Merged
merged 15 commits into from Dec 6, 2017

Conversation

Projects
None yet
3 participants
@marrus-sh

marrus-sh commented Nov 21, 2017

(Note 1,655 of those added lines are the win95 theme I didn't change things that much)

This is the more robust themeing system suggested by @ekiru, or as best as I could interpret it. Probably don't merge until I've had time to document since I know a lot of folks running glitchsoc are interested in custom themes and this is a breaking change (see below). But, I wanted to get eyes on it early. It's late and i'm tired so there might still be some problems/bugs.

This was the old theme format (only affected web view), which should be ignored after this change:

pack: home.js

This is the new theme format (can affect all sorts of pages):

pack:
  common: # or home, about, settings, etc…
    filename: common.js
    stylesheet: true
  home: home.js # You can specify just the filename if you don't need additional options

fallback: glitch # Uses glitch packs where unspecified

With the exception of locales (which aren't yet integrated into themeing), all of glitchsoc's assets are now loaded this way, including core stuff (see app/javascript/core/theme.yml). This hopefully will fix a lot of our prior problems involving static pages, including profile metadata or things just not being styled correctly.

This PR includes the win95 theme from our friends at cybre, although it will still need some minor tweaking before it's completely compatible with glitch.

@marrus-sh

This comment has been minimized.

marrus-sh commented Nov 21, 2017

Apparently webpack still needs to be configured to ignore the old syntax lol (it's trying to break index.js up into its component parts from the looks of it)

# By default, the glitch preloads will also be used here. You can
# disable them by setting `preload` to `null`.
# preload:

This comment has been minimized.

@marrus-sh

marrus-sh Nov 21, 2017

This comment should be removed, preloads are now specified per-pack

= javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
= stylesheet_pack_tag 'application', integrity: true, media: 'all'
= javascript_pack_tag 'embed', integrity: true, crossorigin: 'anonymous'

This comment has been minimized.

@marrus-sh

marrus-sh Nov 21, 2017

these javascript pack tags need to be removed

marrus-sh added some commits Nov 22, 2017

@marrus-sh

This comment has been minimized.

marrus-sh commented Dec 1, 2017

Skins support! You can now specify skins for themes. A skin named tooty for the rooty theme can be specified in app/javascript/skins/rooty/tooty, for example. This can be either

  • A folder, in which case the (s)css files inside should be named according to the pack whose styles they are intended to replace (eg, home.scss, common.scss), or
  • A stylesheet file, in which case the pack is assumed to be common.

win95 has been migrated over as a vanilla theme, so you can check that out to see how it looks. It's at app/javascript/skins/vanilla/win95.scss!

@marrus-sh

This comment has been minimized.

marrus-sh commented Dec 1, 2017

There's more functionality i'd like to implement before merge but the code here should be functional at this point 🙏🏻

Things still to come:

  • Testing support?? (This might be a separate PR)
  • Renaming "themes" to "flavours" to prevent confusion with upstream themes
  • If the pack file specified is a (s)css file, it'd be nice if stylesheet defaulted to true in theme.yml
  • Update the docs!!
@marrus-sh

This comment has been minimized.

marrus-sh commented Dec 1, 2017

Apparently .match? was added in Ruby 2.4 so I'll have to change that for Ruby 2.3 support. set_path in the registrations controller is a typo for set_pack.

@marrus-sh marrus-sh changed the title from Themes for static pages, etc to Advanced Next-Level Flavours And Skins For Mastodon™ Dec 4, 2017

@marrus-sh

This comment has been minimized.

marrus-sh commented Dec 4, 2017

I haven't tested it yet and it's possible that renaming everything Broke Something Somewhere but @beatrix-bitrot I daresay this is about ready for some eyes 👀

@yipdw

This comment has been minimized.

Member

yipdw commented Dec 4, 2017

I fixed a merge conflict with master; will let the CI build run. If that passes I can do a check over the Ruby code.

yipdw and others added some commits Dec 4, 2017

@marrus-sh

This comment has been minimized.

marrus-sh commented Dec 5, 2017

I fixed the last of the problems with the renaming I think.

I don't understand why the deletes test is failing—I certainly haven't touched it……… 😫

Prepend check_enabled_deletion to Settings::DeletesController (#229)
The specs for Settings::DeletesController include an example that
sets Settings.open_deletion to false and expects the "if deletion is not
available, redirect to root" logic to run.  However, this spec does not
set up a user, which means that the spec (intentionally or otherwise)
expects this redirection to work with unauthenticated access.

We should preserve that behavior.  To do so, we prepend the deletion
check to the action chain set up by Settings::BaseController, so that
said check occurs before the authenticate_user! check.
@beatrix-bitrot

This comment has been minimized.

beatrix-bitrot commented Dec 6, 2017

bravo you two~

@beatrix-bitrot beatrix-bitrot merged commit 81b0145 into master Dec 6, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

yipdw added a commit that referenced this pull request Dec 6, 2017

@yipdw yipdw deleted the glitch-theme branch Feb 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment