format milestone titles

This commit is contained in:
Radek Stepan 2014-09-21 14:26:01 -07:00
parent 5cef4596be
commit 5040501d34
5 changed files with 26 additions and 4 deletions

View File

@ -26,6 +26,7 @@ GitHub Burndown Chart as a service. Public repos are free, for private access au
- [ ] Check that we have not run out of requests to make
- [ ] Show loading sign on top of [browser window](https://github.com/buunguyen/topbar) which is unobtrusive enough we can show it immediately.
- [ ] show a countdown clock towards the end of the milestone or show overdue
- [x] format milestone titles prepending "Milestone" word if appropriate
- [x] Variable document.title on different pages
- [x] be able to go back to homepage
- [x] deal with no due date milestones - always on track

View File

@ -40755,7 +40755,7 @@ if (typeof exports === 'object') {
// showChart.mustache
root.require.register('burnchart/src/templates/pages/showChart.js', function(exports, require, module) {
module.exports = ["<div id=\"title\">"," <div class=\"wrap\">"," <h2 class=\"title\">{{ milestone.title }}</h2>"," <span class=\"sub\">{{{ format.due(milestone.due_on) }}}</span>"," <p class=\"description\">{{{ format.markdown(milestone.description) }}}</p>"," </div>","</div>","","<div id=\"content\" class=\"wrap\">"," <div id=\"chart\">"," <div id=\"svg\"></div>"," </div>","</div>"].join("\n");
module.exports = ["<div id=\"title\">"," <div class=\"wrap\">"," <h2 class=\"title\">{{ format.title(milestone.title) }}</h2>"," <span class=\"sub\">{{{ format.due(milestone.due_on) }}}</span>"," <p class=\"description\">{{{ format.markdown(milestone.description) }}}</p>"," </div>","</div>","","<div id=\"content\" class=\"wrap\">"," <div id=\"chart\">"," <div id=\"svg\"></div>"," </div>","</div>"].join("\n");
});
// projects.mustache
@ -40811,6 +40811,13 @@ if (typeof exports === 'object') {
},
'markdown': function(markup) {
return marked(markup);
},
'title': function(text) {
if (text.toLowerCase().indexOf('milestone') > -1) {
return text;
} else {
return ['Milestone', text].join(' ');
}
}
};

View File

@ -789,7 +789,7 @@
// showChart.mustache
root.require.register('burnchart/src/templates/pages/showChart.js', function(exports, require, module) {
module.exports = ["<div id=\"title\">"," <div class=\"wrap\">"," <h2 class=\"title\">{{ milestone.title }}</h2>"," <span class=\"sub\">{{{ format.due(milestone.due_on) }}}</span>"," <p class=\"description\">{{{ format.markdown(milestone.description) }}}</p>"," </div>","</div>","","<div id=\"content\" class=\"wrap\">"," <div id=\"chart\">"," <div id=\"svg\"></div>"," </div>","</div>"].join("\n");
module.exports = ["<div id=\"title\">"," <div class=\"wrap\">"," <h2 class=\"title\">{{ format.title(milestone.title) }}</h2>"," <span class=\"sub\">{{{ format.due(milestone.due_on) }}}</span>"," <p class=\"description\">{{{ format.markdown(milestone.description) }}}</p>"," </div>","</div>","","<div id=\"content\" class=\"wrap\">"," <div id=\"chart\">"," <div id=\"svg\"></div>"," </div>","</div>"].join("\n");
});
// projects.mustache
@ -845,6 +845,13 @@
},
'markdown': function(markup) {
return marked(markup);
},
'title': function(text) {
if (text.toLowerCase().indexOf('milestone') > -1) {
return text;
} else {
return ['Milestone', text].join(' ');
}
}
};

View File

@ -1,6 +1,6 @@
<div id="title">
<div class="wrap">
<h2 class="title">{{ milestone.title }}</h2>
<h2 class="title">{{ format.title(milestone.title) }}</h2>
<span class="sub">{{{ format.due(milestone.due_on) }}}</span>
<p class="description">{{{ format.markdown(milestone.description) }}}</p>
</div>

View File

@ -38,3 +38,10 @@ module.exports =
# Markdown formatting.
'markdown': (markup) ->
marked markup
# Format milestone title.
'title': (text) ->
if text.toLowerCase().indexOf('milestone') > -1
text
else
[ 'Milestone', text ].join(' ')