Skip to content

Commit

Permalink
only year displayed in projects
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnycrab committed Jun 29, 2013
1 parent 15361db commit 5cafa9d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
11 changes: 7 additions & 4 deletions app/app/modules/Portfolio.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define [
template: 'packery-list-item'
serialize: () ->
data = if @.model then @.model.toJSON() else {}
data.Persons = _.sortBy json.Persons, (person) ->
data.Persons = _.sortBy data.Persons, (person) ->
return person.Surname

data.LinkTo = @.options.linkTo
Expand Down Expand Up @@ -81,17 +81,20 @@ define [
out += ' & '
out

Handlebars.registerHelper 'niceDate', (model) ->
Handlebars.registerHelper 'niceDate', (model, forceYear) ->
return false unless model.DateRangeNice or model.FrontendDate
out = ''
if model.DateRangeNice
out += model.DateRangeNice
else if model.FrontendDate
out += model.FrontendDate
if not forceYear
out += model.FrontendDate
else
out += model.FrontendDate.split(' ')[1]
out

Handlebars.registerHelper 'teaserMeta', ->
niceDate = Handlebars.helpers.niceDate @
niceDate = Handlebars.helpers.niceDate @, true
if @.ClassName is 'Project'
nameSummary = Handlebars.helpers.nameSummary @.Persons
return "#{nameSummary} // #{niceDate}"
Expand Down
12 changes: 8 additions & 4 deletions app/app/modules/Portfolio.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/app/templates/portfolio-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h1>{{Title}}</h1>
<p>
{{{nameSummary Persons}}}
</p>
<p>{{niceDate this}}</p>
<p>{{niceDate this true}}</p>
{{#if Websites}}
<p>{{{commaSeparatedWebsites Websites}}}</p>
{{/if}}
Expand Down

0 comments on commit 5cafa9d

Please sign in to comment.