aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>2013-04-22 11:59:32 +0200
committerJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>2013-04-22 11:59:32 +0200
commit6d6ab14be2a5078b3158344d951fd115958bcf92 (patch)
tree4f323c1847c6aab2b6b22f2e0300d3455a2df852 /sonar-server
parente4e0443c0b4e8b99e5a96af88eb8611ee0534c78 (diff)
downloadsonarqube-6d6ab14be2a5078b3158344d951fd115958bcf92.tar.gz
sonarqube-6d6ab14be2a5078b3158344d951fd115958bcf92.zip
SONAR-3893 Introduced unique partial for source display
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_display.erb14
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_scm.html.erb13
2 files changed, 15 insertions, 12 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_display.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_display.erb
index 3ddbdfcb372..c3ce284ed0a 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_display.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_display.erb
@@ -39,8 +39,18 @@
<%= render :partial => "shared/source_violation_form", :locals => {:resource_id => resource.id, :index => index, :colspans => colspans} %>
<% end %>
- <% if scm_available %>
- render :partial => "shared/source_scm", :locals => {:line => line, :current_revision => current_revision}
+ <% if scm_available
+ if current_revision!=line.revision
+ current_revision=line.revision
+ title = "Revision #{h(line.revision)}"
+ %>
+
+ <%= render :partial => "shared/source_scm", :locals => {:line => line, :title => title} %>
+
+ <% else %>
+ <td class="scm"></td>
+ <% end %>
+
<% end %>
<%= render :partial => "shared/source_line_numbers", :locals => {:index => index} %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_scm.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_scm.html.erb
index 90f0a4a7cc3..f3f5e001aae 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_scm.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_scm.html.erb
@@ -1,11 +1,4 @@
-<%
- if current_revision!=line.revision
- current_revision=line.revision
- title = "Revision #{h(line.revision)}"
- %>
- <td class="scm revision">
+<td class="scm revision">
<span class="date"><a href="#" title="<%= title -%>" alt="<%= title -%>"><%= Java::OrgSonarApiUtils::DateUtils.formatDate(line.datetime) if line.datetime -%></a></span>
- <span class="author"><%= h(line.author) -%></span></td>
- <% else %>
- <td class="scm"></td>
-<% end %> \ No newline at end of file
+ <span class="author"><%= h(line.author) -%></span>
+</td>