aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-09-21 08:43:01 +0200
committerDavid Gageot <david@gageot.net>2012-09-21 08:44:59 +0200
commit6db62fc89efd799d9a1c69c6e8c10719a26984ab (patch)
tree18d94299a0c17d32efdacc77ae9743bde2efab7d
parent1e57c80b28fe762436a8d28b25626b2a66d9b098 (diff)
downloadsonarqube-6db62fc89efd799d9a1c69c6e8c10719a26984ab.tar.gz
sonarqube-6db62fc89efd799d9a1c69c6e8c10719a26984ab.zip
SONAR-3754 Improvements
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb14
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb5
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_iframe.html.erb7
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_multi_value.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb32
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb13
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb6
-rw-r--r--sonar-server/src/main/webapp/stylesheets/style.css9
8 files changed, 55 insertions, 35 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb
index b6dfedd5fc5..fe7ab2ea4ee 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb
@@ -19,15 +19,19 @@
#
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
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb
index 111a50eca07..afd4ebe9269 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb
@@ -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
index 00000000000..6e20677bf70
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_iframe.html.erb
@@ -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
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_multi_value.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_multi_value.html.erb
index a571f937090..3bc94037b05 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_multi_value.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_multi_value.html.erb
@@ -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>
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 3e9602d4820..7719dc2d209 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
@@ -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>
@@ -34,14 +34,22 @@
<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>
@@ -55,13 +63,21 @@
<% 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>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb
index 3411c37143a..c1cb9efeb22 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb
@@ -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>
@@ -26,13 +26,4 @@
</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
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb
index 7292d327860..07d91a2313e 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb
@@ -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 -%>
diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css
index ff58b01e301..7b6ab514660 100644
--- a/sonar-server/src/main/webapp/stylesheets/style.css
+++ b/sonar-server/src/main/webapp/stylesheets/style.css
@@ -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;