<div ng-controller="Preference.WidgetsListController">
    <form name="defaultViewToggle" ng-show="showDefaultForm">
        <h4 translate>preference.widgets.list.defaultView</h4>
        <label><input type="radio" ng-model="defaultViewExpand" value="false" ng-change="toggleDefaultView()" />&nbsp;<span translate>preference.widgets.list.expanded</span></label>
        <label><input type="radio" ng-model="defaultViewExpand" value="true" ng-change="toggleDefaultView()" />&nbsp;<span translate>preference.widgets.list.collapsed</span></label>
    </form>

    <div class="panel panel-default" ng-repeat="widget in widgets">
        <div class="panel-heading">
            <h4 class="panel-title">
                <a data-toggle="collapse" data-parent="#accordion" href="#{{widget.id}}" close-others="false"
                        ng-click="toggleWidget($event, widget)">
                    <span translate>{{widget.title}}</span>
                </a>
                <div class="pull-right">
                    <span translate ng-if="!widget.enabled" class="label label-warning" ng-click="enableWidget($event, widget, true)"> preference.widgets.list.disabled</span>
                    <span translate ng-if="widget.enabled" class="label label-success" ng-click="enableWidget($event, widget, false)">preference.widgets.list.enabled</span>
                </div>
            </h4>
        </div>
        <div id="{{widget.id}}" class="panel-collapse collapse in" collapse="widget.isCollapsed">
            <div class="panel-body">
                <span translate>{{widget.description}}</span>
            </div>
        </div>
    </div>
</div>