tunapanda / provision

System for provisioning a new virtual machine with Tunapanda Edubuntu
7 stars 12 forks source link

Fully modular portal site #38

Closed usernamenumber closed 9 years ago

usernamenumber commented 9 years ago

The ansible roles as of #32 allow resources like edx, wikipedia, kalite, etc to add themselves as "subsites" of the main portal via dependency on the portal_subsite role. For a usage example, see here. This allows the role to set up an nginx redirect from http://portal_ip/foo to an arbitrary directory or port.

The portal site provides a nice set of links for each subsite:

screen shot 2015-01-25 at 11 46 30 am

However, these links are currently hard coded. It would be nice to make the portal page setup for subsites as dynamic as the nginx setup is.

Possible solutions include (in order of preference):

  1. Figure out a way to let roles generate their own links from the portal page, with custom descriptions and images.
    • For example, each role could put html and images into tunapanda/data/portal/subsite_descriptions.d/< role name >, each of which would be loaded by the portal page.
    • Main difficulty here is architecting it properly. I'd want something like this to work by having each role pass custom data to a shared template provided by the portal_subsite role (this allows us to change the formatting of all the subsite links in one place). That's easy enough, but as far as I can tell a role can't pass images and other files to another role, so either each role will need to put its logo image in a known location and then give that location to portal_subsite, or...
  2. Do something like the above, but with no images.
    • If it's just text we're passing to portal_subsite, this gets easier to implement.
  3. Let each role write its own description html into a known directory, to be included by the portal as described above
  4. Continue hard-coding subsite links, but at least add template variable so that, for example, if kalite isn't installed it isn't linked from the portal.
    • This is more work, and much harder to maintain, but it does give us the most flexibility in terms of fine-tuning how the content is presented.
usernamenumber commented 9 years ago

I was recently introduced to Project RACHEL, which already has a portal like the one we're building, but much farther along in development. Here's their demo server.

The source is here, and adding a module should be as simple as creating a modules/modulename/ directory with an index.htmlf (the "f" is for "fragment") file that has the content you want to show up on the portal main page, with an optional <!-- position: X --> comment to force the item to appear in position X on the page.

Adopting this instead of our existing portal would bring with it several easily-deployable modules that Project RACHEL has already created, in addition to whatever we add.

I'm leaning strongly toward scrapping our existing portal and deploying this instead, maybe with some stylesheet updates to port the (IMO nicer) look and feel of our portal to theirs.

usernamenumber commented 9 years ago

Fixed in the usernamenumber/rachel_portal module, which is only waiting on #48 for merge.