Render log in UI

This commit is contained in:
Shaunak Kishore
2015-09-11 01:04:43 -04:00
parent 082b7eca32
commit 0765e8738c
3 changed files with 31 additions and 0 deletions

View File

@ -186,6 +186,12 @@ Template.glyph.helpers({
var glyph = Session.get('glyph.data');
return glyph && glyph.manual.verified ? 'verified' : undefined;
},
log: function() {
var glyph = Session.get('glyph.data');
return glyph ? glyph.render.log.map(function(pair) {
return {log_class: pair[0], log_message: pair[1]};
}) : [];
},
base_color: function() {
return Session.get('glyph.show_strokes') ? 'black' : 'gray';
},

View File

@ -59,6 +59,11 @@
<template name="glyph">
<div id="glyph" class="{{verified}}">
<div class="log">
{{#each log}}
<div class="log-line {{log_class}}">{{log_message}}</div>
{{/each}}
</div>
<svg viewbox="0 0 1024 1024">
<g transform="scale(1, -1) translate(0, -900)">
{{#if glyph}}

View File

@ -52,6 +52,26 @@
text-align: center;
}
#glyph .log {
position: absolute;
text-align: left;
left: 40px;
top: 76px;
}
#glyph .log .log-line {
font-size: 20px;
margin-bottom: 16px;
}
#glyph .log .log-line.error {
color: red;
}
#glyph .log .log-line.success {
color: green;
}
#glyph.verified {
background-color: #dfc;
}