Skip to content
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

Prototype theme editor #1499

Closed
wants to merge 8 commits into from
Closed

Prototype theme editor #1499

wants to merge 8 commits into from

Conversation

taylortom
Copy link
Member

@taylortom taylortom commented Feb 4, 2017

Summary

Code for a theme editor I've developed. Could be used as a starting point for the open-source feature. Needs general tidying and tweaking to work with Learning Pool's plugins.

Summary of features:

  • Replaces theme picker.
  • Pulls in editable settings from the properties.schema associated with a theme.
    • The key value needs to map to the LESS variable value
    • The build process checks all .less files in the theme's less folder (but not sub-folders), and replaces any matches with the input values
  • Allows the user to save selected settings as a 'preset' for the chosen theme, allowing them to be used in other courses.
  • Adds a 'Clear colour' button to the ColorPicker to 'unset' a colour.
  • Adds support for theme and menu to provide pluginLocations

To test

  1. Get a copy of the code in https://github.com/adaptlearning/adapt_authoring/tree/issue/1495
  2. Get the latest node modules with npm install
  3. Rebuild the front-end app with grunt build
  4. That's it!

You'll then find the old theme picker has been replaced with a new section. I've set up a test version of vanilla which exposes a load of variables -- upload this using Plugin management as usual.

Screenshots

See some screenshots below.

Theme picker

screen shot 2017-02-05 at 22 44 45

Theme settings

screen shot 2017-02-05 at 22 44 52

Colour picker component

screen shot 2017-02-05 at 22 45 04

Save preset button

screen shot 2017-02-05 at 22 48 26

Create preset modal

screen shot 2017-02-05 at 22 48 02

Manage presets modal

screen shot 2017-02-05 at 22 48 13

@letithappen
Copy link

letithappen commented Feb 7, 2017

Having no problem using theme editor to change colors, margins, etc using your vanilla or my own theme after filling properties.schema as you did. Courses are previewing OK.
But i'm getting this error downloading the course:
image

Just checked out to master branch and had no problems publishing so it must be related to this code

@taylortom
Copy link
Member Author

@letithappen your issue should be fixed now

@dancgray
Copy link
Member

Looking fantastic. Can edit and preview changes using the new theme.
Still getting an error on export source though:
theme-error.txt

Should this be backward compatible with old themes? Only I'm getting a notify alert using the old theme "constructorFn is not a constructor". No errors on console or terminal.

@taylortom
Copy link
Member Author

@dancgray yeah, should definitely allow you to select un-editable themes. Will have a look at that.

@taylortom
Copy link
Member Author

@dancgray both of your issues should now be fixed :)

@dancgray
Copy link
Member

👍 All fixed, I think that the course schema will need the menu settings as well but we can add that with the menu settings changes.

If I was being pedantic the saved preset item should be selected in the dropdown list on return and the preset list should be updated if one is deleted, but really it's awesome as it is :)

@dancgray
Copy link
Member

Sorry @taylortom just found something else, on the second download or export of a course I get an error, terminal output
theme-settings-error.txt
attached.

Could be my install of archiver module. Will try again tomorrow.

@canstudios-louisem canstudios-louisem added this to the 0.?.0 Theme/menu editor milestone Feb 22, 2018
@taylortom taylortom modified the milestones: 0.?.0 Theme/menu editor, 0.6.0 Scaffold rewrite Jun 5, 2018
@tomgreenfield
Copy link
Contributor

Superseded by #2209.

@taylortom taylortom removed this from the Suggested Next milestone Mar 26, 2019
@tomgreenfield tomgreenfield deleted the issue/1495 branch June 10, 2019 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants