diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-03-20 13:17:29 +0600 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-03-20 13:17:29 +0600 |
commit | 27447442880586ef8636448b07857eee75d270c1 (patch) | |
tree | f661b92fc163d98387be5903783d1be2e4893a61 /sonar-server/src | |
parent | a918f608159c3b22079c0757a28f69db3f00f50a (diff) | |
download | sonarqube-27447442880586ef8636448b07857eee75d270c1.tar.gz sonarqube-27447442880586ef8636448b07857eee75d270c1.zip |
Grunt Handlebars
Diffstat (limited to 'sonar-server/src')
171 files changed, 1881 insertions, 3472 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb index e71ff6b5080..4bafe530c12 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb @@ -1,5 +1,5 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/coding-rules/app" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/coding-rules/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> @@ -8,15 +8,4 @@ </div> -<%= render :partial => '/navigator/filter_templates' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_layout.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_header_template.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_actions_template.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_filter_bar_template.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_list_item_template.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_list_empty_template.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_detail_template.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_detail_quality_profile_template.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_quality_profile_activation_template.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_facets_item_template.hbs' -%> -<%= render :partial => '/coding_rules/templates/coding_rules_bulk_change_template.hbs' -%> +<%= render :partial => '/navigator/filter_templates' -%>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_actions_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_actions_template.hbs.erb deleted file mode 100644 index ff660ae4a24..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_actions_template.hbs.erb +++ /dev/null @@ -1,20 +0,0 @@ -<script id="coding-rules-status-template" type="text/x-handlebars-template"> - <div class="navigator-actions-order"> - {{#if sorting}} - {{t 'coding_rules.ordered_by'}} <strong>{{sorting.sortText}}</strong> {{#if sorting.asc}}<i class="icon-arrow-up"></i>{{else}}<i class="icon-arrow-down"></i>{{/if}} - {{else}} - {{t 'coding_rules.order'}} - {{/if}} - </div> - <ul class="navigator-actions-order-choices"> - <li data-sort="CREATION_DATE" data-asc="true">{{t 'coding_rules.sort.creation_date'}} <i class="icon-arrow-up"></i></li> - <li data-sort="CREATION_DATE" data-asc="false">{{t 'coding_rules.sort.creation_date'}} <i class="icon-arrow-down"></i></li> - <li data-sort="NAME" data-asc="true">{{t 'coding_rules.sort.name'}} <i class="icon-arrow-up"></i></li> - <li data-sort="NAME" data-asc="false">{{t 'coding_rules.sort.name'}} <i class="icon-arrow-down"></i></li> - </ul> - <div class="navigator-actions-total"> - {{t 'coding_rules.found'}}: <strong>{{paging.fTotal}}</strong> - <a class="navigator-actions-bulk" - title="{{t 'bulk_change'}}"><i class="icon-settings-multiple"></i></a> - </div> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_bulk_change_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_bulk_change_template.hbs.erb deleted file mode 100644 index 02eb8ce7691..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_bulk_change_template.hbs.erb +++ /dev/null @@ -1,64 +0,0 @@ -<script id="coding-rules-bulk-change-template" type="text/x-handlebars-template"> - <form> - <div class="modal-head"> - <h2>{{t 'coding_rules.bulk_change'}} {{paging.fTotal}} {{t 'coding_rules._rules'}}</h2> - </div> - - <div class="modal-body"> - <div class="modal-error"></div> - - {{#if inactiveQualityProfile}} - <div class="modal-field"> - <label for="coding-rules-bulk-change-activate-on-qp">Activate on</label> - <input id="coding-rules-bulk-change-activate-qp" type="checkbox"> - <span class="text">{{inactiveQualityProfileName}}</span> - </div> - {{/if}} - - <div class="modal-field"> - <label for="coding-rules-bulk-change-activate-on">{{#unless inactiveQualityProfile}}Activate on{{/unless}}</label> - <input id="coding-rules-bulk-change-activate" type="checkbox"> - <select id="coding-rules-bulk-change-activate-on" multiple> - {{#each activateOnQualityProfiles}} - <option value="{{key}}">{{name}}</option> - {{/each}} - </select> - </div> - - {{#if activeQualityProfile}} - <div class="modal-field"> - <label for="coding-rules-bulk-change-deactivate-on-qp">Deactivate on</label> - <input id="coding-rules-bulk-change-deactivate-qp" type="checkbox"> - <span class="text">{{activeQualityProfileName}}</span> - </div> - {{/if}} - - <div class="modal-field"> - <label for="coding-rules-bulk-change-deactivate-on">{{#unless activeQualityProfile}}Deactivate on{{/unless}}</label> - <input id="coding-rules-bulk-change-deactivate" type="checkbox"> - <select id="coding-rules-bulk-change-deactivate-on" multiple> - {{#each deactivateOnQualityProfiles}} - <option value="{{key}}">{{name}}</option> - {{/each}} - </select> - </div> - - {{#if activeQualityProfile}} - <div class="modal-field"> - <label for="coding-rules-bulk-change-severity">Change Severity</label> - <input id="coding-rules-bulk-change-set-severity" type="checkbox"> - <select id="coding-rules-bulk-change-severity"> - {{#each severities}} - <option value="{{this}}">{{t 'severity' this}}</option> - {{/each}} - </select> - </div> - {{/if}} - </div> - - <div class="modal-foot"> - <button>{{t 'apply'}}</button> - <a id="coding-rules-cancel-bulk-change" class="action">{{t 'cancel'}}</a> - </div> - </form> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_detail_quality_profile_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_detail_quality_profile_template.hbs.erb deleted file mode 100644 index b5d4295ccfa..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_detail_quality_profile_template.hbs.erb +++ /dev/null @@ -1,86 +0,0 @@ -<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}} - - <ul class="coding-rules-detail-parameters coding-rules-detail-quality-profile-parameters"> - <li class="coding-rules-detail-parameter"> - <h3 class="coding-rules-detail-parameter-name">{{t 'severity'}}</h3> - <div class="coding-rules-detail-parameter-description"> - <select class="coding-rules-detail-quality-profile-severity"> - {{#each severities}} - <option value="{{this}}">{{t 'severity' this}}</option> - {{/each}} - </select> - {{#if parent}} - {{#notEq severity parent.severity}} - {{t 'coding_rules.original'}} {{severityIcon parent.severity}}{{t 'severity' parent.severity}} - {{/notEq}} - {{/if}} - </div> - </li> - {{#each parameters}} - <li class="coding-rules-detail-parameter"> - <h3 class="coding-rules-detail-parameter-name">{{key}}</h3> - <div class="coding-rules-detail-parameter-description"> - <input type="text" value="{{value}}"> - {{#if ../parent}} - {{#notEq value original}} - {{t 'coding_rules.original'}} {{original}} - {{/notEq}} - {{/if}} - </div> - </li> - {{/each}} - </ul> - - <div class="coding-rules-detail-quality-profile-note"> - {{#if note}} - <blockquote class="rule-desc"> - <cite> - <b>{{note.username}}</b> ({{note.fCreationDate}}) | - <a class="coding-rules-detail-quality-profile-note-edit link-action">{{t 'edit'}}</a> - <a class="coding-rules-detail-quality-profile-note-delete link-action">{{t 'delete'}}</a> - </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 class="coding-rules-detail-quality-profile-note-form admin"> - <table class="width100 table"> - <tbody> - <tr> - <td class="width100" colspan="2"> - <textarea class="coding-rules-detail-quality-profile-note-text" rows="4" style="width: 100%;">{{#if note}}{{note.raw}}{{/if}}</textarea> - </td> - </tr> - <tr> - <td> - <button class="coding-rules-detail-quality-profile-note-submit"> - {{#if note}}{{t 'update'}}{{else}}{{t 'coding_rules.add_note'}}{{/if}} - </button> - <a class="coding-rules-detail-quality-profile-note-cancel action">{{t 'cancel'}}</a> - </td> - <td class="right"> - <%= render :partial => 'markdown/tips' -%> - </td> - </tr> - </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> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_detail_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_detail_template.hbs.erb deleted file mode 100644 index 09447f2c00e..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_detail_template.hbs.erb +++ /dev/null @@ -1,87 +0,0 @@ -<script id="coding-rules-detail-template" type="text/x-handlebars-template"> - <h3 class="coding-rules-detail-header">{{name}}</h3> - - <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> - {{#notEq status 'READY'}} - <li class="coding-rules-detail-property"> - <span class="coding-rules-detail-status">{{status}}</span> - </li> - {{/notEq}} - <li class="coding-rules-detail-property coding-rules-detail-tag-list"> - <i class="icon-tags"></i> - {{join tags ', '}} - <a class="link-action coding-rules-detail-tags-change">{{t 'change'}}</a> - </li> - <li class="coding-rules-detail-property coding-rules-detail-tag-edit"> - <input class="coding-rules-detail-tag-input" type="text" value="{{join tags ','}}"> - <a class="link-action coding-rules-detail-tag-edit-done">{{t 'done'}}</a> - </li> - <li class="coding-rules-detail-property">{{t 'coding_rules.available_since'}} {{fCreationDate}}</li> - <li class="coding-rules-detail-property">{{t 'coding_rules.repository'}} {{repository}}</li> - <li class="coding-rules-detail-property">{{t 'coding_rules.key'}} {{key}}</li> - </ul> - - <div class="coding-rules-detail-description rule-desc">{{{description}}}</div> - - <div class="coding-rules-detail-description coding-rules-detail-description-extra"> - <div id="coding-rules-detail-description-extra"> - {{#if extra}}<div class="rule-desc">{{{extra}}}</div>{{/if}} - <a class="link-action" id="coding-rules-detail-extend-description">{{t 'coding_rules.extend_description'}}</a> - </div> - - <div id="coding-rules-detail-extend-description-form" class="admin"> - <table class="width100 table"> - <tbody> - <tr> - <td class="width100" colspan="2"> - <textarea id="coding-rules-detail-extend-description-text" rows="4" style="width: 100%;">{{extraRaw}}</textarea> - </td> - </tr> - <tr> - <td> - <button id="coding-rules-detail-extend-description-submit">{{t 'coding_rules.extend_description'}}</button> - <a id="coding-rules-detail-extend-description-cancel" class="action">{{t 'cancel'}}</a> - </td> - <td class="right"> - <%= render :partial => 'markdown/tips' -%> - </td> - </tr> - </tbody> - </table> - </div> - - <div id="coding-rules-detail-extend-description-spinner"> - <i class="spinner"></i> - </div> - </div> - - - {{#if parameters}} - <h3 class="coding-rules-detail-title">{{t 'coding_rules.parameters'}}</h3> - <ul class="coding-rules-detail-parameters"> - {{#each parameters}} - <li class="coding-rules-detail-parameter"> - <h3 class="coding-rules-detail-parameter-name">{{key}}</h3> - <div class="coding-rules-detail-parameter-description"> - {{description}} - - {{#if default}} - <div>{{t 'coding_rules.parameters.default_value'}} {{default}}</div> - {{/if}} - </div> - </li> - {{/each}} - </ul> - {{/if}} - - - <h3 class="coding-rules-detail-title">{{t 'coding_rules.quality_profiles'}}</h3> - <div class="button-group coding-rules-detail-quality-profiles-activation"> - <button id="coding-rules-quality-profile-activate">{{t 'coding_rules.activate_quality_profile'}}</button> - </div> - <div id="coding-rules-detail-quality-profiles"></div> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_facets_item_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_facets_item_template.hbs.erb deleted file mode 100644 index 95c912f21db..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_facets_item_template.hbs.erb +++ /dev/null @@ -1,11 +0,0 @@ -<script id="coding-rules-facets-item-template" type="text/x-handlebars-template"> - <h3 class="navigator-facets-list-item-name">{{name}}</h3> - <ul class="navigator-facets-list-item-options"> - {{#each options}} - <li class="navigator-facets-list-item-option"> - <span class="navigator-facets-list-item-option-name">{{this}}</span> - <span class="navigator-facets-list-item-option-stat subtitle">42</span> - </li> - {{/each}} - </ul> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_filter_bar_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_filter_bar_template.hbs.erb deleted file mode 100644 index 9ca665e0121..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_filter_bar_template.hbs.erb +++ /dev/null @@ -1,4 +0,0 @@ -<script id="filter-bar-template" type="text/x-handlebars-template"> - <div class="navigator-filters-list"></div> - <button class="navigator-filter-submit">{{t 'search_verb'}}</button> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_header_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_header_template.hbs.erb deleted file mode 100644 index e28cd814735..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_header_template.hbs.erb +++ /dev/null @@ -1,7 +0,0 @@ -<script id="coding-rules-header-template" type="text/x-handlebars-template"> - <h1 class="navigator-header-title">{{t 'coding_rules.page'}}</h1> - - <div class="navigator-header-actions button-group"> - <button id="coding-rules-new-search">{{t 'coding_rules.new_search'}}</button> - </div> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_layout.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_layout.hbs.erb deleted file mode 100644 index aa7e978699b..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_layout.hbs.erb +++ /dev/null @@ -1,7 +0,0 @@ -<script id="coding-rules-layout" type="text/x-handlebars-template"> - <div class="navigator-header"></div> - <div class="navigator-filters"></div> - <div class="navigator-results"></div> - <div class="navigator-actions"></div> - <div class="navigator-details"></div> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_list_empty_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_list_empty_template.hbs.erb deleted file mode 100644 index 011edf1776d..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_list_empty_template.hbs.erb +++ /dev/null @@ -1,3 +0,0 @@ -<script id="coding-rules-list-empty-template" type="text/x-handlebars-template"> - {{t 'coding_rules.no_results'}} -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_list_item_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_list_item_template.hbs.erb deleted file mode 100644 index 22f6ce7a019..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_list_item_template.hbs.erb +++ /dev/null @@ -1,12 +0,0 @@ -<script id="coding-rules-list-item-template" type="text/x-handlebars-template"> - <div class="line line-small"> - {{#if qualityProfile}} - <i class="icon-quality-profile"></i> {{qualityProfileName}} - {{severityIcon severity}}{{t "severity" severity}} - {{/if}} - <span class="coding-rules-detail-status">{{language}}</span> - - <div class="line-right">{{#notEq status 'READY'}}{{status}}{{/notEq}}</div> - </div> - <div class="line line-nowrap" title="{{name}}">{{name}}</div> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_quality_profile_activation_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_quality_profile_activation_template.hbs.erb deleted file mode 100644 index 7e82a148084..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_quality_profile_activation_template.hbs.erb +++ /dev/null @@ -1,51 +0,0 @@ -<script id="coding-rules-quality-profile-activation-template" type="text/x-handlebars-template"> - <form> - <div class="modal-head"> - <h2>{{t 'coding_rules.activate_quality_profile'}}</h2> - </div> - - <div class="modal-body"> - <div class="modal-error"></div> - - <table> - <tr class="property"> - <th><h3>{{t 'coding_rules.quality_profile'}}</h3></th> - <td> - <select id="coding-rules-quality-profile-activation-select"> - {{#each qualityProfiles}} - <option value="{{key}}">{{name}}</option> - {{/each}} - </select> - </td> - </tr> - <tr class="property"> - <th><h3>{{t 'severity'}}</h3></th> - <td> - <select id="coding-rules-quality-profile-activation-severity"> - {{#each severities}} - <option value="{{this}}">{{t 'severity' this}}</option> - {{/each}} - </select> - </td> - </tr> - {{#each parameters}} - <tr class="property"> - <th><h3>{{key}}</h3></th> - <td> - <input type="text" {{#if default}}value="{{default}}"{{/if}}> - <div class="note">{{description}}</div> - {{#if extra}} - <div class="note">{{extra}}</div> - {{/if}} - </td> - </tr> - {{/each}} - </table> - </div> - - <div class="modal-foot"> - <button id="coding-rules-quality-profile-activation-activate">{{t 'coding_rules.activate'}}</button> - <a id="coding-rules-quality-profile-activation-cancel" class="action">{{t 'cancel'}}</a> - </div> - </form> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb index 6524fa5401a..671e29f1ab2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb @@ -1,5 +1,5 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/common/select-list" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> <div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb index 2d79b666959..a1cf004f1bb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb @@ -1,5 +1,5 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/issues/app.js" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/issues/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> <div class="navigator"> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb index 8355b6ac94a..00c9287ce9e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb @@ -1,5 +1,5 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/measures/app.js" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/measures/app.js" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb index 6522ec2d6b8..1a4f834e45b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb @@ -1,5 +1,5 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/common/select-list" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> <h1 class="admin-page-title"><%= message 'roles.page' -%></h1> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb index 2e6435d6add..93a78829954 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb @@ -1,5 +1,5 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/common/select-list" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> <div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb index 37251d2951d..470dab4c24e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb @@ -1,31 +1,7 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/quality-gate/app" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/quality-gate/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> <div id="quality-gate-page-loader" class="navigator-page-loader"> <i class="spinner"></i> </div> - -<%= render :partial => '/quality_gates/templates/quality_gates_layout.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_sidebar_list_item_template.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_sidebar_list_empty_template.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_actions_template.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_edit_template.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_detail_template.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_detail_header_template.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_detail_conditions_template.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_detail_conditions_empty_template.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_detail_condition_template.hbs' -%> -<%= render :partial => '/quality_gates/templates/quality_gate_detail_projects_template.hbs' -%> - - -<script> - window.SS = { - workDuration: { - days: '<%= message('work_duration.x_days') -%>', - hours: '<%= message('work_duration.x_hours') -%>', - minutes: '<%= message('work_duration.x_minutes') -%>' - } - }; -</script> - diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_actions_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_actions_template.hbs.erb deleted file mode 100644 index 083091f5e25..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_actions_template.hbs.erb +++ /dev/null @@ -1,8 +0,0 @@ -<script id="quality-gate-actions-template" type="text/x-handlebars-template"> - <h1 class="navigator-header-title">{{t 'quality_gates.page'}}</h1> - {{#if canEdit}} - <div class="navigator-header-actions button-group"> - <button id="quality-gate-add">{{t 'add_verb'}}</button> - </div> - {{/if}} -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_condition_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_condition_template.hbs.erb deleted file mode 100644 index 7ca50016040..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_condition_template.hbs.erb +++ /dev/null @@ -1,59 +0,0 @@ -<script id="quality-gate-detail-condition-template" type="text/x-handlebars-template"> - <td nowrap> - {{metric.name}} - </td> - <td width="10%" nowrap> - {{#if canEdit}} - <select name="period"> - {{#unless isDiffMetric}}<option value="0">{{t 'value'}}</option>{{/unless}} - {{#each periods}}<option value="{{key}}">Δ {{text}}</option>{{/each}} - </select> - {{else}} - {{#if periodText}}Δ {{periodText}} - {{else}}{{t 'value'}} - {{/if}} - {{/if}} - </td> - <td width="10%" nowrap> - {{#if canEdit}} - <select name="operator"> - {{#operators metric.type}} - <option value="{{this}}">{{t 'quality_gates.operator' this}}</option> - {{/operators}} - </select> - {{else}} - {{t 'quality_gates.operator' op}} - {{/if}} - </td> - <td width="15%" nowrap="nowrap"> - <i class="icon-alert-warn" title="{{t 'alerts.warning_tooltip'}}"></i> - {{#if canEdit}} - <input name="warning" class="measure-input" data-type="{{metric.type}}" type="text"> - {{else}} - {{warning}} - {{/if}} - </td> - <td width="15%" nowrap="nowrap"> - <i class="icon-alert-error" title="{{t 'alerts.error_tooltip'}}"></i> - {{#if canEdit}} - <input name="error" class="measure-input" data-type="{{metric.type}}" type="text"> - {{else}} - {{error}} - {{/if}} - </td> - <td class="quality-gate-condition-actions" width="120px" nowrap> - {{#if canEdit}} - {{#if id}} - <div class="button-group"> - <button class="update-condition" disabled>{{t 'update_verb'}}</button> - <button class="button-red delete-condition">{{t 'delete'}}</button> - </div> - {{else}} - <div class="button-group"> - <button class="add-condition">{{t 'add_verb'}}</button> - <a class="action cancel-add-condition">{{t 'cancel'}}</a> - </div> - {{/if}} - {{/if}} - </td> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_conditions_empty_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_conditions_empty_template.hbs.erb deleted file mode 100644 index 038e0786fb5..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_conditions_empty_template.hbs.erb +++ /dev/null @@ -1,5 +0,0 @@ -<script id="quality-gate-detail-conditions-empty-template" type="text/x-handlebars-template"> - <td colspan="6"> - {{t 'quality_gates.no_conditions'}} - </td> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_conditions_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_conditions_template.hbs.erb deleted file mode 100644 index 1ff680bc484..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_conditions_template.hbs.erb +++ /dev/null @@ -1,52 +0,0 @@ -<script id="quality-gate-detail-conditions-template" type="text/x-handlebars-template"> - <div class="quality-gate-section-name">{{t 'quality_gates.conditions'}}</div> - - <div class="quality-gate-introduction"> - <p>{{t 'quality_gates.introduction'}} - <a class="link-action quality-gate-introduction-show-more">{{t 'more'}}</a> - </p> - <div class="quality-gate-introduction-more"> - {{t 'quality_gates.health_icons'}} - <table class="data"> - <thead> - <tr> - <th colspan="3"></th> - </tr> - </thead> - <tbody> - <tr class="even"> - <td><i class="icon-alert-ok"></i></td> - <td>{{t 'alerts.notes.ok'}}</td> - </tr> - <tr class="odd"> - <td><i class="icon-alert-warn"></i></td> - <td>{{t 'alerts.notes.warn'}}</td> - </tr> - <tr class="even"> - <td><i class="icon-alert-error"></i></td> - <td>{{t 'alerts.notes.error'}}</td> - </tr> - </tbody> - </table> - </div> - </div> - - {{#if canEdit}} - <div class="quality-gate-new-condition"> - <label for="quality-gate-new-condition-metric">{{t 'quality_gates.add_condition'}}:</label> - <select id="quality-gate-new-condition-metric"> - <option></option> - {{#each metricGroups}} - <optgroup label="{{domain}}"> - {{#each metrics}}<option value="{{key}}">{{name}}</option>{{/each}} - </optgroup> - {{/each}} - </select> - </div> - {{/if}} - - <table class="data zebra width100 marginbottom10 spaced quality-gate-conditions"> - <thead><tr></tr></thead> - <tbody></tbody> - </table> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_header_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_header_template.hbs.erb deleted file mode 100644 index 7d4274c9de8..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_header_template.hbs.erb +++ /dev/null @@ -1,16 +0,0 @@ -<script id="quality-gate-detail-header-template" type="text/x-handlebars-template"> - <h1 class="navigator-header-title">{{name}}</h1> - - {{#if canEdit}} - <div class="navigator-header-actions button-group"> - <button id="quality-gate-rename">{{t 'rename'}}</button> - <button id="quality-gate-copy">{{t 'copy'}}</button> - {{#if default}} - <button id="quality-gate-unset-as-default">{{t 'unset_as_default'}}</button> - {{else}} - <button id="quality-gate-set-as-default">{{t 'set_as_default'}}</button> - {{/if}} - <button id="quality-gate-delete" class="button-red">{{t 'delete'}}</button> - </div> - {{/if}} -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_projects_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_projects_template.hbs.erb deleted file mode 100644 index 7ea0b397156..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_projects_template.hbs.erb +++ /dev/null @@ -1,15 +0,0 @@ -<script id="quality-gate-detail-projects-template" type="text/x-handlebars-template"> - <div class="quality-gate-section-name">{{t 'quality_gates.projects'}}</div> - - {{#if default}} - <p class="quality-gate-default-message"> - {{#if canEdit}} - {{t 'quality_gates.projects_for_default.edit'}} - {{else}} - {{t 'quality_gates.projects_for_default'}} - {{/if}} - </p> - {{else}} - <div id="select-list-projects"></div> - {{/if}} -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_template.hbs.erb deleted file mode 100644 index 02742bf3f6b..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_template.hbs.erb +++ /dev/null @@ -1,4 +0,0 @@ -<script id="quality-gate-detail-template" type="text/x-handlebars-template"> - <div id="quality-gate-conditions" class="quality-gate-section"></div> - <div id="quality-gate-projects" class="quality-gate-section"></div> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_edit_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_edit_template.hbs.erb deleted file mode 100644 index 592da39d1bc..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_edit_template.hbs.erb +++ /dev/null @@ -1,24 +0,0 @@ -<script id="quality-gate-edit-template" type="text/x-handlebars-template"> - <form> - <div class="modal-head"> - {{#eq method "rename"}}<h2>{{t 'quality_gates.rename'}} {{name}}</h2>{{/eq}} - {{#eq method "copy"}}<h2>{{t 'quality_gates.copy'}} {{name}}</h2>{{/eq}} - {{#eq method "create"}}<h2>{{t 'quality_gates.add'}}</h2>{{/eq}} - </div> - - <div class="modal-body"> - <div class="modal-error"></div> - <div class="modal-field"> - <label for="quality-gate-edit-name">{{t 'name'}} <em class="mandatory">*</em></label> - <input id="quality-gate-edit-name" type="text" size="50" maxlength="100"> - </div> - </div> - - <div class="modal-foot"> - {{#eq method "rename"}}<button>{{t 'save'}}</button>{{/eq}} - {{#eq method "copy"}}<button>{{t 'copy'}}</button>{{/eq}} - {{#eq method "create"}}<button>{{t 'create'}}</button>{{/eq}} - <a id="quality-gate-cancel-create" class="action">{{t 'cancel'}}</a> - </div> - </form> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_sidebar_list_empty_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_sidebar_list_empty_template.hbs.erb deleted file mode 100644 index 9daa6f315a9..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_sidebar_list_empty_template.hbs.erb +++ /dev/null @@ -1,3 +0,0 @@ -<script id="quality-gate-sidebar-list-empty-template" type="text/x-handlebars-template"> - <div class="line line-nowrap">{{t 'quality_gates.noQualityGates'}}</div> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_sidebar_list_item_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_sidebar_list_item_template.hbs.erb deleted file mode 100644 index 7d75b457ec4..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_sidebar_list_item_template.hbs.erb +++ /dev/null @@ -1,3 +0,0 @@ -<script id="quality-gate-sidebar-list-item-template" type="text/x-handlebars-template"> - <div class="line line-nowrap">{{name}} {{#if default}}<span class="subtitle">({{t 'default'}})</span>{{/if}}</div> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gates_layout.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gates_layout.hbs.erb deleted file mode 100644 index cf9b0fb2e2a..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gates_layout.hbs.erb +++ /dev/null @@ -1,6 +0,0 @@ -<script id="quality-gates-layout" type="text/x-handlebars-template"> - <div class="navigator-header"></div> - <div class="navigator-results quality-gates-nav"></div> - <div class="navigator-details"></div> - <div class="navigator-actions"></div> -</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb index 9a2e6d5469e..82b820b1e21 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb @@ -1,5 +1,5 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/common/select-list" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> <h1 class="admin-page-title"><%= h message 'global_permissions.page' -%></h1> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb index 8b80528ebda..200b74e46e4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb @@ -1,5 +1,5 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/common/select-list" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> <h1 class="admin-page-title"><%= message 'roles.page' -%></h1> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb index 061c2fa33ba..2fd4e5045eb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb @@ -1,5 +1,5 @@ <% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/javascripts/common/select-list" src="<%= ApplicationController.root_context -%>/javascripts/third-party/require.js"></script> + <script data-main="<%= ApplicationController.root_context -%>/js/common/select-list" src="<%= ApplicationController.root_context -%>/js/require.js"></script> <% end %> <div> diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/app.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/app.coffee index e1ab2f35bac..a290059e0b0 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/app.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/app.coffee @@ -1,5 +1,5 @@ requirejs.config - baseUrl: "#{baseUrl}/javascripts" + baseUrl: "#{baseUrl}/js" paths: 'backbone': 'third-party/backbone' @@ -39,7 +39,8 @@ requirejs [ 'coding-rules/views/filters/quality-profile-filter-view', 'coding-rules/views/filters/inheritance-filter-view', - 'coding-rules/mockjax' + 'coding-rules/mockjax', + 'common/handlebars-extensions' ], ( Backbone, Marionette, diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/layout.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/layout.coffee index 0e3abd4cfd2..dbe8633a152 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/layout.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/layout.coffee @@ -1,13 +1,14 @@ define [ 'backbone.marionette', - 'common/handlebars-extensions' + 'templates/coding-rules' ], ( - Marionette + Marionette, + Templates ) -> class AppLayout extends Marionette.Layout className: 'navigator coding-rules-navigator' - template: getTemplate '#coding-rules-layout' + template: Templates['coding-rules-layout'] spinner: '<i class="spinner"></i>' diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/mockjax.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/mockjax.coffee index d052e6dd829..5f09d1a81d7 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/mockjax.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/mockjax.coffee @@ -46,12 +46,16 @@ define ['jquery.mockjax'], -> 'all': 'All' 'any': 'Any' 'apply': 'Apply' + 'bold': 'Bold' 'bulk_change': 'Bulk Change' + 'bulleted_point': 'Bulleted point' 'cancel': 'Cancel' 'change': 'Change' + 'code': 'Code' 'delete': 'Delete' 'done': 'Done' 'edit': 'Edit' + 'markdown.helplink': 'Markdown Help' 'moreCriteria': '+ More Criteria' 'search_verb': 'Search' 'severity': 'Severity' diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/actions-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/actions-view.coffee index 5371f70b54b..c3d69eb334b 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/views/actions-view.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/views/actions-view.coffee @@ -1,12 +1,13 @@ define [ 'backbone.marionette', - 'common/handlebars-extensions' + 'templates/coding-rules' ], ( - Marionette + Marionette, + Templates ) -> class CodingRulesStatusView extends Marionette.ItemView - template: getTemplate '#coding-rules-status-template' + template: Templates['coding-rules-actions'] collectionEvents: diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee index cfb43fdd315..f0919610617 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-bulk-change-view.coffee @@ -1,13 +1,14 @@ define [ 'backbone.marionette', - 'common/handlebars-extensions' + 'templates/coding-rules' ], ( - Marionette + Marionette, + Templates ) -> class CodingRulesBulkChangeView extends Marionette.ItemView className: 'modal' - template: getTemplate '#coding-rules-bulk-change-template' + template: Templates['coding-rules-bulk-change'] events: diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-quality-profile-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-quality-profile-view.coffee index 289c209d2c0..f0b2624a889 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-quality-profile-view.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-quality-profile-view.coffee @@ -1,13 +1,14 @@ define [ 'backbone.marionette', - 'common/handlebars-extensions' + 'templates/coding-rules' ], ( - Marionette + Marionette, + Templates ) -> class CodingRulesDetailQualityProfilesView extends Marionette.ItemView className: 'coding-rules-detail-quality-profile' - template: getTemplate '#coding-rules-detail-quality-profile-template' + template: Templates['coding-rules-detail-quality-profile'] ui: diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-view.coffee index 01e4cca5d40..86eceb9e65e 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-view.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-detail-view.coffee @@ -2,15 +2,16 @@ define [ 'backbone', 'backbone.marionette', 'coding-rules/views/coding-rules-detail-quality-profiles-view' - 'common/handlebars-extensions' + 'templates/coding-rules' ], ( Backbone, Marionette, - CodingRulesDetailQualityProfilesView + CodingRulesDetailQualityProfilesView, + Templates ) -> class CodingRulesDetailView extends Marionette.Layout - template: getTemplate '#coding-rules-detail-template' + template: Templates['coding-rules-detail'] regions: diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-list-empty-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-list-empty-view.coffee index 203fcad6a7a..c3eb8d48c4e 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-list-empty-view.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-list-empty-view.coffee @@ -1,11 +1,12 @@ define [ 'backbone.marionette', - 'common/handlebars-extensions' + 'templates/coding-rules' ], ( Marionette, + Templates ) -> class CodingRulesListEmptyView extends Marionette.ItemView tagName: 'li' className: 'navigator-results-no-results' - template: getTemplate '#coding-rules-list-empty-template' + template: Templates['coding-rules-list-empty'] diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-list-item-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-list-item-view.coffee index bf0ed4d62c5..a468f9179c2 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-list-item-view.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-list-item-view.coffee @@ -1,15 +1,16 @@ define [ 'backbone.marionette', 'coding-rules/views/coding-rules-detail-view', - 'common/handlebars-extensions' + 'templates/coding-rules' ], ( Marionette, - CodingRulesDetailView + CodingRulesDetailView, + Templates ) -> class CodingRulesListItemView extends Marionette.ItemView tagName: 'li' - template: getTemplate '#coding-rules-list-item-template' + template: Templates['coding-rules-list-item'] activeClass: 'active' diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-quality-profile-activation-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-quality-profile-activation-view.coffee index d85a41e3294..f314464e3d7 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-quality-profile-activation-view.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/views/coding-rules-quality-profile-activation-view.coffee @@ -1,13 +1,14 @@ define [ 'backbone.marionette', - 'common/handlebars-extensions' + 'templates/coding-rules' ], ( - Marionette + Marionette, + Templates ) -> class CodingRulesQualityProfileActivationView extends Marionette.ItemView className: 'modal' - template: getTemplate '#coding-rules-quality-profile-activation-template' + template: Templates['coding-rules-quality-profile-activation'] ui: diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/filter-bar-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/filter-bar-view.coffee index 8b662446a99..6a719be85aa 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/views/filter-bar-view.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/views/filter-bar-view.coffee @@ -2,15 +2,18 @@ define [ 'navigator/filters/filter-bar', 'navigator/filters/base-filters', 'navigator/filters/favorite-filters', - 'navigator/filters/more-criteria-filters' + 'navigator/filters/more-criteria-filters', + 'templates/coding-rules' ], ( FilterBarView, BaseFilters, FavoriteFiltersModule, - MoreCriteriaFilters + MoreCriteriaFilters, + Templates ) -> class CodingRulesFilterBarView extends FilterBarView + template: Templates['coding-rules-filter-bar'] collectionEvents: 'change:enabled': 'changeEnabled' diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/header-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/header-view.coffee index ddf75bc5f53..ae0f8718732 100644 --- a/sonar-server/src/main/webapp/coffee/coding-rules/views/header-view.coffee +++ b/sonar-server/src/main/webapp/coffee/coding-rules/views/header-view.coffee @@ -1,12 +1,13 @@ define [ 'backbone.marionette', - 'common/handlebars-extensions' + 'templates/coding-rules' ], ( - Marionette + Marionette, + Templates ) -> class CodingRulesHeaderView extends Marionette.ItemView - template: getTemplate '#coding-rules-header-template' + template: Templates['coding-rules-header'] events: diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/app.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/app.coffee index ca7e143da88..db18db98711 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/app.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/app.coffee @@ -1,5 +1,5 @@ requirejs.config - baseUrl: "#{baseUrl}/javascripts" + baseUrl: "#{baseUrl}/js" paths: 'jquery': 'third-party/jquery' diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/layout.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/layout.coffee index e9805d05953..ff7f6f54bbd 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/layout.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/layout.coffee @@ -1,13 +1,14 @@ define [ 'backbone.marionette', - 'common/handlebars-extensions' + 'templates/quality-gates' ], ( - Marionette + Marionette, + Templates ) -> class AppLayout extends Marionette.Layout className: 'navigator quality-gates-navigator' - template: getTemplate '#quality-gates-layout' + template: Templates['quality-gates-layout'] regions: diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-actions-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-actions-view.coffee index 27d643775e1..6025a3c5b3c 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-actions-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-actions-view.coffee @@ -1,15 +1,15 @@ define [ 'backbone.marionette', - 'handlebars', + 'templates/quality-gates' 'quality-gate/models/quality-gate' ], ( Marionette, - Handlebars, + Templates QualityGate ) -> class QualityGateActionsView extends Marionette.ItemView - template: Handlebars.compile jQuery('#quality-gate-actions-template').html() + template: Templates['quality-gate-actions'] events: diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-condition-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-condition-view.coffee index 26f23dbc32e..1bebd6f6cb3 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-condition-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-condition-view.coffee @@ -1,14 +1,14 @@ define [ 'backbone.marionette', - 'handlebars' + 'templates/quality-gates' ], ( Marionette, - Handlebars + Templates ) -> class QualityGateDetailConditionView extends Marionette.ItemView tagName: 'tr' - template: Handlebars.compile jQuery('#quality-gate-detail-condition-template').html() + template: Templates['quality-gate-detail-condition'] spinner: '<i class="spinner"></i>' diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-conditions-empty-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-conditions-empty-view.coffee index 35bad098ae8..9c0362f4e6a 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-conditions-empty-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-conditions-empty-view.coffee @@ -1,11 +1,11 @@ define [ 'backbone.marionette', - 'handlebars', + 'templates/quality-gates' ], ( Marionette, - Handlebars, + Templates ) -> class QualityGateDetailConditionsView extends Marionette.ItemView tagName: 'tr' - template: Handlebars.compile jQuery('#quality-gate-detail-conditions-empty-template').html() + template: Templates['quality-gate-detail-conditions-empty'] diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-conditions-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-conditions-view.coffee index 9a297344ae7..7b76a55ae61 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-conditions-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-conditions-view.coffee @@ -1,19 +1,19 @@ define [ 'backbone.marionette', - 'handlebars', + 'templates/quality-gates' 'quality-gate/models/condition', 'quality-gate/views/quality-gate-detail-condition-view', 'quality-gate/views/quality-gate-detail-conditions-empty-view' ], ( Marionette, - Handlebars, + Templates Condition, QualityGateDetailConditionView, - QualityGateDetailConditionsEmptyView + QualityGateDetailConditionsEmptyView, ) -> class QualityGateDetailConditionsView extends Marionette.CompositeView - template: Handlebars.compile jQuery('#quality-gate-detail-conditions-template').html() + template: Templates['quality-gate-detail-conditions'] itemView: QualityGateDetailConditionView emptyView: QualityGateDetailConditionsEmptyView itemViewContainer: '.quality-gate-conditions tbody' diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-header-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-header-view.coffee index 69900f06562..8111616458a 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-header-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-header-view.coffee @@ -1,15 +1,15 @@ define [ 'backbone.marionette', - 'handlebars', + 'templates/quality-gates', 'quality-gate/models/quality-gate' ], ( Marionette, - Handlebars, + Templates QualityGate ) -> class QualityGateDetailHeaderView extends Marionette.ItemView - template: Handlebars.compile jQuery('#quality-gate-detail-header-template').html() + template: Templates['quality-gate-detail-header'] spinner: '<i class="spinner"></i>' diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-projects-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-projects-view.coffee index b496d311a37..afa85c6bad7 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-projects-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-projects-view.coffee @@ -1,14 +1,14 @@ define [ 'backbone.marionette', - 'handlebars', + 'templates/quality-gates' 'select-list' ], ( Marionette, - Handlebars + Templates ) -> class QualityGateDetailProjectsView extends Marionette.ItemView - template: Handlebars.compile jQuery('#quality-gate-detail-projects-template').html() + template: Templates['quality-gate-detail-projects'] onRender: -> diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-view.coffee index 475b25fb4e5..ff2ca9c70ea 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-detail-view.coffee @@ -1,13 +1,13 @@ define [ 'backbone.marionette', - 'handlebars', + 'templates/quality-gates', 'quality-gate/collections/conditions', 'quality-gate/views/quality-gate-detail-header-view', 'quality-gate/views/quality-gate-detail-conditions-view', 'quality-gate/views/quality-gate-detail-projects-view' ], ( Marionette, - Handlebars, + Templates, Conditions, QualityGateDetailHeaderView, QualityGateDetailConditionsView, @@ -15,7 +15,7 @@ define [ ) -> class QualityGateDetailView extends Marionette.Layout - template: Handlebars.compile jQuery('#quality-gate-detail-template').html() + template: Templates['quality-gate-detail'] regions: diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-edit-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-edit-view.coffee index a1763eedca2..47e0bbd9101 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-edit-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-edit-view.coffee @@ -1,14 +1,14 @@ define [ 'backbone.marionette', - 'handlebars' + 'templates/quality-gates' ], ( Marionette, - Handlebars, + Templates ) -> class QualityGateEditView extends Marionette.ItemView className: 'modal' - template: Handlebars.compile jQuery('#quality-gate-edit-template').html() + template: Templates['quality-gate-edit'] ui: diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-empty-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-empty-view.coffee index e867a80b1d2..c828e4b72f2 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-empty-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-empty-view.coffee @@ -1,12 +1,12 @@ define [ 'backbone.marionette', - 'handlebars' + 'templates/quality-gates' ], ( Marionette, - Handlebars + Templates ) -> class QualityGateSidebarListEmptyView extends Marionette.ItemView tagName: 'li' className: 'empty' - template: Handlebars.compile jQuery('#quality-gate-sidebar-list-empty-template').html() + template: Templates['quality-gate-sidebar-list-empty'] diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-item-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-item-view.coffee index 458736751db..70cd6d15366 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-item-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-item-view.coffee @@ -1,14 +1,14 @@ define [ 'backbone.marionette', - 'handlebars' + 'templates/quality-gates' ], ( Marionette, - Handlebars + Templates ) -> class QualityGateSidebarListItemView extends Marionette.ItemView tagName: 'li' - template: Handlebars.compile jQuery('#quality-gate-sidebar-list-item-template').html() + template: Templates['quality-gate-sidebar-list-item'] modelEvents: diff --git a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-view.coffee b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-view.coffee index 44269dbd3f1..43f92f74d27 100644 --- a/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-view.coffee +++ b/sonar-server/src/main/webapp/coffee/quality-gate/views/quality-gate-sidebar-list-view.coffee @@ -1,15 +1,11 @@ define [ 'backbone.marionette', - 'handlebars', - 'quality-gate/models/quality-gate', 'quality-gate/views/quality-gate-sidebar-list-item-view', 'quality-gate/views/quality-gate-sidebar-list-empty-view' ], ( Marionette, - Handlebars, - QualityGate, QualityGateSidebarListItemView, - QualityGateSidebarListEmptyView + QualityGateSidebarListEmptyView, ) -> class QualityGateSidebarListView extends Marionette.CollectionView diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/app.js b/sonar-server/src/main/webapp/javascripts/coding-rules/app.js deleted file mode 100644 index 30594f5515e..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/app.js +++ /dev/null @@ -1,299 +0,0 @@ -(function() { - requirejs.config({ - baseUrl: "" + baseUrl + "/javascripts", - paths: { - 'backbone': 'third-party/backbone', - 'backbone.marionette': 'third-party/backbone.marionette', - 'handlebars': 'third-party/handlebars', - 'jquery.mockjax': 'third-party/jquery.mockjax' - }, - shim: { - 'backbone.marionette': { - deps: ['backbone'], - exports: 'Marionette' - }, - 'backbone': { - exports: 'Backbone' - }, - 'handlebars': { - exports: 'Handlebars' - } - } - }); - - requirejs(['backbone', 'backbone.marionette', 'coding-rules/layout', 'coding-rules/router', 'coding-rules/views/header-view', 'coding-rules/views/actions-view', 'coding-rules/views/filter-bar-view', 'coding-rules/views/coding-rules-list-view', 'coding-rules/views/coding-rules-bulk-change-view', 'coding-rules/views/coding-rules-quality-profile-activation-view', 'navigator/filters/base-filters', 'navigator/filters/choice-filters', 'navigator/filters/string-filters', 'navigator/filters/date-filter-view', 'coding-rules/views/filters/quality-profile-filter-view', 'coding-rules/views/filters/inheritance-filter-view', 'coding-rules/mockjax'], function(Backbone, Marionette, CodingRulesLayout, CodingRulesRouter, CodingRulesHeaderView, CodingRulesActionsView, CodingRulesFilterBarView, CodingRulesListView, CodingRulesBulkChangeView, CodingRulesQualityProfileActivationView, BaseFilters, ChoiceFilters, StringFilterView, DateFilterView, QualityProfileFilterView, InheritanceFilterView) { - var App, appXHR; - jQuery.ajaxSetup({ - error: function(jqXHR) { - var errorBox, text, _ref; - text = jqXHR.responseText; - errorBox = jQuery('.modal-error'); - if (((_ref = jqXHR.responseJSON) != null ? _ref.errors : void 0) != null) { - text = _.pluck(jqXHR.responseJSON.errors, 'msg').join('. '); - } - if (errorBox.length > 0) { - return errorBox.show().text(text); - } else { - return alert(text); - } - } - }); - jQuery('html').addClass('navigator-page coding-rules-page'); - App = new Marionette.Application; - App.getQuery = function() { - return this.filterBarView.getQuery(); - }; - App.restoreSorting = function() {}; - App.storeQuery = function(query, sorting) { - var queryString; - if (sorting) { - _.extend(query, { - sort: sorting.sort, - asc: '' + sorting.asc - }); - } - queryString = _.map(query, function(v, k) { - return "" + k + "=" + (encodeURIComponent(v)); - }); - return this.router.navigate(queryString.join('|'), { - replace: true - }); - }; - App.fetchList = function(firstPage) { - var fetchQuery, query; - query = this.getQuery(); - fetchQuery = _.extend({ - pageIndex: this.pageIndex - }, query); - if (this.codingRules.sorting) { - _.extend(fetchQuery, { - sort: this.codingRules.sorting.sort, - asc: this.codingRules.sorting.asc - }); - } - this.storeQuery(query, this.codingRules.sorting); - this.layout.showSpinner('resultsRegion'); - return jQuery.ajax({ - url: "" + baseUrl + "/api/codingrules/search", - data: fetchQuery - }).done((function(_this) { - return function(r) { - if (firstPage) { - _this.codingRules.reset(r.codingrules); - } else { - _this.codingRules.add(r.codingrules); - } - _this.codingRules.paging = r.paging; - _this.codingRulesListView = new CodingRulesListView({ - app: _this, - collection: _this.codingRules - }); - _this.layout.resultsRegion.show(_this.codingRulesListView); - return _this.codingRulesListView.selectFirst(); - }; - })(this)); - }; - App.fetchFirstPage = function() { - this.pageIndex = 1; - return App.fetchList(true); - }; - App.fetchNextPage = function() { - if (this.pageIndex < this.codingRules.paging.pages) { - this.pageIndex++; - return App.fetchList(false); - } - }; - App.getActiveQualityProfile = function() { - var value; - value = this.activeInFilter.get('value'); - if ((value != null) && value.length === 1) { - return value[0]; - } else { - return null; - } - }; - App.getInactiveQualityProfile = function() { - var value; - value = this.inactiveInFilter.get('value'); - if ((value != null) && value.length === 1) { - return value[0]; - } else { - return null; - } - }; - App.addInitializer(function() { - this.layout = new CodingRulesLayout({ - app: this - }); - return jQuery('body').append(this.layout.render().el); - }); - App.addInitializer(function() { - this.codingRulesHeaderView = new CodingRulesHeaderView({ - app: this - }); - return this.layout.headerRegion.show(this.codingRulesHeaderView); - }); - App.addInitializer(function() { - this.codingRules = new Backbone.Collection; - return this.codingRules.sorting = { - sort: 'CREATION_DATE', - asc: false - }; - }); - App.addInitializer(function() { - this.codingRulesActionsView = new CodingRulesActionsView({ - app: this, - collection: this.codingRules - }); - return this.layout.actionsRegion.show(this.codingRulesActionsView); - }); - App.addInitializer(function() { - return this.codingRulesBulkChangeView = new CodingRulesBulkChangeView({ - app: this - }); - }); - App.addInitializer(function() { - return this.codingRulesQualityProfileActivationView = new CodingRulesQualityProfileActivationView({ - app: this - }); - }); - App.addInitializer(function() { - this.filters = new BaseFilters.Filters; - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.name'), - property: 'name', - type: StringFilterView - })); - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.language'), - property: 'languages', - type: ChoiceFilters.ChoiceFilterView, - choices: this.languages - })); - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.severity'), - property: 'severities', - type: ChoiceFilters.ChoiceFilterView, - choices: { - 'BLOCKER': t('severity.BLOCKER'), - 'CRITICAL': t('severity.CRITICAL'), - 'MAJOR': t('severity.MAJOR'), - 'MINOR': t('severity.MINOR'), - 'INFO': t('severity.INFO') - }, - choiceIcons: { - 'BLOCKER': 'severity-blocker', - 'CRITICAL': 'severity-critical', - 'MAJOR': 'severity-major', - 'MINOR': 'severity-minor', - 'INFO': 'severity-info' - } - })); - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.tag'), - property: 'tags', - type: ChoiceFilters.ChoiceFilterView, - choices: this.tags - })); - this.activeInFilter = new BaseFilters.Filter({ - name: t('coding_rules.filters.in_quality_profile'), - property: 'in_quality_profile', - type: QualityProfileFilterView, - multiple: false - }); - this.filters.add(this.activeInFilter); - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.key'), - property: 'key', - type: StringFilterView, - enabled: false, - optional: true - })); - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.description'), - property: 'description', - type: StringFilterView, - enabled: false, - optional: true - })); - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.repository'), - property: 'repositories', - type: ChoiceFilters.ChoiceFilterView, - enabled: false, - optional: true, - choices: this.repositories - })); - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.status'), - property: 'statuses', - type: ChoiceFilters.ChoiceFilterView, - enabled: false, - optional: true, - choices: this.statuses - })); - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.availableSince'), - property: 'availableSince', - type: DateFilterView, - enabled: false, - optional: true - })); - this.inactiveInFilter = new BaseFilters.Filter({ - name: t('coding_rules.filters.out_of_quality_profile'), - property: 'out_of_quality_profile', - type: QualityProfileFilterView, - multiple: false, - enabled: false, - optional: true - }); - this.filters.add(this.inactiveInFilter); - this.filters.add(new BaseFilters.Filter({ - name: t('coding_rules.filters.inheritance'), - property: 'inheritance', - type: InheritanceFilterView, - enabled: false, - optional: true, - multiple: false, - qualityProfileFilter: this.activeInFilter, - choices: { - 'any': t('coding_rules.filters.inheritance.any'), - 'not_inhertited': t('coding_rules.filters.inheritance.not_inherited'), - 'inhertited': t('coding_rules.filters.inheritance.inherited'), - 'overriden': t('coding_rules.filters.inheritance.overriden') - } - })); - this.filterBarView = new CodingRulesFilterBarView({ - app: this, - collection: this.filters, - extra: { - sort: '', - asc: false - } - }); - return this.layout.filtersRegion.show(this.filterBarView); - }); - App.addInitializer(function() { - this.router = new CodingRulesRouter({ - app: this - }); - return Backbone.history.start(); - }); - appXHR = jQuery.ajax({ - url: "" + baseUrl + "/api/codingrules/app" - }); - return jQuery.when(appXHR).done(function(r) { - App.appState = new Backbone.Model; - App.state = new Backbone.Model; - App.qualityProfiles = r.qualityprofiles; - App.languages = r.languages; - App.repositories = r.repositories; - App.statuses = r.statuses; - App.tags = r.tags; - window.messages = r.messages; - jQuery('#coding-rules-page-loader').remove(); - return App.start(); - }); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/layout.js b/sonar-server/src/main/webapp/javascripts/coding-rules/layout.js deleted file mode 100644 index b042d824ee9..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/layout.js +++ /dev/null @@ -1,41 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'common/handlebars-extensions'], function(Marionette) { - var AppLayout; - return AppLayout = (function(_super) { - __extends(AppLayout, _super); - - function AppLayout() { - return AppLayout.__super__.constructor.apply(this, arguments); - } - - AppLayout.prototype.className = 'navigator coding-rules-navigator'; - - AppLayout.prototype.template = getTemplate('#coding-rules-layout'); - - AppLayout.prototype.spinner = '<i class="spinner"></i>'; - - AppLayout.prototype.regions = { - headerRegion: '.navigator-header', - actionsRegion: '.navigator-actions', - resultsRegion: '.navigator-results', - detailsRegion: '.navigator-details', - filtersRegion: '.navigator-filters' - }; - - AppLayout.prototype.onRender = function() { - return this.$(this.detailsRegion.el).css('bottom', jQuery('#footer').outerHeight()); - }; - - AppLayout.prototype.showSpinner = function(region) { - return this.$(this[region].el).html(this.spinner); - }; - - return AppLayout; - - })(Marionette.Layout); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/mockjax.js b/sonar-server/src/main/webapp/javascripts/coding-rules/mockjax.js deleted file mode 100644 index a526a99d3a7..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/mockjax.js +++ /dev/null @@ -1,290 +0,0 @@ -(function() { - define(['jquery.mockjax'], function() { - jQuery.mockjaxSettings.contentType = 'text/json'; - jQuery.mockjaxSettings.responseTime = 250; - jQuery.mockjax({ - url: "" + baseUrl + "/api/codingrules/app", - responseText: JSON.stringify({ - qualityprofiles: [ - { - key: 'sonarway', - name: 'Sonar Way', - parent: null - }, { - key: 'qualityprofile1', - name: 'Quality Profile 1', - parent: 'sonarway' - }, { - key: 'qualityprofile2', - name: 'Quality Profile 2', - parent: 'sonarway' - }, { - key: 'qualityprofile3', - name: 'Quality Profile 3', - parent: null - } - ], - languages: { - java: 'Java', - javascript: 'JavaScript' - }, - repositories: { - 'checkstyle': 'Checkstyle', - 'common-java': 'Common SonarQube', - 'findbugs': 'FindBugs', - 'pmd': 'PMD', - 'pmd-unit-tests': 'PMD Unit Tests', - 'squid': 'SonarQube' - }, - statuses: { - 'BETA': 'Beta', - 'DEPRECATED': 'Deprecated', - 'READY': 'Ready' - }, - tags: { - 'brain-overload': 'brain-overload', - 'bug': 'bug', - 'comment': 'comment', - 'convention': 'convention', - 'error-handling': 'error-handling', - 'formatting': 'formatting', - 'java8': 'java8', - 'multithreading': 'multithreading', - 'naming': 'naming', - 'pitfall': 'pitfall', - 'security': 'security', - 'size': 'size', - 'unused': 'unused', - 'unused-code': 'unused-code' - }, - messages: { - 'all': 'All', - 'any': 'Any', - 'apply': 'Apply', - 'bulk_change': 'Bulk Change', - 'cancel': 'Cancel', - 'change': 'Change', - 'delete': 'Delete', - 'done': 'Done', - 'edit': 'Edit', - 'moreCriteria': '+ More Criteria', - 'search_verb': 'Search', - 'severity': 'Severity', - 'update': 'Update', - 'severity.BLOCKER': 'Blocker', - 'severity.CRITICAL': 'Critical', - 'severity.MAJOR': 'Major', - 'severity.MINOR': 'Minor', - 'severity.INFO': 'Info', - 'coding_rules.activate': 'Activate', - 'coding_rules.activate_quality_profile': 'Activate Quality Profile', - 'coding_rules.add_note': 'Add Note', - 'coding_rules.available_since': 'Available Since', - 'coding_rules.bulk_change': 'Bulk Change', - 'coding_rules.extend_description': 'Extend Description', - 'coding_rules.deactivate_quality_profile': 'Deactivate', - 'coding_rules.found': 'Found', - 'coding_rules.inherits': 'Inherits', - 'coding_rules.key': 'Key:', - 'coding_rules.new_search': 'New Search', - 'coding_rules.no_results': 'No Coding Rules', - 'coding_rules.order': 'Order', - 'coding_rules.ordered_by': 'Ordered By', - 'coding_rules.original': 'Original:', - 'coding_rules.page': 'Coding Rules', - 'coding_rules.parameters': 'Parameters', - 'coding_rules.parameters.default_value': 'Default Value:', - 'coding_rules.quality_profiles': 'Quality Profiles', - 'coding_rules.quality_profile': 'Quality Profile', - 'coding_rules.repository': 'Repository:', - 'coding_rules.revert_to_parent_definition': 'Revert to Parent Definition', - 'coding_rules._rules': 'rule(s)', - 'coding_rules.select_tag': 'Select Tag', - 'coding_rules.filters.availableSince': 'Available Since', - 'coding_rules.filters.description': 'Description', - 'coding_rules.filters.in_quality_profile': 'In Quality Profile', - 'coding_rules.filters.inheritance': 'Inheritance', - 'coding_rules.filters.inheritance.inactive': 'Inheritance criteria is available when an inherited quality profile is selected', - 'coding_rules.filters.inheritance.any': 'Any', - 'coding_rules.filters.inheritance.not_inherited': 'Not Inherited', - 'coding_rules.filters.inheritance.inherited': 'Inherited', - 'coding_rules.filters.inheritance.overriden': 'Overriden', - 'coding_rules.filters.key': 'Key', - 'coding_rules.filters.language': 'Language', - 'coding_rules.filters.name': 'Name', - 'coding_rules.filters.out_of_quality_profile': 'Out of Quality Profile', - 'coding_rules.filters.repository': 'Repository', - 'coding_rules.filters.severity': 'Severity', - 'coding_rules.filters.status': 'Status', - 'coding_rules.filters.tag': 'Tag', - 'coding_rules.sort.creation_date': 'Creation Date', - 'coding_rules.sort.name': 'Name' - } - }) - }); - jQuery.mockjax({ - url: "" + baseUrl + "/api/codingrules/search", - responseText: JSON.stringify({ - codingrules: [ - { - name: 'Array designators "[]" should be located after the type in method signatures', - language: 'Java', - severity: 'MAJOR', - status: 'DEPRECATED' - }, { - name: 'Avoid Array Loops', - language: 'Java', - severity: 'CRITICAL', - status: 'READY' - }, { - name: 'Bad practice - Abstract class defines covariant compareTo() method', - language: 'Java', - severity: 'MAJOR', - status: 'READY' - }, { - name: 'Correctness - Use of class without a hashCode() method in a hashed data structure', - language: 'Java', - severity: 'MINOR', - status: 'BETA' - }, { - name: 'Useless Operation On Immutable', - language: 'Java', - severity: 'MAJOR', - status: 'READY' - } - ], - paging: { - total: 5, - fTotal: '5' - } - }) - }); - jQuery.mockjax({ - url: "" + baseUrl + "/api/codingrules/show", - responseText: JSON.stringify({ - codingrule: { - name: 'Array designators "[]" should be located after the type in method signatures', - language: 'Java', - tags: ['bug', 'comment', 'java8'], - creationDate: '2013-10-15', - fCreationDate: 'Oct 15, 2013', - status: 'DEPRECATED', - repository: 'squid', - key: 'S1190', - parameters: [ - { - key: 'someParameter', - type: 'INT', - "default": 4, - description: 'Some parameter description' - }, { - key: 'boolParameter', - type: 'BOOL', - description: 'Bool parameter description' - } - ], - description: '<p>\nAccording to the Java Language Specification:\n</p>\n\n<pre>For compatibility with older versions of the Java SE platform,\nthe declaration of a method that returns an array is allowed to place (some or all of)\nthe empty bracket pairs that form the declaration of the array type after\nthe formal parameter list. This obsolescent syntax should not be used in new code.\n</pre>\n\n<p>The following code snippet illustrates this rule:</p>\n\n<pre>public int getVector()[] { /* ... */ } // Non-Compliant\n\npublic int[] getVector() { /* ... */ } // Compliant\n\npublic int[] getMatrix()[] { /* ... */ } // Non-Compliant\n\npublic int[][] getMatrix() { /* ... */ } // Compliant\n</pre>', - extra: '<p>This note is here <b>only for test purposes</b>.</p>', - extraRaw: 'This note is here *only for test purposes*.', - qualityProfiles: [ - { - name: 'SonarWay', - key: 'sonarway', - severity: 'MINOR', - canDeactivate: true, - canUpdate: true, - parameters: [ - { - key: 'someParameter', - value: 8 - } - ] - }, { - name: 'Quality Profile 1', - key: 'qualityprofile1', - severity: 'MAJOR', - canDeactivate: false, - canUpdate: false, - parameters: [ - { - key: 'someParameter', - value: 6 - } - ], - inherits: 'sonarway', - note: { - username: 'Admin Admin', - html: '<p>This note is here <b>only for test purposes</b>.</p>', - raw: 'This note is here *only for test purposes*.', - fCreationDate: 'less than a minute' - } - } - ] - } - }) - }); - jQuery.mockjax({ - url: "" + baseUrl + "/api/codingrules/extend_description", - responseText: JSON.stringify({ - extra: '<p>This note is here <i>only for test purposes</i>.</p>', - extraRaw: 'This note is here *only for test purposes*.' - }) - }); - jQuery.mockjax({ - url: "" + baseUrl + "/api/codingrules/bulk_change" - }); - jQuery.mockjax({ - url: "" + baseUrl + "/api/codingrules/set_tags" - }); - jQuery.mockjax({ - url: "" + baseUrl + "/api/codingrules/activate" - }); - jQuery.mockjax({ - url: "" + baseUrl + "/api/codingrules/note", - responseText: JSON.stringify({ - note: { - username: 'Admin Admin', - html: '<p>This note is here <b>only for test purposes</b>.</p>', - raw: 'This note is here *only for test purposes*.', - fCreationDate: 'less than a minute' - } - }) - }); - jQuery.mockjax({ - url: "" + baseUrl + "/api/qualityprofiles/list", - responseText: JSON.stringify({ - more: false, - results: [ - { - id: 'sonarway', - text: 'Sonar Way', - parent: null - }, { - id: 'qp1', - text: 'Quality Profile 1', - parent: 'sonarway' - }, { - id: 'qp2', - text: 'Quality Profile 2', - parent: 'sonarway' - }, { - id: 'qp3', - text: 'Quality Profile 3', - parent: null - } - ] - }) - }); - return jQuery.mockjax({ - url: "" + baseUrl + "/api/qualityprofiles/show", - responseText: JSON.stringify({ - qualityprofile: { - id: 'sonarway', - text: 'Sonar Way', - parent: null - } - }) - }); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/router.js b/sonar-server/src/main/webapp/javascripts/coding-rules/router.js deleted file mode 100644 index 91e750abdfe..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/router.js +++ /dev/null @@ -1,75 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone'], function(Backbone) { - var AppRouter; - return AppRouter = (function(_super) { - __extends(AppRouter, _super); - - function AppRouter() { - return AppRouter.__super__.constructor.apply(this, arguments); - } - - AppRouter.prototype.routes = { - '': 'index', - ':query': 'index' - }; - - AppRouter.prototype.initialize = function(options) { - return this.app = options.app; - }; - - AppRouter.prototype.parseQuery = function(query, separator) { - return (query || '').split(separator || '|').map(function(t) { - var tokens; - tokens = t.split('='); - return { - key: tokens[0], - value: decodeURIComponent(tokens[1]) - }; - }); - }; - - AppRouter.prototype.emptyQuery = function() { - return this.navigate('', { - trigger: true, - replace: true - }); - }; - - AppRouter.prototype.index = function(query) { - var f, idObj, params; - params = this.parseQuery(query); - idObj = _.findWhere(params, { - key: 'id' - }); - if (idObj) { - f = this.app.favoriteFilter; - this.app.canSave = false; - f.set('id', idObj.value); - return f.fetch({ - success: (function(_this) { - return function() { - params = _.extend({}, _this.parseQuery(f.get('query')), params); - return _this.loadResults(params); - }; - })(this) - }); - } else { - return this.loadResults(params); - } - }; - - AppRouter.prototype.loadResults = function(params) { - this.app.filterBarView.restoreFromQuery(params); - this.app.restoreSorting(params); - return this.app.fetchFirstPage(); - }; - - return AppRouter; - - })(Backbone.Router); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/actions-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/actions-view.js deleted file mode 100644 index ab8816875f4..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/actions-view.js +++ /dev/null @@ -1,83 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'common/handlebars-extensions'], function(Marionette) { - var CodingRulesStatusView; - return CodingRulesStatusView = (function(_super) { - __extends(CodingRulesStatusView, _super); - - function CodingRulesStatusView() { - return CodingRulesStatusView.__super__.constructor.apply(this, arguments); - } - - CodingRulesStatusView.prototype.template = getTemplate('#coding-rules-status-template'); - - CodingRulesStatusView.prototype.collectionEvents = { - 'all': 'render' - }; - - CodingRulesStatusView.prototype.ui = { - orderChoices: '.navigator-actions-order-choices' - }; - - CodingRulesStatusView.prototype.events = { - 'click .navigator-actions-order': 'toggleOrderChoices', - 'click @ui.orderChoices': 'sort', - 'click .navigator-actions-bulk': 'bulkChange' - }; - - CodingRulesStatusView.prototype.onRender = function() { - if (!this.collection.sorting.sortText) { - this.collection.sorting.sortText = this.$('[data-sort=' + this.collection.sorting.sort + ']:first').text(); - return this.render(); - } - }; - - CodingRulesStatusView.prototype.toggleOrderChoices = function(e) { - e.stopPropagation(); - this.ui.orderChoices.toggleClass('open'); - if (this.ui.orderChoices.is('.open')) { - return jQuery('body').on('click.coding_rules_actions', (function(_this) { - return function() { - return _this.ui.orderChoices.removeClass('open'); - }; - })(this)); - } - }; - - CodingRulesStatusView.prototype.sort = function(e) { - var asc, el, sort; - e.stopPropagation(); - this.ui.orderChoices.removeClass('open'); - jQuery('body').off('click.coding_rules_actions'); - el = jQuery(e.target); - sort = el.data('sort'); - asc = el.data('asc'); - if (sort !== null && asc !== null) { - this.collection.sorting = { - sort: sort, - sortText: el.text(), - asc: asc - }; - return this.options.app.fetchFirstPage(); - } - }; - - CodingRulesStatusView.prototype.bulkChange = function() { - return this.options.app.codingRulesBulkChangeView.show(); - }; - - CodingRulesStatusView.prototype.serializeData = function() { - return _.extend(CodingRulesStatusView.__super__.serializeData.apply(this, arguments), { - paging: this.collection.paging, - sorting: this.collection.sorting - }); - }; - - return CodingRulesStatusView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-bulk-change-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-bulk-change-view.js deleted file mode 100644 index 3667c047779..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-bulk-change-view.js +++ /dev/null @@ -1,157 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'common/handlebars-extensions'], function(Marionette) { - var CodingRulesBulkChangeView; - return CodingRulesBulkChangeView = (function(_super) { - __extends(CodingRulesBulkChangeView, _super); - - function CodingRulesBulkChangeView() { - return CodingRulesBulkChangeView.__super__.constructor.apply(this, arguments); - } - - CodingRulesBulkChangeView.prototype.className = 'modal'; - - CodingRulesBulkChangeView.prototype.template = getTemplate('#coding-rules-bulk-change-template'); - - CodingRulesBulkChangeView.prototype.events = { - 'submit form': 'onSubmit', - 'click #coding-rules-cancel-bulk-change': 'hide', - 'click label': 'enableAction', - 'change select': 'enableAction' - }; - - CodingRulesBulkChangeView.prototype.onRender = function() { - var format; - this.$el.dialog({ - dialogClass: 'no-close', - width: '600px', - draggable: false, - autoOpen: false, - modal: true, - minHeight: 50, - resizable: false, - title: null - }); - this.$('#coding-rules-bulk-change-activate-on, #coding-rules-bulk-change-deactivate-on').select2({ - width: '250px', - minimumResultsForSearch: 1 - }); - format = function(state) { - if (!state.id) { - return state.text; - } - return "<i class='icon-severity-" + (state.id.toLowerCase()) + "'></i> " + state.text; - }; - return this.$('#coding-rules-bulk-change-severity').select2({ - width: '250px', - minimumResultsForSearch: 999, - formatResult: format, - formatSelection: format, - escapeMarkup: function(m) { - return m; - } - }); - }; - - CodingRulesBulkChangeView.prototype.show = function() { - this.render(); - return this.$el.dialog('open'); - }; - - CodingRulesBulkChangeView.prototype.hide = function() { - return this.$el.dialog('close'); - }; - - CodingRulesBulkChangeView.prototype.prepareQuery = function() { - var actions, activateIn, deactivateIn, query, severity; - query = this.options.app.getQuery(); - activateIn = []; - deactivateIn = []; - severity = null; - if (this.$('#coding-rules-bulk-change-activate-qp').is(':checked')) { - activateIn.push(this.options.app.getInactiveQualityProfile()); - } - if (this.$('#coding-rules-bulk-change-activate').is(':checked')) { - activateIn.push(this.$('#coding-rules-bulk-change-activate-on').val()); - } - if (this.$('#coding-rules-bulk-change-deactivate-qp').is(':checked')) { - deactivateIn.push(this.options.app.getActiveQualityProfile()); - } - if (this.$('#coding-rules-bulk-change-deactivate').is(':checked')) { - deactivateIn.push(this.$('#coding-rules-bulk-change-deactivate-on').val()); - } - if (this.$('#coding-rules-bulk-change-set-severity').is(':checked')) { - severity = this.$('#coding-rules-bulk-change-severity').val(); - } - actions = []; - if (activateIn.length > 0) { - actions.push('bulk_activate'); - _.extend(query, { - bulk_activate_in: activateIn.join(',') - }); - } - if (deactivateIn.length > 0) { - actions.push('bulk_deactivate'); - _.extend(query, { - bulk_deactivate_in: deactivateIn.join(',') - }); - } - if (severity) { - actions.push('bulk_set_severity'); - _.extend(query, { - bulk_severity: severity - }); - } - return _.extend(query, { - bulk_actions: actions - }); - }; - - CodingRulesBulkChangeView.prototype.onSubmit = function(e) { - e.preventDefault(); - return jQuery.ajax({ - type: 'POST', - url: "" + baseUrl + "/api/codingrules/bulk_change", - data: this.prepareQuery() - }).done((function(_this) { - return function() { - _this.options.app.fetchFirstPage(); - return _this.hide(); - }; - })(this)); - }; - - CodingRulesBulkChangeView.prototype.enableAction = function(e) { - return jQuery(e.target).siblings('input[type=checkbox]').prop('checked', true); - }; - - CodingRulesBulkChangeView.prototype.serializeData = function() { - return { - paging: this.options.app.codingRules.paging, - qualityProfiles: this.options.app.qualityProfiles, - activeQualityProfile: this.options.app.getActiveQualityProfile(), - activeQualityProfileName: this.options.app.activeInFilter.view.renderValue(), - activateOnQualityProfiles: _.reject(this.options.app.qualityProfiles, (function(_this) { - return function(q) { - return q.key === _this.options.app.getInactiveQualityProfile(); - }; - })(this)), - inactiveQualityProfile: this.options.app.getInactiveQualityProfile(), - inactiveQualityProfileName: this.options.app.inactiveInFilter.view.renderValue(), - deactivateOnQualityProfiles: _.reject(this.options.app.qualityProfiles, (function(_this) { - return function(q) { - return q.key === _this.options.app.getActiveQualityProfile(); - }; - })(this)), - severities: ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'] - }; - }; - - return CodingRulesBulkChangeView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-quality-profile-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-quality-profile-view.js deleted file mode 100644 index 988feb8a876..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-quality-profile-view.js +++ /dev/null @@ -1,136 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'common/handlebars-extensions'], function(Marionette) { - var CodingRulesDetailQualityProfilesView; - return CodingRulesDetailQualityProfilesView = (function(_super) { - __extends(CodingRulesDetailQualityProfilesView, _super); - - function CodingRulesDetailQualityProfilesView() { - return CodingRulesDetailQualityProfilesView.__super__.constructor.apply(this, arguments); - } - - CodingRulesDetailQualityProfilesView.prototype.className = 'coding-rules-detail-quality-profile'; - - CodingRulesDetailQualityProfilesView.prototype.template = getTemplate('#coding-rules-detail-quality-profile-template'); - - CodingRulesDetailQualityProfilesView.prototype.ui = { - severitySelect: '.coding-rules-detail-quality-profile-severity', - note: '.coding-rules-detail-quality-profile-note', - noteForm: '.coding-rules-detail-quality-profile-note-form', - noteText: '.coding-rules-detail-quality-profile-note-text', - noteAdd: '.coding-rules-detail-quality-profile-note-add', - noteEdit: '.coding-rules-detail-quality-profile-note-edit', - noteDelete: '.coding-rules-detail-quality-profile-note-delete', - noteCancel: '.coding-rules-detail-quality-profile-note-cancel', - noteSubmit: '.coding-rules-detail-quality-profile-note-submit' - }; - - CodingRulesDetailQualityProfilesView.prototype.events = { - 'click @ui.noteAdd': 'editNote', - 'click @ui.noteEdit': 'editNote', - 'click @ui.noteDelete': 'deleteNote', - 'click @ui.noteCancel': 'cancelNote', - 'click @ui.noteSubmit': 'submitNote' - }; - - CodingRulesDetailQualityProfilesView.prototype.editNote = function() { - this.ui.note.hide(); - this.ui.noteForm.show(); - return this.ui.noteText.focus(); - }; - - CodingRulesDetailQualityProfilesView.prototype.deleteNote = function() { - this.ui.noteText.val(''); - return this.submitNote().done((function(_this) { - return function() { - _this.model.unset('note'); - return _this.render(); - }; - })(this)); - }; - - CodingRulesDetailQualityProfilesView.prototype.cancelNote = function() { - this.ui.note.show(); - return this.ui.noteForm.hide(); - }; - - CodingRulesDetailQualityProfilesView.prototype.submitNote = function() { - this.ui.note.html('<i class="spinner"></i>'); - this.ui.noteForm.html('<i class="spinner"></i>'); - return jQuery.ajax({ - type: 'POST', - url: "" + baseUrl + "/api/codingrules/note", - dataType: 'json', - data: { - text: this.ui.noteText.val() - } - }).done((function(_this) { - return function(r) { - _this.model.set('note', r.note); - return _this.render(); - }; - })(this)); - }; - - CodingRulesDetailQualityProfilesView.prototype.onRender = function() { - var format; - this.ui.noteForm.hide(); - format = function(state) { - if (!state.id) { - return state.text; - } - return "<i class='icon-severity-" + (state.id.toLowerCase()) + "'></i> " + state.text; - }; - this.ui.severitySelect.val(this.model.get('severity')); - return this.ui.severitySelect.select2({ - width: '200px', - minimumResultsForSearch: 999, - formatResult: format, - formatSelection: format, - escapeMarkup: function(m) { - return m; - } - }); - }; - - CodingRulesDetailQualityProfilesView.prototype.getParent = function() { - if (!this.model.get('inherits')) { - return null; - } - return this.options.qualityProfiles.findWhere({ - key: this.model.get('inherits') - }).toJSON(); - }; - - CodingRulesDetailQualityProfilesView.prototype.enhanceParameters = function() { - var parameters, parent; - parent = this.getParent(); - parameters = this.model.get('parameters'); - if (!parent) { - return parameters; - } - return parameters.map(function(p) { - return _.extend(p, { - original: _.findWhere(parent.parameters, { - key: p.key - }).value - }); - }); - }; - - CodingRulesDetailQualityProfilesView.prototype.serializeData = function() { - return _.extend(CodingRulesDetailQualityProfilesView.__super__.serializeData.apply(this, arguments), { - parent: this.getParent(), - parameters: this.enhanceParameters(), - severities: ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'] - }); - }; - - return CodingRulesDetailQualityProfilesView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-quality-profiles-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-quality-profiles-view.js deleted file mode 100644 index 7720c203d89..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-quality-profiles-view.js +++ /dev/null @@ -1,27 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'coding-rules/views/coding-rules-detail-quality-profile-view'], function(Marionette, CodingRulesDetailQualityProfileView) { - var CodingRulesDetailQualityProfilesView; - return CodingRulesDetailQualityProfilesView = (function(_super) { - __extends(CodingRulesDetailQualityProfilesView, _super); - - function CodingRulesDetailQualityProfilesView() { - return CodingRulesDetailQualityProfilesView.__super__.constructor.apply(this, arguments); - } - - CodingRulesDetailQualityProfilesView.prototype.itemView = CodingRulesDetailQualityProfileView; - - CodingRulesDetailQualityProfilesView.prototype.itemViewOptions = function() { - return { - qualityProfiles: this.collection - }; - }; - - return CodingRulesDetailQualityProfilesView; - - })(Marionette.CollectionView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-view.js deleted file mode 100644 index 2183f1a7004..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-view.js +++ /dev/null @@ -1,131 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone', 'backbone.marionette', 'coding-rules/views/coding-rules-detail-quality-profiles-view', 'common/handlebars-extensions'], function(Backbone, Marionette, CodingRulesDetailQualityProfilesView) { - var CodingRulesDetailView; - return CodingRulesDetailView = (function(_super) { - __extends(CodingRulesDetailView, _super); - - function CodingRulesDetailView() { - return CodingRulesDetailView.__super__.constructor.apply(this, arguments); - } - - CodingRulesDetailView.prototype.template = getTemplate('#coding-rules-detail-template'); - - CodingRulesDetailView.prototype.regions = { - qualityProfilesRegion: '#coding-rules-detail-quality-profiles' - }; - - CodingRulesDetailView.prototype.ui = { - tagsChange: '.coding-rules-detail-tags-change', - tagInput: '.coding-rules-detail-tag-input', - tagsEdit: '.coding-rules-detail-tag-edit', - tagsEditDone: '.coding-rules-detail-tag-edit-done', - tagsList: '.coding-rules-detail-tag-list', - descriptionExtra: '#coding-rules-detail-description-extra', - extendDescriptionLink: '#coding-rules-detail-extend-description', - extendDescriptionForm: '#coding-rules-detail-extend-description-form', - extendDescriptionSubmit: '#coding-rules-detail-extend-description-submit', - extendDescriptionText: '#coding-rules-detail-extend-description-text', - extendDescriptionSpinner: '#coding-rules-detail-extend-description-spinner', - cancelExtendDescription: '#coding-rules-detail-extend-description-cancel', - qualityProfileActivate: '#coding-rules-quality-profile-activate' - }; - - CodingRulesDetailView.prototype.events = { - 'click @ui.tagsChange': 'changeTags', - 'click @ui.tagsEditDone': 'editDone', - 'click @ui.extendDescriptionLink': 'showExtendDescriptionForm', - 'click @ui.cancelExtendDescription': 'hideExtendDescriptionForm', - 'click @ui.extendDescriptionSubmit': 'submitExtendDescription', - 'click @ui.qualityProfileActivate': 'activateQualityProfile' - }; - - CodingRulesDetailView.prototype.initialize = function(options) { - return this.qualityProfilesView = new CodingRulesDetailQualityProfilesView({ - collection: new Backbone.Collection(options.model.get('qualityProfiles')) - }); - }; - - CodingRulesDetailView.prototype.onRender = function() { - var qp; - this.qualityProfilesRegion.show(this.qualityProfilesView); - this.ui.tagInput.select2({ - tags: _.difference(this.options.app.tags, this.model.get('tags')), - width: '500px' - }); - this.ui.tagsEdit.hide(); - this.ui.extendDescriptionForm.hide(); - this.ui.extendDescriptionSpinner.hide(); - qp = this.options.app.getActiveQualityProfile(); - if (qp != null) { - return this.$('.coding-rules-detail-quality-profile').first().addClass('active'); - } - }; - - CodingRulesDetailView.prototype.changeTags = function() { - this.ui.tagsEdit.show(); - return this.ui.tagsList.hide(); - }; - - CodingRulesDetailView.prototype.editDone = function() { - var tags; - this.ui.tagsEdit.html('<i class="spinner"></i>'); - tags = this.ui.tagInput.val(); - return jQuery.ajax({ - type: 'POST', - url: "" + baseUrl + "/api/codingrules/set_tags", - data: { - tags: tags - } - }).done((function(_this) { - return function() { - _this.model.set('tags', tags.split(',')); - return _this.render(); - }; - })(this)); - }; - - CodingRulesDetailView.prototype.showExtendDescriptionForm = function() { - this.ui.descriptionExtra.hide(); - return this.ui.extendDescriptionForm.show(); - }; - - CodingRulesDetailView.prototype.hideExtendDescriptionForm = function() { - this.ui.descriptionExtra.show(); - return this.ui.extendDescriptionForm.hide(); - }; - - CodingRulesDetailView.prototype.submitExtendDescription = function() { - this.ui.extendDescriptionForm.hide(); - this.ui.extendDescriptionSpinner.show(); - return jQuery.ajax({ - type: 'POST', - url: "" + baseUrl + "/api/codingrules/extend_description", - dataType: 'json', - data: { - text: this.ui.extendDescriptionText.val() - } - }).done((function(_this) { - return function(r) { - _this.model.set({ - extra: r.extra, - extraRaw: r.extraRaw - }); - return _this.render(); - }; - })(this)); - }; - - CodingRulesDetailView.prototype.activateQualityProfile = function() { - this.options.app.codingRulesQualityProfileActivationView.model = this.model; - return this.options.app.codingRulesQualityProfileActivationView.show(); - }; - - return CodingRulesDetailView; - - })(Marionette.Layout); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-empty-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-empty-view.js deleted file mode 100644 index d92e95c02a7..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-empty-view.js +++ /dev/null @@ -1,25 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'common/handlebars-extensions'], function(Marionette) { - var CodingRulesListEmptyView; - return CodingRulesListEmptyView = (function(_super) { - __extends(CodingRulesListEmptyView, _super); - - function CodingRulesListEmptyView() { - return CodingRulesListEmptyView.__super__.constructor.apply(this, arguments); - } - - CodingRulesListEmptyView.prototype.tagName = 'li'; - - CodingRulesListEmptyView.prototype.className = 'navigator-results-no-results'; - - CodingRulesListEmptyView.prototype.template = getTemplate('#coding-rules-list-empty-template'); - - return CodingRulesListEmptyView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-item-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-item-view.js deleted file mode 100644 index 020835df080..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-item-view.js +++ /dev/null @@ -1,57 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'coding-rules/views/coding-rules-detail-view', 'common/handlebars-extensions'], function(Marionette, CodingRulesDetailView) { - var CodingRulesListItemView; - return CodingRulesListItemView = (function(_super) { - __extends(CodingRulesListItemView, _super); - - function CodingRulesListItemView() { - return CodingRulesListItemView.__super__.constructor.apply(this, arguments); - } - - CodingRulesListItemView.prototype.tagName = 'li'; - - CodingRulesListItemView.prototype.template = getTemplate('#coding-rules-list-item-template'); - - CodingRulesListItemView.prototype.activeClass = 'active'; - - CodingRulesListItemView.prototype.events = function() { - return { - 'click': 'showDetail' - }; - }; - - CodingRulesListItemView.prototype.showDetail = function() { - this.$el.siblings().removeClass(this.activeClass); - this.$el.addClass(this.activeClass); - this.options.app.layout.showSpinner('detailsRegion'); - return jQuery.ajax({ - url: "" + baseUrl + "/api/codingrules/show" - }).done((function(_this) { - return function(r) { - var detailView; - _this.model.set(r.codingrule); - detailView = new CodingRulesDetailView({ - app: _this.options.app, - model: _this.model - }); - return _this.options.app.layout.detailsRegion.show(detailView); - }; - })(this)); - }; - - CodingRulesListItemView.prototype.serializeData = function() { - return _.extend(CodingRulesListItemView.__super__.serializeData.apply(this, arguments), { - qualityProfile: this.options.app.getActiveQualityProfile(), - qualityProfileName: this.options.app.activeInFilter.view.renderValue() - }); - }; - - return CodingRulesListItemView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-view.js deleted file mode 100644 index 248d2124a5e..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-view.js +++ /dev/null @@ -1,38 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'coding-rules/views/coding-rules-list-item-view', 'coding-rules/views/coding-rules-list-empty-view'], function(Marionette, CodingRulesListItemView, CodingRulesListEmptyView) { - var CodingRulesListView; - return CodingRulesListView = (function(_super) { - __extends(CodingRulesListView, _super); - - function CodingRulesListView() { - return CodingRulesListView.__super__.constructor.apply(this, arguments); - } - - CodingRulesListView.prototype.tagName = 'ol'; - - CodingRulesListView.prototype.className = 'navigator-results-list'; - - CodingRulesListView.prototype.itemView = CodingRulesListItemView; - - CodingRulesListView.prototype.emptyView = CodingRulesListEmptyView; - - CodingRulesListView.prototype.itemViewOptions = function() { - return { - listView: this, - app: this.options.app - }; - }; - - CodingRulesListView.prototype.selectFirst = function() { - return this.$el.find('*:first').click(); - }; - - return CodingRulesListView; - - })(Marionette.CollectionView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/filter-bar-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/filter-bar-view.js deleted file mode 100644 index 2f77ecc7430..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/filter-bar-view.js +++ /dev/null @@ -1,100 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['navigator/filters/filter-bar', 'navigator/filters/base-filters', 'navigator/filters/favorite-filters', 'navigator/filters/more-criteria-filters'], function(FilterBarView, BaseFilters, FavoriteFiltersModule, MoreCriteriaFilters) { - var CodingRulesFilterBarView; - return CodingRulesFilterBarView = (function(_super) { - __extends(CodingRulesFilterBarView, _super); - - function CodingRulesFilterBarView() { - return CodingRulesFilterBarView.__super__.constructor.apply(this, arguments); - } - - CodingRulesFilterBarView.prototype.collectionEvents = { - 'change:enabled': 'changeEnabled' - }; - - CodingRulesFilterBarView.prototype.events = { - 'click .navigator-filter-submit': 'search' - }; - - CodingRulesFilterBarView.prototype.getQuery = function() { - var query; - query = {}; - this.collection.each(function(filter) { - return _.extend(query, filter.view.formatValue()); - }); - return query; - }; - - CodingRulesFilterBarView.prototype.onAfterItemAdded = function(itemView) { - if (itemView.model.get('type') === FavoriteFiltersModule.FavoriteFilterView) { - return jQuery('.navigator-header').addClass('navigator-header-favorite'); - } - }; - - CodingRulesFilterBarView.prototype.addMoreCriteriaFilter = function() { - var disabledFilters; - disabledFilters = this.collection.where({ - enabled: false - }); - if (disabledFilters.length > 0) { - this.moreCriteriaFilter = new BaseFilters.Filter({ - type: MoreCriteriaFilters.MoreCriteriaFilterView, - enabled: true, - optional: false, - filters: disabledFilters - }); - return this.collection.add(this.moreCriteriaFilter); - } - }; - - CodingRulesFilterBarView.prototype.changeEnabled = function() { - var disabledFilters; - if (this.moreCriteriaFilter != null) { - disabledFilters = _.reject(this.collection.where({ - enabled: false - }), function(filter) { - return filter.get('type') === MoreCriteriaFilters.MoreCriteriaFilterView; - }); - if (disabledFilters.length === 0) { - this.moreCriteriaFilter.set({ - enabled: false - }, { - silent: true - }); - } else { - this.moreCriteriaFilter.set({ - enabled: true - }, { - silent: true - }); - } - this.moreCriteriaFilter.set({ - filters: disabledFilters - }, { - silent: true - }); - return this.moreCriteriaFilter.trigger('change:filters'); - } - }; - - CodingRulesFilterBarView.prototype.search = function() { - this.options.app.state.set({ - query: this.options.app.getQuery(), - search: true - }); - return this.options.app.fetchFirstPage(); - }; - - CodingRulesFilterBarView.prototype.fetchNextPage = function() { - return this.options.app.fetchNextPage(); - }; - - return CodingRulesFilterBarView; - - })(FilterBarView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/filters/inheritance-filter-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/filters/inheritance-filter-view.js deleted file mode 100644 index 47c0d653136..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/filters/inheritance-filter-view.js +++ /dev/null @@ -1,81 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['navigator/filters/choice-filters'], function(ChoiceFilters) { - var InheritanceFilterView; - return InheritanceFilterView = (function(_super) { - __extends(InheritanceFilterView, _super); - - function InheritanceFilterView() { - return InheritanceFilterView.__super__.constructor.apply(this, arguments); - } - - InheritanceFilterView.prototype.initialize = function() { - InheritanceFilterView.__super__.initialize.apply(this, arguments); - this.qualityProfileFilter = this.model.get('qualityProfileFilter'); - this.listenTo(this.qualityProfileFilter, 'change:value', this.onChangeQualityProfile); - return this.onChangeQualityProfile(); - }; - - InheritanceFilterView.prototype.onChangeQualityProfile = function() { - var parentQualityProfile, qualityProfile; - qualityProfile = this.qualityProfileFilter.get('value'); - parentQualityProfile = this.qualityProfileFilter.get('parentQualityProfile'); - if (_.isArray(qualityProfile) && qualityProfile.length === 1 && parentQualityProfile) { - return this.makeActive(); - } else { - return this.makeInactive(); - } - }; - - InheritanceFilterView.prototype.makeActive = function() { - this.model.set({ - inactive: false, - title: '' - }); - this.model.trigger('change:enabled'); - return this.$el.removeClass('navigator-filter-inactive').prop('title', ''); - }; - - InheritanceFilterView.prototype.makeInactive = function() { - this.model.set({ - inactive: true, - title: t('coding_rules.filters.inheritance.inactive') - }); - this.model.trigger('change:enabled'); - this.choices.each(function(model) { - return model.set('checked', false); - }); - this.detailsView.updateLists(); - this.detailsView.updateValue(); - return this.$el.addClass('navigator-filter-inactive').prop('title', t('coding_rules.filters.inheritance.inactive')); - }; - - InheritanceFilterView.prototype.showDetails = function() { - if (!this.$el.is('.navigator-filter-inactive')) { - return InheritanceFilterView.__super__.showDetails.apply(this, arguments); - } - }; - - InheritanceFilterView.prototype.restore = function(value) { - if (_.isString(value)) { - value = value.split(','); - } - if (this.choices && value.length > 0) { - this.model.set({ - value: value, - enabled: true - }); - return this.onChangeQualityProfile; - } else { - return this.clear(); - } - }; - - return InheritanceFilterView; - - })(ChoiceFilters.ChoiceFilterView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/filters/quality-profile-filter-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/filters/quality-profile-filter-view.js deleted file mode 100644 index 51255bfded2..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/filters/quality-profile-filter-view.js +++ /dev/null @@ -1,68 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['navigator/filters/ajax-select-filters'], function(AjaxSelectFilters) { - var QualityProfileFilterView, QualityProfileSuggestions; - QualityProfileSuggestions = (function(_super) { - __extends(QualityProfileSuggestions, _super); - - function QualityProfileSuggestions() { - return QualityProfileSuggestions.__super__.constructor.apply(this, arguments); - } - - QualityProfileSuggestions.prototype.url = function() { - return "" + baseUrl + "/api/qualityprofiles/list"; - }; - - return QualityProfileSuggestions; - - })(AjaxSelectFilters.Suggestions); - return QualityProfileFilterView = (function(_super) { - __extends(QualityProfileFilterView, _super); - - function QualityProfileFilterView() { - return QualityProfileFilterView.__super__.constructor.apply(this, arguments); - } - - QualityProfileFilterView.prototype.initialize = function() { - QualityProfileFilterView.__super__.initialize.apply(this, arguments); - this.choices = new QualityProfileSuggestions; - return this.listenTo(this.model, 'change:value', this.updateParentQualityProfile); - }; - - QualityProfileFilterView.prototype.updateParentQualityProfile = function() { - var selected; - selected = this.getSelected(); - if (selected.length === 1) { - return this.model.set('parentQualityProfile', selected[0].get('parent')); - } else { - return this.model.unset('parentQualityProfile'); - } - }; - - QualityProfileFilterView.prototype.createRequest = function(v) { - return jQuery.ajax({ - url: baseUrl + '/api/qualityprofiles/show', - type: 'GET', - data: { - key: v - } - }).done((function(_this) { - return function(r) { - return _this.choices.add(new Backbone.Model({ - id: r.qualityprofile.id, - text: r.qualityprofile.text, - parent: r.qualityprofile.parent, - checked: true - })); - }; - })(this)); - }; - - return QualityProfileFilterView; - - })(AjaxSelectFilters.AjaxSelectFilterView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/header-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/header-view.js deleted file mode 100644 index a5b1c4dd3e1..00000000000 --- a/sonar-server/src/main/webapp/javascripts/coding-rules/views/header-view.js +++ /dev/null @@ -1,31 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'common/handlebars-extensions'], function(Marionette) { - var CodingRulesHeaderView; - return CodingRulesHeaderView = (function(_super) { - __extends(CodingRulesHeaderView, _super); - - function CodingRulesHeaderView() { - return CodingRulesHeaderView.__super__.constructor.apply(this, arguments); - } - - CodingRulesHeaderView.prototype.template = getTemplate('#coding-rules-header-template'); - - CodingRulesHeaderView.prototype.events = { - 'click #coding-rules-new-search': 'newSearch' - }; - - CodingRulesHeaderView.prototype.newSearch = function() { - return this.options.app.router.navigate('', { - trigger: true - }); - }; - - return CodingRulesHeaderView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/app.js b/sonar-server/src/main/webapp/javascripts/quality-gate/app.js deleted file mode 100644 index 8b1ede8433d..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/app.js +++ /dev/null @@ -1,127 +0,0 @@ -(function() { - requirejs.config({ - baseUrl: "" + baseUrl + "/javascripts", - paths: { - 'jquery': 'third-party/jquery', - 'backbone': 'third-party/backbone', - 'backbone.marionette': 'third-party/backbone.marionette', - 'handlebars': 'third-party/handlebars', - 'moment': 'third-party/moment', - 'select-list': 'common/select-list' - }, - shim: { - 'backbone.marionette': { - deps: ['backbone'], - exports: 'Marionette' - }, - 'backbone': { - exports: 'Backbone' - }, - 'handlebars': { - exports: 'Handlebars' - }, - 'moment': { - exports: 'moment' - }, - 'select-list': { - exports: 'SelectList' - } - } - }); - - requirejs(['backbone', 'backbone.marionette', 'handlebars', 'quality-gate/collections/quality-gates', 'quality-gate/views/quality-gate-sidebar-list-view', 'quality-gate/views/quality-gate-actions-view', 'quality-gate/views/quality-gate-edit-view', 'quality-gate/router', 'quality-gate/layout', 'common/handlebars-extensions'], function(Backbone, Marionette, Handlebars, QualityGates, QualityGateSidebarListItemView, QualityGateActionsView, QualityGateEditView, QualityGateRouter, QualityGateLayout) { - var App, appXHR, qualityGatesXHR; - jQuery.ajaxSetup({ - error: function(jqXHR) { - var errorBox, text, _ref; - text = jqXHR.responseText; - errorBox = jQuery('.modal-error'); - if (((_ref = jqXHR.responseJSON) != null ? _ref.errors : void 0) != null) { - text = _.pluck(jqXHR.responseJSON.errors, 'msg').join('. '); - } - if (errorBox.length > 0) { - return errorBox.show().text(text); - } else { - return alert(text); - } - } - }); - jQuery('html').addClass('navigator-page quality-gates-page'); - App = new Marionette.Application; - App.qualityGates = new QualityGates; - App.openFirstQualityGate = function() { - if (this.qualityGates.length > 0) { - return this.router.navigate("show/" + (this.qualityGates.models[0].get('id')), { - trigger: true - }); - } else { - return App.layout.detailsRegion.reset(); - } - }; - App.deleteQualityGate = function(id) { - App.qualityGates.remove(id); - return App.openFirstQualityGate(); - }; - App.unsetDefaults = function(id) { - return App.qualityGates.each(function(gate) { - if (gate.id !== id) { - return gate.set('default', false); - } - }); - }; - App.addInitializer(function() { - this.layout = new QualityGateLayout({ - app: this - }); - return jQuery('body').append(this.layout.render().el); - }); - App.addInitializer(function() { - this.codingRulesHeaderView = new QualityGateActionsView({ - app: this - }); - return this.layout.actionsRegion.show(this.codingRulesHeaderView); - }); - App.addInitializer(function() { - this.qualityGateSidebarListView = new QualityGateSidebarListItemView({ - collection: this.qualityGates, - app: this - }); - return this.layout.resultsRegion.show(this.qualityGateSidebarListView); - }); - App.addInitializer(function() { - this.qualityGateEditView = new QualityGateEditView({ - app: this - }); - return this.qualityGateEditView.render(); - }); - App.addInitializer(function() { - this.router = new QualityGateRouter({ - app: this - }); - return Backbone.history.start(); - }); - App.addInitializer(function() { - var initial; - initial = Backbone.history.fragment === ''; - if (initial) { - return App.openFirstQualityGate(); - } - }); - appXHR = jQuery.ajax({ - url: "" + baseUrl + "/api/qualitygates/app" - }).done((function(_this) { - return function(r) { - App.canEdit = r.edit; - App.periods = r.periods; - App.metrics = r.metrics; - return window.messages = r.messages; - }; - })(this)); - qualityGatesXHR = App.qualityGates.fetch(); - return jQuery.when(qualityGatesXHR, appXHR).done(function() { - jQuery('#quality-gate-page-loader').remove(); - return App.start(); - }); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/collections/conditions.js b/sonar-server/src/main/webapp/javascripts/quality-gate/collections/conditions.js deleted file mode 100644 index 0643c625032..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/collections/conditions.js +++ /dev/null @@ -1,21 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone', 'quality-gate/models/condition'], function(Backbone, Condition) { - var Conditions; - return Conditions = (function(_super) { - __extends(Conditions, _super); - - function Conditions() { - return Conditions.__super__.constructor.apply(this, arguments); - } - - Conditions.prototype.model = Condition; - - return Conditions; - - })(Backbone.Collection); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/collections/quality-gates.js b/sonar-server/src/main/webapp/javascripts/quality-gate/collections/quality-gates.js deleted file mode 100644 index 6167539697e..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/collections/quality-gates.js +++ /dev/null @@ -1,33 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone', 'quality-gate/models/quality-gate'], function(Backbone, QualityGate) { - var QualityGates; - return QualityGates = (function(_super) { - __extends(QualityGates, _super); - - function QualityGates() { - return QualityGates.__super__.constructor.apply(this, arguments); - } - - QualityGates.prototype.model = QualityGate; - - QualityGates.prototype.url = function() { - return "" + baseUrl + "/api/qualitygates/list"; - }; - - QualityGates.prototype.parse = function(r) { - return r.qualitygates.map(function(gate) { - return _.extend(gate, { - "default": gate.id === r["default"] - }); - }); - }; - - return QualityGates; - - })(Backbone.Collection); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/layout.js b/sonar-server/src/main/webapp/javascripts/quality-gate/layout.js deleted file mode 100644 index 1f1e946e049..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/layout.js +++ /dev/null @@ -1,46 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'common/handlebars-extensions'], function(Marionette) { - var AppLayout; - return AppLayout = (function(_super) { - __extends(AppLayout, _super); - - function AppLayout() { - return AppLayout.__super__.constructor.apply(this, arguments); - } - - AppLayout.prototype.className = 'navigator quality-gates-navigator'; - - AppLayout.prototype.template = getTemplate('#quality-gates-layout'); - - AppLayout.prototype.regions = { - headerRegion: '.navigator-header', - actionsRegion: '.navigator-actions', - resultsRegion: '.navigator-results', - detailsRegion: '.navigator-details' - }; - - AppLayout.prototype.initialize = function(options) { - return this.listenTo(options.app.qualityGates, 'all', this.updateLayout); - }; - - AppLayout.prototype.updateLayout = function() { - var empty; - empty = this.options.app.qualityGates.length === 0; - this.$(this.headerRegion.el).toggle(!empty); - return this.$(this.detailsRegion.el).toggle(!empty); - }; - - AppLayout.prototype.onRender = function() { - this.updateLayout(); - return this.$(this.detailsRegion.el).css('bottom', jQuery('#footer').outerHeight()); - }; - - return AppLayout; - - })(Marionette.Layout); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/models/condition.js b/sonar-server/src/main/webapp/javascripts/quality-gate/models/condition.js deleted file mode 100644 index 0686fedacbf..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/models/condition.js +++ /dev/null @@ -1,61 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone'], function(Backbone) { - var Condition; - return Condition = (function(_super) { - __extends(Condition, _super); - - function Condition() { - return Condition.__super__.constructor.apply(this, arguments); - } - - Condition.prototype.url = function() { - return "" + baseUrl + "/api/qualitygates/create_condition"; - }; - - Condition.prototype.save = function() { - var data, method; - method = !this.isNew() ? 'update' : 'create'; - data = { - metric: this.get('metric').key, - op: this.get('op'), - warning: this.get('warning'), - error: this.get('error') - }; - if (this.get('period') !== '0') { - data.period = this.get('period'); - } - if (!this.isNew()) { - data.id = this.id; - } else { - data.gateId = this.get('gateId'); - } - return jQuery.ajax({ - url: "" + baseUrl + "/api/qualitygates/" + method + "_condition", - type: 'POST', - data: data - }).done((function(_this) { - return function(r) { - return _this.set('id', r.id); - }; - })(this)); - }; - - Condition.prototype["delete"] = function() { - return jQuery.ajax({ - url: "" + baseUrl + "/api/qualitygates/delete_condition", - type: 'POST', - data: { - id: this.id - } - }); - }; - - return Condition; - - })(Backbone.Model); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/models/quality-gate.js b/sonar-server/src/main/webapp/javascripts/quality-gate/models/quality-gate.js deleted file mode 100644 index 921b1314422..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/models/quality-gate.js +++ /dev/null @@ -1,23 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone'], function(Backbone) { - var QualityGate; - return QualityGate = (function(_super) { - __extends(QualityGate, _super); - - function QualityGate() { - return QualityGate.__super__.constructor.apply(this, arguments); - } - - QualityGate.prototype.url = function() { - return "" + baseUrl + "/api/qualitygates/show?id=" + (this.get('id')); - }; - - return QualityGate; - - })(Backbone.Model); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/router.js b/sonar-server/src/main/webapp/javascripts/quality-gate/router.js deleted file mode 100644 index b86680b330a..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/router.js +++ /dev/null @@ -1,51 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone', 'quality-gate/models/quality-gate', 'quality-gate/views/quality-gate-detail-view', 'quality-gate/views/quality-gate-detail-header-view'], function(Backbone, QualityGate, QualityGateDetailView, QualityGateDetailHeaderView) { - var QualityGateRouter; - return QualityGateRouter = (function(_super) { - __extends(QualityGateRouter, _super); - - function QualityGateRouter() { - return QualityGateRouter.__super__.constructor.apply(this, arguments); - } - - QualityGateRouter.prototype.routes = { - 'show/:id': 'show' - }; - - QualityGateRouter.prototype.initialize = function(options) { - return this.app = options.app; - }; - - QualityGateRouter.prototype.show = function(id) { - var qualityGate, qualityGateDetailHeaderView, qualityGateDetailView; - qualityGate = this.app.qualityGates.get(id); - if (qualityGate) { - this.app.qualityGateSidebarListView.highlight(id); - qualityGateDetailHeaderView = new QualityGateDetailHeaderView({ - app: this.app, - model: qualityGate - }); - this.app.layout.headerRegion.show(qualityGateDetailHeaderView); - qualityGateDetailView = new QualityGateDetailView({ - app: this.app, - model: qualityGate - }); - this.app.layout.detailsRegion.show(qualityGateDetailView); - qualityGateDetailView.$el.hide(); - qualityGateDetailHeaderView.showSpinner(); - return qualityGate.fetch().done(function() { - qualityGateDetailView.$el.show(); - return qualityGateDetailHeaderView.hideSpinner(); - }); - } - }; - - return QualityGateRouter; - - })(Backbone.Router); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-actions-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-actions-view.js deleted file mode 100644 index 06993b01c5e..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-actions-view.js +++ /dev/null @@ -1,39 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars', 'quality-gate/models/quality-gate'], function(Marionette, Handlebars, QualityGate) { - var QualityGateActionsView; - return QualityGateActionsView = (function(_super) { - __extends(QualityGateActionsView, _super); - - function QualityGateActionsView() { - return QualityGateActionsView.__super__.constructor.apply(this, arguments); - } - - QualityGateActionsView.prototype.template = Handlebars.compile(jQuery('#quality-gate-actions-template').html()); - - QualityGateActionsView.prototype.events = { - 'click #quality-gate-add': 'add' - }; - - QualityGateActionsView.prototype.add = function() { - var qualityGate; - qualityGate = new QualityGate(); - this.options.app.qualityGateEditView.method = 'create'; - this.options.app.qualityGateEditView.model = qualityGate; - return this.options.app.qualityGateEditView.show(); - }; - - QualityGateActionsView.prototype.serializeData = function() { - return _.extend(QualityGateActionsView.__super__.serializeData.apply(this, arguments), { - canEdit: this.options.app.canEdit - }); - }; - - return QualityGateActionsView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-conditions-empty-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-conditions-empty-view.js deleted file mode 100644 index 4942957f1be..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-conditions-empty-view.js +++ /dev/null @@ -1,23 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars'], function(Marionette, Handlebars) { - var QualityGateDetailConditionsView; - return QualityGateDetailConditionsView = (function(_super) { - __extends(QualityGateDetailConditionsView, _super); - - function QualityGateDetailConditionsView() { - return QualityGateDetailConditionsView.__super__.constructor.apply(this, arguments); - } - - QualityGateDetailConditionsView.prototype.tagName = 'tr'; - - QualityGateDetailConditionsView.prototype.template = Handlebars.compile(jQuery('#quality-gate-detail-conditions-empty-template').html()); - - return QualityGateDetailConditionsView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-conditions-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-conditions-view.js deleted file mode 100644 index 1fdcbbdd769..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-conditions-view.js +++ /dev/null @@ -1,115 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars', 'quality-gate/models/condition', 'quality-gate/views/quality-gate-detail-condition-view', 'quality-gate/views/quality-gate-detail-conditions-empty-view'], function(Marionette, Handlebars, Condition, QualityGateDetailConditionView, QualityGateDetailConditionsEmptyView) { - var QualityGateDetailConditionsView; - return QualityGateDetailConditionsView = (function(_super) { - __extends(QualityGateDetailConditionsView, _super); - - function QualityGateDetailConditionsView() { - return QualityGateDetailConditionsView.__super__.constructor.apply(this, arguments); - } - - QualityGateDetailConditionsView.prototype.template = Handlebars.compile(jQuery('#quality-gate-detail-conditions-template').html()); - - QualityGateDetailConditionsView.prototype.itemView = QualityGateDetailConditionView; - - QualityGateDetailConditionsView.prototype.emptyView = QualityGateDetailConditionsEmptyView; - - QualityGateDetailConditionsView.prototype.itemViewContainer = '.quality-gate-conditions tbody'; - - QualityGateDetailConditionsView.prototype.ui = { - metricSelect: '#quality-gate-new-condition-metric', - introductionShowMore: '.quality-gate-introduction-show-more', - introductionMore: '.quality-gate-introduction-more' - }; - - QualityGateDetailConditionsView.prototype.events = { - 'click @ui.introductionShowMore': 'showMoreIntroduction', - 'change @ui.metricSelect': 'addCondition' - }; - - QualityGateDetailConditionsView.prototype.itemViewOptions = function() { - return { - app: this.options.app, - collectionView: this - }; - }; - - QualityGateDetailConditionsView.prototype.appendHtml = function(compositeView, itemView) { - var container; - if (compositeView.isBuffering) { - compositeView.elBuffer.appendChild(itemView.el); - return compositeView._bufferedChildren.push(itemView); - } else { - container = this.getItemViewContainer(compositeView); - return container.prepend(itemView.el); - } - }; - - QualityGateDetailConditionsView.prototype.onRender = function() { - this.ui.introductionMore.hide(); - return this.ui.metricSelect.select2({ - allowClear: false, - width: '250px', - placeholder: t('alerts.select_metric') - }); - }; - - QualityGateDetailConditionsView.prototype.groupedMetrics = function() { - var metrics; - metrics = this.options.app.metrics; - metrics = _.groupBy(metrics, 'domain'); - metrics = _.map(metrics, function(metrics, domain) { - return { - domain: domain, - metrics: _.sortBy(metrics, 'short_name') - }; - }); - return _.sortBy(metrics, 'domain'); - }; - - QualityGateDetailConditionsView.prototype.serializeData = function() { - return _.extend(QualityGateDetailConditionsView.__super__.serializeData.apply(this, arguments), { - canEdit: this.options.app.canEdit, - metricGroups: this.groupedMetrics() - }); - }; - - QualityGateDetailConditionsView.prototype.showMoreIntroduction = function() { - this.ui.introductionShowMore.hide(); - return this.ui.introductionMore.show(); - }; - - QualityGateDetailConditionsView.prototype.addCondition = function() { - var condition, metric; - metric = this.ui.metricSelect.val(); - this.ui.metricSelect.select2('val', ''); - condition = new Condition({ - metric: metric, - gateId: this.options.gateId - }); - return this.collection.unshift(condition); - }; - - QualityGateDetailConditionsView.prototype.updateConditions = function() { - var conditions; - conditions = this.collection.map(function(item) { - return _.extend(item.toJSON(), { - metric: item.get('metric').key - }); - }); - return this.options.qualityGate.set({ - conditions: conditions - }, { - silent: true - }); - }; - - return QualityGateDetailConditionsView; - - })(Marionette.CompositeView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-header-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-header-view.js deleted file mode 100644 index 04d1e816c6a..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-header-view.js +++ /dev/null @@ -1,118 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars', 'quality-gate/models/quality-gate'], function(Marionette, Handlebars, QualityGate) { - var QualityGateDetailHeaderView; - return QualityGateDetailHeaderView = (function(_super) { - __extends(QualityGateDetailHeaderView, _super); - - function QualityGateDetailHeaderView() { - return QualityGateDetailHeaderView.__super__.constructor.apply(this, arguments); - } - - QualityGateDetailHeaderView.prototype.template = Handlebars.compile(jQuery('#quality-gate-detail-header-template').html()); - - QualityGateDetailHeaderView.prototype.spinner = '<i class="spinner"></i>'; - - QualityGateDetailHeaderView.prototype.modelEvents = { - 'change': 'render' - }; - - QualityGateDetailHeaderView.prototype.events = { - 'click #quality-gate-rename': 'renameQualityGate', - 'click #quality-gate-copy': 'copyQualityGate', - 'click #quality-gate-delete': 'deleteQualityGate', - 'click #quality-gate-set-as-default': 'setAsDefault', - 'click #quality-gate-unset-as-default': 'unsetAsDefault' - }; - - QualityGateDetailHeaderView.prototype.renameQualityGate = function() { - this.options.app.qualityGateEditView.method = 'rename'; - this.options.app.qualityGateEditView.model = this.model; - return this.options.app.qualityGateEditView.show(); - }; - - QualityGateDetailHeaderView.prototype.copyQualityGate = function() { - var copiedModel; - copiedModel = new QualityGate(this.model.toJSON()); - copiedModel.set('default', false); - this.options.app.qualityGateEditView.method = 'copy'; - this.options.app.qualityGateEditView.model = copiedModel; - return this.options.app.qualityGateEditView.show(); - }; - - QualityGateDetailHeaderView.prototype.deleteQualityGate = function() { - if (confirm(t('are_you_sure'))) { - this.showSpinner(); - return jQuery.ajax({ - type: 'POST', - url: "" + baseUrl + "/api/qualitygates/destroy", - data: { - id: this.model.id - } - }).always((function(_this) { - return function() { - return _this.hideSpinner(); - }; - })(this)).done((function(_this) { - return function() { - return _this.options.app.deleteQualityGate(_this.model.id); - }; - })(this)); - } - }; - - QualityGateDetailHeaderView.prototype.changeDefault = function(set) { - var data, method; - this.showSpinner(); - data = set ? { - id: this.model.id - } : {}; - method = set ? 'set_as_default' : 'unset_default'; - return jQuery.ajax({ - type: 'POST', - url: "" + baseUrl + "/api/qualitygates/" + method, - data: data - }).always((function(_this) { - return function() { - return _this.hideSpinner(); - }; - })(this)).done((function(_this) { - return function() { - _this.options.app.unsetDefaults(_this.model.id); - return _this.model.set('default', !_this.model.get('default')); - }; - })(this)); - }; - - QualityGateDetailHeaderView.prototype.setAsDefault = function() { - return this.changeDefault(true); - }; - - QualityGateDetailHeaderView.prototype.unsetAsDefault = function() { - return this.changeDefault(false); - }; - - QualityGateDetailHeaderView.prototype.showSpinner = function() { - this.$el.hide(); - return jQuery(this.spinner).insertBefore(this.$el); - }; - - QualityGateDetailHeaderView.prototype.hideSpinner = function() { - this.$el.prev().remove(); - return this.$el.show(); - }; - - QualityGateDetailHeaderView.prototype.serializeData = function() { - return _.extend(QualityGateDetailHeaderView.__super__.serializeData.apply(this, arguments), { - canEdit: this.options.app.canEdit - }); - }; - - return QualityGateDetailHeaderView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-projects-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-projects-view.js deleted file mode 100644 index 7bf96743e78..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-projects-view.js +++ /dev/null @@ -1,58 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars', 'select-list'], function(Marionette, Handlebars) { - var QualityGateDetailProjectsView; - return QualityGateDetailProjectsView = (function(_super) { - __extends(QualityGateDetailProjectsView, _super); - - function QualityGateDetailProjectsView() { - return QualityGateDetailProjectsView.__super__.constructor.apply(this, arguments); - } - - QualityGateDetailProjectsView.prototype.template = Handlebars.compile(jQuery('#quality-gate-detail-projects-template').html()); - - QualityGateDetailProjectsView.prototype.onRender = function() { - if (!this.model.get('default')) { - return new SelectList({ - el: this.$('#select-list-projects'), - width: '100%', - readOnly: !this.options.app.canEdit, - format: function(item) { - return item.name; - }, - searchUrl: "" + baseUrl + "/api/qualitygates/search?gateId=" + this.options.gateId, - selectUrl: "" + baseUrl + "/api/qualitygates/select", - deselectUrl: "" + baseUrl + "/api/qualitygates/deselect", - extra: { - gateId: this.options.gateId - }, - selectParameter: 'projectId', - selectParameterValue: 'id', - labels: { - selected: t('quality_gates.projects.with'), - deselected: t('quality_gates.projects.without'), - all: t('quality_gates.projects.all'), - noResults: t('quality_gates.projects.noResults') - }, - tooltips: { - select: t('quality_gates.projects.select_hint'), - deselect: t('quality_gates.projects.deselect_hint') - } - }); - } - }; - - QualityGateDetailProjectsView.prototype.serializeData = function() { - return _.extend(QualityGateDetailProjectsView.__super__.serializeData.apply(this, arguments), { - canEdit: this.options.app.canEdit - }); - }; - - return QualityGateDetailProjectsView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-view.js deleted file mode 100644 index f9fdd640c21..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-view.js +++ /dev/null @@ -1,57 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars', 'quality-gate/collections/conditions', 'quality-gate/views/quality-gate-detail-header-view', 'quality-gate/views/quality-gate-detail-conditions-view', 'quality-gate/views/quality-gate-detail-projects-view'], function(Marionette, Handlebars, Conditions, QualityGateDetailHeaderView, QualityGateDetailConditionsView, QualityGateDetailProjectsView) { - var QualityGateDetailView; - return QualityGateDetailView = (function(_super) { - __extends(QualityGateDetailView, _super); - - function QualityGateDetailView() { - return QualityGateDetailView.__super__.constructor.apply(this, arguments); - } - - QualityGateDetailView.prototype.template = Handlebars.compile(jQuery('#quality-gate-detail-template').html()); - - QualityGateDetailView.prototype.regions = { - conditionsRegion: '#quality-gate-conditions', - projectsRegion: '#quality-gate-projects' - }; - - QualityGateDetailView.prototype.modelEvents = { - 'change': 'render' - }; - - QualityGateDetailView.prototype.onRender = function() { - this.showConditions(); - return this.showProjects(); - }; - - QualityGateDetailView.prototype.showConditions = function() { - var conditions, view; - conditions = new Conditions(this.model.get('conditions')); - view = new QualityGateDetailConditionsView({ - app: this.options.app, - collection: conditions, - gateId: this.model.id, - qualityGate: this.model - }); - return this.conditionsRegion.show(view); - }; - - QualityGateDetailView.prototype.showProjects = function() { - var view; - view = new QualityGateDetailProjectsView({ - app: this.options.app, - model: this.model, - gateId: this.model.id - }); - return this.projectsRegion.show(view); - }; - - return QualityGateDetailView; - - })(Marionette.Layout); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-edit-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-edit-view.js deleted file mode 100644 index 9529a449d90..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-edit-view.js +++ /dev/null @@ -1,141 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars'], function(Marionette, Handlebars) { - var QualityGateEditView; - return QualityGateEditView = (function(_super) { - __extends(QualityGateEditView, _super); - - function QualityGateEditView() { - return QualityGateEditView.__super__.constructor.apply(this, arguments); - } - - QualityGateEditView.prototype.className = 'modal'; - - QualityGateEditView.prototype.template = Handlebars.compile(jQuery('#quality-gate-edit-template').html()); - - QualityGateEditView.prototype.ui = { - nameInput: '#quality-gate-edit-name' - }; - - QualityGateEditView.prototype.events = { - 'submit form': 'onSubmit', - 'click #quality-gate-cancel-create': 'hide' - }; - - QualityGateEditView.prototype.onRender = function() { - return this.$el.dialog({ - dialogClass: 'no-close', - width: '600px', - draggable: false, - autoOpen: false, - modal: true, - minHeight: 50, - resizable: false, - title: null - }); - }; - - QualityGateEditView.prototype.show = function() { - this.render(); - this.$el.dialog('open'); - return this.ui.nameInput.focus(); - }; - - QualityGateEditView.prototype.hide = function() { - return this.$el.dialog('close'); - }; - - QualityGateEditView.prototype.saveRequest = function(data) { - return jQuery.ajax({ - type: 'POST', - url: "" + baseUrl + "/api/qualitygates/" + this.method, - data: data - }).done((function(_this) { - return function() { - return _this.hide(); - }; - })(this)); - }; - - QualityGateEditView.prototype.onSubmit = function(e) { - e.preventDefault(); - switch (this.method) { - case 'create': - return this.createQualityGate(); - case 'copy': - return this.copyQualityGate(); - case 'rename': - return this.saveQualityGate(); - } - }; - - QualityGateEditView.prototype.createQualityGate = function() { - var data; - data = { - name: this.ui.nameInput.val() - }; - return this.saveRequest(data).done((function(_this) { - return function(r) { - _this.model.set({ - id: r.id, - name: r.name - }); - _this.options.app.qualityGates.add(_this.model); - return _this.options.app.router.navigate("show/" + r.id, { - trigger: true - }); - }; - })(this)); - }; - - QualityGateEditView.prototype.saveQualityGate = function() { - var data; - data = { - id: this.model.id, - name: this.ui.nameInput.val() - }; - return this.saveRequest(data).done((function(_this) { - return function(r) { - return _this.model.set({ - name: r.name - }); - }; - })(this)); - }; - - QualityGateEditView.prototype.copyQualityGate = function() { - var data; - data = { - id: this.model.id, - name: this.ui.nameInput.val() - }; - return this.saveRequest(data).done((function(_this) { - return function(r) { - _this.model.set({ - id: r.id, - name: r.name - }); - _this.options.app.qualityGates.add(_this.model); - return _this.options.app.router.navigate("show/" + r.id, { - trigger: true - }); - }; - })(this)); - }; - - QualityGateEditView.prototype.serializeData = function() { - if (this.model) { - return _.extend(this.model.toJSON(), { - method: this.method - }); - } - }; - - return QualityGateEditView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-sidebar-list-empty-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-sidebar-list-empty-view.js deleted file mode 100644 index 289f5a48bbf..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-sidebar-list-empty-view.js +++ /dev/null @@ -1,25 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars'], function(Marionette, Handlebars) { - var QualityGateSidebarListEmptyView; - return QualityGateSidebarListEmptyView = (function(_super) { - __extends(QualityGateSidebarListEmptyView, _super); - - function QualityGateSidebarListEmptyView() { - return QualityGateSidebarListEmptyView.__super__.constructor.apply(this, arguments); - } - - QualityGateSidebarListEmptyView.prototype.tagName = 'li'; - - QualityGateSidebarListEmptyView.prototype.className = 'empty'; - - QualityGateSidebarListEmptyView.prototype.template = Handlebars.compile(jQuery('#quality-gate-sidebar-list-empty-template').html()); - - return QualityGateSidebarListEmptyView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-sidebar-list-item-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-sidebar-list-item-view.js deleted file mode 100644 index e0fe339fa42..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-sidebar-list-item-view.js +++ /dev/null @@ -1,41 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars'], function(Marionette, Handlebars) { - var QualityGateSidebarListItemView; - return QualityGateSidebarListItemView = (function(_super) { - __extends(QualityGateSidebarListItemView, _super); - - function QualityGateSidebarListItemView() { - return QualityGateSidebarListItemView.__super__.constructor.apply(this, arguments); - } - - QualityGateSidebarListItemView.prototype.tagName = 'li'; - - QualityGateSidebarListItemView.prototype.template = Handlebars.compile(jQuery('#quality-gate-sidebar-list-item-template').html()); - - QualityGateSidebarListItemView.prototype.modelEvents = { - 'change': 'render' - }; - - QualityGateSidebarListItemView.prototype.events = { - 'click': 'showQualityGate' - }; - - QualityGateSidebarListItemView.prototype.onRender = function() { - return this.$el.toggleClass('active', this.options.highlighted); - }; - - QualityGateSidebarListItemView.prototype.showQualityGate = function() { - return this.options.app.router.navigate("show/" + this.model.id, { - trigger: true - }); - }; - - return QualityGateSidebarListItemView; - - })(Marionette.ItemView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-sidebar-list-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-sidebar-list-view.js deleted file mode 100644 index 5001d37d154..00000000000 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-sidebar-list-view.js +++ /dev/null @@ -1,39 +0,0 @@ -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - define(['backbone.marionette', 'handlebars', 'quality-gate/models/quality-gate', 'quality-gate/views/quality-gate-sidebar-list-item-view', 'quality-gate/views/quality-gate-sidebar-list-empty-view'], function(Marionette, Handlebars, QualityGate, QualityGateSidebarListItemView, QualityGateSidebarListEmptyView) { - var QualityGateSidebarListView; - return QualityGateSidebarListView = (function(_super) { - __extends(QualityGateSidebarListView, _super); - - function QualityGateSidebarListView() { - return QualityGateSidebarListView.__super__.constructor.apply(this, arguments); - } - - QualityGateSidebarListView.prototype.tagName = 'ol'; - - QualityGateSidebarListView.prototype.className = 'navigator-results-list'; - - QualityGateSidebarListView.prototype.itemView = QualityGateSidebarListItemView; - - QualityGateSidebarListView.prototype.emptyView = QualityGateSidebarListEmptyView; - - QualityGateSidebarListView.prototype.itemViewOptions = function(model) { - return { - app: this.options.app, - highlighted: model.get('id') === +this.highlighted - }; - }; - - QualityGateSidebarListView.prototype.highlight = function(id) { - this.highlighted = id; - return this.render(); - }; - - return QualityGateSidebarListView; - - })(Marionette.CollectionView); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/tests/common/inputsSpec.js b/sonar-server/src/main/webapp/javascripts/tests/common/inputsSpec.js deleted file mode 100644 index 4af7a003c84..00000000000 --- a/sonar-server/src/main/webapp/javascripts/tests/common/inputsSpec.js +++ /dev/null @@ -1,78 +0,0 @@ -(function() { - var $; - - $ = jQuery; - - describe('WORK_DUR suite', function() { - beforeEach(function() { - window.SS = {}; - window.SS.phrases = { - 'work_duration': { - 'x_days': '{0}d', - 'x_hours': '{0}h', - 'x_minutes': '{0}min' - } - }; - this.input = $('<input type="text">'); - this.input.appendTo($('body')); - return this.input.data('type', 'WORK_DUR'); - }); - it('converts', function() { - this.input.originalVal('2d 7h 13min'); - return expect(this.input.val()).toBe(1393); - }); - it('converts only days', function() { - this.input.originalVal('1d'); - return expect(this.input.val()).toBe(480); - }); - it('converts hours with minutes', function() { - this.input.originalVal('2h 30min'); - return expect(this.input.val()).toBe(150); - }); - it('restores', function() { - this.input.val(1393); - return expect(this.input.originalVal()).toBe('2d 7h 13min'); - }); - return it('returns initially incorrect value', function() { - this.input.val('something'); - return expect(this.input.val()).toBe('something'); - }); - }); - - describe('RATING suite', function() { - beforeEach(function() { - this.input = $('<input type="text">'); - this.input.appendTo($('body')); - return this.input.data('type', 'RATING'); - }); - it('converts A', function() { - this.input.originalVal('A'); - return expect(this.input.val()).toBe(1); - }); - it('converts B', function() { - this.input.originalVal('B'); - return expect(this.input.val()).toBe(2); - }); - it('converts E', function() { - this.input.originalVal('E'); - return expect(this.input.val()).toBe(5); - }); - it('does not convert F', function() { - this.input.originalVal('F'); - return expect(this.input.val()).toBe('F'); - }); - it('restores A', function() { - this.input.val(1); - return expect(this.input.originalVal()).toBe('A'); - }); - it('restores E', function() { - this.input.val(5); - return expect(this.input.originalVal()).toBe('E'); - }); - return it('returns initially incorrect value', function() { - this.input.val('something'); - return expect(this.input.val()).toBe('something'); - }); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/tests/translateSpec.js b/sonar-server/src/main/webapp/javascripts/tests/translateSpec.js deleted file mode 100644 index 0a59fc4de6a..00000000000 --- a/sonar-server/src/main/webapp/javascripts/tests/translateSpec.js +++ /dev/null @@ -1,71 +0,0 @@ -(function() { - var $; - - $ = jQuery; - - describe('translation "t" suite', function() { - beforeEach(function() { - window.messages = { - 'something': 'SOMETHING', - 'something_with_underscore': 'SOMETHING_WITH_UNDERSCORE', - 'something_with{braces}': 'SOMETHING_WITH{braces}' - }; - return window.SS = { - phrases: { - 'something': 'SOMETHING ANOTHER' - } - }; - }); - afterEach(function() { - return window.messages = window.SS = void 0; - }); - it('translates', function() { - return expect(t('something')).toBe('SOMETHING'); - }); - it('translates with underscore', function() { - return expect(t('something_with_underscore')).toBe('SOMETHING_WITH_UNDERSCORE'); - }); - it('translates with braces', function() { - return expect(t('something_with{braces}')).toBe('SOMETHING_WITH{braces}'); - }); - it('fallbacks to "translate"', function() { - window.messages = void 0; - return expect(t('something')).toBe('SOMETHING ANOTHER'); - }); - return it('returns the key when no translation', function() { - return expect(t('something_another')).toBe('something_another'); - }); - }); - - describe('translation "translate" suite', function() { - beforeEach(function() { - return window.SS = { - phrases: { - 'something': 'SOMETHING', - 'something_with_underscore': 'SOMETHING_WITH_UNDERSCORE', - 'something_with{braces}': 'SOMETHING_WITH{braces}' - } - }; - }); - afterEach(function() { - return window.messages = window.SS = void 0; - }); - it('translates', function() { - return expect(translate('something')).toBe('SOMETHING'); - }); - it('translates with underscore', function() { - return expect(translate('something_with_underscore')).toBe('SOMETHING_WITH_UNDERSCORE'); - }); - it('translates with braces', function() { - return expect(translate('something_with{braces}')).toBe('SOMETHING_WITH{braces}'); - }); - it('returns the key when no translation', function() { - return expect(translate('something_another')).toBe('something_another'); - }); - return it('does not fail when there is no dictionary', function() { - window.SS = void 0; - return expect(translate('something_another')).toBe('something_another'); - }); - }); - -}).call(this); diff --git a/sonar-server/src/main/webapp/javascripts/application.js b/sonar-server/src/main/webapp/js/application.js index fbeef6d0c13..fbeef6d0c13 100644 --- a/sonar-server/src/main/webapp/javascripts/application.js +++ b/sonar-server/src/main/webapp/js/application.js diff --git a/sonar-server/src/main/webapp/javascripts/build.js b/sonar-server/src/main/webapp/js/build.js index 3f238b9080c..3f238b9080c 100644 --- a/sonar-server/src/main/webapp/javascripts/build.js +++ b/sonar-server/src/main/webapp/js/build.js diff --git a/sonar-server/src/main/webapp/javascripts/common/handlebars-extensions.js b/sonar-server/src/main/webapp/js/common/handlebars-extensions.js index 07c1044a316..07c1044a316 100644 --- a/sonar-server/src/main/webapp/javascripts/common/handlebars-extensions.js +++ b/sonar-server/src/main/webapp/js/common/handlebars-extensions.js diff --git a/sonar-server/src/main/webapp/javascripts/common/inputs.coffee b/sonar-server/src/main/webapp/js/common/inputs.coffee index 4352040b021..4352040b021 100644 --- a/sonar-server/src/main/webapp/javascripts/common/inputs.coffee +++ b/sonar-server/src/main/webapp/js/common/inputs.coffee diff --git a/sonar-server/src/main/webapp/javascripts/common/inputs.js b/sonar-server/src/main/webapp/js/common/inputs.js index 6c3cbe034dc..6c3cbe034dc 100644 --- a/sonar-server/src/main/webapp/javascripts/common/inputs.js +++ b/sonar-server/src/main/webapp/js/common/inputs.js diff --git a/sonar-server/src/main/webapp/javascripts/common/select-list.js b/sonar-server/src/main/webapp/js/common/select-list.js index 0c23099255b..8d91dc39dca 100644 --- a/sonar-server/src/main/webapp/javascripts/common/select-list.js +++ b/sonar-server/src/main/webapp/js/common/select-list.js @@ -1,5 +1,5 @@ requirejs.config({ - baseUrl: baseUrl + '/javascripts', + baseUrl: baseUrl + '/js', paths: { 'backbone': 'third-party/backbone' diff --git a/sonar-server/src/main/webapp/javascripts/dashboard.js b/sonar-server/src/main/webapp/js/dashboard.js index 576dba7046d..576dba7046d 100644 --- a/sonar-server/src/main/webapp/javascripts/dashboard.js +++ b/sonar-server/src/main/webapp/js/dashboard.js diff --git a/sonar-server/src/main/webapp/javascripts/duplication.js b/sonar-server/src/main/webapp/js/duplication.js index edd28f41fee..edd28f41fee 100644 --- a/sonar-server/src/main/webapp/javascripts/duplication.js +++ b/sonar-server/src/main/webapp/js/duplication.js diff --git a/sonar-server/src/main/webapp/javascripts/issue.js b/sonar-server/src/main/webapp/js/issue.js index 3a91c7401ba..3a91c7401ba 100644 --- a/sonar-server/src/main/webapp/javascripts/issue.js +++ b/sonar-server/src/main/webapp/js/issue.js diff --git a/sonar-server/src/main/webapp/javascripts/issues/app.js b/sonar-server/src/main/webapp/js/issues/app.js index 1467c52c0d6..4a291cc45f7 100644 --- a/sonar-server/src/main/webapp/javascripts/issues/app.js +++ b/sonar-server/src/main/webapp/js/issues/app.js @@ -1,5 +1,5 @@ requirejs.config({ - baseUrl: baseUrl + '/javascripts', + baseUrl: baseUrl + '/js', paths: { 'backbone': 'third-party/backbone', diff --git a/sonar-server/src/main/webapp/javascripts/issues/extra.js b/sonar-server/src/main/webapp/js/issues/extra.js index 66fa821b014..66fa821b014 100644 --- a/sonar-server/src/main/webapp/javascripts/issues/extra.js +++ b/sonar-server/src/main/webapp/js/issues/extra.js diff --git a/sonar-server/src/main/webapp/javascripts/measures/app.js b/sonar-server/src/main/webapp/js/measures/app.js index dff79a245c7..830a6cf4eb4 100644 --- a/sonar-server/src/main/webapp/javascripts/measures/app.js +++ b/sonar-server/src/main/webapp/js/measures/app.js @@ -1,5 +1,5 @@ requirejs.config({ - baseUrl: baseUrl + '/javascripts', + baseUrl: baseUrl + '/js', paths: { 'backbone': 'third-party/backbone', diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/action-plan-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/action-plan-filters.js index 7503e344d2a..7503e344d2a 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/action-plan-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/action-plan-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/ajax-select-filters.js index dd2e246d217..dd2e246d217 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/ajax-select-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/ajax-select-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/base-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/base-filters.js index e07a3517bfe..e07a3517bfe 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/base-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/base-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/checkbox-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/checkbox-filters.js index 025ce9dc649..025ce9dc649 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/checkbox-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/checkbox-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/choice-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/choice-filters.js index cf74a21562e..cf74a21562e 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/choice-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/choice-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/context-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/context-filters.js index ec71ff3f774..ec71ff3f774 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/context-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/context-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/date-filter-view.coffee b/sonar-server/src/main/webapp/js/navigator/filters/date-filter-view.coffee index da9fc81679b..da9fc81679b 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/date-filter-view.coffee +++ b/sonar-server/src/main/webapp/js/navigator/filters/date-filter-view.coffee diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/date-filter-view.js b/sonar-server/src/main/webapp/js/navigator/filters/date-filter-view.js index 30b6a7df873..30b6a7df873 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/date-filter-view.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/date-filter-view.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/favorite-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/favorite-filters.js index a5c8134b07d..a5c8134b07d 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/favorite-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/favorite-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/filter-bar.js b/sonar-server/src/main/webapp/js/navigator/filters/filter-bar.js index a859c721382..a859c721382 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/filter-bar.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/filter-bar.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/metric-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/metric-filters.js index b97c557654f..b97c557654f 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/metric-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/metric-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/more-criteria-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/more-criteria-filters.js index 755c4bbfb42..755c4bbfb42 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/more-criteria-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/more-criteria-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/range-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/range-filters.js index 910d37c7fa5..910d37c7fa5 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/range-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/range-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/read-only-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/read-only-filters.js index 5a203e5214f..5a203e5214f 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/read-only-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/read-only-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/rule-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/rule-filters.js index aed4b8d894a..aed4b8d894a 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/rule-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/rule-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/string-filters.js b/sonar-server/src/main/webapp/js/navigator/filters/string-filters.js index 2e1278f350f..2e1278f350f 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/string-filters.js +++ b/sonar-server/src/main/webapp/js/navigator/filters/string-filters.js diff --git a/sonar-server/src/main/webapp/javascripts/recent-history.js b/sonar-server/src/main/webapp/js/recent-history.js index e371603c963..e371603c963 100644 --- a/sonar-server/src/main/webapp/javascripts/recent-history.js +++ b/sonar-server/src/main/webapp/js/recent-history.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/require.js b/sonar-server/src/main/webapp/js/require.js index 84d1d678cf4..84d1d678cf4 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/require.js +++ b/sonar-server/src/main/webapp/js/require.js diff --git a/sonar-server/src/main/webapp/javascripts/resource.js b/sonar-server/src/main/webapp/js/resource.js index 04165488070..04165488070 100644 --- a/sonar-server/src/main/webapp/javascripts/resource.js +++ b/sonar-server/src/main/webapp/js/resource.js diff --git a/sonar-server/src/main/webapp/javascripts/select2-jquery-ui-fix.js b/sonar-server/src/main/webapp/js/select2-jquery-ui-fix.js index edaa4899a82..edaa4899a82 100644 --- a/sonar-server/src/main/webapp/javascripts/select2-jquery-ui-fix.js +++ b/sonar-server/src/main/webapp/js/select2-jquery-ui-fix.js diff --git a/sonar-server/src/main/webapp/javascripts/sortable.js b/sonar-server/src/main/webapp/js/sortable.js index 6f3eae3147d..6f3eae3147d 100644 --- a/sonar-server/src/main/webapp/javascripts/sortable.js +++ b/sonar-server/src/main/webapp/js/sortable.js diff --git a/sonar-server/src/main/webapp/js/templates/coding-rules.js b/sonar-server/src/main/webapp/js/templates/coding-rules.js new file mode 100644 index 00000000000..f47a7459ffc --- /dev/null +++ b/sonar-server/src/main/webapp/js/templates/coding-rules.js @@ -0,0 +1,733 @@ +define(['handlebars'], function(Handlebars) { + +this["SS"] = this["SS"] || {}; +this["SS"]["Templates"] = this["SS"]["Templates"] || {}; + +Handlebars.registerPartial("_markdown-tips", Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "<div class=\"markdown-tips\">\n <a href=\"#\" onclick=\"window.open(baseUrl + '/markdown/help','markdown','height=300,width=600,scrollbars=1,resizable=1');return false;\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "markdown.helplink", options) : helperMissing.call(depth0, "t", "markdown.helplink", options))) + + "</a> :\n *" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "bold", options) : helperMissing.call(depth0, "t", "bold", options))) + + "* ``" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "code", options) : helperMissing.call(depth0, "t", "code", options))) + + "`` * " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "bulleted_point", options) : helperMissing.call(depth0, "t", "bulleted_point", options))) + + "\n</div>"; + return buffer; + })); + +this["SS"]["Templates"]["coding-rules-actions"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType="function", self=this; + +function program1(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.ordered_by", options) : helperMissing.call(depth0, "t", "coding_rules.ordered_by", options))) + + " <strong>" + + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.sorting)),stack1 == null || stack1 === false ? stack1 : stack1.sortText)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + + "</strong> "; + stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.sorting)),stack1 == null || stack1 === false ? stack1 : stack1.asc), {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } +function program2(depth0,data) { + + + return "<i class=\"icon-arrow-up\"></i>"; + } + +function program4(depth0,data) { + + + return "<i class=\"icon-arrow-down\"></i>"; + } + +function program6(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.order", options) : helperMissing.call(depth0, "t", "coding_rules.order", options))) + + "\n "; + return buffer; + } + + buffer += "<div class=\"navigator-actions-order\">\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.sorting), {hash:{},inverse:self.program(6, program6, data),fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</div>\n<ul class=\"navigator-actions-order-choices\">\n <li data-sort=\"CREATION_DATE\" data-asc=\"true\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.sort.creation_date", options) : helperMissing.call(depth0, "t", "coding_rules.sort.creation_date", options))) + + " <i class=\"icon-arrow-up\"></i></li>\n <li data-sort=\"CREATION_DATE\" data-asc=\"false\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.sort.creation_date", options) : helperMissing.call(depth0, "t", "coding_rules.sort.creation_date", options))) + + " <i class=\"icon-arrow-down\"></i></li>\n <li data-sort=\"NAME\" data-asc=\"true\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.sort.name", options) : helperMissing.call(depth0, "t", "coding_rules.sort.name", options))) + + " <i class=\"icon-arrow-up\"></i></li>\n <li data-sort=\"NAME\" data-asc=\"false\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.sort.name", options) : helperMissing.call(depth0, "t", "coding_rules.sort.name", options))) + + " <i class=\"icon-arrow-down\"></i></li>\n</ul>\n<div class=\"navigator-actions-total\">\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.found", options) : helperMissing.call(depth0, "t", "coding_rules.found", options))) + + ": <strong>" + + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.paging)),stack1 == null || stack1 === false ? stack1 : stack1.fTotal)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + + "</strong>\n <a class=\"navigator-actions-bulk\"\n title=\"" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "bulk_change", options) : helperMissing.call(depth0, "t", "bulk_change", options))) + + "\"><i class=\"icon-settings-multiple\"></i></a>\n</div>"; + return buffer; + }); + +this["SS"]["Templates"]["coding-rules-bulk-change"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n <div class=\"modal-field\">\n <label for=\"coding-rules-bulk-change-activate-on-qp\">Activate on</label>\n <input id=\"coding-rules-bulk-change-activate-qp\" type=\"checkbox\">\n <span class=\"text\">"; + if (helper = helpers.inactiveQualityProfileName) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.inactiveQualityProfileName); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</span>\n </div>\n "; + return buffer; + } + +function program3(depth0,data) { + + + return "Activate on"; + } + +function program5(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n <option value=\""; + if (helper = helpers.key) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.key); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\">"; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</option>\n "; + return buffer; + } + +function program7(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n <div class=\"modal-field\">\n <label for=\"coding-rules-bulk-change-deactivate-on-qp\">Deactivate on</label>\n <input id=\"coding-rules-bulk-change-deactivate-qp\" type=\"checkbox\">\n <span class=\"text\">"; + if (helper = helpers.activeQualityProfileName) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.activeQualityProfileName); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</span>\n </div>\n "; + return buffer; + } + +function program9(depth0,data) { + + + return "Deactivate on"; + } + +function program11(depth0,data) { + + var buffer = "", stack1; + buffer += "\n <div class=\"modal-field\">\n <label for=\"coding-rules-bulk-change-severity\">Change Severity</label>\n <input id=\"coding-rules-bulk-change-set-severity\" type=\"checkbox\">\n <select id=\"coding-rules-bulk-change-severity\">\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.severities), {hash:{},inverse:self.noop,fn:self.program(12, program12, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </select>\n </div>\n "; + return buffer; + } +function program12(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <option value=\"" + + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0)) + + "\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "severity", depth0, options) : helperMissing.call(depth0, "t", "severity", depth0, options))) + + "</option>\n "; + return buffer; + } + + buffer += "<form>\n <div class=\"modal-head\">\n <h2>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.bulk_change", options) : helperMissing.call(depth0, "t", "coding_rules.bulk_change", options))) + + " " + + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.paging)),stack1 == null || stack1 === false ? stack1 : stack1.fTotal)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + + " " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules._rules", options) : helperMissing.call(depth0, "t", "coding_rules._rules", options))) + + "</h2>\n </div>\n\n <div class=\"modal-body\">\n <div class=\"modal-error\"></div>\n\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.inactiveQualityProfile), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n\n <div class=\"modal-field\">\n <label for=\"coding-rules-bulk-change-activate-on\">"; + stack1 = helpers.unless.call(depth0, (depth0 && depth0.inactiveQualityProfile), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "</label>\n <input id=\"coding-rules-bulk-change-activate\" type=\"checkbox\">\n <select id=\"coding-rules-bulk-change-activate-on\" multiple>\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.activateOnQualityProfiles), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </select>\n </div>\n\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.activeQualityProfile), {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n\n <div class=\"modal-field\">\n <label for=\"coding-rules-bulk-change-deactivate-on\">"; + stack1 = helpers.unless.call(depth0, (depth0 && depth0.activeQualityProfile), {hash:{},inverse:self.noop,fn:self.program(9, program9, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "</label>\n <input id=\"coding-rules-bulk-change-deactivate\" type=\"checkbox\">\n <select id=\"coding-rules-bulk-change-deactivate-on\" multiple>\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.deactivateOnQualityProfiles), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </select>\n </div>\n\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.activeQualityProfile), {hash:{},inverse:self.noop,fn:self.program(11, program11, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </div>\n\n <div class=\"modal-foot\">\n <button>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "apply", options) : helperMissing.call(depth0, "t", "apply", options))) + + "</button>\n <a id=\"coding-rules-cancel-bulk-change\" class=\"action\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "cancel", options) : helperMissing.call(depth0, "t", "cancel", options))) + + "</a>\n </div>\n</form>"; + return buffer; + }); + +this["SS"]["Templates"]["coding-rules-detail-quality-profile"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); partials = this.merge(partials, Handlebars.partials); data = data || {}; + var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType="function", self=this; + +function program1(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n <div class=\"coding-rules-detail-quality-profile-inheritance\">\n <i class=\"icon-inheritance\"></i> " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.inherits", options) : helperMissing.call(depth0, "t", "coding_rules.inherits", options))) + + " <strong>" + + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.parent)),stack1 == null || stack1 === false ? stack1 : stack1.name)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + + "</strong>\n </div>\n"; + return buffer; + } + +function program3(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <option value=\"" + + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0)) + + "\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "severity", depth0, options) : helperMissing.call(depth0, "t", "severity", depth0, options))) + + "</option>\n "; + return buffer; + } + +function program5(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n "; + stack1 = (helper = helpers.notEq || (depth0 && depth0.notEq),options={hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.severity), ((stack1 = (depth0 && depth0.parent)),stack1 == null || stack1 === false ? stack1 : stack1.severity), options) : helperMissing.call(depth0, "notEq", (depth0 && depth0.severity), ((stack1 = (depth0 && depth0.parent)),stack1 == null || stack1 === false ? stack1 : stack1.severity), options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } +function program6(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.original", options) : helperMissing.call(depth0, "t", "coding_rules.original", options))) + + " " + + escapeExpression((helper = helpers.severityIcon || (depth0 && depth0.severityIcon),options={hash:{},data:data},helper ? helper.call(depth0, ((stack1 = (depth0 && depth0.parent)),stack1 == null || stack1 === false ? stack1 : stack1.severity), options) : helperMissing.call(depth0, "severityIcon", ((stack1 = (depth0 && depth0.parent)),stack1 == null || stack1 === false ? stack1 : stack1.severity), options))) + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "severity", ((stack1 = (depth0 && depth0.parent)),stack1 == null || stack1 === false ? stack1 : stack1.severity), options) : helperMissing.call(depth0, "t", "severity", ((stack1 = (depth0 && depth0.parent)),stack1 == null || stack1 === false ? stack1 : stack1.severity), options))) + + "\n "; + return buffer; + } + +function program8(depth0,data,depth1) { + + var buffer = "", stack1, helper; + buffer += "\n <li class=\"coding-rules-detail-parameter\">\n <h3 class=\"coding-rules-detail-parameter-name\">"; + if (helper = helpers.key) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.key); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</h3>\n <div class=\"coding-rules-detail-parameter-description\">\n <input type=\"text\" value=\""; + if (helper = helpers.value) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.value); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\">\n "; + stack1 = helpers['if'].call(depth0, (depth1 && depth1.parent), {hash:{},inverse:self.noop,fn:self.program(9, program9, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </div>\n </li>\n "; + return buffer; + } +function program9(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n "; + stack1 = (helper = helpers.notEq || (depth0 && depth0.notEq),options={hash:{},inverse:self.noop,fn:self.program(10, program10, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.value), (depth0 && depth0.original), options) : helperMissing.call(depth0, "notEq", (depth0 && depth0.value), (depth0 && depth0.original), options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } +function program10(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.original", options) : helperMissing.call(depth0, "t", "coding_rules.original", options))) + + " "; + if (helper = helpers.original) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.original); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\n "; + return buffer; + } + +function program12(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n <blockquote class=\"rule-desc\">\n <cite>\n <b>" + + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.note)),stack1 == null || stack1 === false ? stack1 : stack1.username)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + + "</b> (" + + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.note)),stack1 == null || stack1 === false ? stack1 : stack1.fCreationDate)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + + ") | \n <a class=\"coding-rules-detail-quality-profile-note-edit link-action\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "edit", options) : helperMissing.call(depth0, "t", "edit", options))) + + "</a> \n <a class=\"coding-rules-detail-quality-profile-note-delete link-action\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "delete", options) : helperMissing.call(depth0, "t", "delete", options))) + + "</a>\n </cite>\n "; + stack1 = ((stack1 = ((stack1 = (depth0 && depth0.note)),stack1 == null || stack1 === false ? stack1 : stack1.html)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </blockquote>\n "; + return buffer; + } + +function program14(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <a class=\"coding-rules-detail-quality-profile-note-add link-action\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.add_note", options) : helperMissing.call(depth0, "t", "coding_rules.add_note", options))) + + "</a>\n "; + return buffer; + } + +function program16(depth0,data) { + + var stack1; + return escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.note)),stack1 == null || stack1 === false ? stack1 : stack1.raw)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)); + } + +function program18(depth0,data) { + + var helper, options; + return escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "update", options) : helperMissing.call(depth0, "t", "update", options))); + } + +function program20(depth0,data) { + + var helper, options; + return escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.add_note", options) : helperMissing.call(depth0, "t", "coding_rules.add_note", options))); + } + +function program22(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <button class=\"button-red\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.revert_to_parent_definition", options) : helperMissing.call(depth0, "t", "coding_rules.revert_to_parent_definition", options))) + + "</button>\n "; + return buffer; + } + + buffer += "<div class=\"coding-rules-detail-quality-profile-name\">"; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</div>\n\n"; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.parent), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n\n<ul class=\"coding-rules-detail-parameters coding-rules-detail-quality-profile-parameters\">\n <li class=\"coding-rules-detail-parameter\">\n <h3 class=\"coding-rules-detail-parameter-name\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "severity", options) : helperMissing.call(depth0, "t", "severity", options))) + + "</h3>\n <div class=\"coding-rules-detail-parameter-description\">\n <select class=\"coding-rules-detail-quality-profile-severity\">\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.severities), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </select>\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.parent), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </div>\n </li>\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.parameters), {hash:{},inverse:self.noop,fn:self.programWithDepth(8, program8, data, depth0),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</ul>\n\n<div class=\"coding-rules-detail-quality-profile-note\">\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.note), {hash:{},inverse:self.program(14, program14, data),fn:self.program(12, program12, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</div>\n\n<div class=\"coding-rules-detail-quality-profile-note-form admin\">\n <table class=\"width100 table\">\n <tbody>\n <tr>\n <td class=\"width100\" colspan=\"2\">\n <textarea class=\"coding-rules-detail-quality-profile-note-text\" rows=\"4\" style=\"width: 100%;\">"; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.note), {hash:{},inverse:self.noop,fn:self.program(16, program16, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "</textarea>\n </td>\n </tr>\n <tr>\n <td>\n <button class=\"coding-rules-detail-quality-profile-note-submit\">\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.note), {hash:{},inverse:self.program(20, program20, data),fn:self.program(18, program18, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </button>\n <a class=\"coding-rules-detail-quality-profile-note-cancel action\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "cancel", options) : helperMissing.call(depth0, "t", "cancel", options))) + + "</a>\n </td>\n <td class=\"right\">\n "; + stack1 = self.invokePartial(partials['_markdown-tips'], '_markdown-tips', depth0, helpers, partials, data); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"button-group coding-rules-detail-quality-profile-actions\">\n <button>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "update", options) : helperMissing.call(depth0, "t", "update", options))) + + "</button>\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.parent), {hash:{},inverse:self.noop,fn:self.program(22, program22, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n <button class=\"button-red\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.deactivate_quality_profile", options) : helperMissing.call(depth0, "t", "coding_rules.deactivate_quality_profile", options))) + + "</button>\n</div>"; + return buffer; + }); + +this["SS"]["Templates"]["coding-rules-detail"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); partials = this.merge(partials, Handlebars.partials); data = data || {}; + var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n <li class=\"coding-rules-detail-property\">\n <span class=\"coding-rules-detail-status\">"; + if (helper = helpers.status) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.status); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</span>\n </li>\n "; + return buffer; + } + +function program3(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "<div class=\"rule-desc\">"; + if (helper = helpers.extra) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.extra); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "</div>"; + return buffer; + } + +function program5(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n <h3 class=\"coding-rules-detail-title\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.parameters", options) : helperMissing.call(depth0, "t", "coding_rules.parameters", options))) + + "</h3>\n <ul class=\"coding-rules-detail-parameters\">\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.parameters), {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </ul>\n"; + return buffer; + } +function program6(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n <li class=\"coding-rules-detail-parameter\">\n <h3 class=\"coding-rules-detail-parameter-name\">"; + if (helper = helpers.key) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.key); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</h3>\n <div class=\"coding-rules-detail-parameter-description\">\n "; + if (helper = helpers.description) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.description); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\n\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0['default']), {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </div>\n </li>\n "; + return buffer; + } +function program7(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n <div>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.parameters.default_value", options) : helperMissing.call(depth0, "t", "coding_rules.parameters.default_value", options))) + + " "; + if (helper = helpers['default']) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0['default']); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</div>\n "; + return buffer; + } + + buffer += "<h3 class=\"coding-rules-detail-header\">"; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</h3>\n\n<ul class=\"coding-rules-detail-properties\">\n <li class=\"coding-rules-detail-property\">" + + escapeExpression((helper = helpers.severityIcon || (depth0 && depth0.severityIcon),options={hash:{},data:data},helper ? helper.call(depth0, (depth0 && depth0.severity), options) : helperMissing.call(depth0, "severityIcon", (depth0 && depth0.severity), options))) + + " " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "severity", (depth0 && depth0.severity), options) : helperMissing.call(depth0, "t", "severity", (depth0 && depth0.severity), options))) + + "</li>\n <li class=\"coding-rules-detail-property\">\n <span class=\"coding-rules-detail-status\">"; + if (helper = helpers.language) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.language); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</span>\n </li>\n "; + stack1 = (helper = helpers.notEq || (depth0 && depth0.notEq),options={hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.status), "READY", options) : helperMissing.call(depth0, "notEq", (depth0 && depth0.status), "READY", options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n <li class=\"coding-rules-detail-property coding-rules-detail-tag-list\">\n <i class=\"icon-tags\"></i>\n " + + escapeExpression((helper = helpers.join || (depth0 && depth0.join),options={hash:{},data:data},helper ? helper.call(depth0, (depth0 && depth0.tags), ", ", options) : helperMissing.call(depth0, "join", (depth0 && depth0.tags), ", ", options))) + + "\n <a class=\"link-action coding-rules-detail-tags-change\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "change", options) : helperMissing.call(depth0, "t", "change", options))) + + "</a>\n </li>\n <li class=\"coding-rules-detail-property coding-rules-detail-tag-edit\">\n <input class=\"coding-rules-detail-tag-input\" type=\"text\" value=\"" + + escapeExpression((helper = helpers.join || (depth0 && depth0.join),options={hash:{},data:data},helper ? helper.call(depth0, (depth0 && depth0.tags), ",", options) : helperMissing.call(depth0, "join", (depth0 && depth0.tags), ",", options))) + + "\">\n <a class=\"link-action coding-rules-detail-tag-edit-done\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "done", options) : helperMissing.call(depth0, "t", "done", options))) + + "</a>\n </li>\n <li class=\"coding-rules-detail-property\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.available_since", options) : helperMissing.call(depth0, "t", "coding_rules.available_since", options))) + + " "; + if (helper = helpers.fCreationDate) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.fCreationDate); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</li>\n <li class=\"coding-rules-detail-property\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.repository", options) : helperMissing.call(depth0, "t", "coding_rules.repository", options))) + + " "; + if (helper = helpers.repository) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.repository); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</li>\n <li class=\"coding-rules-detail-property\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.key", options) : helperMissing.call(depth0, "t", "coding_rules.key", options))) + + " "; + if (helper = helpers.key) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.key); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</li>\n</ul>\n\n<div class=\"coding-rules-detail-description rule-desc\">"; + if (helper = helpers.description) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.description); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "</div>\n\n<div class=\"coding-rules-detail-description coding-rules-detail-description-extra\">\n <div id=\"coding-rules-detail-description-extra\">\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.extra), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n <a class=\"link-action\" id=\"coding-rules-detail-extend-description\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.extend_description", options) : helperMissing.call(depth0, "t", "coding_rules.extend_description", options))) + + "</a>\n </div>\n\n <div id=\"coding-rules-detail-extend-description-form\" class=\"admin\">\n <table class=\"width100 table\">\n <tbody>\n <tr>\n <td class=\"width100\" colspan=\"2\">\n <textarea id=\"coding-rules-detail-extend-description-text\" rows=\"4\" style=\"width: 100%;\">"; + if (helper = helpers.extraRaw) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.extraRaw); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</textarea>\n </td>\n </tr>\n <tr>\n <td>\n <button id=\"coding-rules-detail-extend-description-submit\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.extend_description", options) : helperMissing.call(depth0, "t", "coding_rules.extend_description", options))) + + "</button>\n <a id=\"coding-rules-detail-extend-description-cancel\" class=\"action\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "cancel", options) : helperMissing.call(depth0, "t", "cancel", options))) + + "</a>\n </td>\n <td class=\"right\">\n "; + stack1 = self.invokePartial(partials['_markdown-tips'], '_markdown-tips', depth0, helpers, partials, data); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <div id=\"coding-rules-detail-extend-description-spinner\">\n <i class=\"spinner\"></i>\n </div>\n</div>\n\n\n"; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.parameters), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n\n\n<h3 class=\"coding-rules-detail-title\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.quality_profiles", options) : helperMissing.call(depth0, "t", "coding_rules.quality_profiles", options))) + + "</h3>\n<div class=\"button-group coding-rules-detail-quality-profiles-activation\">\n <button id=\"coding-rules-quality-profile-activate\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.activate_quality_profile", options) : helperMissing.call(depth0, "t", "coding_rules.activate_quality_profile", options))) + + "</button>\n</div>\n<div id=\"coding-rules-detail-quality-profiles\"></div>"; + return buffer; + }); + +this["SS"]["Templates"]["coding-rules-facets-item"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = ""; + buffer += "\n <li class=\"navigator-facets-list-item-option\">\n <span class=\"navigator-facets-list-item-option-name\">" + + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0)) + + "</span>\n <span class=\"navigator-facets-list-item-option-stat subtitle\">42</span>\n </li>\n "; + return buffer; + } + + buffer += "<h3 class=\"navigator-facets-list-item-name\">"; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</h3>\n<ul class=\"navigator-facets-list-item-options\">\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.options), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</ul>"; + return buffer; + }); + +this["SS"]["Templates"]["coding-rules-filter-bar"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "<div class=\"navigator-filters-list\"></div>\n<button class=\"navigator-filter-submit\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "search_verb", options) : helperMissing.call(depth0, "t", "search_verb", options))) + + "</button>"; + return buffer; + }); + +this["SS"]["Templates"]["coding-rules-header"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "<h1 class=\"navigator-header-title\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.page", options) : helperMissing.call(depth0, "t", "coding_rules.page", options))) + + "</h1>\n\n<div class=\"navigator-header-actions button-group\">\n <button id=\"coding-rules-new-search\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.new_search", options) : helperMissing.call(depth0, "t", "coding_rules.new_search", options))) + + "</button>\n</div>"; + return buffer; + }); + +this["SS"]["Templates"]["coding-rules-layout"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "<div class=\"navigator-header\"></div>\n<div class=\"navigator-filters\"></div>\n<div class=\"navigator-results\"></div>\n<div class=\"navigator-actions\"></div>\n<div class=\"navigator-details\"></div>"; + }); + +this["SS"]["Templates"]["coding-rules-list-empty"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + return escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.no_results", options) : helperMissing.call(depth0, "t", "coding_rules.no_results", options))); + }); + +this["SS"]["Templates"]["coding-rules-list-item"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n <i class=\"icon-quality-profile\"></i> "; + if (helper = helpers.qualityProfileName) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.qualityProfileName); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + " \n " + + escapeExpression((helper = helpers.severityIcon || (depth0 && depth0.severityIcon),options={hash:{},data:data},helper ? helper.call(depth0, (depth0 && depth0.severity), options) : helperMissing.call(depth0, "severityIcon", (depth0 && depth0.severity), options))) + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "severity", (depth0 && depth0.severity), options) : helperMissing.call(depth0, "t", "severity", (depth0 && depth0.severity), options))) + + " \n "; + return buffer; + } + +function program3(depth0,data) { + + var stack1, helper; + if (helper = helpers.status) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.status); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + return escapeExpression(stack1); + } + + buffer += "<div class=\"line line-small\">\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.qualityProfile), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n <span class=\"coding-rules-detail-status\">"; + if (helper = helpers.language) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.language); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</span>\n\n <div class=\"line-right\">"; + stack1 = (helper = helpers.notEq || (depth0 && depth0.notEq),options={hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.status), "READY", options) : helperMissing.call(depth0, "notEq", (depth0 && depth0.status), "READY", options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "</div>\n</div>\n<div class=\"line line-nowrap\" title=\""; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\">"; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</div>"; + return buffer; + }); + +this["SS"]["Templates"]["coding-rules-quality-profile-activation"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n <option value=\""; + if (helper = helpers.key) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.key); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\">"; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</option>\n "; + return buffer; + } + +function program3(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <option value=\"" + + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0)) + + "\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "severity", depth0, options) : helperMissing.call(depth0, "t", "severity", depth0, options))) + + "</option>\n "; + return buffer; + } + +function program5(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n <tr class=\"property\">\n <th><h3>"; + if (helper = helpers.key) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.key); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</h3></th>\n <td>\n <input type=\"text\" "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0['default']), {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += ">\n <div class=\"note\">"; + if (helper = helpers.description) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.description); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</div>\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.extra), {hash:{},inverse:self.noop,fn:self.program(8, program8, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </td>\n </tr>\n "; + return buffer; + } +function program6(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "value=\""; + if (helper = helpers['default']) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0['default']); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\""; + return buffer; + } + +function program8(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n <div class=\"note\">"; + if (helper = helpers.extra) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.extra); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</div>\n "; + return buffer; + } + + buffer += "<form>\n <div class=\"modal-head\">\n <h2>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.activate_quality_profile", options) : helperMissing.call(depth0, "t", "coding_rules.activate_quality_profile", options))) + + "</h2>\n </div>\n\n <div class=\"modal-body\">\n <div class=\"modal-error\"></div>\n\n <table>\n <tr class=\"property\">\n <th><h3>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.quality_profile", options) : helperMissing.call(depth0, "t", "coding_rules.quality_profile", options))) + + "</h3></th>\n <td>\n <select id=\"coding-rules-quality-profile-activation-select\">\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.qualityProfiles), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </select>\n </td>\n </tr>\n <tr class=\"property\">\n <th><h3>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "severity", options) : helperMissing.call(depth0, "t", "severity", options))) + + "</h3></th>\n <td>\n <select id=\"coding-rules-quality-profile-activation-severity\">\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.severities), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </select>\n </td>\n </tr>\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.parameters), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </table>\n </div>\n\n <div class=\"modal-foot\">\n <button id=\"coding-rules-quality-profile-activation-activate\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "coding_rules.activate", options) : helperMissing.call(depth0, "t", "coding_rules.activate", options))) + + "</button>\n <a id=\"coding-rules-quality-profile-activation-cancel\" class=\"action\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "cancel", options) : helperMissing.call(depth0, "t", "cancel", options))) + + "</a>\n </div>\n</form>"; + return buffer; + }); + +return this["SS"]["Templates"]; + +});
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/js/templates/quality-gates.js b/sonar-server/src/main/webapp/js/templates/quality-gates.js new file mode 100644 index 00000000000..3a3bf93216c --- /dev/null +++ b/sonar-server/src/main/webapp/js/templates/quality-gates.js @@ -0,0 +1,543 @@ +define(['handlebars'], function(Handlebars) { + +this["SS"] = this["SS"] || {}; +this["SS"]["Templates"] = this["SS"]["Templates"] || {}; + +this["SS"]["Templates"]["quality-gate-actions"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <div class=\"navigator-header-actions button-group\">\n <button id=\"quality-gate-add\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "add_verb", options) : helperMissing.call(depth0, "t", "add_verb", options))) + + "</button>\n </div>\n"; + return buffer; + } + + buffer += "<h1 class=\"navigator-header-title\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.page", options) : helperMissing.call(depth0, "t", "quality_gates.page", options))) + + "</h1>\n"; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.canEdit), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + return buffer; + }); + +this["SS"]["Templates"]["quality-gate-detail-condition"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType="function", self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n <select name=\"period\">\n "; + stack1 = helpers.unless.call(depth0, (depth0 && depth0.isDiffMetric), {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.periods), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </select>\n "; + return buffer; + } +function program2(depth0,data) { + + var buffer = "", helper, options; + buffer += "<option value=\"0\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "value", options) : helperMissing.call(depth0, "t", "value", options))) + + "</option>"; + return buffer; + } + +function program4(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "<option value=\""; + if (helper = helpers.key) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.key); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\">Δ "; + if (helper = helpers.text) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.text); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</option>"; + return buffer; + } + +function program6(depth0,data) { + + var buffer = "", stack1; + buffer += "\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.periodText), {hash:{},inverse:self.program(9, program9, data),fn:self.program(7, program7, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } +function program7(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "Δ "; + if (helper = helpers.periodText) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.periodText); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\n "; + return buffer; + } + +function program9(depth0,data) { + + var buffer = "", helper, options; + buffer += escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "value", options) : helperMissing.call(depth0, "t", "value", options))) + + "\n "; + return buffer; + } + +function program11(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n <select name=\"operator\">\n "; + stack1 = (helper = helpers.operators || (depth0 && depth0.operators),options={hash:{},inverse:self.noop,fn:self.program(12, program12, data),data:data},helper ? helper.call(depth0, ((stack1 = (depth0 && depth0.metric)),stack1 == null || stack1 === false ? stack1 : stack1.type), options) : helperMissing.call(depth0, "operators", ((stack1 = (depth0 && depth0.metric)),stack1 == null || stack1 === false ? stack1 : stack1.type), options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </select>\n "; + return buffer; + } +function program12(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <option value=\"" + + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0)) + + "\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.operator", depth0, options) : helperMissing.call(depth0, "t", "quality_gates.operator", depth0, options))) + + "</option>\n "; + return buffer; + } + +function program14(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.operator", (depth0 && depth0.op), options) : helperMissing.call(depth0, "t", "quality_gates.operator", (depth0 && depth0.op), options))) + + "\n "; + return buffer; + } + +function program16(depth0,data) { + + var buffer = "", stack1; + buffer += "\n <input name=\"warning\" class=\"measure-input\" data-type=\"" + + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.metric)),stack1 == null || stack1 === false ? stack1 : stack1.type)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + + "\" type=\"text\">\n "; + return buffer; + } + +function program18(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n "; + if (helper = helpers.warning) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.warning); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\n "; + return buffer; + } + +function program20(depth0,data) { + + var buffer = "", stack1; + buffer += "\n <input name=\"error\" class=\"measure-input\" data-type=\"" + + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.metric)),stack1 == null || stack1 === false ? stack1 : stack1.type)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + + "\" type=\"text\">\n "; + return buffer; + } + +function program22(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n "; + if (helper = helpers.error) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.error); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\n "; + return buffer; + } + +function program24(depth0,data) { + + var buffer = "", stack1; + buffer += "\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.program(27, program27, data),fn:self.program(25, program25, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } +function program25(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <div class=\"button-group\">\n <button class=\"update-condition\" disabled>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "update_verb", options) : helperMissing.call(depth0, "t", "update_verb", options))) + + "</button>\n <button class=\"button-red delete-condition\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "delete", options) : helperMissing.call(depth0, "t", "delete", options))) + + "</button>\n </div>\n "; + return buffer; + } + +function program27(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <div class=\"button-group\">\n <button class=\"add-condition\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "add_verb", options) : helperMissing.call(depth0, "t", "add_verb", options))) + + "</button>\n <a class=\"action cancel-add-condition\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "cancel", options) : helperMissing.call(depth0, "t", "cancel", options))) + + "</a>\n </div>\n "; + return buffer; + } + + buffer += "<td nowrap>\n " + + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.metric)),stack1 == null || stack1 === false ? stack1 : stack1.name)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + + "\n</td>\n<td width=\"10%\" nowrap>\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.canEdit), {hash:{},inverse:self.program(6, program6, data),fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</td>\n<td width=\"10%\" nowrap>\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.canEdit), {hash:{},inverse:self.program(14, program14, data),fn:self.program(11, program11, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</td>\n<td width=\"15%\" nowrap=\"nowrap\">\n <i class=\"icon-alert-warn\" title=\"" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "alerts.warning_tooltip", options) : helperMissing.call(depth0, "t", "alerts.warning_tooltip", options))) + + "\"></i>\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.canEdit), {hash:{},inverse:self.program(18, program18, data),fn:self.program(16, program16, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</td>\n<td width=\"15%\" nowrap=\"nowrap\">\n <i class=\"icon-alert-error\" title=\"" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "alerts.error_tooltip", options) : helperMissing.call(depth0, "t", "alerts.error_tooltip", options))) + + "\"></i>\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.canEdit), {hash:{},inverse:self.program(22, program22, data),fn:self.program(20, program20, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</td>\n<td class=\"quality-gate-condition-actions\" width=\"120px\" nowrap>\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.canEdit), {hash:{},inverse:self.noop,fn:self.program(24, program24, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</td>"; + return buffer; + }); + +this["SS"]["Templates"]["quality-gate-detail-conditions-empty"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "<td colspan=\"6\">\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.no_conditions", options) : helperMissing.call(depth0, "t", "quality_gates.no_conditions", options))) + + "\n</td>"; + return buffer; + }); + +this["SS"]["Templates"]["quality-gate-detail-conditions"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing; + +function program1(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n <div class=\"quality-gate-new-condition\">\n <label for=\"quality-gate-new-condition-metric\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.add_condition", options) : helperMissing.call(depth0, "t", "quality_gates.add_condition", options))) + + ":</label>\n <select id=\"quality-gate-new-condition-metric\">\n <option></option>\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.metricGroups), {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </select>\n </div>\n"; + return buffer; + } +function program2(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "\n <optgroup label=\""; + if (helper = helpers.domain) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.domain); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\">\n "; + stack1 = helpers.each.call(depth0, (depth0 && depth0.metrics), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </optgroup>\n "; + return buffer; + } +function program3(depth0,data) { + + var buffer = "", stack1, helper; + buffer += "<option value=\""; + if (helper = helpers.key) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.key); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "\">"; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</option>"; + return buffer; + } + + buffer += "<div class=\"quality-gate-section-name\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.conditions", options) : helperMissing.call(depth0, "t", "quality_gates.conditions", options))) + + "</div>\n\n<div class=\"quality-gate-introduction\">\n <p>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.introduction", options) : helperMissing.call(depth0, "t", "quality_gates.introduction", options))) + + "\n <a class=\"link-action quality-gate-introduction-show-more\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "more", options) : helperMissing.call(depth0, "t", "more", options))) + + "</a>\n </p>\n <div class=\"quality-gate-introduction-more\">\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.health_icons", options) : helperMissing.call(depth0, "t", "quality_gates.health_icons", options))) + + "\n <table class=\"data\">\n <thead>\n <tr>\n <th colspan=\"3\"></th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"even\">\n <td><i class=\"icon-alert-ok\"></i></td>\n <td>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "alerts.notes.ok", options) : helperMissing.call(depth0, "t", "alerts.notes.ok", options))) + + "</td>\n </tr>\n <tr class=\"odd\">\n <td><i class=\"icon-alert-warn\"></i></td>\n <td>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "alerts.notes.warn", options) : helperMissing.call(depth0, "t", "alerts.notes.warn", options))) + + "</td>\n </tr>\n <tr class=\"even\">\n <td><i class=\"icon-alert-error\"></i></td>\n <td>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "alerts.notes.error", options) : helperMissing.call(depth0, "t", "alerts.notes.error", options))) + + "</td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n\n"; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.canEdit), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n\n<table class=\"data zebra width100 marginbottom10 spaced quality-gate-conditions\">\n <thead><tr></tr></thead>\n <tbody></tbody>\n</table>"; + return buffer; + }); + +this["SS"]["Templates"]["quality-gate-detail-header"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this, functionType="function"; + +function program1(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "\n <div class=\"navigator-header-actions button-group\">\n <button id=\"quality-gate-rename\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "rename", options) : helperMissing.call(depth0, "t", "rename", options))) + + "</button>\n <button id=\"quality-gate-copy\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "copy", options) : helperMissing.call(depth0, "t", "copy", options))) + + "</button>\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0['default']), {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n <button id=\"quality-gate-delete\" class=\"button-red\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "delete", options) : helperMissing.call(depth0, "t", "delete", options))) + + "</button>\n </div>\n"; + return buffer; + } +function program2(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <button id=\"quality-gate-unset-as-default\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "unset_as_default", options) : helperMissing.call(depth0, "t", "unset_as_default", options))) + + "</button>\n "; + return buffer; + } + +function program4(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n <button id=\"quality-gate-set-as-default\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "set_as_default", options) : helperMissing.call(depth0, "t", "set_as_default", options))) + + "</button>\n "; + return buffer; + } + + buffer += "<h1 class=\"navigator-header-title\">"; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</h1>\n\n"; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.canEdit), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + return buffer; + }); + +this["SS"]["Templates"]["quality-gate-detail-projects"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n <p class=\"quality-gate-default-message\">\n "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0.canEdit), {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </p>\n"; + return buffer; + } +function program2(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.projects_for_default.edit", options) : helperMissing.call(depth0, "t", "quality_gates.projects_for_default.edit", options))) + + "\n "; + return buffer; + } + +function program4(depth0,data) { + + var buffer = "", helper, options; + buffer += "\n " + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.projects_for_default", options) : helperMissing.call(depth0, "t", "quality_gates.projects_for_default", options))) + + "\n "; + return buffer; + } + +function program6(depth0,data) { + + + return "\n <div id=\"select-list-projects\"></div>\n"; + } + + buffer += "<div class=\"quality-gate-section-name\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.projects", options) : helperMissing.call(depth0, "t", "quality_gates.projects", options))) + + "</div>\n\n"; + stack1 = helpers['if'].call(depth0, (depth0 && depth0['default']), {hash:{},inverse:self.program(6, program6, data),fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + return buffer; + }); + +this["SS"]["Templates"]["quality-gate-detail"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "<div id=\"quality-gate-conditions\" class=\"quality-gate-section\"></div>\n<div id=\"quality-gate-projects\" class=\"quality-gate-section\"></div>"; + }); + +this["SS"]["Templates"]["quality-gate-edit"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType="function", self=this; + +function program1(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "<h2>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.rename", options) : helperMissing.call(depth0, "t", "quality_gates.rename", options))) + + " "; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</h2>"; + return buffer; + } + +function program3(depth0,data) { + + var buffer = "", stack1, helper, options; + buffer += "<h2>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.copy", options) : helperMissing.call(depth0, "t", "quality_gates.copy", options))) + + " "; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + "</h2>"; + return buffer; + } + +function program5(depth0,data) { + + var buffer = "", helper, options; + buffer += "<h2>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.add", options) : helperMissing.call(depth0, "t", "quality_gates.add", options))) + + "</h2>"; + return buffer; + } + +function program7(depth0,data) { + + var buffer = "", helper, options; + buffer += "<button>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "save", options) : helperMissing.call(depth0, "t", "save", options))) + + "</button>"; + return buffer; + } + +function program9(depth0,data) { + + var buffer = "", helper, options; + buffer += "<button>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "copy", options) : helperMissing.call(depth0, "t", "copy", options))) + + "</button>"; + return buffer; + } + +function program11(depth0,data) { + + var buffer = "", helper, options; + buffer += "<button>" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "create", options) : helperMissing.call(depth0, "t", "create", options))) + + "</button>"; + return buffer; + } + + buffer += "<form>\n <div class=\"modal-head\">\n "; + stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "rename", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "rename", options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "copy", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "copy", options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "create", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "create", options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n </div>\n\n <div class=\"modal-body\">\n <div class=\"modal-error\"></div>\n <div class=\"modal-field\">\n <label for=\"quality-gate-edit-name\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "name", options) : helperMissing.call(depth0, "t", "name", options))) + + " <em class=\"mandatory\">*</em></label>\n <input id=\"quality-gate-edit-name\" type=\"text\" size=\"50\" maxlength=\"100\">\n </div>\n </div>\n\n <div class=\"modal-foot\">\n "; + stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "rename", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "rename", options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(9, program9, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "copy", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "copy", options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(11, program11, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "create", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "create", options)); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n <a id=\"quality-gate-cancel-create\" class=\"action\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "cancel", options) : helperMissing.call(depth0, "t", "cancel", options))) + + "</a>\n </div>\n</form>"; + return buffer; + }); + +this["SS"]["Templates"]["quality-gate-sidebar-list-empty"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "<div class=\"line line-nowrap\">" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.noQualityGates", options) : helperMissing.call(depth0, "t", "quality_gates.noQualityGates", options))) + + "</div>"; + return buffer; + }); + +this["SS"]["Templates"]["quality-gate-sidebar-list-item"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, helper, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType="function", self=this; + +function program1(depth0,data) { + + var buffer = "", helper, options; + buffer += "<span class=\"subtitle\">(" + + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "default", options) : helperMissing.call(depth0, "t", "default", options))) + + ")</span>"; + return buffer; + } + + buffer += "<div class=\"line line-nowrap\">"; + if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } + else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } + buffer += escapeExpression(stack1) + + " "; + stack1 = helpers['if'].call(depth0, (depth0 && depth0['default']), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "</div>"; + return buffer; + }); + +this["SS"]["Templates"]["quality-gates-layout"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "<div class=\"navigator-header\"></div>\n<div class=\"navigator-results quality-gates-nav\"></div>\n<div class=\"navigator-details\"></div>\n<div class=\"navigator-actions\"></div>"; + }); + +return this["SS"]["Templates"]; + +});
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/javascripts/tests/main.js b/sonar-server/src/main/webapp/js/tests/main.js index c012e4777e2..c012e4777e2 100644 --- a/sonar-server/src/main/webapp/javascripts/tests/main.js +++ b/sonar-server/src/main/webapp/js/tests/main.js diff --git a/sonar-server/src/main/webapp/javascripts/tests/navigator/filters/BaseFilterViewSpec.js b/sonar-server/src/main/webapp/js/tests/navigator/filters/BaseFilterViewSpec.js index b1a0ab15c4f..b1a0ab15c4f 100644 --- a/sonar-server/src/main/webapp/javascripts/tests/navigator/filters/BaseFilterViewSpec.js +++ b/sonar-server/src/main/webapp/js/tests/navigator/filters/BaseFilterViewSpec.js diff --git a/sonar-server/src/main/webapp/javascripts/tests/navigator/filters/ChoiceFilterViewSpec.js b/sonar-server/src/main/webapp/js/tests/navigator/filters/ChoiceFilterViewSpec.js index 3b905a9f88f..3b905a9f88f 100644 --- a/sonar-server/src/main/webapp/javascripts/tests/navigator/filters/ChoiceFilterViewSpec.js +++ b/sonar-server/src/main/webapp/js/tests/navigator/filters/ChoiceFilterViewSpec.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/backbone.js b/sonar-server/src/main/webapp/js/third-party/backbone.js index f7783c2c199..f7783c2c199 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/backbone.js +++ b/sonar-server/src/main/webapp/js/third-party/backbone.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/backbone.marionette.js b/sonar-server/src/main/webapp/js/third-party/backbone.marionette.js index a7dfbc340fc..a7dfbc340fc 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/backbone.marionette.js +++ b/sonar-server/src/main/webapp/js/third-party/backbone.marionette.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/d3.js b/sonar-server/src/main/webapp/js/third-party/d3.js index b57c8d0b1c1..b57c8d0b1c1 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/d3.js +++ b/sonar-server/src/main/webapp/js/third-party/d3.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/handlebars.js b/sonar-server/src/main/webapp/js/third-party/handlebars.js index 1c64ca507d8..1c64ca507d8 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/handlebars.js +++ b/sonar-server/src/main/webapp/js/third-party/handlebars.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/jquery-ui.js b/sonar-server/src/main/webapp/js/third-party/jquery-ui.js index fd8cf31e50d..fd8cf31e50d 100755 --- a/sonar-server/src/main/webapp/javascripts/third-party/jquery-ui.js +++ b/sonar-server/src/main/webapp/js/third-party/jquery-ui.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/jquery.js b/sonar-server/src/main/webapp/js/third-party/jquery.js index 3c88fa8b7fd..3c88fa8b7fd 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/jquery.js +++ b/sonar-server/src/main/webapp/js/third-party/jquery.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/jquery.mockjax.js b/sonar-server/src/main/webapp/js/third-party/jquery.mockjax.js index b8e13145e40..b8e13145e40 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/jquery.mockjax.js +++ b/sonar-server/src/main/webapp/js/third-party/jquery.mockjax.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/moment.js b/sonar-server/src/main/webapp/js/third-party/moment.js index 0018faebf9f..0018faebf9f 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/moment.js +++ b/sonar-server/src/main/webapp/js/third-party/moment.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/select2.js b/sonar-server/src/main/webapp/js/third-party/select2.js index 213f4cf930a..213f4cf930a 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/select2.js +++ b/sonar-server/src/main/webapp/js/third-party/select2.js diff --git a/sonar-server/src/main/webapp/javascripts/third-party/underscore.js b/sonar-server/src/main/webapp/js/third-party/underscore.js index ca61fdc3a4b..ca61fdc3a4b 100644 --- a/sonar-server/src/main/webapp/javascripts/third-party/underscore.js +++ b/sonar-server/src/main/webapp/js/third-party/underscore.js diff --git a/sonar-server/src/main/webapp/javascripts/top-search.js b/sonar-server/src/main/webapp/js/top-search.js index f6b3d7afe6e..f6b3d7afe6e 100644 --- a/sonar-server/src/main/webapp/javascripts/top-search.js +++ b/sonar-server/src/main/webapp/js/top-search.js diff --git a/sonar-server/src/main/webapp/javascripts/translate.js b/sonar-server/src/main/webapp/js/translate.js index 9795da08b27..9795da08b27 100644 --- a/sonar-server/src/main/webapp/javascripts/translate.js +++ b/sonar-server/src/main/webapp/js/translate.js diff --git a/sonar-server/src/main/webapp/javascripts/widgets/bubble-chart.js b/sonar-server/src/main/webapp/js/widgets/bubble-chart.js index 3d60d877944..3d60d877944 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/bubble-chart.js +++ b/sonar-server/src/main/webapp/js/widgets/bubble-chart.js diff --git a/sonar-server/src/main/webapp/javascripts/widgets/histogram.js b/sonar-server/src/main/webapp/js/widgets/histogram.js index bbef0380f31..bbef0380f31 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/histogram.js +++ b/sonar-server/src/main/webapp/js/widgets/histogram.js diff --git a/sonar-server/src/main/webapp/javascripts/widgets/pie-chart.js b/sonar-server/src/main/webapp/js/widgets/pie-chart.js index cf7acdced26..cf7acdced26 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/pie-chart.js +++ b/sonar-server/src/main/webapp/js/widgets/pie-chart.js diff --git a/sonar-server/src/main/webapp/javascripts/widgets/stack-area.js b/sonar-server/src/main/webapp/js/widgets/stack-area.js index 8a16b7e679a..8a16b7e679a 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/stack-area.js +++ b/sonar-server/src/main/webapp/js/widgets/stack-area.js diff --git a/sonar-server/src/main/webapp/javascripts/widgets/timeline.js b/sonar-server/src/main/webapp/js/widgets/timeline.js index 32d33b0abfb..32d33b0abfb 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/timeline.js +++ b/sonar-server/src/main/webapp/js/widgets/timeline.js diff --git a/sonar-server/src/main/webapp/javascripts/widgets/widget.js b/sonar-server/src/main/webapp/js/widgets/widget.js index 4c7f3a6a06e..4c7f3a6a06e 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/widget.js +++ b/sonar-server/src/main/webapp/js/widgets/widget.js diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-actions.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-actions.hbs new file mode 100644 index 00000000000..ad149573ba4 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-actions.hbs @@ -0,0 +1,18 @@ +<div class="navigator-actions-order"> + {{#if sorting}} + {{t 'coding_rules.ordered_by'}} <strong>{{sorting.sortText}}</strong> {{#if sorting.asc}}<i class="icon-arrow-up"></i>{{else}}<i class="icon-arrow-down"></i>{{/if}} + {{else}} + {{t 'coding_rules.order'}} + {{/if}} +</div> +<ul class="navigator-actions-order-choices"> + <li data-sort="CREATION_DATE" data-asc="true">{{t 'coding_rules.sort.creation_date'}} <i class="icon-arrow-up"></i></li> + <li data-sort="CREATION_DATE" data-asc="false">{{t 'coding_rules.sort.creation_date'}} <i class="icon-arrow-down"></i></li> + <li data-sort="NAME" data-asc="true">{{t 'coding_rules.sort.name'}} <i class="icon-arrow-up"></i></li> + <li data-sort="NAME" data-asc="false">{{t 'coding_rules.sort.name'}} <i class="icon-arrow-down"></i></li> +</ul> +<div class="navigator-actions-total"> + {{t 'coding_rules.found'}}: <strong>{{paging.fTotal}}</strong> + <a class="navigator-actions-bulk" + title="{{t 'bulk_change'}}"><i class="icon-settings-multiple"></i></a> +</div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-bulk-change.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-bulk-change.hbs new file mode 100644 index 00000000000..f7f1010eeba --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-bulk-change.hbs @@ -0,0 +1,62 @@ +<form> + <div class="modal-head"> + <h2>{{t 'coding_rules.bulk_change'}} {{paging.fTotal}} {{t 'coding_rules._rules'}}</h2> + </div> + + <div class="modal-body"> + <div class="modal-error"></div> + + {{#if inactiveQualityProfile}} + <div class="modal-field"> + <label for="coding-rules-bulk-change-activate-on-qp">Activate on</label> + <input id="coding-rules-bulk-change-activate-qp" type="checkbox"> + <span class="text">{{inactiveQualityProfileName}}</span> + </div> + {{/if}} + + <div class="modal-field"> + <label for="coding-rules-bulk-change-activate-on">{{#unless inactiveQualityProfile}}Activate on{{/unless}}</label> + <input id="coding-rules-bulk-change-activate" type="checkbox"> + <select id="coding-rules-bulk-change-activate-on" multiple> + {{#each activateOnQualityProfiles}} + <option value="{{key}}">{{name}}</option> + {{/each}} + </select> + </div> + + {{#if activeQualityProfile}} + <div class="modal-field"> + <label for="coding-rules-bulk-change-deactivate-on-qp">Deactivate on</label> + <input id="coding-rules-bulk-change-deactivate-qp" type="checkbox"> + <span class="text">{{activeQualityProfileName}}</span> + </div> + {{/if}} + + <div class="modal-field"> + <label for="coding-rules-bulk-change-deactivate-on">{{#unless activeQualityProfile}}Deactivate on{{/unless}}</label> + <input id="coding-rules-bulk-change-deactivate" type="checkbox"> + <select id="coding-rules-bulk-change-deactivate-on" multiple> + {{#each deactivateOnQualityProfiles}} + <option value="{{key}}">{{name}}</option> + {{/each}} + </select> + </div> + + {{#if activeQualityProfile}} + <div class="modal-field"> + <label for="coding-rules-bulk-change-severity">Change Severity</label> + <input id="coding-rules-bulk-change-set-severity" type="checkbox"> + <select id="coding-rules-bulk-change-severity"> + {{#each severities}} + <option value="{{this}}">{{t 'severity' this}}</option> + {{/each}} + </select> + </div> + {{/if}} + </div> + + <div class="modal-foot"> + <button>{{t 'apply'}}</button> + <a id="coding-rules-cancel-bulk-change" class="action">{{t 'cancel'}}</a> + </div> +</form>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-detail-quality-profile.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-detail-quality-profile.hbs new file mode 100644 index 00000000000..fe6fc385a58 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-detail-quality-profile.hbs @@ -0,0 +1,84 @@ +<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}} + +<ul class="coding-rules-detail-parameters coding-rules-detail-quality-profile-parameters"> + <li class="coding-rules-detail-parameter"> + <h3 class="coding-rules-detail-parameter-name">{{t 'severity'}}</h3> + <div class="coding-rules-detail-parameter-description"> + <select class="coding-rules-detail-quality-profile-severity"> + {{#each severities}} + <option value="{{this}}">{{t 'severity' this}}</option> + {{/each}} + </select> + {{#if parent}} + {{#notEq severity parent.severity}} + {{t 'coding_rules.original'}} {{severityIcon parent.severity}}{{t 'severity' parent.severity}} + {{/notEq}} + {{/if}} + </div> + </li> + {{#each parameters}} + <li class="coding-rules-detail-parameter"> + <h3 class="coding-rules-detail-parameter-name">{{key}}</h3> + <div class="coding-rules-detail-parameter-description"> + <input type="text" value="{{value}}"> + {{#if ../parent}} + {{#notEq value original}} + {{t 'coding_rules.original'}} {{original}} + {{/notEq}} + {{/if}} + </div> + </li> + {{/each}} +</ul> + +<div class="coding-rules-detail-quality-profile-note"> + {{#if note}} + <blockquote class="rule-desc"> + <cite> + <b>{{note.username}}</b> ({{note.fCreationDate}}) | + <a class="coding-rules-detail-quality-profile-note-edit link-action">{{t 'edit'}}</a> + <a class="coding-rules-detail-quality-profile-note-delete link-action">{{t 'delete'}}</a> + </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 class="coding-rules-detail-quality-profile-note-form admin"> + <table class="width100 table"> + <tbody> + <tr> + <td class="width100" colspan="2"> + <textarea class="coding-rules-detail-quality-profile-note-text" rows="4" style="width: 100%;">{{#if note}}{{note.raw}}{{/if}}</textarea> + </td> + </tr> + <tr> + <td> + <button class="coding-rules-detail-quality-profile-note-submit"> + {{#if note}}{{t 'update'}}{{else}}{{t 'coding_rules.add_note'}}{{/if}} + </button> + <a class="coding-rules-detail-quality-profile-note-cancel action">{{t 'cancel'}}</a> + </td> + <td class="right"> + {{> '_markdown-tips' }} + </td> + </tr> + </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>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-detail.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-detail.hbs new file mode 100644 index 00000000000..9a047d15023 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-detail.hbs @@ -0,0 +1,85 @@ +<h3 class="coding-rules-detail-header">{{name}}</h3> + +<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> + {{#notEq status 'READY'}} + <li class="coding-rules-detail-property"> + <span class="coding-rules-detail-status">{{status}}</span> + </li> + {{/notEq}} + <li class="coding-rules-detail-property coding-rules-detail-tag-list"> + <i class="icon-tags"></i> + {{join tags ', '}} + <a class="link-action coding-rules-detail-tags-change">{{t 'change'}}</a> + </li> + <li class="coding-rules-detail-property coding-rules-detail-tag-edit"> + <input class="coding-rules-detail-tag-input" type="text" value="{{join tags ','}}"> + <a class="link-action coding-rules-detail-tag-edit-done">{{t 'done'}}</a> + </li> + <li class="coding-rules-detail-property">{{t 'coding_rules.available_since'}} {{fCreationDate}}</li> + <li class="coding-rules-detail-property">{{t 'coding_rules.repository'}} {{repository}}</li> + <li class="coding-rules-detail-property">{{t 'coding_rules.key'}} {{key}}</li> +</ul> + +<div class="coding-rules-detail-description rule-desc">{{{description}}}</div> + +<div class="coding-rules-detail-description coding-rules-detail-description-extra"> + <div id="coding-rules-detail-description-extra"> + {{#if extra}}<div class="rule-desc">{{{extra}}}</div>{{/if}} + <a class="link-action" id="coding-rules-detail-extend-description">{{t 'coding_rules.extend_description'}}</a> + </div> + + <div id="coding-rules-detail-extend-description-form" class="admin"> + <table class="width100 table"> + <tbody> + <tr> + <td class="width100" colspan="2"> + <textarea id="coding-rules-detail-extend-description-text" rows="4" style="width: 100%;">{{extraRaw}}</textarea> + </td> + </tr> + <tr> + <td> + <button id="coding-rules-detail-extend-description-submit">{{t 'coding_rules.extend_description'}}</button> + <a id="coding-rules-detail-extend-description-cancel" class="action">{{t 'cancel'}}</a> + </td> + <td class="right"> + {{> '_markdown-tips' }} + </td> + </tr> + </tbody> + </table> + </div> + + <div id="coding-rules-detail-extend-description-spinner"> + <i class="spinner"></i> + </div> +</div> + + +{{#if parameters}} + <h3 class="coding-rules-detail-title">{{t 'coding_rules.parameters'}}</h3> + <ul class="coding-rules-detail-parameters"> + {{#each parameters}} + <li class="coding-rules-detail-parameter"> + <h3 class="coding-rules-detail-parameter-name">{{key}}</h3> + <div class="coding-rules-detail-parameter-description"> + {{description}} + + {{#if default}} + <div>{{t 'coding_rules.parameters.default_value'}} {{default}}</div> + {{/if}} + </div> + </li> + {{/each}} + </ul> +{{/if}} + + +<h3 class="coding-rules-detail-title">{{t 'coding_rules.quality_profiles'}}</h3> +<div class="button-group coding-rules-detail-quality-profiles-activation"> + <button id="coding-rules-quality-profile-activate">{{t 'coding_rules.activate_quality_profile'}}</button> +</div> +<div id="coding-rules-detail-quality-profiles"></div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-facets-item.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-facets-item.hbs new file mode 100644 index 00000000000..634d28353c1 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-facets-item.hbs @@ -0,0 +1,9 @@ +<h3 class="navigator-facets-list-item-name">{{name}}</h3> +<ul class="navigator-facets-list-item-options"> + {{#each options}} + <li class="navigator-facets-list-item-option"> + <span class="navigator-facets-list-item-option-name">{{this}}</span> + <span class="navigator-facets-list-item-option-stat subtitle">42</span> + </li> + {{/each}} +</ul>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-filter-bar.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-filter-bar.hbs new file mode 100644 index 00000000000..2e0f52a1b21 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-filter-bar.hbs @@ -0,0 +1,2 @@ +<div class="navigator-filters-list"></div> +<button class="navigator-filter-submit">{{t 'search_verb'}}</button>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-header.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-header.hbs new file mode 100644 index 00000000000..37f1e638244 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-header.hbs @@ -0,0 +1,5 @@ +<h1 class="navigator-header-title">{{t 'coding_rules.page'}}</h1> + +<div class="navigator-header-actions button-group"> + <button id="coding-rules-new-search">{{t 'coding_rules.new_search'}}</button> +</div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-layout.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-layout.hbs new file mode 100644 index 00000000000..98a5dd7c69a --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-layout.hbs @@ -0,0 +1,5 @@ +<div class="navigator-header"></div> +<div class="navigator-filters"></div> +<div class="navigator-results"></div> +<div class="navigator-actions"></div> +<div class="navigator-details"></div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-list-empty.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-list-empty.hbs new file mode 100644 index 00000000000..75e2daf75af --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-list-empty.hbs @@ -0,0 +1 @@ +{{t 'coding_rules.no_results'}}
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-list-item.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-list-item.hbs new file mode 100644 index 00000000000..8dd7be70fca --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-list-item.hbs @@ -0,0 +1,10 @@ +<div class="line line-small"> + {{#if qualityProfile}} + <i class="icon-quality-profile"></i> {{qualityProfileName}} + {{severityIcon severity}}{{t "severity" severity}} + {{/if}} + <span class="coding-rules-detail-status">{{language}}</span> + + <div class="line-right">{{#notEq status 'READY'}}{{status}}{{/notEq}}</div> +</div> +<div class="line line-nowrap" title="{{name}}">{{name}}</div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-quality-profile-activation.hbs b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-quality-profile-activation.hbs new file mode 100644 index 00000000000..e1b322ebcd2 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/coding-rules/coding-rules-quality-profile-activation.hbs @@ -0,0 +1,49 @@ +<form> + <div class="modal-head"> + <h2>{{t 'coding_rules.activate_quality_profile'}}</h2> + </div> + + <div class="modal-body"> + <div class="modal-error"></div> + + <table> + <tr class="property"> + <th><h3>{{t 'coding_rules.quality_profile'}}</h3></th> + <td> + <select id="coding-rules-quality-profile-activation-select"> + {{#each qualityProfiles}} + <option value="{{key}}">{{name}}</option> + {{/each}} + </select> + </td> + </tr> + <tr class="property"> + <th><h3>{{t 'severity'}}</h3></th> + <td> + <select id="coding-rules-quality-profile-activation-severity"> + {{#each severities}} + <option value="{{this}}">{{t 'severity' this}}</option> + {{/each}} + </select> + </td> + </tr> + {{#each parameters}} + <tr class="property"> + <th><h3>{{key}}</h3></th> + <td> + <input type="text" {{#if default}}value="{{default}}"{{/if}}> + <div class="note">{{description}}</div> + {{#if extra}} + <div class="note">{{extra}}</div> + {{/if}} + </td> + </tr> + {{/each}} + </table> + </div> + + <div class="modal-foot"> + <button id="coding-rules-quality-profile-activation-activate">{{t 'coding_rules.activate'}}</button> + <a id="coding-rules-quality-profile-activation-cancel" class="action">{{t 'cancel'}}</a> + </div> +</form>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/common/_markdown-tips.hbs b/sonar-server/src/main/webapp/templates/common/_markdown-tips.hbs new file mode 100644 index 00000000000..948a55e77ac --- /dev/null +++ b/sonar-server/src/main/webapp/templates/common/_markdown-tips.hbs @@ -0,0 +1,4 @@ +<div class="markdown-tips"> + <a href="#" onclick="window.open(baseUrl + '/markdown/help','markdown','height=300,width=600,scrollbars=1,resizable=1');return false;">{{t 'markdown.helplink'}}</a> : + *{{t 'bold'}}* ``{{t 'code'}}`` * {{t 'bulleted_point'}} +</div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-actions.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-actions.hbs new file mode 100644 index 00000000000..df06013aa54 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-actions.hbs @@ -0,0 +1,6 @@ +<h1 class="navigator-header-title">{{t 'quality_gates.page'}}</h1> +{{#if canEdit}} + <div class="navigator-header-actions button-group"> + <button id="quality-gate-add">{{t 'add_verb'}}</button> + </div> +{{/if}}
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-condition.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-condition.hbs new file mode 100644 index 00000000000..50e3e04484a --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-condition.hbs @@ -0,0 +1,57 @@ +<td nowrap> + {{metric.name}} +</td> +<td width="10%" nowrap> + {{#if canEdit}} + <select name="period"> + {{#unless isDiffMetric}}<option value="0">{{t 'value'}}</option>{{/unless}} + {{#each periods}}<option value="{{key}}">Δ {{text}}</option>{{/each}} + </select> + {{else}} + {{#if periodText}}Δ {{periodText}} + {{else}}{{t 'value'}} + {{/if}} + {{/if}} +</td> +<td width="10%" nowrap> + {{#if canEdit}} + <select name="operator"> + {{#operators metric.type}} + <option value="{{this}}">{{t 'quality_gates.operator' this}}</option> + {{/operators}} + </select> + {{else}} + {{t 'quality_gates.operator' op}} + {{/if}} +</td> +<td width="15%" nowrap="nowrap"> + <i class="icon-alert-warn" title="{{t 'alerts.warning_tooltip'}}"></i> + {{#if canEdit}} + <input name="warning" class="measure-input" data-type="{{metric.type}}" type="text"> + {{else}} + {{warning}} + {{/if}} +</td> +<td width="15%" nowrap="nowrap"> + <i class="icon-alert-error" title="{{t 'alerts.error_tooltip'}}"></i> + {{#if canEdit}} + <input name="error" class="measure-input" data-type="{{metric.type}}" type="text"> + {{else}} + {{error}} + {{/if}} +</td> +<td class="quality-gate-condition-actions" width="120px" nowrap> + {{#if canEdit}} + {{#if id}} + <div class="button-group"> + <button class="update-condition" disabled>{{t 'update_verb'}}</button> + <button class="button-red delete-condition">{{t 'delete'}}</button> + </div> + {{else}} + <div class="button-group"> + <button class="add-condition">{{t 'add_verb'}}</button> + <a class="action cancel-add-condition">{{t 'cancel'}}</a> + </div> + {{/if}} + {{/if}} +</td>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-conditions-empty.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-conditions-empty.hbs new file mode 100644 index 00000000000..40c92668496 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-conditions-empty.hbs @@ -0,0 +1,3 @@ +<td colspan="6"> + {{t 'quality_gates.no_conditions'}} +</td>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-conditions.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-conditions.hbs new file mode 100644 index 00000000000..ef2980720ce --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-conditions.hbs @@ -0,0 +1,50 @@ +<div class="quality-gate-section-name">{{t 'quality_gates.conditions'}}</div> + +<div class="quality-gate-introduction"> + <p>{{t 'quality_gates.introduction'}} + <a class="link-action quality-gate-introduction-show-more">{{t 'more'}}</a> + </p> + <div class="quality-gate-introduction-more"> + {{t 'quality_gates.health_icons'}} + <table class="data"> + <thead> + <tr> + <th colspan="3"></th> + </tr> + </thead> + <tbody> + <tr class="even"> + <td><i class="icon-alert-ok"></i></td> + <td>{{t 'alerts.notes.ok'}}</td> + </tr> + <tr class="odd"> + <td><i class="icon-alert-warn"></i></td> + <td>{{t 'alerts.notes.warn'}}</td> + </tr> + <tr class="even"> + <td><i class="icon-alert-error"></i></td> + <td>{{t 'alerts.notes.error'}}</td> + </tr> + </tbody> + </table> + </div> +</div> + +{{#if canEdit}} + <div class="quality-gate-new-condition"> + <label for="quality-gate-new-condition-metric">{{t 'quality_gates.add_condition'}}:</label> + <select id="quality-gate-new-condition-metric"> + <option></option> + {{#each metricGroups}} + <optgroup label="{{domain}}"> + {{#each metrics}}<option value="{{key}}">{{name}}</option>{{/each}} + </optgroup> + {{/each}} + </select> + </div> +{{/if}} + +<table class="data zebra width100 marginbottom10 spaced quality-gate-conditions"> + <thead><tr></tr></thead> + <tbody></tbody> +</table>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-header.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-header.hbs new file mode 100644 index 00000000000..e84a730d379 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-header.hbs @@ -0,0 +1,14 @@ +<h1 class="navigator-header-title">{{name}}</h1> + +{{#if canEdit}} + <div class="navigator-header-actions button-group"> + <button id="quality-gate-rename">{{t 'rename'}}</button> + <button id="quality-gate-copy">{{t 'copy'}}</button> + {{#if default}} + <button id="quality-gate-unset-as-default">{{t 'unset_as_default'}}</button> + {{else}} + <button id="quality-gate-set-as-default">{{t 'set_as_default'}}</button> + {{/if}} + <button id="quality-gate-delete" class="button-red">{{t 'delete'}}</button> + </div> +{{/if}}
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-projects.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-projects.hbs new file mode 100644 index 00000000000..989cae0f31e --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail-projects.hbs @@ -0,0 +1,13 @@ +<div class="quality-gate-section-name">{{t 'quality_gates.projects'}}</div> + +{{#if default}} + <p class="quality-gate-default-message"> + {{#if canEdit}} + {{t 'quality_gates.projects_for_default.edit'}} + {{else}} + {{t 'quality_gates.projects_for_default'}} + {{/if}} + </p> +{{else}} + <div id="select-list-projects"></div> +{{/if}}
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail.hbs new file mode 100644 index 00000000000..0c5467b3476 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-detail.hbs @@ -0,0 +1,2 @@ +<div id="quality-gate-conditions" class="quality-gate-section"></div> +<div id="quality-gate-projects" class="quality-gate-section"></div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-edit.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-edit.hbs new file mode 100644 index 00000000000..658b9326cbf --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-edit.hbs @@ -0,0 +1,22 @@ +<form> + <div class="modal-head"> + {{#eq method "rename"}}<h2>{{t 'quality_gates.rename'}} {{name}}</h2>{{/eq}} + {{#eq method "copy"}}<h2>{{t 'quality_gates.copy'}} {{name}}</h2>{{/eq}} + {{#eq method "create"}}<h2>{{t 'quality_gates.add'}}</h2>{{/eq}} + </div> + + <div class="modal-body"> + <div class="modal-error"></div> + <div class="modal-field"> + <label for="quality-gate-edit-name">{{t 'name'}} <em class="mandatory">*</em></label> + <input id="quality-gate-edit-name" type="text" size="50" maxlength="100"> + </div> + </div> + + <div class="modal-foot"> + {{#eq method "rename"}}<button>{{t 'save'}}</button>{{/eq}} + {{#eq method "copy"}}<button>{{t 'copy'}}</button>{{/eq}} + {{#eq method "create"}}<button>{{t 'create'}}</button>{{/eq}} + <a id="quality-gate-cancel-create" class="action">{{t 'cancel'}}</a> + </div> +</form>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-sidebar-list-empty.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-sidebar-list-empty.hbs new file mode 100644 index 00000000000..8b017f09987 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-sidebar-list-empty.hbs @@ -0,0 +1 @@ +<div class="line line-nowrap">{{t 'quality_gates.noQualityGates'}}</div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-sidebar-list-item.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-sidebar-list-item.hbs new file mode 100644 index 00000000000..af8d93ae07b --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gate-sidebar-list-item.hbs @@ -0,0 +1 @@ +<div class="line line-nowrap">{{name}} {{#if default}}<span class="subtitle">({{t 'default'}})</span>{{/if}}</div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/templates/quality-gates/quality-gates-layout.hbs b/sonar-server/src/main/webapp/templates/quality-gates/quality-gates-layout.hbs new file mode 100644 index 00000000000..32f6d7e2694 --- /dev/null +++ b/sonar-server/src/main/webapp/templates/quality-gates/quality-gates-layout.hbs @@ -0,0 +1,4 @@ +<div class="navigator-header"></div> +<div class="navigator-results quality-gates-nav"></div> +<div class="navigator-details"></div> +<div class="navigator-actions"></div>
\ No newline at end of file |