Commit b1f92f72 authored by colemanw's avatar colemanw

CRM-13823 - Show count in Angular tabs

parent 28bd6c8d
......@@ -12,6 +12,7 @@
ng-repeat="tab in [{is_visible: 1, name: 'visible'}, {is_visible: 0, name: 'hidden'}]"
crm-ui-tab
id="tab-{{tab.name}}"
count="{{_.where(statuses, {is_visible: tab.is_visible}).length}}"
crm-title="tab.is_visible ? ts('Active') : ts('Hushed/Snoozed')"
>
<div id="crm-status-list" ng-repeat="status in statuses | filter:{is_visible: tab.is_visible}" >
......
......@@ -6,6 +6,7 @@
var ts = $scope.ts = CRM.ts();
$scope.alert = CRM.alert;
$scope.statuses = statusData.values;
$scope._ = _;
_.each($scope.statuses, function(status) {
status.severity_id = status.severity;
......
......@@ -653,7 +653,7 @@
};
})
// example <div crm-ui-tab crm-title="ts('My Title')">...content...</div>
// example <div crm-ui-tab id="tab-1" crm-title="ts('My Title')" count="3">...content...</div>
// WISHLIST: use a full Angular component instead of an incomplete jQuery wrapper
.directive('crmUiTab', function($parse) {
return {
......@@ -661,6 +661,7 @@
restrict: 'EA',
scope: {
crmTitle: '@',
count: '@',
id: '@'
},
template: '<div ng-transclude></div>',
......
<div ui-jq="tabs" class="crm-tabset">
<ul>
<li ng-repeat="tab in tabs" class="ui-corner-all">
<a href="#{{tab.id}}">{{tab.$parent.$eval(tab.crmTitle)}}</a>
<li ng-repeat="tab in tabs" class="ui-corner-all crm-tab-button crm-count-{{tab.count}}">
<a href="#{{tab.id}}">
{{tab.$parent.$eval(tab.crmTitle)}}
<em ng-if="tab.count">{{tab.count}}</em>
</a>
</li>
</ul>
<div ng-transclude/>
......
......@@ -1594,7 +1594,7 @@ input.crm-form-entityref {
font-size: 0.9em;
}
#mainTabContainer li.crm-tab-button {
.crm-container li.crm-tab-button {
margin: 0 2px 2px 0;
}
......@@ -2820,14 +2820,12 @@ tbody.scrollContent tr.alternateRow {
.crm-container .disabled,
.crm-container .cancelled,
#mainTabContainer li.disabled a.ui-tabs-anchor,
#mainTabContainer li.crm-count-0 a.ui-tabs-anchor,
#mainTabContainer li.crm-count-0 a.ui-tabs-anchor em {
.crm-container li.disabled a.ui-tabs-anchor,
.crm-container li.crm-count-0 a.ui-tabs-anchor,
.crm-container li.crm-count-0 a.ui-tabs-anchor em {
color: #999999 !important;
}
#mainTabContainer li.disabled {
text-decoration: none;
}
#crm-container tr.crm-job {
text-decoration: none !important;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment