<script id="coding-rules-detail-quality-profile-template" type="text/x-handlebars-template">
- <div class="coding-rules-detail-quality-profile-name">{{name}}</div>
-
- {{#if parent}}
- <div class="coding-rules-detail-quality-profile-inheritance">
- <i class="icon-inheritance"></i> {{t 'coding_rules.inherits'}} <strong>{{parent.name}}</strong>
- </div>
- {{/if}}
+ <div class="coding-rules-detail-quality-profile-name">
+ {{name}}
+ {{#if parent}}
+ <span class="coding-rules-detail-quality-profile-inheritance">
+ <i class="icon-inheritance"></i> {{parent.name}}
+ </span>
+ {{/if}}
+ </div>
<ul class="coding-rules-detail-parameters coding-rules-detail-quality-profile-parameters">
<li class="coding-rules-detail-parameter">
</select>
{{#if parent}}
{{#notEq severity parent.severity}}
- {{t 'coding_rules.original'}} {{severityIcon parent.severity}}{{t 'severity' parent.severity}}
+ <span class="coding-rules-detail-parameter-original">
+ {{t 'coding_rules.original'}} {{severityIcon parent.severity}}{{t 'severity' parent.severity}}
+ </span>
{{/notEq}}
{{/if}}
</div>
<input type="text" value="{{value}}">
{{#if ../parent}}
{{#notEq value original}}
- {{t 'coding_rules.original'}} {{original}}
+ <span class="coding-rules-detail-parameter-original">
+ {{t 'coding_rules.original'}} {{original}}
+ </span>
{{/notEq}}
{{/if}}
</div>
{{/each}}
</ul>
- <div class="coding-rules-detail-quality-profile-note">
- {{#if note}}
+ <div class="button-group coding-rules-detail-quality-profile-actions">
+ <button class="coding-rules-detail-quality-profile-update" disabled>{{t 'update'}}</button>
+ {{#unless note}}
+ <button class="coding-rules-detail-quality-profile-note-add">{{t 'coding_rules.add_note'}}</button>
+ {{/unless}}
+ {{#if parent}}
+ <button class="button-red">{{t 'coding_rules.revert_to_parent_definition'}}</button>
+ {{/if}}
+ <button class="button-red">{{t 'coding_rules.deactivate_quality_profile'}}</button>
+ </div>
+
+ {{#if note}}
+ <div class="coding-rules-detail-quality-profile-note">
<blockquote class="rule-desc">
<cite>
<b>{{note.username}}</b> ({{note.fCreationDate}}) |
</cite>
{{{note.html}}}
</blockquote>
- {{else}}
- <a class="coding-rules-detail-quality-profile-note-add link-action">{{t 'coding_rules.add_note'}}</a>
- {{/if}}
- </div>
+ </div>
+ {{/if}}
<div class="coding-rules-detail-quality-profile-note-form admin">
<table class="width100 table">
</tbody>
</table>
</div>
-
- <div class="button-group coding-rules-detail-quality-profile-actions">
- <button>{{t 'update'}}</button>
- {{#if parent}}
- <button class="button-red">{{t 'coding_rules.revert_to_parent_definition'}}</button>
- {{/if}}
- <button class="button-red">{{t 'coding_rules.deactivate_quality_profile'}}</button>
- </div>
</script>
<ul class="coding-rules-detail-properties">
<li class="coding-rules-detail-property">{{severityIcon severity}} {{t "severity" severity}}</li>
- <li class="coding-rules-detail-property">
- <span class="coding-rules-detail-status">{{language}}</span>
- </li>
+ <li class="coding-rules-detail-property">{{language}}</li>
{{#notEq status 'READY'}}
- <li class="coding-rules-detail-property">
- <span class="coding-rules-detail-status">{{status}}</span>
- </li>
+ <li class="coding-rules-detail-property">{{status}}</li>
{{/notEq}}
<li class="coding-rules-detail-property coding-rules-detail-tag-list">
<i class="icon-tags"></i>
<i class="icon-quality-profile"></i> {{qualityProfileName}}
{{severityIcon severity}}{{t "severity" severity}}
{{/if}}
- <span class="coding-rules-detail-status">{{language}}</span>
+ {{language}}
<div class="line-right">{{#notEq status 'READY'}}{{status}}{{/notEq}}</div>
</div>
'coding_rules.extend_description': 'Extend Description'
'coding_rules.deactivate_quality_profile': 'Deactivate'
'coding_rules.found': 'Found'
- 'coding_rules.inherits': 'Inherits'
+ 'coding_rules._inherits': 'inherits'
'coding_rules.key': 'Key:'
'coding_rules.new_search': 'New Search'
'coding_rules.no_results': 'No Coding Rules'
'coding_rules.extend_description': 'Extend Description',
'coding_rules.deactivate_quality_profile': 'Deactivate',
'coding_rules.found': 'Found',
- 'coding_rules.inherits': 'Inherits',
+ 'coding_rules._inherits': 'inherits',
'coding_rules.key': 'Key:',
'coding_rules.new_search': 'New Search',
'coding_rules.no_results': 'No Coding Rules',
ui:
+ update: '.coding-rules-detail-quality-profile-update'
severitySelect: '.coding-rules-detail-quality-profile-severity'
note: '.coding-rules-detail-quality-profile-note'
'click @ui.noteCancel': 'cancelNote'
'click @ui.noteSubmit': 'submitNote'
+ 'change .coding-rules-detail-parameters select': 'enableUpdate'
+ 'keyup .coding-rules-detail-parameters input': 'enableUpdate'
+
editNote: ->
@ui.note.hide()
@render()
+ enableUpdate: ->
+ @ui.update.prop 'disabled', false
+
+
onRender: ->
@ui.noteForm.hide()
CodingRulesDetailQualityProfilesView.prototype.template = getTemplate('#coding-rules-detail-quality-profile-template');
CodingRulesDetailQualityProfilesView.prototype.ui = {
+ update: '.coding-rules-detail-quality-profile-update',
severitySelect: '.coding-rules-detail-quality-profile-severity',
note: '.coding-rules-detail-quality-profile-note',
noteForm: '.coding-rules-detail-quality-profile-note-form',
'click @ui.noteEdit': 'editNote',
'click @ui.noteDelete': 'deleteNote',
'click @ui.noteCancel': 'cancelNote',
- 'click @ui.noteSubmit': 'submitNote'
+ 'click @ui.noteSubmit': 'submitNote',
+ 'change .coding-rules-detail-parameters select': 'enableUpdate',
+ 'keyup .coding-rules-detail-parameters input': 'enableUpdate'
};
CodingRulesDetailQualityProfilesView.prototype.editNote = function() {
});
};
+ CodingRulesDetailQualityProfilesView.prototype.enableUpdate = function() {
+ return this.ui.update.prop('disabled', false);
+ };
+
CodingRulesDetailQualityProfilesView.prototype.onRender = function() {
var format;
this.ui.noteForm.hide();
@ui.tagInput.select2
tags: _.difference @options.app.tags, @model.get 'tags'
- width: '500px'
+ width: '300px'
@ui.tagsEdit.hide()
@ui.extendDescriptionForm.hide()
this.qualityProfilesRegion.show(this.qualityProfilesView);
this.ui.tagInput.select2({
tags: _.difference(this.options.app.tags, this.model.get('tags')),
- width: '500px'
+ width: '300px'
});
this.ui.tagsEdit.hide();
this.ui.extendDescriptionForm.hide();
line-height: 1.5;
font-weight: bold;
}
+.coding-rules-detail-header {
+ font-size: 18px;
+}
.coding-rules-detail-title {
display: inline-block;
+ margin-top: 30px;
text-transform: uppercase;
}
-.coding-rules-detail-status {
- padding: 3px 4px;
- background-color: #efefef;
- color: #777;
- font-size: 11px;
-}
.coding-rules-detail-properties {
margin: 10px 0;
font-size: 0;
}
.coding-rules-detail-parameter-name {
display: inline-block;
- visibility: top;
+ vertical-align: top;
width: 150px;
font-size: 13px;
- font-weight: bold;
+ font-weight: normal;
text-align: right;
}
.coding-rules-detail-parameter-description {
margin-left: 20px;
font-size: 13px;
}
+.coding-rules-detail-parameter-original {
+ margin-left: 10px;
+ font-size: 11px;
+}
.coding-rules-detail-quality-profiles-header {
margin-top: 30px;
}
font-size: 0;
}
.coding-rules-detail-quality-profile {
- border: 1px solid transparent;
-}
-.coding-rules-detail-quality-profile.active {
- border-color: #4b9fd5;
+ margin-left: 20px;
}
.coding-rules-detail-quality-profile.active .coding-rules-detail-quality-profile-name {
background-color: #4b9fd5;
}
.coding-rules-detail-quality-profile + .coding-rules-detail-quality-profile {
margin-top: 20px;
+ padding-top: 20px;
+ border-top: 1px solid #e1e1e1;
}
.coding-rules-detail-quality-profile-name {
- padding: 5px;
- background-color: #efefef;
- line-height: 1;
font-weight: bold;
}
.coding-rules-detail-quality-profile-actions {
width: 200px;
}
.coding-rules-detail-quality-profile-inheritance {
- margin: 10px 0;
- padding: 0 5px;
+ vertical-align: middle;
+ margin-left: 10px;
+ font-size: 11px;
+ font-weight: normal;
+}
+.coding-rules-detail-quality-profile-inheritance i {
+ position: relative;
+ top: -1px;
+ font-size: 14px;
}
.coding-rules-detail-quality-profile-inheritance strong {
font-weight: bold;
}
.coding-rules-detail-quality-profile-note {
- margin: 10px 0;
+ margin: 20px 0;
padding: 0 5px;
}
.coding-rules-detail-quality-profiles-activation {
font-weight: bold;
}
+.coding-rules-detail-header {
+ font-size: 18px;
+}
+
.coding-rules-detail-title {
display: inline-block;
+ margin-top: 3 * @navigatorPadding;
text-transform: uppercase;
}
-.coding-rules-detail-status {
- padding: 3px 4px;
- background-color: @navigatorBarBackground;
- color: #777;
- font-size: @smallFontSize;
-}
-
-.coding-rules-detail-key {
-
-}
-
.coding-rules-detail-properties {
margin: @navigatorPadding 0;
font-size: 0;
.coding-rules-detail-parameter-name {
display: inline-block;
- visibility: top;
+ vertical-align: top;
width: 150px;
font-size: @baseFontSize;
- font-weight: bold;
+ font-weight: normal;
text-align: right;
}
font-size: @baseFontSize;
}
+.coding-rules-detail-parameter-original {
+ margin-left: @navigatorPadding;
+ font-size: @smallFontSize;
+}
+
// Quality Profiles
.coding-rules-detail-quality-profiles-header {
}
.coding-rules-detail-quality-profile {
- border: 1px solid transparent;
+ margin-left: 2 * @navigatorPadding;
&.active {
- border-color: @highlighted;
.coding-rules-detail-quality-profile-name {
background-color: @highlighted;
.coding-rules-detail-quality-profile + .coding-rules-detail-quality-profile {
margin-top: 2 * @navigatorPadding;
+ padding-top: 2 * @navigatorPadding;
+ border-top: 1px solid @navigatorBorderLightColor;
}
.coding-rules-detail-quality-profile-name {
- padding: @navigatorPadding / 2;
- background-color: @navigatorBarBackground;
- line-height: 1;
font-weight: bold;
}
}
.coding-rules-detail-quality-profile-inheritance {
- margin: @navigatorPadding 0;
- padding: 0 @navigatorPadding / 2;
+ vertical-align: middle;
+ margin-left: @navigatorPadding;
+ font-size: @smallFontSize;
+ font-weight: normal;
+ i {
+ position: relative;
+ top: -1px;
+ font-size: @iconSmallFontSize;
+ }
strong { font-weight: bold; }
}
.coding-rules-detail-quality-profile-note {
- margin: @navigatorPadding 0;
+ margin: @navigatorPadding * 2 0;
padding: 0 @navigatorPadding / 2;
}
}
.icon-inheritance:before {
content: "\f126";
- font-size: 16px;
}
.icon-plus:before {
content: "\f067";
}
.icon-inheritance:before {
content: "\f126";
- font-size: @iconFontSize;
}
.icon-plus:before {
content: "\f067";