From 1719abc62d33568dfc1a1d8d90262062211c5f39 Mon Sep 17 00:00:00 2001
From: Stas Vilchik <stas.vilchik@sonarsource.com>
Date: Mon, 9 Oct 2017 18:11:33 +0200
Subject: SONAR-8513 Show visual indicator that a rule is a template

---
 server/sonar-web/src/main/js/apps/coding-rules/controller.js          | 2 +-
 .../apps/coding-rules/templates/coding-rules-workspace-list-item.hbs  | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/server/sonar-web/src/main/js/apps/coding-rules/controller.js b/server/sonar-web/src/main/js/apps/coding-rules/controller.js
index 8545fcfada6..8e4465bab0a 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/controller.js
+++ b/server/sonar-web/src/main/js/apps/coding-rules/controller.js
@@ -26,7 +26,7 @@ import throwGlobalError from '../../app/utils/throwGlobalError';
 
 export default Controller.extend({
   pageSize: 200,
-  ruleFields: ['name', 'lang', 'langName', 'sysTags', 'tags', 'status', 'severity'],
+  ruleFields: ['name', 'lang', 'langName', 'sysTags', 'tags', 'status', 'severity', 'isTemplate'],
 
   _searchParameters() {
     const fields = this.ruleFields.slice();
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list-item.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list-item.hbs
index 9996447d1bc..bc729a5054a 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list-item.hbs
+++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list-item.hbs
@@ -17,6 +17,10 @@
     <td>
       <div class="coding-rule-title">
         <a class="js-rule link-no-underline" href="{{permalink}}">{{name}}</a>
+        {{#if isTemplate}}
+          <span class="outline-badge spacer-left" title="{{t 'coding_rules.rule_template.title'}}" 
+            data-toggle="tooltip" data-placement="bottom">{{t 'coding_rules.rule_template'}}</span>
+        {{/if}}
       </div>
     </td>
 
-- 
cgit v1.2.3