diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-04-22 17:27:28 +0200 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-04-22 17:34:27 +0200 |
commit | 4b39fc732040f0e64e73f833117333f8021d891e (patch) | |
tree | 3c5f762f9ced74aa258bf0d0b960f5da1528b808 /sonar-server | |
parent | 55d60c0ffdc0c634eb20b152b4e76351faa5d9bd (diff) | |
download | sonarqube-4b39fc732040f0e64e73f833117333f8021d891e.tar.gz sonarqube-4b39fc732040f0e64e73f833117333f8021d891e.zip |
SONAR-2327 improve CSS
Diffstat (limited to 'sonar-server')
7 files changed, 173 insertions, 42 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/reviews_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/reviews_helper.rb index 7c51816f333..2cf6e97b6ee 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/reviews_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/reviews_helper.rb @@ -19,13 +19,8 @@ # module ReviewsHelper - def options_for_project_select - options=[['Any', '']] - projects=Project.find(:all, :select => 'id,name', :conditions => ['enabled=? AND scope=? AND qualifier IN (?)', true, 'PRJ', ['TRK', 'VW','SVW']], :order => 'name ASC') - projects.each do |project| - options<<[project.name, project.id] - end - options_for_select(options, @projects) + def projects_for_select + Project.find(:all, :select => 'id,name,long_name', :conditions => ['enabled=? AND scope=? AND qualifier IN (?)', true, 'PRJ', ['TRK', 'VW','SVW']], :order => 'name ASC') end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb index 4d5b6b5e443..0e45f87f94b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb @@ -50,8 +50,19 @@ class Review < ActiveRecord::Base return STATUS_OPEN end - def source? - resource!=nil && resource.last_snapshot!=nil && resource.last_snapshot.source!=nil + def on_project? + resource_id==project_id + end + + def rule + @rule ||= + begin + rule_failure ? rule_failure.rule : nil + end + end + + def comments + review_comments end private diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb index 1fec9f4e7bc..84b476fa9ac 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb @@ -80,7 +80,7 @@ </div> - <div class="comment"> + <div class="discussionComment first"> <%= h(violation.message) -%> </div> @@ -89,7 +89,7 @@ last_comment = current_open_review.review_comments.last current_open_review.review_comments.each do |review_comment| %> - <div class="comment"> + <div class="discussionComment"> <% duration=Date.today - review_comment.created_at.to_date %> <h4><%= image_tag("reviews/comment.png") -%> <b><%= review_comment.user.name -%></b> (<%= duration==0 ? 'today' : "#{duration} days ago" -%>) <% if review_comment == last_comment && current_user && current_user.id == review_comment.user.id %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb new file mode 100644 index 00000000000..35407e6eb7a --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb @@ -0,0 +1,75 @@ +<div id="rev_<%= review.id -%>"> + <div class="reportTitle"> + <div style="float: right"><span class="violation_date">#<%= review.id.to_s -%></span></div> + <h2><%= h(review.title) -%></h2> + </div> + + <table class="reportDetails"> + <tr> + <td class="key"> + Status: + </td> + <td class="val"> + <%= image_tag "status/#{review.status}.png" -%> <%= review.status -%> + </td> + <td class="key"> + Severity: + </td> + <td class="val"> + <%= image_tag "priority/#{review.severity}.png" -%> <%= review.severity -%> + </td> + </tr> + <tr> + <td class="key"> + Assignee: + </td> + <td class="val"> + <%= review.assignee ? h(review.assignee.name) : '-'-%> + </td> + <td class="key"> + Created: + </td> + <td class="val"> + by <%= h(review.user.name) -%> at <%= l(review.created_at) -%> + </td> + </tr> + <% if review.rule %> + <tr> + <td class="key"> + Rule: + </td> + <td class="val" colspan="3"> + <a onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => review.rule.key, :layout => 'false' -%>"><%= h(review.rule.key) -%></a> + </td> + </tr> + <% end %> + <tr> + <td class="key"> + File: + </td> + <td class="val" colspan="3"> + <%= qualifier_icon(@review.resource) -%> + <% if !review.on_project? %> <%= @review.project.long_name -%> <%= image_tag 'sep12.png' -%> <% end %> + <%= link_to_resource(review.resource, review.resource.long_name) %> + </td> + </tr> + </table> + + <% if review.rule_failure %> + + <% end %> + + <div class="discussion"> + <% if review.rule_failure %> + <div class="discussionComment first"> + <%= h(review.rule_failure.message) -%> + </div> + <% end %> + <% review.comments.each do |comment| %> + <div class="discussionComment"> + <h4><%= image_tag("reviews/comment.png") -%> <b><%= comment.user.name -%></b> (<%= distance_of_time_in_words_to_now(comment.created_at) -%>)</h4> + <%= h(comment.review_text) -%> + </div> + <% end %> + </div> +<div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb index 499fd213363..45b8bc3a8af 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb @@ -1,13 +1,5 @@ -<div> - <a href="#" onclick="backReviews()">Back to results</a> +<div class="marginbottom10"> + <a href="#" onclick="backReviews()">Back to reviews</a> </div> -<h1><%= h(@review.project.long_name) -%> | <%= h(@review.resource.long_name) -%></h1> - -<% if @review.source? %> - -<% end %> - -<%= @review.title -%> - - +<%= render :partial => 'reviews/review', :locals => {:review => @review} -%>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb index a2a06f63c8d..67707ac52f6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb @@ -19,7 +19,7 @@ function backReviews() { <div id="reviews-search"> <h1>Reviews</h1> <% form_tag({:action => 'index'}, {:method => 'get'}) do %> - <table id="reviews-form" class="search-filter-box"> + <table id="reviews-form" class="searchFilterBox"> <thead> <tr><th colspan="6"></th></tr> </thead> @@ -27,7 +27,7 @@ function backReviews() { <tr> <td width="1%" nowrap> <span class="note">Status</span><br/> - <select size="6" name="statuses[]" multiple="multiple" id="statuses" class="with-icons"> + <select size="6" name="statuses[]" multiple="multiple" id="statuses" class="withIcons"> <option <%= 'selected' if @statuses.include?('') -%> value="">Any</option> <option value="<%= Review::STATUS_OPEN -%>" class="status_open" <%= 'selected' if @statuses.include?(Review::STATUS_OPEN) -%>>Open</option> <option value="<%= Review::STATUS_CLOSED -%>" class="status_closed" <%= 'selected' if @statuses.include?(Review::STATUS_CLOSED) -%>>Closed</option> @@ -35,11 +35,18 @@ function backReviews() { <td width="1%" nowrap> <span class="note">Project</span><br/> - <%= select_tag "projects", options_for_project_select(), :multiple => true, :size => 6 %> + <select size="6" name="projects[]" multiple="multiple" id="projects"> + <option <%= 'selected' if @projects.include?('') -%> value="">Any</option> + <% projects_for_select.each do |project| + name=project.name(true) + %> + <option value="<%= project.id -%>" title="<%= h(name)-%>" <%= 'selected' if @projects.include?(project.id.to_s) -%>><%= h(truncate(name, :length => 20)) -%></option> + <% end %> + </select> </td> <td width="1%" nowrap> <span class="note">Severity</span><br/> - <select size="6" name="severities[]" multiple="multiple" id="severities" class="with-icons"> + <select size="6" name="severities[]" multiple="multiple" id="severities" class="withIcons"> <option <%= 'selected' if @severities.include?('') -%> value="">Any</option> <option value="<%= Severity::BLOCKER -%>" class="sev_BLOCKER" <%= 'selected' if @severities.include?(Severity::BLOCKER) -%>>Blocker</option> <option value="<%= Severity::CRITICAL -%>" class="sev_CRITICAL" <%= 'selected' if @severities.include?(Severity::CRITICAL) -%>>Critical</option> diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index 16eb2895a8f..52d2e3bd5e0 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -670,17 +670,6 @@ ul.operations li img { margin:0; border: 1px solid #DDD; } -.sources2 div.comment{ - background-color:#FBFBFB; - margin:0; - padding:5px 10px; - border-top: 1px solid #DDD; - line-height: 1.5em; -} -.sources2 div.comment h4{ - font-size: 90%; - margin-bottom: 2px; -} .sources2 div.violation .actions{ visibility: hidden; } @@ -690,7 +679,7 @@ ul.operations li img { .sources2 div.violation .actions form { display: inline; } -.sources2 div.vtitle{ +div.vtitle{ background-color:#E4ECF3; margin:0; padding:0 10px; @@ -698,7 +687,7 @@ ul.operations li img { text-shadow: 1px 1px 0 #FFF; color:#777 } -.sources2 div.vtitle a.action { +div.vtitle a.action { color: #777; } span.rulename, span.rulename a { @@ -818,6 +807,68 @@ span.rulename a:hover { + + +div.reportTitle { + background-color: #CAE3F2; + color: #4B9FD5; + line-height: 2.2em; + margin: 0; + padding: 0 10px; + border: 1px solid #4B9FD5; +} +div.reportTitle h2 { + color: #4183C4; + font-weight: bold; + display: inline; + font-size: 100%; + text-shadow: 0 1px 0 #FFFFFF; +} +table.reportDetails { + width: 100%; + border: 0; +} +table.reportDetails td { + vertical-align: top; + text-align: left; + padding: 5px 10px; +} +table.reportDetails td.key { + white-space: nowrap; + min-width: 1%; + color: #777; +} +table.reportDetails td img { + vertical-align: bottom; +} + +div.discussion { + width: 100%; + border: 1px solid #DDDDDD; +} +.discussionComment.first { + border-top: none; +} +div.discussionComment { + background-color: #F4F4F4; + border-top: 1px solid #DDDDDD; + line-height: 1.5em; + margin: 0; + padding: 5px 10px; +} +div.discussionComment h4 { + font-size: 90%; + margin-bottom: 2px; +} +div.discussionComment h4 img { + vertical-align: sub; +} + + + + + + #gwtpage { width: 100%; clear: both; @@ -1036,18 +1087,18 @@ span.rulename a:hover { padding: 10px; } -.search-filter-box { +.searchFilterBox { background-color: #ECECEC; color: #444; border: 1px solid #DDD; margin: 0 0 10px 0; } -.search-filter-box td { +.searchFilterBox td { padding: 10px; text-align: left; vertical-align: top; } -select.with-icons option { +select.withIcons option { background-repeat: no-repeat; background-position: 2px 0; padding: 0 2px 0 22px; |