]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4326 UI tuning for rule tag management
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 22 Jan 2014 15:35:41 +0000 (16:35 +0100)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 22 Jan 2014 16:52:37 +0000 (17:52 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_select_tags.html.erb

index 212710046255f56e26a558c55a9afe60e7de183e..0cf780a937b021183e103b2fc59eccca6ef79f43 100644 (file)
@@ -1673,6 +1673,7 @@ rules_configuration.available_since=Available since
 rules_configuration.removed_since=Removed since
 rules_configuration.select_tags=Select Tags
 rules_configuration.select_tags_for_rule=Select Tags for Rule:
+rules_configuration.available_tags=Available Tags
 rules_configuration.update_tags=Update Tags
 rules_configuration.new_tag=New Tag...
 rules_configuration.create_tag=Create Tag
index 6c522e504584ef00d654ea2f1140a41e0cafc1a7..5636ddf9c01dce111f61a403c9f6f538e8f210dc 100644 (file)
@@ -4,45 +4,50 @@
 </div>
 
 <form onsubmit="$j.ajax({
-                        url:'<%=ApplicationController.root_context-%>/rules_configuration/create_tag',
-                        success:function(response){ $j('#select-rule-tags').html(response); },
-                        error:function(response){ $j('#select-tags-error').html(response); },
+                        url:'<%=ApplicationController.root_context-%>/rules_configuration/select_tags',
+                        success:function(response){ closeModalWindow();$j('#rule_tags_<%=rule.id-%>').html(response); },
+                        error:function(result,status,errmsg){ $j('#select-tags-error').show().html(errmsg); },
                         data: $j(this).serialize(),
                         type:'post'});
                   return false;"
         method="post"
-        action="<%=ApplicationController.root_context-%>/rules_configuration/create_tag">
+        id="select-tags-form"
+        action="<%=ApplicationController.root_context-%>/rules_configuration/select_tags">
   <%= hidden_field_tag :rule_id, rule.id -%>
+  <%= hidden_field_tag :profile_id, profile_id -%>
   <fieldset>
     <div class="modal-body">
-      <%= text_field_tag 'new_tag', '', :size => 20, :maxlength => 20, :placeholder => message('rules_configuration.new_tag') -%>
-      <%= submit_tag message('rules_configuration.create_tag'), { :id => 'create_tag' } -%>
+      <h2><%= message('rules_configuration.available_tags') -%></h2>
+      <div id="select-rule-tags" style="height: 200px; overflow-y: scroll; border: 1px solid #cdcdcd;">
+        <%= render :partial => 'select_tags_list', :locals => { :tags => tags } -%>
+      </div>
     </div>
+
   </fieldset>
 </form>
 
+<div class="modal-error" id="select-tags-error"/>
+
 <form onsubmit="$j.ajax({
-                        url:'<%=ApplicationController.root_context-%>/rules_configuration/select_tags',
-                        success:function(response){ closeModalWindow();$j('#rule_tags_<%=rule.id-%>').html(response); },
-                        error:function(response){ $j('#select-tags-error').html(response); },
+                        url:'<%=ApplicationController.root_context-%>/rules_configuration/create_tag',
+                        success:function(response){ $j('#select-tags-error').hide();$j('#select-rule-tags').html(response);$j('#new_tag').val('');},
+                        error:function(response){ $j('#select-tags-error').show().html(response.responseText); },
                         data: $j(this).serialize(),
                         type:'post'});
                   return false;"
         method="post"
-        action="<%=ApplicationController.root_context-%>/rules_configuration/select_tags">
+        id="create-tag-form"
+        action="<%=ApplicationController.root_context-%>/rules_configuration/create_tag">
   <%= hidden_field_tag :rule_id, rule.id -%>
-  <%= hidden_field_tag :profile_id, profile_id -%>
   <fieldset>
     <div class="modal-body">
-      <div class="modal-error" id="select-tags-error"/>
-      <div id="select-rule-tags" style="height: 200px; overflow-y: visible">
-        <%= render :partial => 'select_tags_list', :locals => { :tags => tags } -%>
-      </div>
-    </div>
-
-    <div class="modal-foot">
-      <%= submit_tag message('rules_configuration.update_tags'), { :id => 'update_tags_' + rule.id.to_s } -%>
-      <a href="#" onclick="return closeModalWindow()" id="confirm-cancel"><%= h message('cancel') -%></a>
+      <%= text_field_tag 'new_tag', '', :size => 20, :maxlength => 20, :placeholder => message('rules_configuration.new_tag') -%>
+      <%= submit_tag message('rules_configuration.create_tag'), { :id => 'create_tag' } -%>
     </div>
   </fieldset>
 </form>
+
+<div class="modal-foot">
+  <button type="button" id="update_tags_<%= rule.id.to_s -%>" onclick="$j('#select-tags-form').submit();return true;"><%= message('rules_configuration.update_tags') -%></button>
+  <a href="#" onclick="return closeModalWindow()" id="confirm-cancel"><%= h message('cancel') -%></a>
+</div>