Type Selection Template

Support Ticket

+status
answered
 

I want a script template for type selection.

 

The list of available types may depend on which user/roles are on the page, but it doesn't change per card or slot.  This means that a hidden <script type="text/html"> in the header or wherever it is needed can be accessed in a javascript module to implement a type selector.

This PR implements the change: https://github.com/wagn/wagn/pull/152

 

On it's own, it shouldn't change anything that Wagn does, but it adds the ability to include this template in the *head inclusion as follows:

 

{{*head|show:type_template}}

 

Almost forgot this, maybe I should add it to the 'issue' part?

 

I need a class on the type view so javascript knows if the cardtype can be changed. Don't want to have to do a transaction with the server to know that. In the PR, that class is 'no-edit', that's what the comment about changing the class as you like is about.

--Gerry Gleason.....2014-01-11 03:31:42 +0000

What's a "script template"? What does is mean for "user/roles" to be on a page?

 

Why not just do something like this:

<head>

  {{*head}}

  {{type template}}

</head>

 

seems a lot simpler, no?

 

 

--Ethan McCutchen.....2014-01-11 03:54:00 +0000

extra context: *head seems like a mess to me. I've been looking for ways to clean it up; I don't think we can just go sticking in optional_renders for every odd use case we come up with.

--Ethan McCutchen.....2014-01-11 03:58:05 +0000

It's dynamic, so you can't just put it in a card. I guess it could be a self view.

--Gerry Gleason.....2014-01-30 04:46:04 +0000

of course you can put it in a card; you can put everything in a card. if it needs code, then you can override the raw view.

--Ethan McCutchen.....2014-01-30 05:22:12 +0000

(that's what's turning into standard practice for code-driven content)

--Ethan McCutchen.....2014-01-30 05:38:42 +0000

and if you don't want it processed, just add:

view :core, :raw

--Ethan McCutchen.....2014-01-30 05:39:16 +0000