Review Board 1.5.4

Issue 458 -- Add a nice Menu DSL

Updated 1 year, 9 months ago

David Pollak Reviewers
dpp, timperrett, marius, charles, heiko, joni, atsuhiko, jorge, naftoli, kris, indrajit, alexb, dlouwers, mstarzyk, rmellgren, jhoffman, probinett, jmadsen, mhartmann, jstrachan, jgoday
None LiftWeb-archive
https://liftweb.assembla.com/spaces/liftweb/tickets/458-nicer-dsl-for-creating-menus

dpp_issue_458

Added a nice DSL for Menu creation.  It looks like 
    Menu("Home") / "index",
    Menu("Interactive Stuff") / "interactive" submenus(
      Menu("Comet Chat") / "chat" >> noGAE,
      Menu("Ajax Samples") / "ajax",
      Menu("Ajax Form") / "ajax-form",
      Menu("Modal Dialog") / "rhodeisland",
      Menu("JSON Messaging") / "json",
      Menu("Stateless JSON Messaging") / "stateless_json",
      Menu("More JSON") / "json_more",
      Menu("Ajax and Forms") / "form_ajax") ,
Tested against a number of applications including examples/example
Ship it!
Posted 1 year, 9 months ago (April 24th, 2010, 7:59 a.m.)
looks good to me. the only thing I would change is to add some example DSL usage to the doc comment for object Menu, since extracting a DSL usage from the published API is kind of tricky.
Posted 1 year, 9 months ago (April 24th, 2010, 9:04 a.m.)
How would one internationalize menus texts using this DSL ?
  1. Menu(S ?? "Home") / "index"
    
    S ?? "Home" is by-name and evaluated each time the LinkText is requested.
Posted 1 year, 9 months ago (April 24th, 2010, 2:08 p.m.)
Only real comment is (as per my ML post) I would like some alias on apply for Menu so that i could use a symbol rather than having t type Menu("NAME"). Probably a taste thing, but I think its a fairly easy thing to do right? 
Ship it!
Posted 1 year, 9 months ago (April 24th, 2010, 11:06 p.m.)
ok.