From d2f8f932f60590410f51f63061539ef58ff16809 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 6 Feb 2014 13:35:11 +0600 Subject: [PATCH] New Issues Page: resource viewer refactoring --- .../templates/_issue_detail_inner.hbs.erb | 144 +++++++----------- .../navigator/handlebars-extensions.js | 18 +++ .../webapp/javascripts/navigator/issues.js | 1 + .../src/main/webapp/stylesheets/icons.css | 10 ++ .../src/main/webapp/stylesheets/icons.less | 10 ++ .../src/main/webapp/stylesheets/navigator.css | 3 +- .../webapp/stylesheets/navigator/base.css | 3 +- .../webapp/stylesheets/navigator/base.less | 3 +- .../src/main/webapp/stylesheets/style.css | 81 ++++++++-- .../main/webapp/stylesheets/variables.less | 1 + 10 files changed, 170 insertions(+), 104 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/templates/_issue_detail_inner.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/templates/_issue_detail_inner.hbs.erb index abe586e4526..76a50f4bea2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/templates/_issue_detail_inner.hbs.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/templates/_issue_detail_inner.hbs.erb @@ -1,22 +1,29 @@ diff --git a/sonar-server/src/main/webapp/javascripts/navigator/handlebars-extensions.js b/sonar-server/src/main/webapp/javascripts/navigator/handlebars-extensions.js index c66b76a3c07..032346929c0 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/handlebars-extensions.js +++ b/sonar-server/src/main/webapp/javascripts/navigator/handlebars-extensions.js @@ -32,6 +32,24 @@ return v1 != v2 ? options.fn(this) : options.inverse(this); }); + Handlebars.registerHelper('all', function() { + var args = Array.prototype.slice.call(arguments, 0, -1), + options = arguments[arguments.length - 1], + all = args.reduce(function(prev, current) { + return prev && current; + }, true); + return all ? options.fn(this) : options.inverse(this); + }); + + Handlebars.registerHelper('any', function() { + var args = Array.prototype.slice.call(arguments, 0, -1), + options = arguments[arguments.length - 1], + all = args.reduce(function(prev, current) { + return prev || current; + }, true); + return all ? options.fn(this) : options.inverse(this); + }); + Handlebars.registerHelper('inArray', function(array, element, options) { if (array.indexOf(element) !== -1) { return options.fn(this); diff --git a/sonar-server/src/main/webapp/javascripts/navigator/issues.js b/sonar-server/src/main/webapp/javascripts/navigator/issues.js index a00409cd8e7..4b73bcd7a24 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/issues.js +++ b/sonar-server/src/main/webapp/javascripts/navigator/issues.js @@ -822,6 +822,7 @@ jQuery(function() { toggleCollapsed: function() { this.$('.code-issue').toggleClass('code-issue-collapsed'); + this.fetchRule(); }, diff --git a/sonar-server/src/main/webapp/stylesheets/icons.css b/sonar-server/src/main/webapp/stylesheets/icons.css index f61b55a3c87..a8bd57d5e4b 100644 --- a/sonar-server/src/main/webapp/stylesheets/icons.css +++ b/sonar-server/src/main/webapp/stylesheets/icons.css @@ -39,26 +39,31 @@ content: "\f000"; color: #d4333f; font-size: 14px; + line-height: 12px; } .icon-severity-critical:before { content: "\f001"; color: #d4333f; font-size: 14px; + line-height: 12px; } .icon-severity-major:before { content: "\f002"; color: #d4333f; font-size: 14px; + line-height: 12px; } .icon-severity-minor:before { content: "\f003"; color: #85bb43; font-size: 14px; + line-height: 12px; } .icon-severity-info:before { content: "\f004"; color: #85bb43; font-size: 14px; + line-height: 12px; } /* * Status @@ -67,26 +72,31 @@ content: "\f010"; color: #85bb43; font-size: 14px; + line-height: 12px; } .icon-status-confirmed:before { content: "\f011"; color: #d4333f; font-size: 14px; + line-height: 12px; } .icon-status-reopened:before { content: "\f012"; color: #85bb43; font-size: 14px; + line-height: 12px; } .icon-status-resolved:before { content: "\f013"; color: #4b9fd5; font-size: 14px; + line-height: 12px; } .icon-status-closed:before { content: "\f014"; color: #444444; font-size: 14px; + line-height: 12px; } /* * Resolution diff --git a/sonar-server/src/main/webapp/stylesheets/icons.less b/sonar-server/src/main/webapp/stylesheets/icons.less index df62d1603b9..e76ccec86ef 100644 --- a/sonar-server/src/main/webapp/stylesheets/icons.less +++ b/sonar-server/src/main/webapp/stylesheets/icons.less @@ -35,26 +35,31 @@ content: "\f000"; color: @severityBlockerColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } .icon-severity-critical:before { content: "\f001"; color: @severityCriticalColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } .icon-severity-major:before { content: "\f002"; color: @severityMajorColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } .icon-severity-minor:before { content: "\f003"; color: @severityMinorColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } .icon-severity-info:before { content: "\f004"; color: @severityInfoColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } @@ -66,26 +71,31 @@ content: "\f010"; color: @statusOpenColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } .icon-status-confirmed:before { content: "\f011"; color: @statusConfirmedColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } .icon-status-reopened:before { content: "\f012"; color: @statusReopenedColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } .icon-status-resolved:before { content: "\f013"; color: @statusResolvedColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } .icon-status-closed:before { content: "\f014"; color: @statusClosedColor; font-size: @iconFontSize; + line-height: @iconLineHeight; } diff --git a/sonar-server/src/main/webapp/stylesheets/navigator.css b/sonar-server/src/main/webapp/stylesheets/navigator.css index d59efd8d7fd..bfeba2c35e9 100644 --- a/sonar-server/src/main/webapp/stylesheets/navigator.css +++ b/sonar-server/src/main/webapp/stylesheets/navigator.css @@ -108,7 +108,7 @@ } .navigator-fetching.code-issue-actions:before, .navigator-fetching#tab-issue-rule:before { - background-color: #EFEFEF; + background-color: #CAE3F2; } .navigator-header { padding: 0 10px; @@ -245,6 +245,7 @@ } .navigator-details .source_title { position: fixed; + z-index: 3; top: 104px; left: 320px; right: 0; diff --git a/sonar-server/src/main/webapp/stylesheets/navigator/base.css b/sonar-server/src/main/webapp/stylesheets/navigator/base.css index 9ea3bea4aa5..a1a994a0ac5 100644 --- a/sonar-server/src/main/webapp/stylesheets/navigator/base.css +++ b/sonar-server/src/main/webapp/stylesheets/navigator/base.css @@ -108,7 +108,7 @@ } .navigator-fetching.code-issue-actions:before, .navigator-fetching#tab-issue-rule:before { - background-color: #EFEFEF; + background-color: #CAE3F2; } .navigator-header { padding: 0 10px; @@ -245,6 +245,7 @@ } .navigator-details .source_title { position: fixed; + z-index: 3; top: 104px; left: 320px; right: 0; diff --git a/sonar-server/src/main/webapp/stylesheets/navigator/base.less b/sonar-server/src/main/webapp/stylesheets/navigator/base.less index 9d4e9a3ce88..6ce05b3dfa0 100644 --- a/sonar-server/src/main/webapp/stylesheets/navigator/base.less +++ b/sonar-server/src/main/webapp/stylesheets/navigator/base.less @@ -108,7 +108,7 @@ position: relative; &:before { - background-color: #EFEFEF; + background-color: #CAE3F2; } } } @@ -292,6 +292,7 @@ .source_title { position: fixed; + z-index: 3; top: @navigatorTopOffset + @navigatorHeaderHeight + @navigatorFiltersHeight; left: @navigatorResultsWidth; right: 0; diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index 4b82297f612..2201b027d29 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -802,22 +802,13 @@ th.operations, td.operations { font-weight: bold; } -.code-issue-permalink { - float: right; - padding: 4px 4px 0 0; -} - -.code-issue-name-extra { - float: right; - padding-right: 10px; -} - .code-issue-toggle { cursor: pointer; text-decoration: underline; } .code-issue-name { + position: relative; background-color: #E4ECF3; margin: 0; padding: 5px 10px; @@ -838,6 +829,32 @@ th.operations, td.operations { vertical-align: text-bottom; } +.code-issue-name-rule { + max-width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.code-issue-permalink { + position: absolute; + top: 4px; right: 4px; +} + +.code-issue-name-extra { + margin-top: 6px; + line-height: 12px; +} + +.code-issue-name-extra li { + font-size: 11px !important; +} + +.code-issue-name-right { + position: absolute; + top: 5px; right: 26px; +} + .code-issue-comment, .code-issue-msg, .code-issue-actions, .code-issue-form, .issue-rule, .issue-changelog, .issue-technicaldebt { background-color: #EFEFEF; border: 1px solid #DDD; @@ -925,11 +942,55 @@ th.operations, td.operations { content: ":"; } +.code-issue-list { + font-size: 0; +} + +.code-issue-list > li { + display: inline-block; + vertical-align: middle; + height: 14px; + line-height: 14px; + padding: 0 8px; + border-left: 1px solid #fff; + border-right: 1px solid #bfbfbf; + font-size: 12px; +} + +.code-issue-list > li:first-child { + padding-left: 0; + border-left: none; +} + +.code-issue-list > li:last-child { + padding-right: 0; + border-right: none; +} + .code-issue-collapsed .code-issue-msg, .code-issue-collapsed .code-issue-details { display: none; } +.code-issue-active .code-issue-name, +.code-issue-active .code-issue-details, +.code-issue-active .code-issue-actions, +.code-issue-active .code-issue-form, +.code-issue-active .code-issue-comments, +.code-issue-active .code-issue-comment { + background-color: #CAE3F2; + border-color: #4B9FD5; +} + +.code-issue-active .code-issue-name, +.code-issue-active .code-issue-details { + border-bottom: none; +} + +.code-issue-active .code-issue-details .tabs { + border-color: #4B9FD5; +} + .tab_header { border-bottom: 1px solid #DDD; background-color: #EFEFEF; diff --git a/sonar-server/src/main/webapp/stylesheets/variables.less b/sonar-server/src/main/webapp/stylesheets/variables.less index 51d6da6a405..23f27fe2c2e 100644 --- a/sonar-server/src/main/webapp/stylesheets/variables.less +++ b/sonar-server/src/main/webapp/stylesheets/variables.less @@ -31,6 +31,7 @@ */ @iconFontSize: 14px; +@iconLineHeight: 12px; @severityBlockerColor: @red; @severityCriticalColor: @red; -- 2.39.5