Skip to content

Commit

Permalink
fix the use of _.template
Browse files Browse the repository at this point in the history
"Underscore templates no longer accept an initial data object. _.template
always returns a function now."
  • Loading branch information
LuizArmesto committed Oct 22, 2014
1 parent ae04236 commit 1d17582
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/components/importEdit.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ App.components.importEdit = ->

showErrors: ->
if !@hasMap()
_tpl = _.template(@errMessage, msg: I18n.imports.errors.map)
_tpl = _.template(@errMessage)(msg: I18n.imports.errors.map)
@attr.errsDiv.append _tpl

if !@allEntriesAreValid()
_tpl = _.template(@errMessage, msg: I18n.imports.errors.invalid)
_tpl = _.template(@errMessage)(msg: I18n.imports.errors.invalid)
@attr.errsDiv.append _tpl
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/overlay.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ App.components.overlay = ->
@render()

render: ->
@overlay = $ _.template(overlayTemplate, @attr)
@overlay = $ _.template(overlayTemplate)(@attr)
@container.css 'position', 'relative'
@container.prepend @overlay
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ App.components.pictureUploader = ->
, 200)

addPictureThumb: (result) ->
picture = $ _.template(@pictureThumb, result)
picture = $ _.template(@pictureThumb)(result)
@picturesList.prepend picture
App.mediator.publish 'components:start', picture

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/uploader.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ App.components.uploader = ->
method: 'PATCH'

attributes: ->
_uploader = $ _.template(uploaderTemplate, buttonLabel: @buttonLabel)
_uploader = $ _.template(uploaderTemplate)(buttonLabel: @buttonLabel)
{
field: @container.closest('.field')
uploader: _uploader
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ en:
profile: 'profile'
you: 'you'

empty_location: "Loocation not provided yet"
empty_location: "Location not provided yet"

search:
empty: "No results found!"
Expand Down

0 comments on commit 1d17582

Please sign in to comment.