<dependency>
<groupId>org.sonarsource.orchestrator</groupId>
<artifactId>sonar-orchestrator</artifactId>
- <version>3.7</version>
+ <version>3.9</version>
<scope>test</scope>
</dependency>
<dependency>
@ClassRule
public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
- .setContext("/")
.setServerProperty("sonar.notifications.delay", "1")
.addPlugin(pluginArtifact("property-sets-plugin"))
.addPlugin(pluginArtifact("sonar-subcategories-plugin"))
@ClassRule
public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
- .setContext("/")
-
.addPlugin(xooPlugin())
// issue
public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
.addPlugin(xooPlugin())
.setOrchestratorProperty("javaVersion", "LATEST_RELEASE").addPlugin("java")
- .setContext("/")
// Used by SettingsEncryptionTest
.addPlugin(pluginArtifact("settings-encryption-plugin"))
@ClassRule
public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
- .setContext("/")
.addPlugin(xooPlugin())
.build();
}
import com.sonar.orchestrator.build.BuildFailureException;
import com.sonar.orchestrator.build.BuildResult;
import com.sonar.orchestrator.build.SonarRunner;
-import com.sonar.orchestrator.build.SonarRunnerInstaller;
+import com.sonar.orchestrator.build.SonarScanner;
+import com.sonar.orchestrator.build.SonarScannerInstaller;
import com.sonar.orchestrator.config.FileSystem;
import com.sonar.orchestrator.locator.FileLocation;
import com.sonar.orchestrator.version.Version;
private void runConcurrentIssues() throws Exception {
// Install sonar-runner in advance to avoid concurrent unzip issues
FileSystem fileSystem = orchestrator.getConfiguration().fileSystem();
- new SonarRunnerInstaller(fileSystem).install(Version.create(SonarRunner.DEFAULT_RUNNER_VERSION), fileSystem.workspace());
+ new SonarScannerInstaller(fileSystem).install(Version.create(SonarScanner.DEFAULT_RUNNER_VERSION), fileSystem.workspace());
final int nThreads = 3;
ExecutorService executorService = Executors.newFixedThreadPool(nThreads);
List<Callable<BuildResult>> tasks = new ArrayList<>();
tasks.add(new Callable<BuildResult>() {
public BuildResult call() throws Exception {
- SonarRunner runner = configureRunnerIssues("shared/xoo-sample", homeDir, "sonar.it.enableWaitingSensor", "true");
+ SonarScanner runner = configureRunnerIssues("shared/xoo-sample", homeDir, "sonar.it.enableWaitingSensor", "true");
return orchestrator.executeBuild(runner);
}
});
return orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics(key, "lines"));
}
- private SonarRunner configureRunnerIssues(String projectDir, @Nullable File homeDir, String... props) throws IOException {
- SonarRunner runner = SonarRunner.create(ItUtils.projectDir(projectDir),
+ private SonarScanner configureRunnerIssues(String projectDir, @Nullable File homeDir, String... props) throws IOException {
+ SonarScanner scanner = SonarScanner.create(ItUtils.projectDir(projectDir),
"sonar.working.directory", temp.newFolder().getAbsolutePath(),
"sonar.analysis.mode", "issues",
"sonar.report.export.path", "sonar-report.json");
if (homeDir != null) {
- runner.setProperty("sonar.userHome", homeDir.getAbsolutePath());
+ scanner.setProperty("sonar.userHome", homeDir.getAbsolutePath());
} else {
- runner.setProperty("sonar.userHome", temp.newFolder().getAbsolutePath());
+ scanner.setProperty("sonar.userHome", temp.newFolder().getAbsolutePath());
}
- runner.setProperties(props);
- return runner;
+ scanner.setProperties(props);
+ return scanner;
}
private SonarRunner configureRunner(String projectDir, String... props) throws IOException {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package util;/*
- * Copyright (C) 2009-2014 SonarSource SA
- * All rights reserved
- * mailto:contact AT sonarsource DOT com
- */
+package util;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.sonar.orchestrator.Orchestrator;
private ItUtils() {
}
- private static final Supplier<File> HOME_DIR = Suppliers.memoize(new Supplier<File>() {
- @Override
- public File get() {
- File testResources = FileUtils.toFile(ItUtils.class.getResource("/ItUtils.txt"));
- return testResources // ${home}/it/it-tests/src/test/resources
- .getParentFile() // ${home}/it/it-tests/src/test
- .getParentFile() // ${home}/it/it-tests/src
- .getParentFile() // ${home}/it/it-tests
- .getParentFile() // ${home}/it
- .getParentFile(); // ${home}
- }
- });
-
public static FileLocation xooPlugin() {
- File target = new File(HOME_DIR.get(), "plugins/sonar-xoo-plugin/target");
- if (target.exists()) {
- for (File jar : FileUtils.listFiles(target, new String[] {"jar"}, false)) {
- if (jar.getName().startsWith("sonar-xoo-plugin-") && !jar.getName().contains("-sources")) {
- return FileLocation.of(jar);
- }
- }
- }
- throw new IllegalStateException("XOO plugin is not built");
+ return FileLocation.byWildcardMavenFilename(new File("../../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar");
}
public static List<Issue> getAllServerIssues(Orchestrator orchestrator) {
* @param relativePath path related to the directory it/it-projects, for example "qualitygate/xoo-sample"
*/
public static File projectDir(String relativePath) {
- File dir = new File(HOME_DIR.get(), "it/it-projects/" + relativePath);
+ File dir = new File("../it-projects/" + relativePath);
if (!dir.exists() || !dir.isDirectory()) {
throw new IllegalStateException("Directory does not exist: " + dir.getAbsolutePath());
}
* It assumes that version is 1.0-SNAPSHOT
*/
public static FileLocation pluginArtifact(String dirName) {
- File file = new File(HOME_DIR.get(), "it/it-plugins/" + dirName + "/target/" + dirName + "-1.0-SNAPSHOT.jar");
- if (!file.exists()) {
- throw new IllegalStateException(String.format("Plugin [%s]for integration tests is not built. File not found:%s", dirName, file));
- }
- return FileLocation.of(file);
+ return FileLocation.byWildcardMavenFilename(new File("../it-plugins/" + dirName + "/target"), dirName + "-*.jar");
}
/**
# By default, ports will be used on all IP addresses associated with the server.
#sonar.web.host=0.0.0.0
-# Web context. When set, it must start with forward slash (for example /sonarqube).
-# The default value is root context (empty value).
-#sonar.web.context=
-
# TCP port for incoming HTTP connections. Disabled when value is -1.
#sonar.web.port=9000
# By default, ports will be used on all IP addresses associated with the server.
#sonar.web.host=0.0.0.0
-# Web context. When set, it must start with forward slash (for example /sonarqube).
-# The default value is root context (empty value).
-#sonar.web.context=
-
# TCP port for incoming HTTP connections. Disabled when value is -1.
#sonar.web.port=9000
private static final String JRUBY_MAX_RUNTIMES = "jruby.max.runtimes";
private static final String RAILS_ENV = "rails.env";
- private static final String PROPERTY_CONTEXT = "sonar.web.context";
+ private static final String ROOT_CONTEXT_PATH = "";
private Webapp() {
}
static StandardContext configure(Tomcat tomcat, Props props) {
try {
- StandardContext context = (StandardContext) tomcat.addWebapp(getContextPath(props), webappPath(props));
+ StandardContext context = (StandardContext) tomcat.addWebapp(ROOT_CONTEXT_PATH, webappPath(props));
context.setClearReferencesHttpClientKeepAliveThread(false);
context.setClearReferencesStatic(false);
context.setClearReferencesStopThreads(false);
}
}
- static String getContextPath(Props props) {
- String context = props.value(PROPERTY_CONTEXT, "");
- if ("/".equals(context)) {
- context = "";
- } else if (!"".equals(context) && !context.startsWith("/")) {
- throw new IllegalStateException(String.format("Value of '%s' must start with a forward slash: '%s'", PROPERTY_CONTEXT, context));
- }
- return context;
- }
-
static void configureRails(Props props, Context context) {
// sonar.dev is kept for backward-compatibility
if (props.valueAsBoolean("sonar.dev", false)) {
private String id;
private String version;
private String implementationBuild;
- private String contextPath;
private File sonarHome;
private File deployDir;
version = readVersion(versionPath);
implementationBuild = read(buildProperties).getProperty("Implementation-Build");
- contextPath = StringUtils.defaultIfBlank(settings.getString("sonar.web.context"), "")
- // Remove trailing slashes
- .replaceFirst("(\\/+)$", "");
sonarHome = new File(settings.getString(ProcessProperties.PATH_HOME));
if (!sonarHome.isDirectory()) {
@Override
public String getContextPath() {
- return contextPath;
+ return "";
}
@Override
*/
package org.sonar.server.app;
+import java.io.File;
+import java.util.Properties;
import org.apache.catalina.Context;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.Tomcat;
import org.junit.rules.TemporaryFolder;
import org.sonar.process.Props;
-import java.io.File;
-import java.util.Properties;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.anyString;
verify(context).addParameter("jruby.max.runtimes", "1");
verify(context).addParameter("rails.env", "production");
}
-
- @Test
- public void context_path_must_start_with_slash() {
- Properties p = new Properties();
- p.setProperty("sonar.web.context", "foo");
-
- try {
- Webapp.getContextPath(new Props(p));
- fail();
- } catch (IllegalStateException e) {
- assertThat(e.getMessage()).isEqualTo("Value of 'sonar.web.context' must start with a forward slash: 'foo'");
- }
- }
-
- @Test
- public void root_context_path_must_be_blank() {
- Properties p = new Properties();
- p.setProperty("sonar.web.context", "/");
-
- assertThat(Webapp.getContextPath(new Props(p))).isEqualTo("");
- }
-
- @Test
- public void default_context_path_is_root() {
- String context = Webapp.getContextPath(new Props(new Properties()));
- assertThat(context).isEqualTo("");
- }
}
assertThat(server.getContextPath()).isEqualTo("");
}
- @Test
- public void get_context_path_from_settings() {
- settings.setProperty("sonar.web.context", "/my_path");
- server.start();
- assertThat(server.getContextPath()).isEqualTo("/my_path");
- }
-
- @Test
- public void sanitize_context_path_from_settings() {
- settings.setProperty("sonar.web.context", "/my_path///");
- server.start();
- assertThat(server.getContextPath()).isEqualTo("/my_path");
- }
-
@Test
public void is_dev() throws Exception {
settings.setProperty("sonar.web.dev", true);
@Override
public String getContextPath() {
- return null;
+ return "";
}
@Override
end
end
- redirect_to "#{ApplicationController.root_context}/account/notifications"
+ redirect_to "/account/notifications"
end
private
rescue_from Errors::AccessDenied, :with => :render_access_denied # See lib/authenticated_system.rb#access_denied()
def self.root_context
- ActionController::Base.relative_url_root || ''
+ ''
end
def java_facade
# url_for_static(:plugin => 'myplugin', :path => 'image.png')
def url_for_static(options={})
if options[:plugin]
- "#{ApplicationController.root_context}/static/#{options[:plugin]}/#{options[:path]}"
+ "/static/#{options[:plugin]}/#{options[:path]}"
else
- "#{ApplicationController.root_context}/#{options[:path]}"
+ "/#{options[:path]}"
end
end
period_index=nil if period_index && period_index<=0
if resource.display_dashboard?
if options[:dashboard]
- root = "#{ApplicationController.root_context}/dashboard/index?"
+ root = "/dashboard/index?"
else
# stay on the same page (for example components)
- root = "#{ApplicationController.root_context}/#{u params[:controller]}/#{u params[:action]}?"
+ root = "/#{u params[:controller]}/#{u params[:action]}?"
end
path = ''
query = request.query_parameters
end
"<a class='#{options[:class]}' title='#{options[:title]}' href='#{root + path}'>#{name || resource.name}</a>"
else
- url = "#{ApplicationController.root_context}/dashboard/index?id=#{u resource.key}"
+ url = "/dashboard/index?id=#{u resource.key}"
url += "&period=#{u period_index}" if period_index
url += "&metric=#{u options[:metric]}" if options[:metric]
"<a class='#{options[:class]}' title='#{options[:title]}' " +
end
def chart(parameters, options={})
- image_tag("#{ApplicationController.root_context}/chart?#{parameters}", options)
+ image_tag("/chart?#{parameters}", options)
end
def link_to_favourite(resource, deprecated_options=nil)
# see limitation in /api/resources/search
options[:min_length]=2
- ws_url="#{ApplicationController::root_context}/api/resources/search?f=s2&"
+ ws_url="/api/resources/search?f=s2&"
if options[:qualifiers]
ws_url+="q=#{options[:qualifiers].join(',')}"
elsif options[:resource_type_property]
# see limitation in /api/resources/search
options[:min_length]=2
- ws_url="#{ApplicationController::root_context}/api/resources/search?f=s2&"
+ ws_url="/api/resources/search?f=s2&"
if options[:qualifiers]
ws_url+="q=#{options[:qualifiers].join(',')}"
elsif options[:resource_type_property]
# * <tt>:select2_options</tt> - hash of select2 options
#
def user_select_tag(name, options={})
- ws_url="#{ApplicationController::root_context}/api/users/search"
+ ws_url="/api/users/search"
options[:min_length]=2
options[:select2_ajax_options]={
'data' => 'function (term, page) { return { q: term, p: page } }',
message_params = options[:confirm_msg_params]
width = options[:confirm_width]||500
- url = "#{ApplicationController.root_context}/confirm?url=#{u post_url}"
+ url = "/confirm?url=#{u post_url}"
url += "&tk=#{u title_key}" if title_key
if message_key
url += "&mk=#{u message_key}&"
html += " colspan='#{options[:colspan]}'" if options[:colspan]
html += '>'
if options[:include_loading_icon] && options[:id]
- html += "<img src='#{ApplicationController.root_context}/images/loading-small.gif' style='display: none' id='#{options[:id]}_loading'>"
+ html += "<img src='/images/loading-small.gif' style='display: none' id='#{options[:id]}_loading'>"
end
html += '<div'
html += " id='#{options[:id]}_pages'" if options[:id]
html += " colspan='#{options[:colspan]}'" if options[:colspan]
html += '>'
if options[:include_loading_icon] && options[:id]
- html += "<img src='#{ApplicationController.root_context}/images/loading-small.gif' style='display: none' id='#{options[:id]}_loading'>"
+ html += "<img src='/images/loading-small.gif' style='display: none' id='#{options[:id]}_loading'>"
end
html += '<div'
html += " id='#{options[:id]}_pages'" if options[:id]
end
def url_for_issues(params)
- url = ApplicationController.root_context + '/issues/search#'
+ url = '/issues/search#'
params.each_with_index do |(key, value), index|
if key == 'filter'
key = 'id'
if component.blank?
url_for_issues(params)
else
- url = ApplicationController.root_context + '/component_issues/index?id=' + url_encode(component.key) + '#'
+ url = '/component_issues/index?id=' + url_encode(component.key) + '#'
params.each_with_index do |(key, value), index|
if key != 'componentUuids'
url += key.to_s + '=' + value.to_s
-<form id="pass_form_tag" name="pass_form_tag" method="post" action="<%= ApplicationController.root_context -%>/account/change_password">
+<form id="pass_form_tag" name="pass_form_tag" method="post" action="/account/change_password">
<div class="modal-head">
<h2><%= message('my_profile.password.title') -%></h2>
</div>
<td class="thin"><%= link_to_favourite f -%></td>
<td>
<%
- url = ApplicationController.root_context + '/dashboard?id=' + url_encode(f.key)
+ url = '/dashboard?id=' + url_encode(f.key)
%>
<a href="<%= url -%>" class="link-with-icon">
<%= qualifier_icon f %>
]
};
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/account.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/account.js?v=<%= sonar_version -%>"></script>
<% end %>
</section>
<% end %>
- <form id="notif_form" method="post" action="<%= ApplicationController.root_context -%>/account/update_notifications">
+ <form id="notif_form" method="post" action="/account/update_notifications">
<% unless @global_dispatchers.empty? -%>
<section class="big-spacer-bottom">
<%= render "account/global_notifications" -%>
</div>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/account.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/account.js?v=<%= sonar_version -%>"></script>
<% end %>
<% if is_admin?(@resource.id) %>
<div class="page-actions">
<a id="create-link-action_plans"
- href="<%=ApplicationController.root_context-%>/action_plans/create_form/<%= h(@resource.id) -%>"
+ href="/action_plans/create_form/<%= h(@resource.id) -%>"
class="open-modal button"><%= message('action_plans.add_new_action_plan') -%></a>
</div>
<% end %>
%>
<tr class="<%= cycle('even', 'odd', :name => 'open_plans') -%>">
<td class="thin nowrap text-center">
- <img src="<%= ApplicationController.root_context -%>/images/status/<%= plan.status() -%>.png" title="<%= message("action_plans.status.#{plan.status}") -%>"/></td>
+ <img src="/images/status/<%= plan.status() -%>.png" title="<%= message("action_plans.status.#{plan.status}") -%>"/></td>
<td class="thin nowrap"><%= h(plan.name()) -%></td>
<td class="thin nowrap <%= 'over-due' if plan.overDue() -%>" align="right"><%= format_date(plan.deadLine()) -%></td>
<% if plan.totalIssues()==0 %>
<%= link_to message('close'),
{:action => 'change_status', :id => @resource.id, :plan_key => plan.key()}, {:method => 'POST', :class => 'link-action'}.merge(close_confirmation_message) -%>
- <%= link_to_action message('delete'), "#{ApplicationController.root_context}/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}",
+ <%= link_to_action message('delete'), "/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}",
:class => 'link-action link-red',
:id => "delete_#{h(plan.key)}",
:confirm_button => message('delete'),
@closed_action_plans.each do |plan|
%>
<tr class="<%= cycle('even', 'odd', :name => 'closed_plans') -%>">
- <td class="thin nowrap text-center"><img src="<%= ApplicationController.root_context -%>/images/status/<%= plan.status() -%>.png" title="<%= message("action_plans.status.#{plan.status}") -%>"/>
+ <td class="thin nowrap text-center"><img src="/images/status/<%= plan.status() -%>.png" title="<%= message("action_plans.status.#{plan.status}") -%>"/>
</td>
<td class="thin nowrap"><%= h(plan.name) -%></td>
<td class="thin nowrap <%= 'over-due' if plan.overDue() -%>" align="right"><%= format_date(plan.deadLine()) -%></td>
<%= link_to message('action_plans.reopen'),
{:action => 'change_status', :id => @resource.id, :plan_key => plan.key}, {:method => 'POST', :class => 'link-action'} -%>
- <%= link_to_action message('delete'), "#{ApplicationController.root_context}/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}",
+ <%= link_to_action message('delete'), "/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}",
:class => 'link-action link-red',
:id => "delete_#{h(plan.key)}",
:confirm_button => message('delete'),
<script>
window.sonarqube.urlRoot = window.baseUrl + '/api_documentation';
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/api-documentation.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/api-documentation.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/background-tasks.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/background-tasks.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/code.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/code.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/coding-rules.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/coding-rules.js?v=<%= sonar_version -%>"></script>
<% end %>
<header class="page-header">
<h1 class="page-title"><%= h message('comparison.page') -%></h1>
</header>
- <form method="GET" id="compare-form" action="<%= ApplicationController.root_context -%>/comparison/index">
+ <form method="GET" id="compare-form" action="/comparison/index">
<input type="hidden" name="sids" id="sids" value="<%= @snapshots.map { |s| s.id.to_s }.join(',') -%>">
<input type="hidden" name="metrics" id="metrics" value="<%= @metrics.map { |m| m.key }.join(',') -%>">
$j('#version_loading').show();
$j.ajax({
type:'GET',
- url:'<%= ApplicationController.root_context -%>/comparison/versions?resource='
+ url:'/comparison/versions?resource='
+ id + '&sids='
+ $j('#sids').val(),
success:function (data) {
<% if index > 0 %>
<a class="icon-move-left" href="#" onclick="moveLeft(<%= index -%>)" id="left-<%= index -%>"></a>
<% else %>
- <img src="<%= ApplicationController.root_context -%>/images/transparent_16.gif"/>
+ <img src="/images/transparent_16.gif"/>
<% end %>
</td>
<td style="text-align: center; min-width: 100px">
<% if index < last_index %>
<a class="icon-move-right" href="#" onclick="moveRight(<%= index -%>)" id="right-<%= index -%>"></a>
<% else %>
- <img src="<%= ApplicationController.root_context -%>/images/transparent_16.gif"/>
+ <img src="/images/transparent_16.gif"/>
<% end %>
</td>
</tr>
%>
<th style="text-align: center; vertical-align: top; line-height: 1.5;">
<span class="no-transform">
- <a href="<%= ApplicationController.root_context -%>/dashboard/index/<%= s.resource.key -%>"><%= h s.resource.name(true) -%></a>
+ <a href="/dashboard/index/<%= s.resource.key -%>"><%= h s.resource.name(true) -%></a>
<br/>
<span class="note"><b><%= event ? event.name : message('comparison.version.latest') -%></b></span>
<br/>
};
})();
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/source-viewer.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/source-viewer.js?v=<%= sonar_version -%>"></script>
<% end %>
};
})();
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/component-issues.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/component-issues.js?v=<%= sonar_version -%>"></script>
<% end %>
</div>
<div class="modal-body">
<div class="info">
- <img src="<%= ApplicationController.root_context -%>/images/information.png" style="vertical-align: text-bottom"/>
+ <img src="/images/information.png" style="vertical-align: text-bottom"/>
<%= h message(message_key, :params => message_params) -%>
</div>
</div>
<script>
window.sonarqube.projectId = '<%= @resource.uuid -%>';
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/custom-measures.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/custom-measures.js?v=<%= sonar_version -%>"></script>
<% end %>
-<form id="configure-widget-<%= widget.id -%>" method="post" action="<%= ApplicationController.root_context -%>/dashboard/save_widget?wid=<%= widget.id -%>">
+<form id="configure-widget-<%= widget.id -%>" method="post" action="/dashboard/save_widget?wid=<%= widget.id -%>">
<div id="error<%= widget.id -%>" class="error" style="display: none"></div>
<table class="table width100">
<tbody>
<% content_for :script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/dashboard.js?v=<%= sonar_version -%>"></script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/widgets.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/dashboard.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/widgets.js?v=<%= sonar_version -%>"></script>
<% end %>
<div class="page" id="dashboard">
<% content_for :script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/dashboard.js?v=<%= sonar_version -%>"></script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/widgets.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/dashboard.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/widgets.js?v=<%= sonar_version -%>"></script>
<% end %>
};
})();
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/source-viewer.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/source-viewer.js?v=<%= sonar_version -%>"></script>
<% end %>
-<form id="create-dashboard-form" method="post" action="<%= ApplicationController.root_context -%>/dashboards/create">
+<form id="create-dashboard-form" method="post" action="/dashboards/create">
<% if @global %>
<input type="hidden" name="global" value="true" />
<% else %>
-<form id="delete-dashboard-form" method="post" action="<%= ApplicationController.root_context -%>/dashboards/delete">
+<form id="delete-dashboard-form" method="post" action="/dashboards/delete">
<input type="hidden" name="id" value="<%= @dashboard.id -%>">
<% if @dashboard.global %>
<input type="hidden" name="global" value="true" />
-<form id="edit-dashboard-form" method="post" action="<%= ApplicationController.root_context -%>/dashboards/update">
+<form id="edit-dashboard-form" method="post" action="/dashboards/update">
<input type="hidden" name="id" value="<%= @dashboard.id -%>">
<% if @dashboard.global %>
<input type="hidden" name="global" value="true" />
<% if params[:period] && @snapshot.project_snapshot.periods? %>
<div id="snapshot_title" class="spacer-bottom">
<h4>
- <form method="GET" action="<%= ApplicationController.root_context -%>/drilldown/measures" style="display: inline">
+ <form method="GET" action="/drilldown/measures" style="display: inline">
<input type="hidden" name="id" value="<%= h @snapshot.project.key -%>"/>
<input type="hidden" name="metric" value="<%= h params[:metric] -%>"/>
<% if params[:highlight] %>
<script>
window.sonarqube.el = '#source-viewer';
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/drilldown.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/drilldown.js?v=<%= sonar_version -%>"></script>
<% end %>
-<form method="post" action="<%= ApplicationController.root_context -%>/email_configuration/save" class="marginbottom10">
+<form method="post" action="/email_configuration/save" class="marginbottom10">
<table class="marginbottom10">
<tbody>
<tr class="property">
</table>
</form>
-<form method="post" action="<%= ApplicationController.root_context -%>/email_configuration/send_test_email">
+<form method="post" action="/email_configuration/send_test_email">
<table class="data marginbottom10">
<thead>
<tr>
type="button"
value="Generate secret key"
onclick="$j.ajax({
- url:'<%=ApplicationController.root_context-%>/encryption_configuration/generate_secret',
+ url:'/encryption_configuration/generate_secret',
type:'post',
success:function(response){$j('#secret_content').html(response);},
error:function(response){$j('#secret_error').html(response.responseText); $j('#secret_error').show();}
<form class="spacer-bottom"
onsubmit=
"$j.ajax({
- url:'<%=ApplicationController.root_context-%>/encryption_configuration/encrypt',
+ url:'/encryption_configuration/encrypt',
type:'post',
success:function(response)
{
});
return false;"
method="post"
- action="<%=ApplicationController.root_context-%>/encryption_configuration/encrypt" >
+ action="/encryption_configuration/encrypt" >
<input type="text" name="text" id="clear_text"/>
<input type="submit" value="Encrypt" id="submit_encrypt"/>
</form>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/groups.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/groups.js?v=<%= sonar_version -%>"></script>
<% end %>
all_issues_are_assigned_to_current_user &&= issue.assignee() == current_user.login
end
%>
-<form id="bulk-change-form" method="post" action="<%= ApplicationController.root_context -%>/issues/bulk_change">
+<form id="bulk-change-form" method="post" action="/issues/bulk_change">
<input type="hidden" name="issues" value="<%= @issues.map { |issue| issue.key() }.join(',') -%>">
<input type="hidden" name="actions[]" id="bulk-change-transition-action">
<fieldset>
-<form id="copy-filter-form" method="post" action="<%= ApplicationController.root_context -%>/issues/copy">
+<form id="copy-filter-form" method="post" action="/issues/copy">
<input type="hidden" name="id" value="<%= @filter.id -%>">
<fieldset>
<div class="modal-head">
-<form id="edit-filter-form" method="post" action="<%= ApplicationController.root_context -%>/issues/edit">
+<form id="edit-filter-form" method="post" action="/issues/edit">
<input type="hidden" name="id" value="<%= @filter.id -%>">
<fieldset>
<div class="modal-head">
-<form id="save-as-filter-form" method="post" action="<%= ApplicationController.root_context -%>/issues/save_as">
+<form id="save-as-filter-form" method="post" action="/issues/save_as">
<input type="hidden" name="data" value="<%= u(@filter_query_serialized) -%>">
<fieldset>
<div class="modal-head">
<%= issue_filter_star(filter, @favourite_filter_ids.include?(filter.id)) -%>
</td>
<td>
- <a href="<%= ApplicationController.root_context -%>/issues/search#id=<%= h filter.id -%>"><%= h filter.name -%></a>
+ <a href="/issues/search#id=<%= h filter.id -%>"><%= h filter.name -%></a>
<% if filter.description %>
<div class="note"><%= h filter.description -%></div>
<% end %>
<% end %>
</td>
<td class="thin nowrap text-right">
- <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/copy_form/<%= filter.id -%>"
+ <a id="copy-<%= filter.name.parameterize -%>" href="/issues/copy_form/<%= filter.id -%>"
class="link-action open-modal"><%= message('copy') -%></a>
- <a id="edit_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/edit_form/<%= filter.id -%>"
+ <a id="edit_<%= filter.name.parameterize -%>" href="/issues/edit_form/<%= filter.id -%>"
class="link-action open-modal"><%= message('edit') -%></a>
- <%= link_to_action message('delete'), "#{ApplicationController.root_context}/issues/delete/#{filter.id}",
+ <%= link_to_action message('delete'), "/issues/delete/#{filter.id}",
:class => 'link-action link-red',
:id => "delete_#{filter.name.parameterize}",
:confirm_button => message('delete'),
<%= issue_filter_star(filter, @favourite_filter_ids.include?(filter.id)) -%>
</td>
<td>
- <a href="<%= ApplicationController.root_context -%>/issues/search#id=<%= h filter.id -%>|<%= h filter.data -%>"><%= h filter.name -%></a>
+ <a href="/issues/search#id=<%= h filter.id -%>|<%= h filter.data -%>"><%= h filter.name -%></a>
<% if filter.description %>
<div class="note"><%= h filter.description -%></div>
<% end %>
<%= filter.userLogin ? h(Api.users.findByLogin(filter.userLogin).name) : '[SonarQube]' -%>
</td>
<td class="thin nowrap text-right">
- <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
+ <a id="copy-<%= filter.name.parameterize -%>" href="/issues/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
<% if has_role?(:admin) %>
- <a id="edit_shared_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
+ <a id="edit_shared_<%= filter.name.parameterize -%>" href="/issues/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
- <%= link_to_action message('delete'), "#{ApplicationController.root_context}/issues/delete/#{filter.id}",
+ <%= link_to_action message('delete'), "/issues/delete/#{filter.id}",
:class => 'link-action link-red',
:id => "delete_system_#{filter.name.parameterize}",
:confirm_button => message('delete'),
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/issues.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/issues.js?v=<%= sonar_version -%>"></script>
<% end %>
</script>
<% end %>
-<script src="<%= ApplicationController.root_context -%>/js/bundles/main.js?v=<%= sonar_version -%>"></script>
+<script src="/js/bundles/main.js?v=<%= sonar_version -%>"></script>
<%= yield :extra_script -%>
</body>
%>
<title><%= title -%></title>
- <link href="<%= ApplicationController.root_context -%>/css/sonar.css?v=<%= sonar_version -%>" rel="stylesheet" media="all">
+ <link href="/css/sonar.css?v=<%= sonar_version -%>" rel="stylesheet" media="all">
<%= yield :style -%>
<script>
updateCenterActive: <%= configuration('sonar.updatecenter.activate', true) %>
};
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/vendor.js?v=<%= sonar_version -%>"></script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/sonar.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/vendor.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/sonar.js?v=<%= sonar_version -%>"></script>
<script>
- window.baseUrl = '<%= ApplicationController.root_context -%>';
+ window.baseUrl = '';
</script>
<%= yield :script -%>
</head>
<a href="http://www.sonarqube.org/documentation" target="sonar_doc">Documentation</a> -
<a href="http://www.sonarqube.org/support" target="support">Get Support</a> -
<a href="http://redirect.sonarsource.com/doc/plugin-library.html" target="plugins">Plugins</a> -
- <a href="<%= ApplicationController.root_context -%>/api_documentation">Web Service API</a>
+ <a href="/api_documentation">Web Service API</a>
</div>
<!--[if lte IE 8 ]><p class="spacer-top alert alert-danger">IE 8 is not supported. Some widgets may not be properly displayed. Please switch to a <a target="_blank" href="http://redirect.sonarsource.com/doc/requirements.html">supported version or another supported browser</a>.</p><!--<![endif]-->
</div>
<nav class="navbar navbar-global page-container" id="global-navigation">
<div class="navbar-header">
- <a class="navbar-brand" href="<%= ApplicationController.root_context -%>/">
- <img src="<%= ApplicationController.root_context -%>/images/logo.svg" height="30"
+ <a class="navbar-brand" href="/">
+ <img src="/images/logo.svg" height="30"
alt="<%= h message('layout.sonar.slogan') -%>"
title="<%= h message('layout.sonar.slogan') -%>">
</a>
<a href="http://www.sonarqube.org/documentation" target="sonar_doc">Documentation</a> -
<a href="http://www.sonarqube.org/support" target="support">Get Support</a> -
<a href="http://redirect.sonarsource.com/doc/plugin-library.html" target="plugins">Plugins</a> -
- <a href="<%= ApplicationController.root_context -%>/api_documentation">Web Service API</a>
+ <a href="/api_documentation">Web Service API</a>
</div>
<%= render 'branding/footer' -%>
</div>
})(window.jQuery);
</script>
-<script src="<%= ApplicationController.root_context -%>/js/bundles/main.js?v=<%= sonar_version -%>"></script>
+<script src="/js/bundles/main.js?v=<%= sonar_version -%>"></script>
<%= yield :extra_script -%>
</body></html>
<script>
window.sonarqube.setup = false;
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/maintenance.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/maintenance.js?v=<%= sonar_version -%>"></script>
<% end %>
<script>
window.sonarqube.el = '#markdown-full-help';
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/markdown.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/markdown.js?v=<%= sonar_version -%>"></script>
<% end %>
-<form id="copy-filter-form" method="post" action="<%= ApplicationController.root_context -%>/measures/copy">
+<form id="copy-filter-form" method="post" action="/measures/copy">
<input type="hidden" name="id" value="<%= @filter.id -%>">
<fieldset>
<div class="modal-head">
$j("#copy-filter-form").modalForm({success: function (data) {
window.location = baseUrl + '/measures/filter/' + data;
}});
-</script>
\ No newline at end of file
+</script>
-<form id="edit-filter-form" method="post" action="<%= ApplicationController.root_context -%>/measures/edit">
+<form id="edit-filter-form" method="post" action="/measures/edit">
<input type="hidden" name="id" value="<%= @filter.id -%>">
<fieldset>
<div class="modal-head">
$j("#edit-filter-form").modalForm({success: function (data) {
window.location = baseUrl + '/measures/filter/' + data;
}});
-</script>
\ No newline at end of file
+</script>
<li class="sidebar-title"><%= message('measure_filter.favourite_filters') -%></li>
<% current_user.favourited_measure_filters.each do |filter| %>
<li <%= "class='active'" if @filter && filter.id==@filter.id -%>>
- <a href="<%= ApplicationController.root_context -%>/measures/filter/<%= filter.id -%>"><%= h filter.name -%></a>
+ <a href="/measures/filter/<%= filter.id -%>"><%= h filter.name -%></a>
</li>
<% end %>
- <li><a href="<%= ApplicationController.root_context -%>/measures/manage" class="link-action"><%= message('manage') %></a></li>
+ <li><a href="/measures/manage" class="link-action"><%= message('manage') %></a></li>
<li class="spacer"></li>
<% end %>
-</div>
\ No newline at end of file
+</div>
-<form id="save-as-filter-form" method="post" action="<%= ApplicationController.root_context -%>/measures/save_as">
+<form id="save-as-filter-form" method="post" action="/measures/save_as">
<input type="hidden" name="id" value="<%= @filter.id -%>">
<input type="hidden" name="data" value="<%= u(@filter.data) -%>">
<fieldset>
$j("#save-as-filter-form").modalForm({success:function (data) {
window.location = baseUrl + '/measures/filter/' + data;
}});
-</script>
\ No newline at end of file
+</script>
<div class="page-actions">
<div class="button-group">
- <button onclick="window.location='<%= ApplicationController.root_context -%>/measures/search?qualifiers[]=TRK';"><%= message 'measure_filter.new_search' -%></button>
+ <button onclick="window.location='/measures/search?qualifiers[]=TRK';"><%= message 'measure_filter.new_search' -%></button>
<% unless edit_mode %>
<% if logged_in? %>
<% end %>
</td>
<td class="text-thin nowrap text-right">
- <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
+ <a id="copy-<%= filter.name.parameterize -%>" href="/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
- <a id="edit_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
+ <a id="edit_<%= filter.name.parameterize -%>" href="/measures/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
- <%= link_to_action message('delete'), "#{ApplicationController.root_context}/measures/delete/#{filter.id}",
+ <%= link_to_action message('delete'), "/measures/delete/#{filter.id}",
:class => 'link-action link-red',
:id => "delete_#{filter.name.parameterize}",
:confirm_button => message('delete'),
<%= filter.user ? h(filter.user.name) : '[SonarQube]' -%>
</td>
<td class="thin nowrap text-right">
- <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
+ <a id="copy-<%= filter.name.parameterize -%>" href="/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
<% if has_role?(:admin) %>
- <a id="edit_system_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
+ <a id="edit_system_<%= filter.name.parameterize -%>" href="/measures/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
- <%= link_to_action message('delete'), "#{ApplicationController.root_context}/measures/delete/#{filter.id}",
+ <%= link_to_action message('delete'), "/measures/delete/#{filter.id}",
:class => 'link-action link-red',
:id => "delete_system_#{filter.name.parameterize}",
:confirm_button => message('delete'),
<script id="filter-bar-template" type="text/x-handlebars-template">
- <form method="get" action="<%= ApplicationController.root_context -%>/measures/search">
+ <form method="get" action="/measures/search">
<% if @filter.id %>
<input type="hidden" name="id" value="<%= h @filter.id -%>">
<% end %>
];
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/measures.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/measures.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/metrics.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/metrics.js?v=<%= sonar_version -%>"></script>
<% end %>
};
})();
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/overview.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/overview.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/permission-templates.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/permission-templates.js?v=<%= sonar_version -%>"></script>
<% end %>
<script>
window.sonarqube.urlRoot = baseUrl + '/profiles';
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/quality-profiles.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/quality-profiles.js?v=<%= sonar_version -%>"></script>
<% end %>
<% resource_qualifier = message('qualifier.' + @project.qualifier) %>
-<form id="delete-project-form" method="post" action="<%= ApplicationController.root_context -%>/project/delete">
+<form id="delete-project-form" method="post" action="/project/delete">
<fieldset>
<div class="modal-head">
<h2><%= message('project_deletion.page', :params => resource_qualifier) -%></h2>
$j("#delete-project-form").modalForm({
success: function () {
$j.ajax({
- url: "<%= ApplicationController.root_context-%>/project/delete/<%= h(@project.id) -%>",
+ url: "/project/delete/<%= h(@project.id) -%>",
success: function (request) {
window.location = '<%= url_for(:action => 'pending_deletion',:id => @project.id)-%>';
},
<script>
window.sonarqube.componentId = '<%= @project.uuid -%>';
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/background-tasks.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/background-tasks.js?v=<%= sonar_version -%>"></script>
<% end %>
<div class="yui-g widget" id="widget_delete_project">
<div class="alert alert-warning spacer-bottom"><%= message('project_deletion.operation_cannot_be_undone') -%></div>
<a id="delete_resource" class="open-modal button button-red"
- href="<%= ApplicationController.root_context -%>/project/delete_form/<%= h(@project.id) -%>"><%= delete_resource_message -%></a>
+ href="/project/delete_form/<%= h(@project.id) -%>"><%= delete_resource_message -%></a>
</div>
<% end %>
</div>
<tr class="<%= cycle 'even', 'odd' -%>">
<td class="thin" nowrap><%= h language.getName() -%></td>
<td>
- <form id="form-<%= language.getKey().parameterize -%>" method="POST" action="<%= ApplicationController.root_context -%>/project/set_profile">
+ <form id="form-<%= language.getKey().parameterize -%>" method="POST" action="/project/set_profile">
<input type="hidden" name="id" value="<%= @project_id -%>"/>
<input type="hidden" name="language" value="<%= language.getKey() -%>"/>
<p class="page-description"><%= message('project_quality_gate.page.description') -%></p>
</header>
- <form id="select-quality-gate" method="POST" action="<%= ApplicationController.root_context -%>/project/set_qualitygate">
+ <form id="select-quality-gate" method="POST" action="/project/set_qualitygate">
<input type="hidden" name="id" value="<%= @project_id -%>"/>
<input type="hidden" name="previous_qgate_id" value="<%= @selected_qgate -%>"/>
<%= h truncate(issue.message, :length => 100) -%></a>
<% if last_comment && last_comment.userLogin() %>
<div class="comment-excerpt">
- <img src="<%= ApplicationController.root_context -%>/images/reviews/comment.png"/>
+ <img src="/images/reviews/comment.png"/>
<% commentAuthor = users_by_login[last_comment.userLogin()] %>
<b><%= h( commentAuthor.nil? ? last_comment.userLogin() : commentAuthor.name() ) -%> :</b>
<%= Internal.text.markdownToHtml(last_comment.markdownText) -%>
<script>
window.sonarqube.componentId = '<%= @project.uuid -%>';
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/project-permissions.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/project-permissions.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/projects.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/projects.js?v=<%= sonar_version -%>"></script>
<% end %>
<script>
window.sonarqube.urlRoot = baseUrl + '/quality_gates';
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/quality-gates.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/quality-gates.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/global-permissions.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/global-permissions.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/project-permissions.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/project-permissions.js?v=<%= sonar_version -%>"></script>
<% end %>
-<form method="post" action="<%= ApplicationController.root_context -%>/server_id_configuration/generate">
+<form method="post" action="/server_id_configuration/generate">
<table class="marginbottom10">
<thead>
<tr>
<label for="remember_me"><%= message('sessions.remember_me') -%></label>
</p>
- <div class="text-right overflow-hidden">
- <button name="commit"><%= message('sessions.log_in') -%></button>
- <a class="spacer-left" href="<%= home_path -%>"><%= message('cancel') -%></a>
+ <div>
+ <div class="pull-left">
+ <% auth_providers = Api::Utils.java_facade.getIdentityProviders().to_a %>
+ <ul class="list-inline">
+ <% auth_providers.each do |provider| %>
+ <li>
+ <a class="oauth-link"
+ href="/sessions/init/<%= provider.getKey().to_s %>"
+ title="Login with <%= provider.getName().to_s -%>">
+ <img alt="<%= provider.getName().to_s -%>" width="24" height="24"
+ src="<%= provider.getIconPath().to_s -%>">
+ </a>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+ <div class="text-right overflow-hidden">
+ <button name="commit"><%= message('sessions.log_in') -%></button>
+ <a class="spacer-left" href="<%= home_path -%>"><%= message('cancel') -%></a>
+ </div>
</div>
</form>
<div class="marginbottom10" style="padding-left: 5px;">
<%= hidden_field_tag('page_version', (params[:page_version] || 0).to_i + 1) -%>
<%= submit_tag(message('settings.save_category', :params => [subcategory_name(@category, @subcategory)]), :id => 'submit_settings') -%>
- <img src="<%= ApplicationController.root_context -%>/images/loading.gif" id="loading_settings" style="display:none;">
+ <img src="/images/loading.gif" id="loading_settings" style="display:none;">
</div>
<% end %>
<script>
window.sonarqube.setup = true;
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/maintenance.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/maintenance.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
-<script src="<%= ApplicationController.root_context -%>/js/bundles/system.js?v=<%= sonar_version -%>"></script>
+<script src="/js/bundles/system.js?v=<%= sonar_version -%>"></script>
<% end %>
<script>
window.sonarqube.urlRoot = baseUrl + '/updatecenter';
</script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/update-center.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/update-center.js?v=<%= sonar_version -%>"></script>
<% end %>
-<form id="user_edit_form" method="post" action="<%= ApplicationController.root_context -%>/users/update">
+<form id="user_edit_form" method="post" action="/users/update">
<fieldset>
<div class="modal-head">
<h2>Edit user: <%= h @user.login() -%></h2>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/users.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/users.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/code.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/code.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :script do %>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/dashboard.js?v=<%= sonar_version -%>"></script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/widgets.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/dashboard.js?v=<%= sonar_version -%>"></script>
+ <script src="/js/bundles/widgets.js?v=<%= sonar_version -%>"></script>
<% end %>
<div id="block_1" class="block" style="width: <%= @widget_width -%>">
<div style="clear: both;"></div>
</div>
-</div>
\ No newline at end of file
+</div>
# By default, ports will be used on all IP addresses associated with the server.
#sonar.web.host=0.0.0.0
-# Web context. When set, it must start with forward slash (for example /sonarqube).
-# The default value is root context (empty value).
-#sonar.web.context=
-
# TCP port for incoming HTTP connections. Disabled when value is -1.
#sonar.web.port=9000
@Override
public String getContextPath() {
- return null;
+ return "";
}
@Override
@CheckForNull
public abstract File getDeployDir();
+ /**
+ * @deprecated in 5.4. Web context path can not be configured. It's always {@code ""}. See https://jira.sonarsource.com/browse/SONAR-7122
+ */
+ @Deprecated
public abstract String getContextPath();
/**