cmsmon
Version:
61 lines (57 loc) • 2.61 kB
HTML
<div class="clearfix"></div>
<div ng-if="!to.noPanel"
ng-show="!(model[options.key].null && to.null)"
class="cms-panel" ng-init="state = {_show :true}"
style="position: relative;">
<button type="button" class="btn btn-xs btn-white" ng-if="to.null"
style="position: relative;right: 0px;margin-top: 15px;z-index: 1;"
ng-click="model[options.key].null = true;">
<i class="fa fa-trash-o"></i>
</button>
<fieldset style="padding: 0 10px 10px 10px;position: relative;top:0px;
border: 1px solid #eee;border-radius:4px;background-color: rgba(128, 128, 128, 0.03)">
<legend style="color: #337ab7;font-weight: 200;border: 0;margin-left: 10px;width: initial;padding: 0 5px;"
ng-if="to.label"
ng-style="{color:to.choice?'#8338b7':'#337ab7'}">
<span ng-show="to.choice"
uib-dropdown on-toggle="toggled(open)">
<span uib-dropdown-toggle
uib-tooltip='{{to.tooltip}}'
style="cursor: pointer">
{{options.templateOptions.label}}</span>
<ul uib-dropdown-menu aria-labelledby="simple-dropdown">
<li ng-repeat="v in options.fieldGroup track by $index"
ng-show="v.key !== 'choice'">
<a ng-click="options.key && options.key !== ''? (model[options.key].choice = v.key): (model.choice = v.key);">
{{v.key}}</a>
</li>
</ul>
</span>
<span ng-if="!to.choice"
uib-tooltip='{{to.tooltip}}'>
{{options.templateOptions.label}}
</span>
<button type="button" ng-click="state._show = !state._show"
class="btn btn-white btn-xs"
style="border: none;background-color: transparent;"
ng-bind="state._show? '-': '+'">
</button>
</legend>
<div ng-show="state._show">
<formly-transclude></formly-transclude>
</div>
</fieldset>
<br>
</div>
<div ng-if="to.noPanel">
<formly-transclude></formly-transclude>
</div>
<div ng-show="(model[options.key].null && to.null)">
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="button" class="btn btn-white btn-xs"
ng-click="model[options.key].null = false;" style="z-index: 1;"> add {{to.label}}
</button>
</div>
</div>
</div>