<div class="modal" tabindex="-1" role="dialog" aria-hidden="true">
    <form class="form-sport" name="form.leagueForm" ng-submit="submit()" novalidate>
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h3 class="modal-title">Edit League</h3>
                </div>
                <div class="modal-body form">
                    <div class="form-group" ng-class="{ 'has-error': form.leagueForm.name.$dirty && form.leagueForm.name.$invalid }">
                        <label class="control-label" for="name">Name</label>
                        <div class="">
                            <input id="name" name="name" ng-model="fields.name" ng-change="slugify()" type="text" class="form-control" required>
                        </div>
                    </div>
                    <div class="form-group" ng-class="{ 'has-error': form.leagueForm.shortName.$dirty && form.leagueForm.shortName.$invalid }">
                        <label class="control-label" for="shortName">Short Name</label>
                        <div class="">
                            <input id="name" name="shortName" ng-model="fields.shortName" ng-change="slugify()" type="text" class="form-control" required>
                        </div>
                    </div>
                    <!-- Text input-->
                    <div class="form-group" ng-class="{ 'has-error': form.leagueForm.slug.$dirty && form.leagueForm.slug.$invalid }">
                        <label class="control-label" for="slug">Slug</label>
                        <div class="">
                            <input id="slug" name="slug" ng-model="fields.slug" type="text" class="form-control" required fsa-slugify>
                        </div>
                    </div>
                    <div class="form-group" ng-class="{ 'has-error': form.leagueForm.name.$dirty && form.leagueForm.name.$invalid }">
                        <label class="control-label" for="name">Sport</label>
                        <div class="">
                            <ui-select ng-model="fields.sport" theme="selectize" ng-required="true">
                                <ui-select-match placeholder="Please select...">{{$select.selected.name}}</ui-select-match>
                                <ui-select-choices repeat="sport in sports.items | filter: $select.search track by sport.id">
                                    <span ng-bind-html="sport.name | highlight: $select.search"></span>
                                </ui-select-choices>
                            </ui-select>
                        </div>
                    </div>
                    <!-- Text input-->
                    <div class="form-group">
                        <label class="control-label" for="description">Description</label>
                        <div class="">
                            <textarea id="description" name="description" ng-model="fields.description" class="form-control" rows="10"></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button id="submit" name="submit" class="btn btn-labeled btn-primary" ng-disabled="form.leagueForm.$invalid || isSubmitted"><span class="btn-label"><i class="fa fa-upload"></i></span> Submit</button>
                    <button class="btn btn-default btn-labeled" type="button" ng-click="modalEditActions.hide()"><span class="btn-label"><i class="fa fa-times"></i></span> Cancel</button>
                </div>
            </div>
        </div>
    </form>
</div>