def add_modal(form, error, name, url):
    """Render the given template to provide a modal dialog
    that provides a popup form.

    Args:
        form (Forms) : Django form to render
        error (String) : String to add to the form's class attribute
        name (String) : Name of the buttons / modal
        url (String) : URL to post the form to
    """
    return {
        'form': form,
        'error': error,
        'name': name,
        'id': name.replace(' ', ''),
        'url': url
    }