<div ng-controller="Cases.ActionsController">
    <div class="pull-right">
        <div class="btn-group">
            <fieldset permission="editRequestData" permission-object-type="CASE_FILE" permission-properties="objectInfo"
                      permission-action="disabled">
                <button class="btn btn-sm btn-default" ng-click="save(objectInfo)" ng-disabled="clientInfo.$invalid"
                        permission="buttonAction" permission-object-type="CASE_FILE" permission-properties="objectInfo"
                        permission-action="hide">
                    <i class="{{loadingRequestIcon}}"></i>
                </button>
                <button class="btn btn-sm btn-default" ng-click="refresh()">
                    <i class="fa fa-refresh"></i>
                </button>
                <button class="btn btn-sm btn-default" ng-click="onClickChildOutcome(outcome.name)"
                        ng-repeat="outcome in availableChildOutcomes" ng-show="showBtnChildOutcomes">
                    {{outcome.description}}
                </button>
                <button class="btn btn-sm btn-default" ng-show="showBtnUnsubscribe" ng-click="unsubscribe(objectInfo)"
                        permission="buttonAction" permission-object-type="CASE_FILE" permission-properties="objectInfo"
                        permission-action="hide">
                    <i class="fa fa-bullhorn"></i> <span translate>cases.comp.actions.unsubscribe.button</span>
                </button>
                <button class="btn btn-sm btn-default" ng-show="showBtnSubscribe" ng-click="subscribe(objectInfo)" permission="buttonAction"
                        permission-object-type="CASE_FILE" permission-properties="objectInfo" permission-action="hide">
                    <i class="fa fa-bullhorn"></i> <span translate>cases.comp.actions.subscribe.button</span>
                </button>
                <button class="btn btn-sm btn-default" ng-if="objectInfo.requestType == 'New Request'" ng-click="split()">
                    <i ng-class="splitting ? 'fa fa-circle-o-notch fa-spin' : 'fa fa-code-fork'" />
                    <span translate>cases.comp.actions.split.button</span>
                </button>

                <button class="btn btn-sm btn-default" ng-if="assignee.length == 0 && currentUserProfile.groups.indexOf(owningGroup) > -1"
                        ng-click="claim(objectInfo)" permission="buttonAction" permission-object-type="CASE_FILE"
                        permission-properties="objectInfo" permission-action="hide">
                    <i class="fa fa-edit"></i>
                    <span translate>cases.comp.actions.claim.button</span>
                </button>
                <button class="btn btn-sm btn-default" ng-if="assignee.length > 0 && currentUserProfile.userId == assignee"
                        ng-click="unclaim(objectInfo)" permission="buttonAction" permission-object-type="CASE_FILE"
                        permission-properties="objectInfo" permission-action="hide">
                    <i class="fa fa-edit"></i>
                    <span translate>cases.comp.actions.unclaim.button</span>
                </button>
                <button class="btn btn-sm btn-default" ng-click="sendEmail()">
                    <i class="fa fa-envelope"></i>
                    <span translate>cases.comp.actions.sendEmail.button</span>
                </button>

                <button class="btn btn-sm btn-default" ng-if="documentReviewEnabled && !objectInfo.externalIdentifier"
                        ng-click="createMatter(objectInfo)" ng-disabled="createMatterInProgress" permission="buttonAction" permission-object-type="CASE_FILE"
                        permission-properties="objectInfo" permission-action="hide">
                    <i class="{{creatingMatterIcon}}"></i>
                    <span translate>cases.comp.actions.createMatter.button</span>
                </button>

                <button class="btn btn-sm btn-default" ng-if="documentReviewEnabled && objectInfo.externalIdentifier"
                        ng-click="openMatter(objectInfo.externalIdentifier)" permission="buttonAction" permission-object-type="CASE_FILE"
                        permission-properties="objectInfo" permission-action="hide">
                    <i class="fa fa-gavel"></i>
                    <span translate>cases.comp.actions.openMatter.button</span>
                </button>

                <button class="btn btn-sm btn-default" ng-if="documentReviewEnabled && objectInfo.externalIdentifier"
                        ng-click="openMatterReports(objectInfo)" permission="buttonAction" permission-object-type="CASE_FILE"
                        permission-properties="objectInfo" permission-action="hide">
                    <i class="fa fa-bar-chart"></i>
                    <span translate>cases.comp.actions.matterReports.button</span>
                </button>

            </fieldset>
        </div>
    </div>
</div>
