{% load i18n admin_urls simpletags%}
<div class="submit-row">
    {% if '_popup' not in request.GET %}
        <el-button size="small" type="button" icon="el-icon-arrow-left" onclick="prev()"
                   style="float: left;margin-right: 10px;margin-bottom: 10px;">
            <span v-text="getLanuage('Go back')"></span>
        </el-button>
    {% endif %}
    {% if show_delete_link %}
        {% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}
        <el-button size="small" icon="el-icon-delete" type="danger" onclick="del('{% add_preserved_filters delete_url %}')"
                   style="float: left">{% trans "Delete" %}</el-button>
    {% endif %}
    {% if show_save_as_new %}
        <el-button size="small" type="primary"
                   @click="formSubmit('_saveasnew','{% trans 'Save as new' %}',$event)">{% trans 'Save as new' %}</el-button>
    {% endif %}
    {% if show_save_and_add_another %}
        <button type="submit" class="el-button el-button--primary el-button--small" name="_addanother">
            {% trans 'Save and add another' %}
        </button>
    {% endif %}
    {% if show_save_and_continue %}

        <button type="submit" class="el-button el-button--primary el-button--small" name="_continue">
            {% trans 'Save and continue editing' %}
        </button>
    {% endif %}
    {% if show_save %}
        <button type="submit" class="el-button el-button--primary el-button--small" name="_save">
        {% trans 'Save' %}
        </button>
    {% endif %}
    <input type="hidden" name="actionName" value="actionValue" id="actionName">
</div>
<script type="text/javascript">
    var submitrows=document.getElementsByClassName('submit-row');
    function del(url){
         window.location.href = url;
    }
    function prev() {
         window.location.href='{% get_model_url %}'
    }

    for(var i=0;i<submitrows.length;i++){
        new Vue({
        el: submitrows[i],
        data: {},
        methods: {
            formSubmit: function (name, v, e) {
                $("#actionName").attr('name', name).val(v);
                $("form").submit();
            }
        }
    })
    }

</script>