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.
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?
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.
It's dynamic, so you can't just put it in a card. I guess it could be a self view.
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.
(that's what's turning into standard practice for code-driven content)
and if you don't want it processed, just add:
view :core, :raw