Closed looshi closed 9 years ago
Templates no longer need any relation to the Collections. Originally I was planning on having something like Template.dataContext -- which would automatically populate that Template with its dataContext. However that's proving to be pretty difficult and I think for now simplifying to only provide data via helpers will help :)
@looshi Do you think that we could skip the DB roundtrip and just feed a local client collection with the data provided be the user? That's both easier and more safe.
We currently have two editors: one for the template code, the second one for helpers. Why can't we have a third one for JSON array? In practice it means that the user provided data are always stored in the text form and not in a real database.
Does it sound reasonable?
@apendua great idea, let's do it. We can add a field to the Template object https://github.com/looshi/Meteor-Live-Template-Editor/blob/master/collections/TemplateCollection.js name it "data" or whatever seems appropriate. This field will be a string of the JSON data.
If a user makes an edit to the JSON data, the application should update the local Collection. That user will then see the changes to the rendered template.
Currently there should be three editors, CSS, HTML and JS. If you don't see the CSS tab, it's a bug in the layout. So, we can add a fourth tab for the collection JSON data.
thanks
@apendua i'm going to do this one now. if you already started, then just commit a branch, i may be able to merge it, i will probably be doing it the same way.
Currently all users have access to only two pre-defined databse Collections, 'PeopleCollection' and 'AddressCollection'.
The goal of this ticket is to allow users to import arbitrary JSON that is compatible with a normal mongo import routine, and publish that data if a particular template requests it via a helper.