{% load url from future %}
<script type="text/javascript">
/*
type: content type identifier (required)
cssclass: quickbutton CSS class
raw_id_picker: URL of raw_id_fields picker which should be automatically opened
after: callback, receives new fieldset as argument
keep: keep entry in content type dropdown (defaults to false)
*/
{% url "admin:medialibrary_mediafile_changelist" as media_library_url %}
var CONTENT_TYPE_BUTTONS = [
    {
        type: 'richtextcontent',
        keep: true
    }, {
        type: 'imagecontent',
        keep: true
    }, {
        type: 'filecontent',
        keep: true,
        cssclass: 'pdfcontent'
    }, {
        type: 'videocontent',
        keep: true,
        cssclass: 'oembedcontent'
{% if media_library_url %}
    }, {
        type: 'mediafilecontent',
        keep: true,
        cssclass: 'imagecontent',
        raw_id_picker: '{{ media_library_url }}?type__exact=image&pop=1'
    }, {
        type: 'gallerycontent',
        keep: true
    }, {
        type: 'mediafilecontent',
        keep: true,
        cssclass: 'pdfcontent',
        raw_id_picker: '{{ media_library_url }}?type__exact=pdf&pop=1'
{% endif %}
    }, {
        type: 'oembedcontent',
        keep: true
{% if media_library_url %}
    }, {
        type: 'mediafilecontent',
        keep: true,
        cssclass: 'audiocontent',
        raw_id_picker: '{{ media_library_url }}?type__exact=audio&pop=1'
{% endif %}
    }
];
</script>
