Merge branch 'master' into redesign

This commit is contained in:
Rohan Mitchell
2015-06-16 16:57:09 +10:00
19 changed files with 145 additions and 143 deletions

View File

@@ -1,14 +1,11 @@
angular.module("admin.enterprises").controller "EnterpriseIndexRowCtrl", ($scope) ->
$scope.statusText = ->
issueCount = (issue for issue in $scope.enterprise.issues when !issue.resolved).length
if issueCount > 0
$scope.statusClass = "issue"
$scope.status = ->
if $scope.enterprise.issues.length > 0
"issue"
else if $scope.enterprise.warnings.length > 0
"warning"
else
warningCount = (warning for warning in $scope.enterprise.warnings when !warning.resolved).length
if warningCount > 0
$scope.statusClass = "warning"
else
$scope.statusClass = "ok"
"ok"
$scope.producerText = ->
@@ -42,7 +39,6 @@ angular.module("admin.enterprises").controller "EnterpriseIndexRowCtrl", ($scope
$scope.updateRowText = ->
$scope.producer = $scope.producerText()
$scope.package = $scope.packageText()
$scope.status = $scope.statusText()
$scope.producerError = ($scope.producer == "Choose")
$scope.packageError = ($scope.package == "Choose")

View File

@@ -1,3 +1,3 @@
angular.module("admin.enterprises").controller 'indexStatusPanelCtrl', ($scope, $filter) ->
$scope.issues = $filter('filter')($scope.object.issues, {resolved: false })
$scope.warnings = $filter('filter')($scope.object.warnings, {resolved: false})
$scope.issues = $scope.object.issues
$scope.warnings = $scope.object.warnings

View File

@@ -1,7 +1,7 @@
angular.module("admin.indexUtils").directive "panelToggle", ->
restrict: "C"
transclude: true
template: '<div ng-transclude></div><i class=\'icon-chevron-down\'"></i>'
template: '<div ng-transclude></div><i class=\'icon-chevron\'></i>'
require: "^panelToggleRow"
scope:
name: "@"

View File

@@ -22,17 +22,11 @@ Darkswarm.directive "filterSelector", (FilterSelectorsService)->
.map (selector)->
selector.object.id
# This can be called from a parent scope
# when data has been loaded, in order to pass
# selectors up
scope.$on 'loadFilterSelectors', ->
scope.allSelectors = scope.selectors() if attr.allSelectors?
scope.$watchCollection "selectors()", (newValue, oldValue) ->
scope.allSelectors = scope.selectors() if attr.allSelectors?
scope.$watchCollection "objects()", (newValue, oldValue) ->
scope.allSelectors = scope.buildSelectors()
# Build a list of selectors
scope.selectors = ->
scope.buildSelectors = ->
# Generate a selector for each object.
# NOTE: THESE ARE MEMOIZED to stop new selectors from being created constantly, otherwise function always returns non-identical results
# This means the $digest cycle can never close and times out

View File

@@ -1,5 +1,5 @@
.row.enterprise_status_panel{ ng: { controller: 'indexStatusPanelCtrl' } }
.alpha.sixteen.columns
.alpha.omega.sixteen.columns
%h4.status-ok.text-center{ ng: { show: "issues.length == 0 && warnings.length == 0" } }
%i.icon-ok-sign
@@ -21,7 +21,7 @@
%td.resolve
%div{ ng: { bind: { html: "issue.link" } } }
%tr{ ng: { repeat: "warning in warnings"} }
%td.severity.text-center
%td.severity
%i.icon-warning-sign.warning
%td.description
%span{ bo: { bind: "warning.description" } }

View File

@@ -1,4 +1,4 @@
%div{bindonce:true, style: "display: inline-block" }
%ul{ bindonce: true }
%active-selector{ ng: { repeat: "selector in allSelectors", show: "ifDefined(selector.fits, true)" } }
%render-svg{path: "{{selector.object.icon}}", ng: { if: "selector.object.icon"} }
%span{"bo-text" => "selector.object.name"}

View File

@@ -9,12 +9,10 @@
%br
.filter-shopfront.taxon-selectors.inline-block
%ul
%filter-selector{ objects: "[product] | taxonsOf" }
%filter-selector{ objects: "[product] | taxonsOf" }
.filter-shopfront.property-selectors.inline-block
%ul
%filter-selector{ objects: "[product] | propertiesWithValuesOf" }
%filter-selector{ objects: "[product] | propertiesWithValuesOf" }
%div{"ng-if" => "product.description"}
%hr

View File

@@ -1,8 +1,8 @@
%ul
-# In order for the single-line-selector scope to have access to the available selectors,
%filter-selector{objects: "objects()", "active-selectors" => "activeSelectors", "all-selectors" => "allSelectors" }
-# In order for the single-line-selector scope to have access to the available selectors,
%filter-selector{objects: "objects()", "active-selectors" => "activeSelectors", "all-selectors" => "allSelectors" }
%li.more{ ng: { show: "overFlowSelectors().length > 0 || fitting" } }
%ul{ ng: { if: "overFlowSelectors().length > 0 || fitting" } }
%li.more
%a.dropdown{ data: { dropdown: "{{ 'show-more-' + selectorName }}" }, ng: { class: "{active: selectedOverFlowSelectors().length > 0}" } }
%span
+ {{ overFlowSelectors().length }} more