<div class="modal-header">
  <button type="button" class="close" ng-click="closeDialog()" aria-hidden="true">&times;</button>
  <h4 class="modal-title" ng-bind="translate('ADF_WIDGET_ADD_HEADER')">Add new widget</h4>
</div>
<div class="modal-body">
  <div ng-if="!isEmpty(widgets) || !isEmpty(smartReports)">
	  <!-- dashboard categories enabled -->
	  <div ng-if="createSmartCategories">
	    <uib-accordion ng-init="categorized = createSmartCategories(widgets, smartReports)">
	      <uib-accordion-group heading="{{category.name}}" ng-repeat="category in categorized | adfOrderByObjectKey: 'name'">
	      	<div class="row">
		      	<div class="col-md-6 widget-item clearfix" ng-repeat="widget in category.widgets | adfOrderByObjectKey: 'key'">
		      		<img src="{{widget.image}}" />
		      		<h4><a href="" ng-click="(widget.idSmartReport == undefined ? addWidget(widget.key) : addWidgetSmartReport(widget))">{{widget.title}}</a></h4>
		      		<p ng-click="(widget.idSmartReport == undefined ? addWidget(widget.key) : addWidgetSmartReport(widget))">{{widget.description}}</p>
		      	</div>
	      	</div>
	      </uib-accordion-group>
	    </uib-accordion>
	  </div>
	  
	  <!-- dashboard categories disabled -->
	  <div style="display: inline-block;" ng-if="!createSmartCategories">
	    <dl class="dl-horizontal">
	      <dt ng-repeat-start="widget in widgets | adfOrderByObjectKey: 'key'">
	        <a href="" ng-click="addWidget(widget.key)">
	          {{widget.title}}
	        </a>
	      </dt>
	      <dd ng-repeat-end ng-if="widget.description">
	        {{widget.description}}
	      </dd>
	    </dl>
	  </div>
  </div>
  <div ng-if="isEmpty(widgets) && isEmpty(smartReports)" class="text-center" ng-bind="translate('ADF_WIDGET_EMPTY')">No widget was found.</div>
</div>
<div class="modal-footer">
  <button type="button" class="btn btn-citsmart" ng-click="closeDialog()" ng-bind="translate('ADF_COMMON_CLOSE')">Close</button>
</div>
