# Build action buttons and dialogs given specifications as follows.
# actions = [ { name: { href: h, method: m, fields: [ { name: n, value: v, options: [...] } ] } ]
- _actions: (actions, id) ->
+ _actions: (actions, id, suspended) ->
tpl = _.template """
<div>
$buttons = for n, action of actions
- # Extend the action object with context
- $.extend action, _of: $tr, _name: n, _id: id
+ unless suspended? and n is 'addSuspension'
- # Create a button for this action
- $ tpl href: action.href, action_name: n, label: Labels?[n] or n
+ # Extend the action object with context
+ $.extend action, _of: $tr, _name: n, _id: id
- # On clicking the button, build a new dialog using the extended action object
- .on 'click', action, (ev) ->
- ev.preventDefault()
- $('<div>')['_' + ev.data._name] ev.data
- return false
+ # Create a button for this action
+ $ tpl href: action.href, action_name: n, label: Labels?[n] or n
+
+ # On clicking the button, build a new dialog using the extended action object
+ .on 'click', action, (ev) ->
+ ev.preventDefault()
+ $('<div>')['_' + ev.data._name] ev.data
+ return false
@empty().append $buttons
_holds_row: (hold) ->
+ suspended = if hold.holdSuspension? then 1
+
@find 'td.availability'
._holds_row_avail1 hold
.end()
.find 'td.actions'
- ._actions hold.actions, hold.reserveId
+ ._actions hold.actions, hold.reserveId, suspended
.end()
# Show a title, author, or format by using the given metadata object