import org.sonar.plugins.core.clouds.Clouds;
import org.sonar.plugins.core.colorizers.JavaColorizerFormat;
import org.sonar.plugins.core.coverageviewer.CoverageViewerDefinition;
-import org.sonar.plugins.core.defaultsourceviewer.DefaultSourceViewer;
import org.sonar.plugins.core.duplicationsviewer.DuplicationsViewerDefinition;
import org.sonar.plugins.core.hotspots.Hotspots;
import org.sonar.plugins.core.metrics.UserManagedMetrics;
import org.sonar.plugins.core.sensors.*;
import org.sonar.plugins.core.testdetailsviewer.TestsViewerDefinition;
import org.sonar.plugins.core.timemachine.*;
-import org.sonar.plugins.core.ui.pageselector.GwtPageSelector;
-import org.sonar.plugins.core.violationsviewer.ViolationsViewerDefinition;
import org.sonar.plugins.core.widgets.*;
import java.util.List;
extensions.add(UserManagedMetrics.class);
// pages
- extensions.add(GwtPageSelector.class);
- extensions.add(DefaultSourceViewer.class);
- extensions.add(CoverageViewerDefinition.class);
- extensions.add(ViolationsViewerDefinition.class);
extensions.add(DuplicationsViewerDefinition.class);
extensions.add(TestsViewerDefinition.class);
extensions.add(Clouds.class);
package org.sonar.server.ui;
import org.sonar.api.measures.CoreMetrics;
+import org.sonar.api.resources.Qualifiers;
import org.sonar.api.resources.Resource;
import org.sonar.api.web.*;
return PAGES;
}
- @ResourceScope(Resource.SCOPE_ENTITY)
+ // should be qualifier FILE only but waiting for java refactoring
@NavigationSection(NavigationSection.RESOURCE_TAB)
@DefaultTab
+ @ResourceQualifier({Qualifiers.FILE, Qualifiers.CLASS, Qualifiers.UNIT_TEST_FILE})
@UserRole(UserRole.CODEVIEWER)
private static final class SourceTab implements RubyRailsPage {
public String getTemplate() {
}
- @ResourceQualifier(Resource.QUALIFIER_CLASS)
@NavigationSection(NavigationSection.RESOURCE_TAB)
- @DefaultTab(metrics = {CoreMetrics.COVERAGE_KEY, CoreMetrics.LINES_TO_COVER_KEY, CoreMetrics.UNCOVERED_LINES_KEY, CoreMetrics.LINE_COVERAGE_KEY, CoreMetrics.CONDITIONS_TO_COVER_KEY, CoreMetrics.UNCOVERED_CONDITIONS_KEY, CoreMetrics.BRANCH_COVERAGE_KEY})
+ @ResourceQualifier({Qualifiers.FILE, Qualifiers.CLASS})
+ @DefaultTab(metrics = {CoreMetrics.COVERAGE_KEY, CoreMetrics.LINES_TO_COVER_KEY, CoreMetrics.UNCOVERED_LINES_KEY, CoreMetrics.LINE_COVERAGE_KEY,
+ CoreMetrics.CONDITIONS_TO_COVER_KEY, CoreMetrics.UNCOVERED_CONDITIONS_KEY, CoreMetrics.BRANCH_COVERAGE_KEY,
+ CoreMetrics.NEW_COVERAGE_KEY, CoreMetrics.NEW_UNCOVERED_LINES_KEY, CoreMetrics.NEW_LINE_COVERAGE_KEY,
+ CoreMetrics.NEW_LINES_TO_COVER_KEY, CoreMetrics.NEW_BRANCH_COVERAGE_KEY, CoreMetrics.NEW_CONDITIONS_TO_COVER_KEY
+ })
@UserRole(UserRole.CODEVIEWER)
private static final class CoverageTab implements RubyRailsPage {
public String getTemplate() {
}
@NavigationSection(NavigationSection.RESOURCE_TAB)
- @DefaultTab(metrics = {CoreMetrics.VIOLATIONS_DENSITY_KEY, CoreMetrics.WEIGHTED_VIOLATIONS_KEY, CoreMetrics.VIOLATIONS_KEY, CoreMetrics.BLOCKER_VIOLATIONS_KEY, CoreMetrics.CRITICAL_VIOLATIONS_KEY, CoreMetrics.MAJOR_VIOLATIONS_KEY, CoreMetrics.MINOR_VIOLATIONS_KEY, CoreMetrics.INFO_VIOLATIONS_KEY})
- @ResourceQualifier({Resource.QUALIFIER_CLASS, Resource.QUALIFIER_FILE})
+ @DefaultTab(metrics = {CoreMetrics.VIOLATIONS_DENSITY_KEY, CoreMetrics.WEIGHTED_VIOLATIONS_KEY, CoreMetrics.VIOLATIONS_KEY, CoreMetrics.BLOCKER_VIOLATIONS_KEY,
+ CoreMetrics.CRITICAL_VIOLATIONS_KEY, CoreMetrics.MAJOR_VIOLATIONS_KEY, CoreMetrics.MINOR_VIOLATIONS_KEY, CoreMetrics.INFO_VIOLATIONS_KEY,
+ CoreMetrics.NEW_VIOLATIONS_KEY, CoreMetrics.NEW_BLOCKER_VIOLATIONS_KEY, CoreMetrics.NEW_CRITICAL_VIOLATIONS_KEY, CoreMetrics.NEW_MAJOR_VIOLATIONS_KEY,
+ CoreMetrics.NEW_MINOR_VIOLATIONS_KEY, CoreMetrics.NEW_INFO_VIOLATIONS_KEY})
+ @ResourceQualifier({Qualifiers.VIEW, Qualifiers.SUBVIEW, Qualifiers.PROJECT, Qualifiers.MODULE, Qualifiers.PACKAGE, Qualifiers.DIRECTORY, Qualifiers.FILE, Qualifiers.CLASS}) /* all exept unit tests...*/
@UserRole(UserRole.CODEVIEWER)
private static final class ViolationsTab implements RubyRailsPage {
public String getTemplate() {
@extension=@extensions.find{|extension| extension.isDefaultTab()} if @extension==nil
end
- def load_sources
+ def load_sources(use_scm_for_periods=true)
@period = params[:period].to_i unless params[:period].blank?
+ @display_scm=(params[:scm]=='true')
@expanded=(params[:expand]=='true')
@source = @snapshot.source
if @source
source_lines=Java::OrgSonarServerUi::JRubyFacade.new.colorizeCode(@source.data, @snapshot.project.language).split("\n")
- load_scm()
+ init_scm((@period && use_scm_for_periods) || @display_scm)
@lines=[]
source_lines.each_with_index do |source, index|
end
end
- def load_scm
+ def init_scm(scm)
@scm_available=(@snapshot.measure('last_commit_datetimes_by_line')!=nil)
- @display_scm=(params[:scm]=='true')
- if @display_scm
+ 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')
end
def render_coverage
- load_sources()
+ load_sources(true)
@display_coverage=true
@hits_by_line=load_distribution('coverage_line_hits_data')
@conditions_by_line=load_distribution('conditions_by_line')
def render_violations
- load_sources()
+ load_sources(false)
@display_violations=true
@global_violations=[]
@expandable=true
conditions='snapshot_id=?'
values=[@snapshot.id]
unless params[:rule].blank?
- if params[:rule].include?(':')
+ severity=Sonar::RulePriority.id(params[:rule])
+ if severity
+ conditions += ' AND failure_level=?'
+ values<<severity
+ else
rule=Rule.by_key_or_id(params[:rule])
conditions += ' AND rule_id=?'
values<<(rule ? rule.id : -1)
- else
- # severity
- conditions += ' AND failure_level=?'
- values<<params[:rule].to_i
end
end
def render_source
- load_sources()
+ load_sources(true)
filter_lines_by_date()
render :action => 'index', :layout => !request.xhr?
end
class Sonar::RulePriority
+ INFO = Java::OrgSonarApiRules::RulePriority::INFO
+ MINOR = Java::OrgSonarApiRules::RulePriority::MINOR
+ MAJOR = Java::OrgSonarApiRules::RulePriority::MAJOR
+ CRITICAL = Java::OrgSonarApiRules::RulePriority::CRITICAL
+ BLOCKER = Java::OrgSonarApiRules::RulePriority::BLOCKER
+
PRIORITY_INFO = Java::OrgSonarApiRules::RulePriority::INFO.ordinal()
PRIORITY_MINOR = Java::OrgSonarApiRules::RulePriority::MINOR.ordinal()
PRIORITY_MAJOR = Java::OrgSonarApiRules::RulePriority::MAJOR.ordinal()
end
def self.id(priority)
- Java::OrgSonarApiRules::RulePriority.valueOf(priority).ordinal
+ begin
+ javaPriority=Java::OrgSonarApiRules::RulePriority.valueOf(priority)
+ javaPriority ? javaPriority.ordinal : nil
+ rescue
+ nil
+ end
end
def self.as_array
<div id="coverage_header" class="tab_header">
+ <%= render :partial => 'options' -%>
<table class="col">
<tr>
<td class="big"><%= format_measure('coverage', :default => '-') -%></td>
<div id="source_header" class="tab_header">
+
+ <%= render :partial => 'options' -%>
+
<table class="col">
<% if m=measure('lines') %>
<tr>
<div id="violations_header" class="tab_header">
+
+ <%= render :partial => 'options' -%>
+
<table class="col">
<tr>
<td><span class="big"><%= format_measure('violations', :default => '-') -%></span> violations</td>
--- /dev/null
+<div id="source_options">
+ <script>
+ applyOptions=function() {
+ $('resource-loading').show();
+ <% if request.xhr? %>
+ var params = Form.serialize($('options-form'));
+ new Ajax.Updater('resource_container', '<%= url_for :controller => 'browse', :id => @resource.key -%>', {asynchronous:true, parameters:params});
+ return true;
+ <% else %>
+ $('options-form').submit();
+ return false;
+ <% end %>
+ };
+ </script>
+ <form method="GET" action="<%= url_for :controller => 'browse', :id => @resource.key -%>" id="options-form">
+ <input type="hidden" name="tab" value="<%= params[:tab] -%>"/>
+ <input type="hidden" name="metric" value="<%= params[:metric] -%>"/>
+ <input type="hidden" name="period" value="<%= params[:period] -%>"/>
+
+ <% if @scm_available %>
+ <input type="checkbox" value="true" name="scm" id="scm" <%= 'checked' if @display_scm -%> onclick="applyOptions()"/>
+ <label for="scm">Show commits</label><br/>
+ <% end %>
+
+ <% if @snapshot.project_snapshot.periods? %>
+ <select id="period" name="period" class="small" onchange="applyOptions()">
+ <option value="">Time changes...</option>
+ <%= period_select_options(@snapshot, 1) -%>
+ <%= period_select_options(@snapshot, 2) -%>
+ <%= period_select_options(@snapshot, 3) -%>
+ <%= period_select_options(@snapshot, 4) -%>
+ <%= period_select_options(@snapshot, 5) -%>
+ </select>
+ <br/>
+ <% end %>
+
+ <% if @expandable %>
+ <input type="checkbox" value="true" name="expand" id="expand" <%= 'checked' if @expanded -%> onclick="applyOptions()"/>
+ <label for="expand">Expand</label>
+ <br/>
+ <% end %>
+
+ <%= render :partial => 'rules_filter' if @display_violations -%>
+ </form>
+</div>
rule_options=[]
rules.uniq.sort_by{|rule| rule.name}.each do |rule|
- rule_options<<["#{h rule.name} (#{rule_counts[rule.id]})", rule.key]
+ rule_options<<["#{h rule.name} (#{rule_counts[rule.id]})", rule.id]
end
%>
<select id="rule" name="rule" class="small" onchange="applyOptions()">
<option value="">No filters</option>
<optgroup label="Severity">
<% if blocker_violations && blocker_violations.value>0 %>
- <option value="<%= Sonar::RulePriority::PRIORITY_BLOCKER-%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::PRIORITY_BLOCKER.to_s -%>>Blocker (<%= blocker_violations.formatted_value -%>)</option>
+ <option value="<%= Sonar::RulePriority::BLOCKER.to_s -%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::BLOCKER.to_s -%>>Blocker (<%= blocker_violations.formatted_value -%>)</option>
<% end %>
<% if critical_violations && critical_violations.value>0 %>
- <option value="<%= Sonar::RulePriority::PRIORITY_CRITICAL -%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::PRIORITY_CRITICAL.to_s -%>>Critical (<%= critical_violations.formatted_value -%>)</option>
+ <option value="<%= Sonar::RulePriority::CRITICAL.to_s -%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::CRITICAL.to_s -%>>Critical (<%= critical_violations.formatted_value -%>)</option>
<% end %>
<% if major_violations && major_violations.value>0 %>
- <option value="<%= Sonar::RulePriority::PRIORITY_MAJOR -%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::PRIORITY_MAJOR.to_s -%>>Major (<%= major_violations.formatted_value -%>)</option>
+ <option value="<%= Sonar::RulePriority::MAJOR.to_s -%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::MAJOR.to_s -%>>Major (<%= major_violations.formatted_value -%>)</option>
<% end %>
<% if minor_violations && minor_violations.value>0 %>
- <option value="<%= Sonar::RulePriority::PRIORITY_MINOR -%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::PRIORITY_MINOR.to_s -%>>Minor (<%= minor_violations.formatted_value -%>)</option>
+ <option value="<%= Sonar::RulePriority::MINOR.to_s -%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::MINOR.to_s -%>>Minor (<%= minor_violations.formatted_value -%>)</option>
<% end %>
<% if info_violations && info_violations.value>0 %>
- <option value="<%= Sonar::RulePriority::PRIORITY_INFO -%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::PRIORITY_INFO.to_s -%>>Info (<%= info_violations.formatted_value -%>)</option>
+ <option value="<%= Sonar::RulePriority::INFO.to_s -%>" <%= 'selected' if params[:rule]==Sonar::RulePriority::INFO.to_s -%>>Info (<%= info_violations.formatted_value -%>)</option>
<% end %>
</optgroup>
<optgroup label="Rule">
- <%= options_for_select(rule_options, params[:rule]) -%>
+ <%= options_for_select(rule_options, params[:rule].to_i) -%>
</optgroup>
</select>
\ No newline at end of file
vertical-align: sub;
}
.tab_header {
- width: 100%;
border: 1px solid #DDD;
border-top-width: 0;
background-color: #ECECEC;
.tab_header td.value {
text-align: right;
}
+#source_options {
+ float: right;
+}
</style>
<div id="source_title">
<span class="h1"><%= qualifier_icon(@resource) -%> <%= @resource.long_name -%></span>
- <% if @lines %>
- | <span class="source_link"><a href="<%= ApplicationController.root_context -%>/api/sources?resource=<%= @resource.key -%>&format=txt">raw</a></span>
- <% end %>
</div>
-<ul id="source_tabs" class="tabs">
+<div id="source_tabs">
+ <ul class="tablinks">
+ <%
+ sep=false
+ if @lines
+ sep=true
+ %>
+ <li><a href="<%= ApplicationController.root_context -%>/api/sources?resource=<%= @resource.key -%>&format=txt">Raw</a></li>
+ <% if request.xhr? %>
+ <li class="<%= 'withsep' if sep -%>"><a href="<%= ApplicationController.root_context -%>/browse/<%= @resource.key -%>" target="sonar">New Window</a></li>
+ <% end %>
+ <% end %>
+ </ul>
+ <ul class="tabs" >
<% if request.xhr? %>
<% @extensions.each do |extension| %>
<li><a href="#" onclick="loadAjaxTab('<%= @resource.id -%>','<%= extension.getId() -%>')" class="<%= 'selected' if @extension.getId()==extension.getId() -%>"><%= extension.getTitle() -%></a></li>
<li><a href="#" onClick="loadTab('<%= url_for(:overwrite_params => {:tab => extension.getId()}) -%>')" class="<%= 'selected' if @extension.getId()==extension.getId() -%>"><%= extension.getTitle() -%></a></li>
<% end %>
<% end %>
- <img src="<%= ApplicationController.root_context -%>/images/loading.gif" id="resource-loading" style="display:none"/>
-</ul>
+ <li>
+ <img src="<%= ApplicationController.root_context -%>/images/loading.gif" id="resource-loading" style="display:none"/>
+ </li>
+ </ul>
+</div>
<% else %>
<%= render :partial => 'gwt/base', :locals => {:resource => @resource, :popup => false, :metric => nil} -%>
+ <%= render :partial => 'gwt/resource_viewers' -%>
+
<div id="gwtpage"> </div>
<!-- for SmartGWT -->
<script>var isomorphicDir = "<%= "#{ApplicationController.root_context}/deploy/gwt/#{@extension.getId()}" -%>/sc/";</script>
</table>
<% end %>
-<div id="source_options">
- <script>
- applyOptions=function() {
- $('resource-loading').show();
- <% if request.xhr? %>
- var params = Form.serialize($('options-form'));
- new Ajax.Updater('resource_container', '<%= url_for :controller => 'browse', :id => @resource.key -%>', {asynchronous:true, parameters:params});
- return true;
- <% else %>
- $('options-form').submit();
- return false;
- <% end %>
- };
- </script>
- <form method="GET" action="<%= url_for :controller => 'browse', :id => @resource.key -%>" id="options-form">
- <input type="hidden" name="tab" value="<%= params[:tab] -%>"/>
- <input type="hidden" name="metric" value="<%= params[:metric] -%>"/>
- <% if @scm_available %>
- <input type="checkbox" value="true" name="scm" id="scm" <%= 'checked' if @display_scm -%> onclick="applyOptions()"/>
- <label for="scm">Authors</label>
- <% end %>
-
- <% if @snapshot.project_snapshot.periods? %>
- <select id="period" name="period" class="small" onchange="applyOptions()">
- <option value="">Time changes...</option>
- <%= period_select_options(@snapshot, 1) -%>
- <%= period_select_options(@snapshot, 2) -%>
- <%= period_select_options(@snapshot, 3) -%>
- <%= period_select_options(@snapshot, 4) -%>
- <%= period_select_options(@snapshot, 5) -%>
- </select>
- <% end %>
-
- <% if @expandable %>
- <input type="checkbox" value="true" name="expand" id="expand" <%= 'checked' if @expanded -%> onclick="applyOptions()"/>
- <label for="expand">Expand</label>
- <% end %>
-
- <%= render :partial => 'rules_filter' if @display_violations -%>
- </form>
-</div>
-
<% if @lines && @lines.size>0 %>
<table id="sources" class="sources2 code" cellpadding="0" cellspacing="0" border="0">
<%
--- /dev/null
+<div id="resource_container"> </div>
\ No newline at end of file
--- /dev/null
+<%= render :partial => 'gwt/base', :locals => {:popup => false, :metric => @metric.key} -%>
+<%= render :partial => 'gwt/resource_viewers' -%>
+
+<script>
+ /* display resource */
+ function d(resourceId) {
+ new Ajax.Updater('resource_container', '<%= ApplicationController.root_context-%>/browse/' + resourceId + '?metric=<%= @metric.id if @metric -%>&rule=<%= @rule ? @rule.id : params[:priority] -%>&period=<%= @period -%>', {asynchronous:true, evalScripts:true});
+ return false;
+ }
+
+ function loadAjaxTab(resourceId, tab) {
+ $('resource-loading').show();
+ new Ajax.Updater('resource_container', '<%= ApplicationController.root_context-%>/browse/' + resourceId + '?tab=' + tab, {asynchronous:true, evalScripts:true});
+ return false;
+ }
+
+ /* display GWT component, executed from tabs */
+ function loadGWT(gwtId, resourceId, resourceKey, resourceName, resourceScope, resourceQualifier, resourceLanguage) {
+ config["resource"]=[{"id": resourceId, "key": resourceKey, "name" : resourceName, "scope": resourceScope, "qualifier": resourceQualifier, "lang": resourceLanguage}];
+ config["resource_key"]=resourceId;
+ modules[gwtId]();
+ }
+</script>
-<%= render :partial => 'gwt/base', :locals => {:resource => @highlighted_resource, :popup => false, :metric => @metric.key} %>
-<%= render :partial => 'gwt/resource_viewers', :locals => {:resource => @drilldown.highlighted_resource || @project} %>
+<%= render :partial => 'header' -%>
-<script>
- /* display resource */
- function d(resourceId) {
- new Ajax.Updater('resource_container', '<%= ApplicationController.root_context-%>/browse/' + resourceId + '?metric=<%= @metric.key -%>', {asynchronous:true, evalScripts:true});
- return false;
- }
-
- function loadAjaxTab(resourceId, tab) {
- $('resource-loading').show();
- new Ajax.Updater('resource_container', '<%= ApplicationController.root_context-%>/browse/' + resourceId + '?tab=' + tab, {asynchronous:true, evalScripts:true});
- return false;
- }
-
- /* display GWT component, executed from tabs */
- function loadGWT(gwtId, resourceId, resourceKey, resourceName, resourceScope, resourceQualifier, resourceLanguage) {
- config["resource"]=[{"id": resourceId, "key": resourceKey, "name" : resourceName, "scope": resourceScope, "qualifier": resourceQualifier, "lang": resourceLanguage}];
- modules[gwtId]();
- }
-</script>
<div class="dashbox">
<% if @characteristic %>
<h3><%= @highlighted_metric.short_name -%> / <%= h(@characteristic.name(true)) -%></h3>
<% end %>
</script>
-<div id="resource_container"> </div>
+<%= render :partial => 'footer' -%>
+<%= render :partial => 'header' -%>
+
+
<div id="snapshot_title" class="page_title">
<h4>
<%
<div class="warning">This service is experimental. <a target="faq" href="http://docs.codehaus.org/display/SONAR/Frequently+Asked+Questions#FrequentlyAskedQuestions-Iamnotgettingexpectednewviolationsinthedifferentialviewsofdrilldown%3F">More</a>.</div>
<% end %>
-<%= render :partial => 'gwt/base', :locals => {:resource => @highlighted_resource, :popup => false, :metric => 'violations'} %>
-<%= render :partial => 'gwt/resource_viewers', :locals => {:resource => @project} %>
<table width="100%" cellpadding="0" cellspacing="0" id="columns">
<tr>
<%= link_to(h(resource.name), {:only_path => true, :overwrite_params => {:rids => nil, :id => resource.copy_resource_id}}) -%>
<% else %>
<%= qualifier_icon(resource) %>
- <a href="#" onclick="sr('<%= resource.id -%>');" alt="<%= resource.name(true) -%>" title="<%= resource.name(true) -%>"><%= resource.name(false) %></a>
+ <a href="#" onclick="d(<%= resource.id -%>, '<%= @period_index -%>', '<%= @rule ? @rule.key : params[:priority] -%>');" alt="<%= resource.name(true) -%>" title="<%= resource.name(true) -%>"><%= resource.name(false) %></a>
<%
end
else %>
$$('#col_<%= column.scope -%> tr.selected').each(function(item) {item.scrollIntoView(true);});
<% end %>
</script>
-<div id="pageselector"> </div>
\ No newline at end of file
+
+<%= render :partial => 'footer' -%>
\ No newline at end of file
var config = {
"sonar_url":"<%= url_for(:controller => '/', :action => '', :only_path => true, :trailing_slash => false)[0...-2] -%>",
"version":"<%= sonar_version -%>",
- "popup":<%= popup -%>
+ "popup": "<%= popup -%>"
<% if metric %>
,"metric": "<%= metric -%>"
-<% end
- if resource
-%>
- ,"resource_key": "<%= resource.id -%>",
- "resource":[{"id": <%= resource.id -%>, "key":"<%= resource.key -%>","scope": "<%= resource.scope -%>", "qualifier": "<%= resource.qualifier -%>", "name": "<%= resource.name -%>", "lang":"<%= resource.language -%>"}]
- <% end %>
- <% if @snapshot %>
- <% if @snapshot.project_snapshot.period1_mode %>
- ,"period1": "<%= period_label(@snapshot, 1) -%>"
- ,"period1_date": "<%= @snapshot.project_snapshot.period1_date.strftime("%Y-%m-%dT%H:%M:%S%z") -%>"
- <% end
- if @snapshot.project_snapshot.period2_mode %>
- ,"period2": "<%= period_label(@snapshot, 2) -%>"
- ,"period2_date": "<%= @snapshot.project_snapshot.period2_date.strftime("%Y-%m-%dT%H:%M:%S%z") -%>"
- <% end
- if @snapshot.project_snapshot.period3_mode %>
- ,"period3": "<%= period_label(@snapshot, 3) -%>"
- ,"period3_date": "<%= @snapshot.project_snapshot.period3_date.strftime("%Y-%m-%dT%H:%M:%S%z") -%>"
- <% end
- if @snapshot.project_snapshot.period4_mode %>
- ,"period4": "<%= period_label(@snapshot, 4) -%>"
- ,"period4_date": "<%= @snapshot.project_snapshot.period4_date.strftime("%Y-%m-%dT%H:%M:%S%z") -%>"
- <% end
- if @snapshot.project_snapshot.period5_mode %>
- ,"period5": "<%= period_label(@snapshot, 5) -%>"
- ,"period5_date": "<%= @snapshot.project_snapshot.period5_date.strftime("%Y-%m-%dT%H:%M:%S%z") -%>"
- <% end %>
- <% end %>
+<% end %>
};
var rp = {
-<script type="text/javascript">
- var pages = [
- {"id": "dashboard", "name": "Dashboard", "gwt": false, "url": "/dashboard/index?hd=false&layout=false&id=", "m":[], "s":['PRJ','DIR'], "q": [], "l": []},
- <%
- gwt_pages=[]
- page_index=0
- controller.java_facade.getResourceTabs().each do |tab|
- show_page=false
- tab.getUserRoles().each do |role|
- if has_role?(role, resource)
- show_page=true
- end
- end
- if show_page
- gwt_pages<<tab if tab.isGwt()
- %>
- <%= ',' if page_index>0 -%>{"id": "<%= tab.getId() -%>", "name": "<%= tab.getTitle() -%>", "gwt": <%= tab.isGwt() -%>, "d":<%= tab.isDefaultTab() -%>,"m":[<%= tab.getDefaultTabForMetrics().map{|s| "\"#{s}\""}.join(',') -%>], "s":[<%= tab.getResourceScopes().map{|s| "\"#{s}\""}.join(',') -%>], "q": [<%= tab.getResourceQualifiers().map{|s| "\"#{s}\""}.join(',') -%>], "l": [<%= tab.getResourceLanguages().map{|s| "\"#{s}\""}.join(',') -%>]}
- <%
- page_index+=1
- end
- end %>
- ];
-</script>
-<script src="<%= ApplicationController.root_context -%>/deploy/gwt/org.sonar.plugins.core.ui.pageselector.PageSelector/org.sonar.plugins.core.ui.pageselector.PageSelector.nocache.js?<%= sonar_version -%>"></script>
-<% gwt_pages.each do |gwt_page| %>
-<script src="<%= ApplicationController.root_context -%>/deploy/gwt/<%= gwt_page.getId() -%>/<%= gwt_page.getId() -%>.nocache.js?<%= sonar_version -%>"></script>
-<% end %>
+<%
+ gwt_pages=[]
+ controller.java_facade.getResourceTabs().each do |tab|
+ if tab.isGwt()
+%>
+ <script src="<%= ApplicationController.root_context -%>/deploy/gwt/<%= tab.getId() -%>/<%= tab.getId() -%>.nocache.js"></script>
+
+<%
+ end
+ end
+%>
\ No newline at end of file
title="Sonar - #{h(@page_title)}"
elsif @project
title="Sonar - #{h(@project.name)}"
+ elsif @resource
+ title="#{h(@resource.long_name)}"
else
title='Sonar'
end
}
.tablinks {
float:right;
- padding-right: 10px;
- align: right;
+ padding: 0 5px 0 10px;
+ text-align: right;
+}
+.tablinks li {
+ float:left;
+ padding: 0 7px;
+ text-align: right;
}
+.tablinks li.withsep {
+ background: url("../images/sep12.png") no-repeat scroll 0 50% transparent;
+}
+
.tablinks a {
text-decoration: underline;
color: #555;