<header class="page-header">
<h1 class="page-title">{{t 'quality_profiles.page'}}</h1>
- <div class="page-actions">
- {{#if canWrite}}
+ {{#if canWrite}}
+ <div class="page-actions">
<div class="button-group dropdown">
<button id="quality-profiles-create">{{t 'create'}}</button>
<a class="button dropdown-toggle" href="#" data-toggle="dropdown"><i class="icon-dropdown"></i></a>
<ul class="dropdown-menu dropdown-menu-right">
- <li>
- <a id="quality-profiles-compare" href="#">{{t 'quality_profiles.compare_profiles'}}</a>
- </li>
<li>
<a id="quality-profiles-restore" href="#">{{t 'quality_profiles.restore_profile'}}</a>
</li>
</li>
</ul>
</div>
- {{else}}
- <div class="button-group">
- <button id="quality-profiles-compare">{{t 'quality_profiles.compare_profiles'}}</button>
- </div>
- {{/if}}
- </div>
+ </div>
+ {{/if}}
</header>
<div class="dropdown" id="quality-profiles-filter-by-language">
-<div class="panel panel-vertical" id="quality-profile-rules">
- <header class="page-header">
- <h3 class="page-title">{{t 'coding_rules'}}</h3>
- </header>
- <p>
- <a class="big" href="{{link rulesSearchUrl}}">{{formatMeasure activeRuleCount 'INT'}}</a>
- {{tp 'quality_profile.x_active_rules' ''}}
- </p>
- {{#notEmpty rulesSeverities}}
- <div class="abs-width-400 spacer-top">
- <div class="columns">
- <div class="column-half">
- {{#eachEven rulesSeverities}}
- <p class="spacer-top">
- {{severityIcon val}}
- <a href="{{link ../rulesSearchUrl '|active_severities=' val}}">{{formatMeasure count 'INT'}}</a>
- <span class="text-lowercase">{{t 'severity' val}}</span>
- </p>
- {{/eachEven}}
- </div>
- <div class="column-half">
- {{#eachOdd rulesSeverities}}
- <p class="spacer-top">
- {{severityIcon val}}
- <a href="{{link ../rulesSearchUrl '|active_severities=' val}}">{{formatMeasure count 'INT'}}</a>
- <span class="text-lowercase">{{t 'severity' val}}</span>
- </p>
- {{/eachOdd}}
+<div class="panel panel-vertical">
+ <div class="columns">
+ <div class="column-two-thirds" id="quality-profile-rules">
+ <header class="page-header">
+ <h3 class="page-title">{{t 'coding_rules'}}</h3>
+ </header>
+ <p>
+ <a class="big" href="{{link rulesSearchUrl}}">{{formatMeasure activeRuleCount 'INT'}}</a>
+ {{tp 'quality_profile.x_active_rules' ''}}
+ </p>
+ {{#notEmpty rulesSeverities}}
+ <div class="abs-width-400 spacer-top">
+ <div class="columns">
+ <div class="column-half">
+ {{#eachEven rulesSeverities}}
+ <p class="spacer-top">
+ {{severityIcon val}}
+ <a href="{{link ../rulesSearchUrl '|active_severities=' val}}">{{formatMeasure count 'INT'}}</a>
+ <span class="text-lowercase">{{t 'severity' val}}</span>
+ </p>
+ {{/eachEven}}
+ </div>
+ <div class="column-half">
+ {{#eachOdd rulesSeverities}}
+ <p class="spacer-top">
+ {{severityIcon val}}
+ <a href="{{link ../rulesSearchUrl '|active_severities=' val}}">{{formatMeasure count 'INT'}}</a>
+ <span class="text-lowercase">{{t 'severity' val}}</span>
+ </p>
+ {{/eachOdd}}
+ </div>
+ </div>
</div>
- </div>
+ {{/notEmpty}}
+ </div>
+
+ <div class="column-third" id="quality-profile-permalinks">
+ <header class="page-header">
+ <h3 class="page-title">{{t 'permalinks'}}</h3>
+ </header>
+ <ul class="list-inline">
+ <li>
+ <a href="{{exporterUrl this null}}" target="_blank"><i class="icon-detach"></i> {{t 'quality_profiles.export_all_rules'}}</a>
+ </li>
+ {{#each exporters}}
+ <li>
+ <a href="{{exporterUrl ../this key}}" target="_blank"><i class="icon-detach"></i> {{name}}</a>
+ </li>
+ {{/each}}
+ </ul>
</div>
- {{/notEmpty}}
+ </div>
</div>
<div class="panel panel-vertical" id="quality-profile-projects">
{{/if}}
</div>
-<div class="panel panel-vertical" id="quality-profile-permalinks">
- <header class="page-header">
- <h3 class="page-title">{{t 'permalinks'}}</h3>
- </header>
- <ul class="list-inline">
- <li>
- <a href="{{exporterUrl this null}}" target="_blank"><i class="icon-detach"></i> {{t 'quality_profiles.export_all_rules'}}</a>
- </li>
- {{#each exporters}}
- <li>
- <a href="{{exporterUrl ../this key}}" target="_blank"><i class="icon-detach"></i> {{name}}</a>
- </li>
- {{/each}}
- </ul>
-</div>
-
<div class="panel panel-vertical" id="quality-profile-inheritance">
<header class="page-header">
<h3 class="page-title">{{t 'quality_profiles.profile_inheritance'}}</h3>
events: {
'submit #quality-profile-changelog-form': 'onFormSubmit',
- 'click .js-show-more-changelog': 'onShowMoreChangelogClick'
+ 'click .js-show-more-changelog': 'onShowMoreChangelogClick',
+ 'click .js-hide-changelog': 'onHideChangelogClick'
},
onFormSubmit: function (e) {
this.model.fetchMoreChangelog();
},
+ onHideChangelogClick: function (e) {
+ e.preventDefault();
+ this.model.resetChangelog();
+ },
+
getSearchParameters: function () {
var form = this.$('#quality-profile-changelog-form');
return {
});
-casper.test.begin(testName('Changelog'), 21, function (test) {
+casper.test.begin(testName('Changelog'), 22, function (test) {
casper
.start(lib.buildUrl('profiles#show?key=java-sonar-way-67887'), function () {
lib.setDefaultViewport();
test.assertSelectorContains('#quality-profile-changelog tbody tr:nth-child(3)', 'runFinalizersOnExit');
})
+ .then(function () {
+ casper.click('.js-hide-changelog');
+ test.assertDoesntExist('#quality-profile-changelog tbody tr');
+ })
+
.then(function () {
lib.sendCoverage();
})