 	'''
 	refresh_bookbags_summary = ->
 		$('#bookbags_summary').openils 'bookbags summary', 'actor.container.retrieve_by_class', (o) ->
-			$('.summary_line', @).text tpl_bookbags_summary {
+			$('.summary_line', @).text tpl_bookbags_summary
 				nbb: nbb = o.length
-			}
 		return false
 
 	# ***

	'''
	refresh_fines_summary = ->
		$('#fines_summary').openils 'fines summary', 'actor.user.fines.summary.authoritative', (o) ->
			$('.summary_line', @).text tpl_fines_summary {
				nf:  nf = o.balance_owed
			}
		return false

	tpl_checkouts_summary = _.template '''

		# we will refresh the line and its inner plugins.
		.live 'expand', (e, ui) ->
			$(@).publish $('h3', @).prop 'id' # The h3 element id is the name of the data channel to publish on
			$('.plugin', @).refresh()
			return false

		# Upon the user collapsing a summary line,
		# we will empty its inner plugin content.
		.live 'collapse', (e, ui) ->
			$('.plugin', @).empty()
			return false

		# Upon the user logging in,
		# we will refresh a summary line's inner plugin content if the summary line is not collapsed.
		.subscribe 'login_event', ->
			$(ps).refresh() for ps in $('.plugin', @) when $(ps).closest('.ui-collapsible-content').prop('aria-hidden') is 'false'
			return false

		# Upon the user logging out,
		# we will empty a summary line's inner plugin content if the summary line is not collapsed.
		.subscribe 'logout_event', ->
			$(ps).empty() for ps in $('.plugin', @) when $(ps).closest('.ui-collapsible-content').prop('aria-hidden') is 'false'
			return false

