]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3754 Improvements
authorDavid Gageot <david@gageot.net>
Fri, 21 Sep 2012 06:43:01 +0000 (08:43 +0200)
committerDavid Gageot <david@gageot.net>
Fri, 21 Sep 2012 06:44:59 +0000 (08:44 +0200)
sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_iframe.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/settings/_multi_value.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb
sonar-server/src/main/webapp/stylesheets/style.css

index b6dfedd5fc578d0ce74859266ff19a7bbd2ad7f5..fe7ab2ea4eee3d4bf3fdbd65ed06b4874bbf3c6e 100644 (file)
 #
 module SettingsHelper
   def category_name(category)
-    message_or_default("property.category.#{category}", category)
+    message("property.category.#{category}", :default => category)
   end
 
   def property_name(property)
-    message_or_default("property.#{property.key()}.name", property.name())
+    message("property.#{property.key()}.name", :default => property.name())
   end
 
   def property_description(property)
-    message_or_default("property.#{property.key()}.description", property.description())
+    message("property.#{property.key()}.description", :default => property.description())
+  end
+
+  def property_help(property)
+    message("property.#{property.key()}.help", :default => '')
   end
 
   def property_value(property)
@@ -46,10 +50,6 @@ module SettingsHelper
     property.getType()
   end
 
-  def message_or_default(message_key, default)
-    message(message_key, :default => default)
-  end
-
   def by_name(categories)
     categories.sort_by { |category| category_name(category) }
   end
index 111a50eca076269c1472043b859e54e16577f34a..afd4ebe9269c4fdf48eefb60c68e093e9810dcfe 100644 (file)
@@ -1,3 +1,8 @@
+<style>
+  #body {
+    padding: 0;
+  }
+</style>
 <% form_tag({:action => 'save'}) do -%>
   <table class="data form marginbottom10">
     <thead>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_iframe.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_iframe.html.erb
new file mode 100644 (file)
index 0000000..6e20677
--- /dev/null
@@ -0,0 +1,7 @@
+<div id="body" class="nolayout">
+  <% if @snapshot %><div class="print"><h2><%= @snapshot.project.name(true) %></h2></div><% end %>
+  <div class="error" id="error" style="display:none"><span id="errormsg"></span> &nbsp;&nbsp;[<a href="#" onclick="javascript:$('error').hide();return false;"><%= message('hide').downcase -%></a>]</div>
+  <div class="warning" id="warning" style="display:none"><span id="warningmsg"></span> &nbsp;&nbsp;[<a href="#" onclick="javascript:$('warning').hide();return false;"><%= message('hide').downcase -%></a>]</div>
+  <div class="notice" id="info" style="display:none"><span id="infomsg"></span> &nbsp;&nbsp;[<a href="#" onclick="javascript:$('info').hide();return false;"><%= message('hide').downcase -%></a>]</div>
+  <%= yield %>
+</div>
\ No newline at end of file
index a571f937090db304861677b478eef7f2e6f6fb15..3bc94037b05b0a2dacf1e00bfc0e90e982910836 100644 (file)
@@ -1,5 +1,5 @@
-<div class="multi_value">
+<div class="multi_value marginbottom5">
   <%= render "settings/type_#{property_type(property, value)}", :property => property, :value => value -%>
-  <a href="#" class="delete"></a>
+  <a href="#" class="delete link-action"><%= message('delete') -%></a>
   <br/>
 </div>
index 3e9602d4820b4d7da70fae92200c45f60fb34c7c..7719dc2d20961646c52d2d72e1369604051c5d78 100644 (file)
@@ -7,7 +7,7 @@
                      :update => 'properties',
                      :script => false do -%>
 
-    <table class="data marginbottom10" style="margin: 10px;">
+    <table class="data marginbottom10">
       <thead>
       <tr>
         <th><%= h category_name(@category) -%></th>
               <div class="template" style="display:none;">
                 <%= render "settings/multi_value", :property => property, :value => nil -%>
               </div>
-              <a href="#" class="add"><%= message('settings.add') -%></a>
-            <% else -%>
+              <button class="add_value"><%= message('settings.add') -%></button>
+              <br/>
+          <% else -%>
               <%= render "settings/type_#{property_type(property, value)}", :property => property, :value => value -%>
             <% end -%>
 
             <% default_prop_value = (@resource ? Property.value(property.key, nil, property.defaultValue) : property.defaultValue) -%>
-            <% unless default_prop_value.blank? %>
-              <p class="note">Default: <%= property.type.to_s=='PASSWORD' ? '********' : h(default_prop_value) -%></p>
+            <% unless default_prop_value.blank? -%>
+              <div class="note">Default: <%= property.type.to_s=='PASSWORD' ? '********' : h(default_prop_value) -%></div>
+            <% end -%>
+
+            <% details = property_help(property) -%>
+            <% unless details.blank? -%>
+              <br/>
+
+              <div class="help"><%= details -%></div>
             <% end -%>
           </td>
         </tr>
   <% end -%>
 <% end -%>
 
-<script type="text/javascript">
+<script>
   $j('.delete').live('click', function () {
     $j(this).parent('.multi_value').remove();
+    return false;
   });
 
-  $j('.add').live('click', function () {
+  $j('.add_value').live('click', function () {
     var template = $j(this).siblings('.template');
     template.before(template.html());
+    return false;
   });
-</script>
\ No newline at end of file
+
+  function enlargeTextInput(propertyKey) {
+    var input = $j('#' + propertyKey);
+    var textArea = '<textarea class="width100" rows="10" name="' + input.attr('name') + '" id="input_' + propertyKey + '">' + input.val() + '</textarea>';
+    input.replaceWith(textArea);
+  }
+</script>
index 3411c37143a0b51dc00f5a61d617ab9d2dcbfde0..c1cb9efeb2211a9343b72b09c07bee30e1e130f2 100644 (file)
@@ -3,7 +3,7 @@
 <table width="100%">
   <tr>
     <td width="1%" nowrap class="column first">
-      <table class="data selector">
+      <table class="data">
         <thead>
         <tr>
           <th><%= message('category') -%></th>
       </div>
     </td>
   </tr>
-</table>
-
-<script type="text/javascript">
-  function enlargeTextInput(propertyKey) {
-    var eltId = 'input_' + propertyKey;
-    var textValue = $F(eltId);
-    var textArea = '<textarea class="width100" id="' + propertyKey + '" name="' + propertyKey + '" rows="10" id="input_' + propertyKey + '">' + textValue + '</textarea>';
-    $(eltId).parentNode.replace(textArea);
-  }
-</script>
+</table>
\ No newline at end of file
index 7292d327860e1946b1eb9a6bfbc3f84874a1be9e..07d91a2313e095c76121114606955325cda97251 100644 (file)
@@ -1,2 +1,4 @@
-<input type="text" name="<%= h property.key -%>[]" value="<%= h value if value -%>" size="50" id="input_<%= h property.key -%>"/>
-<%= link_to_function(image_tag('zoom.png'), "enlargeTextInput('#{property.key}')", :class => 'nolink') -%>
\ No newline at end of file
+<input type="text" name="<%= h property.key -%>[]" value="<%= h value if value -%>" size="50" id="input_<%= property.key.parameterize -%>"/>
+<% unless property.multi_values -%>
+  <%= link_to_function(image_tag('zoom.png'), "enlargeTextInput('input_#{property.key.parameterize}')", :class => 'nolink') -%>
+<% end -%>
index ff58b01e30153bd5ea1a8a57e3002aa42e922297..7b6ab514660ebaef501a737462b119441a2bfdd4 100644 (file)
@@ -2031,6 +2031,10 @@ div.break30 {
   margin-bottom: 10px;
 }
 
+.marginbottom5 {
+  margin-bottom: 5px;
+}
+
 .marginright10 {
   margin-right: 10px;
 }
@@ -2087,11 +2091,6 @@ table.nowrap td, td.nowrap, th.nowrap {
   padding: 2px 0 2px 20px;
 }
 
-.delete {
-  background: url("../images/cross.png") no-repeat scroll left 50% transparent;
-  padding: 2px 0 2px 20px;
-}
-
 .restore {
   display: block;
   background: url("../images/restore.gif") no-repeat scroll left 50% transparent;