         if value and not isShortcutValid value
           opt.data 'error', i18n.get 'opt_template_shortcut_invalid'
         else
+          log.debug "Changing template #{key} to '#{value}'"
           opt.data key, value
       when 'title'
         value = @val().trim()

# Validate the specified `object` that represents a template and return any
# validation errors that are encountered.
validateTemplate = (object, isNew) ->
  errors   = []
  template = if $.isPlainObject object then object else deriveTemplate object
  # Only validate the key and title of user-defined templates.
  unless template.readOnly
    # Only validate keys of new templates.

      opt.remove()
      templates.scrollTop(0).change().focus()
      saveTemplates()
      log.debug "Deleted #{title} template"
      analytics.track 'Templates', 'Deleted', title
    $('#delete_con').modal 'hide'
    updateToolbarTemplates()
