Start work on metadata editing

This commit is contained in:
Shaunak Kishore
2015-09-29 20:46:02 -04:00
parent 2228444b82
commit 45dbe62d74
3 changed files with 36 additions and 20 deletions

View File

@ -42,24 +42,6 @@ Template.editor.helpers({
points: () => Session.get('stage.points'),
});
Template.metadata.helpers({
character() {
const glyph = Session.get('editor.glyph');
if (!glyph) return;
return glyph.character;
},
items() {
const glyph = Session.get('editor.glyph');
if (!glyph) return;
const defaults = cjklib.getCharacterData(glyph.character);
const fields = ['definition', 'pinyin', 'strokes']
return fields.map((x) => ({
field: `${x[0].toUpperCase()}${x.substr(1)}:`,
value: glyph.metadata[x] || defaults[x] || '(unknown)',
}));
},
});
Template.status.helpers({
stage: () => Session.get('stage.type'),
instructions: () => Session.get('stage.instructions'),