Opened 13 years ago

Closed 12 years ago

#450 closed enhancement (fixed)

Theming support

Reported by: Christopher Allan Webber Owned by:
Priority: major Milestone:
Component: programming Keywords:
Cc: Parent Tickets:

Description

We should have proper theming support in MediaGoblin. We *kind of* have theming in MediaGoblin at present, but not really.

Okay, so the things that are needed are really:

Requirements:

  • A way to install themes
  • It should be easy to "build" a theme, which means we should be able to provide a staging area of sorts
    • Should be easy to place together the templates
    • Should be easy to add extra assets
    • Should be easy to roll these up into a tarball or etc
  • Should be easy to "roll out" static templates into a directory that's served from apache

ie, you don't want all .png and css files for a theme to be served by
apache/nginx, so you might have a file with something like:

  location /mg_themes {
    alias /srv/mediagoblin/themes/static/;
  }

and a line in mediagoblin.ini like:

theme_install_dir = /srv/mediagoblin/themes/static/

People could possibly push theme static content to something like this
with such a command:

./bin/gmg install_theme coolthemebro.tar.gz

This might install the theme to something like:

themes/
themes/templates/theme1/
themes/templates/theme2/
themes/static/theme1/
themes/static/theme2/
  • That said, the themes that come with MediaGoblin should get a "free pass" here maybe? There's no reason that we shouldn't include a couple of base themes, and there's no reason that someone selecting one should have to push

Questions:

  • Should themes be plugins?
    • Pro: Could make use of infrastructure willkg is already using.
    • Con: Could allow themes to install way more than they should be able to, possibly even install malicious python code. (However, since templates can basically execute a good amount of python, you should only install templates you trust anyway.)
    • Pro: Plugins probably also already need a way to set up their own files, including templates and static files, so we could just use that
  • How to make the staging area and everything work nicely and cleanly?
    • If we set up the config options, directories and stuff in paste.ini and mediagoblin from the get-go, it's probably pretty easy to do right, and we can have a ./bin/gmg rolltheme that rolls up everything in the user_dev/templates/ and user_dev/theme_static/ into the appropriate tarball?
  • How to handle the "registry" of things correctly? (Again, plugin solution might actually just make this easy)

Change History (3)

comment:1 by Christopher Allan Webber, 12 years ago

I'm happy to say that the basics of theming in MediaGoblin are now there:

http://docs.mediagoblin.org/siteadmin/theming.html

However, there are a couple of things I think need finishing around unit tests and maybe some helper functions before I feel comfortable closing this ticket. Hopefully those should wrap up in the next few days!

comment:2 by Aleksej, 12 years ago

Type: defectenhancement

comment:3 by Christopher Allan Webber, 12 years ago

Resolution: fixed
Status: newclosed

Hm, I feel like theming feels like it's closed, so I'm just closing this ticket!

Note: See TracTickets for help on using tickets.