aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-10-04 12:18:55 +0200
committerDavid Gageot <david@gageot.net>2012-10-04 12:18:55 +0200
commitcb018a55a29256f1fad80073dafe788bbbe7b84e (patch)
tree4fb47370a4310477dd294261512a5e5f8d070bd8
parentb65e5b72c43aa688d2832da22a7339c596c0d920 (diff)
downloadsonarqube-cb018a55a29256f1fad80073dafe788bbbe7b84e.tar.gz
sonarqube-cb018a55a29256f1fad80073dafe788bbbe7b84e.zip
SONAR-3529 Improve property sets
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb7
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_set_instance.html.erb25
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET_DEFINITION.html.erb30
-rw-r--r--sonar-server/src/main/webapp/stylesheets/style.css30
4 files changed, 42 insertions, 50 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
index 20da1396a43..b7713ed97fb 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
@@ -15,7 +15,7 @@
</thead>
<tbody>
<% @definitions.each do |property| -%>
- <tr class="<%= cycle('even', 'odd', :name => 'properties') -%>">
+ <tr class="property <%= cycle('even', 'odd', :name => 'properties') -%>">
<td style="padding: 10px" id="block_<%= property.key -%>">
<h3>
<div><%= property_name(property) -%></div>
@@ -74,8 +74,9 @@
$j('.add_value').live('click', function () {
$j('.delete').show();
- var template = $j(this).siblings('.template');
- template.before(template.html());
+ var template = $j(this).parents('.property').find('.template').last();
+ template.clone().insertBefore(template).show();
+
return false;
});
</script>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_set_instance.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_set_instance.html.erb
index bc3ad9282a8..7a2fb8c8afa 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_set_instance.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_set_instance.html.erb
@@ -1,25 +1,12 @@
-<div class="multi_value">
- <div class="field">
- <label><%= message('key') %>:</label>
- <%= text_field_tag "property_sets[#{property.key}][]", set_key, :size => 50 -%>
- <a href="#" class="delete link-action"><%= message('delete') -%></a>
- </div>
+<tr class="multi_value <%= 'template' unless set_key -%>" style="<%= 'display:none' unless set_key -%>">
+ <td><%= text_field_tag "property_sets[#{property.key}][]", set_key, :size => 50 -%></td>
<% property.fields.each do |field| -%>
<% key = "#{property.key}.#{set_key}.#{field.key}" if set_key -%>
<% value = Property.value(key, resource_id) if set_key -%>
- <div class="field">
- <label><%= field_name(property, field) -%>: </label>
- <%= render "settings/type_#{field.type}", :property => field, :field => field, :value => value, :name => "#{property.key}[#{field.key}][]", :id => "input_#{h field.key}" -%>
-
- <% desc=field_description(property, field) -%>
- <% unless desc.blank? %>
- <p class="note"><%= desc -%></p>
- <% end -%>
-
- <%= render "settings/error", :key => key -%>
- </div>
+ <td><%= render "settings/type_#{field.type}", :property => field, :field => field, :value => value, :name => "#{property.key}[#{field.key}][]", :id => "input_#{h field.key}" -%></td>
<% end -%>
- <br/>
-</div>
+
+ <td><a href="#" class="delete link-action"><%= message('delete') -%></a></td>
+</tr>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET_DEFINITION.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET_DEFINITION.html.erb
index d51e73fc377..2e642af64ae 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET_DEFINITION.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET_DEFINITION.html.erb
@@ -1,11 +1,29 @@
<% resource_id = @resource.id if @resource -%>
-<% Property.values(property.key, resource_id).reject(&:blank?).each do |set_key| -%>
- <%= render 'settings/set_instance', :property => property, :set_key => set_key, :resource_id => resource_id %>
-<% end -%>
+<table class="data">
+ <thead>
+ <tr>
+ <th><%= message('key') -%></th>
+ <% property.fields.each do |field| -%>
+ <th><%= field_name(property, field) -%></th>
+ <% end -%>
+ <th></th>
+ </tr>
+ </thead>
-<div class="template" style="display:none;">
+ <tbody>
+ <% Property.values(property.key, resource_id).reject(&:blank?).each do |set_key| -%>
+ <%= render 'settings/set_instance', :property => property, :set_key => set_key, :resource_id => resource_id %>
+ <% end -%>
<%= render 'settings/set_instance', :property => property, :set_key => nil, :resource_id => resource_id %>
-</div>
-<button class="add_value"><%= message('settings.add') -%></button>
+ </tbody>
+
+ <tfoot>
+ <tr>
+ <td>
+ <button class="add_value"><%= message('settings.add') -%></button>
+ </td>
+ </tr>
+ </tfoot>
+</table>
diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css
index 72499036b58..819ddc41a8d 100644
--- a/sonar-server/src/main/webapp/stylesheets/style.css
+++ b/sonar-server/src/main/webapp/stylesheets/style.css
@@ -1091,13 +1091,20 @@ div.progress div.note {
}
div.autocomplete {
+ position: absolute;
+ width: 600px;
+ right: 10px;
+ top: 10px;
background-color: #fff;
border: 1px solid #ccc;
margin: 0;
padding: 0;
color: #111;
line-height: 18px;
- box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
+ -moz-box-shadow: 0 0 10px 5px #EFEFEF;
+ -webkit-box-shadow: 0 0 10px 5px #EFEFEF;
+ -o-box-shadow: 0 0 10px 5px #EFEFEF;
+ box-shadow: 0 0 10px 5px #EFEFEF;
z-index: 999999;
}
@@ -2417,27 +2424,6 @@ textarea.width100 {
box-sizing: border-box; /* Opera/IE 8+ */
}
-.field {
- margin-bottom: 5px;
-}
-
-.field label {
- text-align: right;
- width: 80px;
- display: block;
- float: left;
- line-height: 1;
- word-wrap: break-word;
- position: relative;
- padding-top: 5px;
- padding-right: 5px;
-}
-
-.field .note, .field .error {
- margin-top: 3px;
- margin-left: 88px;
-}
-
.coverage tr {
line-height: 1.8em;
}