implement entire Wagn layout as a card

Ticket

+commit
 

We want to be able to specify the basic layout of Wagn — top bar with links and Search bar, left column with main card area (which includes help text area above), right column with logo and sidebar and "Wheeled by" link — in a card, so that it can be altered directly in Wagn.

 

Once we have patterns, we should be able to set a card's default layout with a pattern, like {Pattern}+*layout, which should be a pointer to a single layout card.  For now, we can probably get away with one pointer to set the default layout: *layout.  We probably need to make this layout readable to everyone and editable only by admin, even on more private wagns.

 

So as not to sacrifice existing functionality, we also need to support our other layouts (like noside, blank, and none), probably by reproducing these in cards and making layout=X refer to these cards.

 

The *layout card will need a way to reproduce the current "yield" functionality, which produces the main content of the page.  One idea would be able to do something like {{_page}} or {{_main}}.

 

To replicate our current layout, we will need several new coded virtual cards (for which we will need to build some extra structure).

  1. *navbar
  2. *account links  - must have all the logic from the relevant section in top_menu
  3. *head (note that is is necessary to do this if we want some layouts, like "none", not to have the head tag
  4. *alerts - popup status messages (connecting to server..., done, etc.)
  5. *foot - javascript (tinyMCE, google analytics)
  6. *version card, which we could either actually make a normal card and update every version (in which case rollbacks would be tricky, but updates are easy to track) or do as a virtual card that pulls from the current representation.

Note that when we render inclusions in a layout the default view should be naked!

 

Will be good to test that special pages still work, eg. /recent ,  /admin/tasks , /account/invite , etc.

 

checkout http://test.dwagn.org/wagn/*layout

 

This shows a fairly complete configuration of the layout we want.  Note that you can't see the '*account links' card because the #logging css uses absolute positioning.  You can see it closer to the right place in this one:

 

http://test.dwagn.org/wagn/Default_Layout?view=content&layout=blank

 

Woud fit to be able to use image card for background image at the same time.


I just want to note that it's ok (and often preferable) if the layout is an html card (or just a basic card with some html classes in it) and accomplishes some things that we currently do via layout files. The only logic that's currently in the logo, for example, is about using text if there's no image, but since we now default with an image, and the layout will be fully configurable, we can drop that. So I'm removing a bunch of the logo / sidebar stuff from the solution.

  --Ethan McCutchen.....Thu Sep 17 14:57:33 -0700 2009


also, the help/error messages seen above cards are generally handled on a different layer from the layout.

  --Ethan McCutchen.....Thu Sep 17 15:26:36 -0700 2009


a crude version is up for testing on dwagn. lots of changes still in the works.

  --Lewis Hoffman.....Fri Sep 18 08:56:25 -0700 2009


Cool, basically looks great so far!

 

How do these double-star cards work? They don't show up as either real or virtual.

 

  • Want editable - **head (opens *many* possibilities) - workaround would be to have the head /head tags in the HTML, as on http://test.dwagn.org/wagn/Default_Layout (ah, but i see that those tags are wanted in **head so as to be able to not have a head tag at all)
  • Nice to have: **top_menu, **account_links, **bottom_menu, **foot
  • Okay uneditable - **logo, **alerts

 

I see _main, so i tagged add reference syntax for main card of page with Wagn 1.2

  --John Abbe.....Thu Sep 24 18:27:51 -0700 2009


I'm editing the solution to match what i'm seeing - double-stars, underscores instead of spaces, added **logo

  --John Abbe.....Thu Sep 24 18:29:17 -0700 2009


I flipped the main and sidebar columns on test. Trivial - http://test.dwagn.org/wagn/*layout and http://test.dwagn.org/wagn/*css

  --John Abbe.....Fri Sep 25 19:19:13 -0700 2009


we want to change what we build to match the solution, not the solution to match the spike. changed all that back :)

  --Ethan McCutchen.....Wed Sep 30 10:28:06 -0700 2009


John, there will be no double star cards, and they won't work like they do now (a hack on inclusions). They'll be virtual cards.

 

Re editability: we should be able to add things to head, but not to remove things that will break everything.

  --Ethan McCutchen.....Wed Sep 30 10:31:06 -0700 2009


Have added another major round of changes: edits to layout itself, having *layout be a pointer referring to Html layout card, and using virtual cards in the layout.

  --Lewis Hoffman.....Wed Oct 07 14:25:08 -0700 2009


Hey Lew, I have a question about this one:

 

Should we move context="main" into a new div that gets created when you render

. That seems like the relevant place to have the "main" context, and it removes a potentially confusing way to break things (if you forget that in a layout). I'm thinking if we want to do this we might want to fix it before the release -- would be harder to do later after everyone had already done their thing, right?

  --Ethan McCutchen.....Thu Oct 15 15:55:23 -0700 2009