From 272f5bf0999168e66f57c0a90a4de5fefebaa9bf Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 5 Nov 2014 10:12:51 +0100 Subject: [PATCH] SONAR-5718 Align files on right in the facet --- .../issues/facets/component-facet.coffee | 12 ++++++++++ .../issues/facets/issues-component-facet.hbs | 10 ++++++++ server/sonar-web/src/main/less/issues.less | 24 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 server/sonar-web/src/main/hbs/issues/facets/issues-component-facet.hbs diff --git a/server/sonar-web/src/main/coffee/issues/facets/component-facet.coffee b/server/sonar-web/src/main/coffee/issues/facets/component-facet.coffee index 752f4ee286a..0a993c73454 100644 --- a/server/sonar-web/src/main/coffee/issues/facets/component-facet.coffee +++ b/server/sonar-web/src/main/coffee/issues/facets/component-facet.coffee @@ -1,11 +1,23 @@ define [ 'issues/facets/base-facet' + 'templates/issues' ], ( BaseFacet + Templates ) -> + $ = jQuery + class extends BaseFacet + template: Templates['issues-component-facet'] + + + onRender: -> + super + maxValueWidth = _.max @$('.facet-stat').map(-> $(@).outerWidth()).get() + @$('.facet-name').css 'padding-right', maxValueWidth + getValuesWithLabels: -> values = @model.getValues() diff --git a/server/sonar-web/src/main/hbs/issues/facets/issues-component-facet.hbs b/server/sonar-web/src/main/hbs/issues/facets/issues-component-facet.hbs new file mode 100644 index 00000000000..ec0d1bd7a6b --- /dev/null +++ b/server/sonar-web/src/main/hbs/issues/facets/issues-component-facet.hbs @@ -0,0 +1,10 @@ +{{> '_issues-facet-header'}} + +
+ {{#each values}} + + {{default label val}} + {{count}} + + {{/each}} +
diff --git a/server/sonar-web/src/main/less/issues.less b/server/sonar-web/src/main/less/issues.less index 53e5a8078f7..357b939a177 100644 --- a/server/sonar-web/src/main/less/issues.less +++ b/server/sonar-web/src/main/less/issues.less @@ -123,6 +123,30 @@ font-size: 0; } +.issues-facet-list-align-right { + + .facet-name { + float: right; + + &:before { + content: " "; + position: absolute; + top: 0; bottom: 0; left: 0; + width: 10px; + background-image: linear-gradient(to left, fade(@barBackgroundColor, 0%), @barBackgroundColor 75%); + } + } + + .facet-stat:before { + display: none; + } + + .facet.active .facet-name:before { + background-image: linear-gradient(to left, fade(@lightBlue, 0%), @lightBlue 75%); + } + +} + .issues-facet-container { margin-top: 6px; padding: 0 10px 16px; -- 2.39.5