From cb018a55a29256f1fad80073dafe788bbbe7b84e Mon Sep 17 00:00:00 2001 From: David Gageot Date: Thu, 4 Oct 2012 12:18:55 +0200 Subject: [PATCH] SONAR-3529 Improve property sets --- .../app/views/settings/_properties.html.erb | 7 +++-- .../app/views/settings/_set_instance.html.erb | 25 ++++------------ .../_type_PROPERTY_SET_DEFINITION.html.erb | 30 +++++++++++++++---- .../src/main/webapp/stylesheets/style.css | 30 +++++-------------- 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 @@ <% @definitions.each do |property| -%> - +

<%= property_name(property) -%>
@@ -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; }); 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 @@ -
-
- - <%= text_field_tag "property_sets[#{property.key}][]", set_key, :size => 50 -%> - <%= message('delete') -%> -
+ + <%= text_field_tag "property_sets[#{property.key}][]", set_key, :size => 50 -%> <% property.fields.each do |field| -%> <% key = "#{property.key}.#{set_key}.#{field.key}" if set_key -%> <% value = Property.value(key, resource_id) if set_key -%> -
- - <%= 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? %> -

<%= desc -%>

- <% end -%> - - <%= render "settings/error", :key => key -%> -
+ <%= render "settings/type_#{field.type}", :property => field, :field => field, :value => value, :name => "#{property.key}[#{field.key}][]", :id => "input_#{h field.key}" -%> <% end -%> -
-
+ + <%= message('delete') -%> + 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 -%> + + + + + <% property.fields.each do |field| -%> + + <% end -%> + + + - + <% 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 %> - - + + + + + + + +
<%= message('key') -%><%= field_name(property, field) -%>
+ +
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; } -- 2.39.5