]> source.dussan.org Git - sonarqube.git/commitdiff
Remove the select-box 'show commits'
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 16 Mar 2011 14:00:54 +0000 (15:00 +0100)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 16 Mar 2011 16:33:28 +0000 (17:33 +0100)
sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_options.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb

index afcc3f2722e682901e243641ce7f82a482323532..0ebc8b8be8f4bef86b2f718d10b857074d92190b 100644 (file)
@@ -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
index 874609065607a3930d28779b0c935a65b45ad529..1e86caee7c8f4b2048d55482f8bf573a653b3cd7 100644 (file)
 
     <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>
index 6e9b128b19a2b3304b693d687b5e210a13c77fa3..1f51b7c26c74628a053210829279c513ecf59072 100644 (file)
@@ -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  %>