{% extends "base.html" %}

{% load static %}

{% block content %}

<div class='container-fluid'>
<h3><button style='float: right;' class="btn btn-success" id='new-company'>New Company</button></h3>
<h3>Companies</h3>
</div>

<table class='table table-striped' id='company-table'>
</table>



{% include 'modals.html' %}

{% endblock %}
{% block js_ready %}
{{ block.super }}
    $('#new-company').click(function () {
        launchModalForm('#modal-form',
                        "{% url 'company-create' %}",
                        {
                            follow: true
                        });
    });

    $("#company-table").bootstrapTable({
        sortable: true,
        search: true,
        pagination: true,
        columns: [
            {
                field: 'pk',
                title: 'ID',
                visible: false,
            },
            {
                field: 'name',
                title: 'Company',
                sortable: true,
                formatter: function(value, row, index, field) {
                    return renderLink(value, row.url);
                }
            },
            {
                field: 'description',
                title: 'Description',
            },
            {
                field: 'website',
                title: 'Website',
                formatter: function(value, row, index, field) {
                    if (value) {
                        return renderLink(value, value);
                    }
                    return '';
                }
            }
        ],
        url: "{% url 'api-company-list' %}"
    });

{% endblock %}
{% extends "base.html" %}

{% load static %}

{% block content %}

<div class='container-fluid'>
<h3><button style='float: right;' class="btn btn-success" id='new-company'>New Company</button></h3>
<h3>Companies</h3>
</div>

<table class='table table-striped' id='company-table'>
</table>



{% include 'modals.html' %}

{% endblock %}
{% block js_ready %}
{{ block.super }}
    $('#new-company').click(function () {
        launchModalForm(
                        "{% url 'company-create' %}",
                        {
                            follow: true
                        });
    });

    $("#company-table").bootstrapTable({
        sortable: true,
        search: true,
        pagination: true,
        columns: [
            {
                field: 'pk',
                title: 'ID',
                visible: false,
            },
            {
                field: 'name',
                title: 'Company',
                sortable: true,
                formatter: function(value, row, index, field) {
                    return renderLink(value, row.url);
                }
            },
            {
                field: 'description',
                title: 'Description',
            },
            {
                field: 'website',
                title: 'Website',
                formatter: function(value, row, index, field) {
                    if (value) {
                        return renderLink(value, value);
                    }
                    return '';
                }
            }
        ],
        url: "{% url 'api-company-list' %}"
    });

{% endblock %}
Fix modal form for creating company
Fix modal form for creating company
