aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-03-16 15:00:54 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-03-16 17:33:28 +0100
commitccfb41a2957432447cd21fcdba764f00b1090f15 (patch)
tree46c6cb8031301df3cd95f9cb3c8e16dae0ae93ae
parentbe5def62257b64e1c7ce9d722dfdf73e887a3b3d (diff)
downloadsonarqube-ccfb41a2957432447cd21fcdba764f00b1090f15.tar.gz
sonarqube-ccfb41a2957432447cd21fcdba764f00b1090f15.zip
Remove the select-box 'show commits'
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb25
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/resource/_options.html.erb13
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb5
3 files changed, 14 insertions, 29 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
index afcc3f2722e..0ebc8b8be8f 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
@@ -73,14 +73,13 @@ class ResourceController < ApplicationController
@extension=@extensions.find{|extension| extension.isDefaultTab()} if @extension==nil
end
- def load_sources(use_scm_for_periods=true)
+ def load_sources
@period = params[:period].to_i unless params[:period].blank?
- @display_scm=(params[:scm]=='true')
@expanded=(params[:expand]=='true')
if @snapshot.source
source_lines=Java::OrgSonarServerUi::JRubyFacade.new.colorizeCode(@snapshot.source.data, @snapshot.project.language).split("\n")
- init_scm((@period && use_scm_for_periods) || @display_scm)
+ init_scm()
@lines=[]
source_lines.each_with_index do |source, index|
@@ -96,17 +95,11 @@ class ResourceController < ApplicationController
end
end
- def init_scm(scm)
+ def init_scm
@scm_available=(@snapshot.measure('last_commit_datetimes_by_line')!=nil)
- if scm
- @authors_by_line=load_distribution('authors_by_line')
- @revisions_by_line=load_distribution('revisions_by_line')
- @dates_by_line=load_distribution('last_commit_datetimes_by_line')
- else
- @authors_by_line={}
- @revisions_by_line={}
- @dates_by_line={}
- end
+ @authors_by_line=load_distribution('authors_by_line')
+ @revisions_by_line=load_distribution('revisions_by_line')
+ @dates_by_line=load_distribution('last_commit_datetimes_by_line')
end
def load_distribution(metric_key)
@@ -115,7 +108,7 @@ class ResourceController < ApplicationController
end
def render_coverage
- load_sources(true)
+ load_sources()
@display_coverage=true
if @lines
@hits_by_line=load_distribution('coverage_line_hits_data')
@@ -149,7 +142,7 @@ class ResourceController < ApplicationController
def render_violations
- load_sources(false)
+ load_sources()
@display_violations=true
@global_violations=[]
@expandable=(@lines!=nil)
@@ -205,7 +198,7 @@ class ResourceController < ApplicationController
def render_source
- load_sources(true)
+ load_sources()
filter_lines_by_date()
render :action => 'index', :layout => !request.xhr?
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_options.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_options.html.erb
index 87460906560..1e86caee7c8 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_options.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_options.html.erb
@@ -23,16 +23,9 @@
<table>
<tr>
- <% first=true %>
- <% if @scm_available %>
- <td class="<%= 'first' if first -%>">
- <input type="checkbox" value="true" name="scm" id="scm" <%= 'checked' if @display_scm -%> onclick="applyOptions()"/>
- <label for="scm">Show commits</label>
- </td>
- <% first=false
- end %>
-
- <% if @expandable %>
+ <%
+ first=true
+ if @expandable %>
<td class="<%= 'first' if first -%>">
<input type="checkbox" value="true" name="expand" id="expand" <%= 'checked' if @expanded -%> onclick="applyOptions()"/>
<label for="expand">Show full source</label>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb
index 6e9b128b19a..1f51b7c26c7 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb
@@ -61,7 +61,7 @@
end
%>
<tr>
- <% if @display_scm
+ <%
if current_revision!=line.revision
current_revision=line.revision
title = "Revision #{h(line.revision)} ยป #{l(line.datetime) if line.datetime}"
@@ -69,8 +69,7 @@
<td class="scm revision"><span class="date"><a href="#" title="<%= title -%>" alt="<%= title -%>"><%= l(line.date) if line.date -%></a></span> <span class="author"><%= h(line.author) -%></span></td>
<% else %>
<td class="scm"></td>
- <% end
- end %>
+ <% end %>
<td class="lid <%= ' section' if line.violations? -%>" id="L<%= index+1 -%>"><a name="L<%= index+1 -%>" href="#L<%= index+1 -%>"><%= index + 1 -%></a></td>
<% if @display_coverage %>