aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-04-22 15:02:58 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2013-04-22 15:03:26 +0200
commitd4b011b397433b1201dfd10297a888fcb5abf8b5 (patch)
treee854a0db6b0e0b06c653021fdc3db6646f5200a3
parent6d6ab14be2a5078b3158344d951fd115958bcf92 (diff)
downloadsonarqube-d4b011b397433b1201dfd10297a888fcb5abf8b5.tar.gz
sonarqube-d4b011b397433b1201dfd10297a888fcb5abf8b5.zip
SONAR-3159 Some visual improvements on subcategories
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb14
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb11
-rw-r--r--sonar-server/src/main/webapp/stylesheets/style.css16
3 files changed, 29 insertions, 12 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 e1101c8f65a..6533ce4ee6b 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
@@ -12,18 +12,18 @@
<tr>
<th><%= h category_name(@category) -%><% if @subcategory != 'default' %> - <%= h subcategory_name(@category, @subcategory) -%><% end -%></th>
</tr>
- </thead>
- <tbody>
<% unless @subcategory != 'default' || category_desc(@category).blank? -%>
- <tr class="property <%= cycle('even', 'odd', :name => 'properties') -%>">
- <td class="help"><%= category_desc(@category) -%> </td>
+ <tr>
+ <td><%= category_desc(@category) -%> </td>
</tr>
<% end -%>
<% unless @subcategory == 'default' || subcategory_desc(@category, @subcategory).blank? -%>
- <tr class="property <%= cycle('even', 'odd', :name => 'properties') -%>">
- <td class="help"><%= subcategory_desc(@category, @subcategory) -%> </td>
+ <tr>
+ <td><%= subcategory_desc(@category, @subcategory) -%> </td>
</tr>
<% end -%>
+ </thead>
+ <tbody>
<% by_property_index_or_name(@definitions).each do |property| -%>
<tr class="property <%= cycle('even', 'odd', :name => 'properties') -%>">
<td style="padding: 10px" id="block_<%= property.key -%>">
@@ -68,11 +68,13 @@
</tbody>
</table>
+ <% unless @definitions.empty? %>
<div style="padding-left: 16px;">
<%= hidden_field_tag('page_version', (params[:page_version] || 0).to_i + 1) -%>
<%= submit_tag(message('settings.save_category', :params => [category_name(@category)]), :id => 'submit_settings') -%>
<img src="<%= ApplicationController.root_context -%>/images/loading.gif" id="loading_settings" style="display:none;">
</div>
+ <% end %>
<% end -%>
<% end -%>
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 a6e6776518f..6266bd865c3 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
@@ -11,13 +11,14 @@
</tr>
</thead>
<tbody>
- <% @categories.each do |category| -%>
- <tr id="select_<%= category -%>" class="select <%= cycle('even', 'odd', :name => 'category') -%> <%= 'selected' if @category==category -%>">
- <td><%= link_to category_name(category), :category => category -%></td>
+ <% @categories.each do |category|
+ subcategories = @subcategories_per_categories[category] || []-%>
+ <tr id="select_<%= category -%>" class="select <%= cycle('even', 'odd', :name => 'category') -%> <%= 'selected' if @category==category && @subcategory == 'default' -%>">
+ <td class="category <%= 'withSubcategories' if not subcategories.empty? -%>"><%= link_to category_name(category), :category => category -%></td>
<% if @category==category
- (@subcategories_per_categories[category]||[]).each do |subcategory| -%>
+ subcategories.each do |subcategory| -%>
<tr id="select_<%= subcategory -%>" class="select <%= cycle('even', 'odd', :name => 'category') -%> <%= 'selected' if @subcategory==subcategory -%>">
- <td> - <%= link_to subcategory_name(category, subcategory), :category => category, :subcategory => subcategory -%></td>
+ <td class="subcategory"><%= link_to subcategory_name(category, subcategory), :category => category, :subcategory => subcategory -%></td>
</tr>
<% end
end -%>
diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css
index c524517d758..8e32124fee5 100644
--- a/sonar-server/src/main/webapp/stylesheets/style.css
+++ b/sonar-server/src/main/webapp/stylesheets/style.css
@@ -475,6 +475,20 @@ table.data th img, table.data td img {
vertical-align: baseline;
}
+.data td.category {
+ padding-right: 15px;
+}
+
+.data td.category.withSubcategories {
+ background-image: url('../images/bullet_arrow_down.gif');
+ background-position: right center;
+ background-repeat: no-repeat;
+}
+
+.data td.subcategory {
+ padding-left: 20px;
+}
+
.hoverable:hover {
background-color: #CAE3F2;
}
@@ -2453,4 +2467,4 @@ textarea.width100 {
text-transform: uppercase;
font-size: 85%;
color: #777;
-} \ No newline at end of file
+}