<div class="clearfix formField">
    <div class="input-group input-group-sm">
        <div ng-if="rel.type == 'REL_NM'">
            <div ng-if="rel.composite" ng-show="nmdata.valid">
                <div ng-if="nmdata.root">
                    <button class="btn {{relstyle}}" type="button" ng-disabled="fieldData.disabled" title="{{fieldData.title}}" ng-click="openRelatedNMDataModal()">
                        <span class="badge">{{nmdata.relatedfeatures.length}}</span>
                        {{rellabel}}
                    </button>
                </div>
            </div>
            <div ng-if="!rel.composite" ng-show="nmdata.valid">
                <div ng-if="nmdata.root">
                    <button class="btn {{relstyle}}" type="button" ng-disabled="fieldData.disabled" title="{{fieldData.title}}" ng-click="openRelatedNMDataModal()">
                        <span class="badge">{{nmdata.relatedfeatures.length}}</span>
                        {{rellabel}}
                    </button>
                </div>
                <div ng-if="!nmdata.root">
                    <button class="btn {{relstyle}}" type="button" ng-disabled="fieldData.disabled" title="{{fieldData.title}}" data-animation="am-flip-x" data-toggle="dropdown" data-template="reldropdownbody" bs-dropdown aria-haspopup="true" aria-expanded="false">{{rellabel}}</button>
                    <script type="text/ng-template" id="reldropdownbody">
                        <ul class="dropdown-menu" role="menu">
							<li><a ng-click="launch1ToNOpenForm()" ng-show="nmdata.relatedfeature"><i class="fa fa-list-alt"></i>&nbsp;&nbsp;{{'tools.builder.fields.relations.form.nmopenform' | translate}}</a></li>
							<li><a ng-click="launch1ToNResetAction()" ng-show="editmode"><i class="fa fa-chain-broken"></i>&nbsp;&nbsp;{{'tools.builder.fields.relations.form.nmresetform' | translate}}</a></li>
							<li class="divider"/>
							<li><a ng-click="launch1ToNFromListAssociateForm()" ng-show="editmode && selectList && selectList.totalFeatures && selectList.totalFeatures > 1"><i class="fa fa-paste"></i>&nbsp;&nbsp;{{'tools.builder.fields.relations.form.nmassociatefromlistform' | translate}}</a></li>
							<li><a ng-click="launch1ToNAssociateForm()" ng-show="editmode"><i class="fa fa-paste"></i>&nbsp;&nbsp;{{'tools.builder.fields.relations.form.nmassociateform' | translate}}</a></li>
							<li><a ng-click="launch1ToNAssociateToNewForm()" ng-show="editmode"><i class="fa fa-edit"></i>&nbsp;&nbsp;{{'tools.builder.fields.relations.form.nmassociatenewform' | translate}}</a></li>
						</ul>
					</script>
                </div>
            </div>
        </div>
        <div ng-if="rel.type == 'REL_SIMPLE' && rel.occurence == '1-1'">
           <div ng-if="nmdata.root">
                <button class="btn {{relstyle}}" type="button" ng-disabled="fieldData.disabled" title="{{fieldData.title}}" data-animation="am-flip-x" data-toggle="dropdown" data-template="relsimpledropdownbody" bs-dropdown aria-haspopup="true" aria-expanded="false">{{rellabel}}</button>
                <script type="text/ng-template" id="relsimpledropdownbody">
                    <ul class="dropdown-menu" role="menu">
							<li><a ng-click="launch1To1OpenForm()" ng-show="nmdata.relatedfeature"><i class="fa fa-list-alt"></i>&nbsp;&nbsp;{{'tools.builder.fields.relations.form.noneopenform' | translate}}</a></li>
							<li><a ng-click="launch1To1ResetAction()" ng-show="editmode"><i class="fa fa-chain-broken"></i>&nbsp;&nbsp;{{'tools.builder.fields.relations.form.noneresetform' | translate}}</a></li>
							<li class="divider"/>
							<li><a ng-click="launch1To1AssociateForm()" ng-show="editmode"><i class="fa fa-paste"></i>&nbsp;&nbsp;{{'tools.builder.fields.relations.form.nmoneassociateform' | translate}}</a></li>
						</ul>
					</script>
            </div>
            <div ng-if="!nmdata.root && nmdata.relatedfeature != null">
                <button class="btn {{relstyle}}" type="button" ng-disabled="fieldData.disabled" title="{{fieldData.title}}" ng-click="launch1To1ParentOpenForm()">
                    {{rellabel}}
                </button>
            </div>
        </div>
    </div>
</div>
</div>