]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7122 Drop the ability to customize the web app context
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 1 Feb 2016 19:35:30 +0000 (20:35 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 2 Feb 2016 15:15:33 +0000 (16:15 +0100)
90 files changed:
it/it-tests/pom.xml
it/it-tests/src/test/java/it/Category1Suite.java
it/it-tests/src/test/java/it/Category2Suite.java
it/it-tests/src/test/java/it/Category3Suite.java
it/it-tests/src/test/java/it/Category4Suite.java
it/it-tests/src/test/java/it/analysis/IssuesModeTest.java
it/it-tests/src/test/java/util/ItUtils.java
server/sonar-process-monitor/src/test/resources/org/sonar/process/ProcessTest/sonar.properties
server/sonar-process/src/test/resources/org/sonar/process/ProcessTest/sonar.properties
server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java
server/sonar-server/src/main/java/org/sonar/server/platform/ServerImpl.java
server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ServerLifecycleNotifierTest.java
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_change_password_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_favorites.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/account/notifications.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/api_documentation/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/background_tasks/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/code/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/component_issues/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/confirm/_confirm.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/custom_measures/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/generate_secret_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/groups/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_edit_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_save_as_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/manage.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_footer.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/nonav.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/maintenance/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/markdown/help.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_favourites.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_save_as_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_search_header.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/search.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/project/_delete_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/project/background_tasks.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/project/deletion.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/project/profile.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/project/qualitygate.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/projects/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/global.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/server_id_configuration/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/setup/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_edit_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/users/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/view_projects/index.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/widget/index.html.erb
sonar-application/src/main/assembly/conf/sonar.properties
sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java
sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java

index 386f69257e8cfa5da7d862a179c09b319e2e2316..25b1a8b2ac1d8ef55fc3d038ce10ceacf3e586cf 100644 (file)
@@ -21,7 +21,7 @@
     <dependency>
       <groupId>org.sonarsource.orchestrator</groupId>
       <artifactId>sonar-orchestrator</artifactId>
-      <version>3.7</version>
+      <version>3.9</version>
       <scope>test</scope>
     </dependency>
     <dependency>
index f9b138e88af4aa08932b3477514fed6b4e8b0274..b5bdb5574da8a727d3ee04f42265b002ab8a8a21 100644 (file)
@@ -118,7 +118,6 @@ public class Category1Suite {
 
   @ClassRule
   public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
-    .setContext("/")
     .setServerProperty("sonar.notifications.delay", "1")
     .addPlugin(pluginArtifact("property-sets-plugin"))
     .addPlugin(pluginArtifact("sonar-subcategories-plugin"))
index 0505c30af73aecd6317bfc1002b13b4d278c5177..3c1bbbf6c279a6e5c6328ecdf7dfa0059bb8c48b 100644 (file)
@@ -105,8 +105,6 @@ public class Category2Suite {
 
   @ClassRule
   public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
-    .setContext("/")
-
     .addPlugin(xooPlugin())
 
     // issue
index 3bd7dfa8afcc80491a28791c1abc8f2cd6956ad4..8576080b5cba2f643b515924059284637d0e7b18 100644 (file)
@@ -54,7 +54,6 @@ public class Category3Suite {
   public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
     .addPlugin(xooPlugin())
     .setOrchestratorProperty("javaVersion", "LATEST_RELEASE").addPlugin("java")
-    .setContext("/")
 
     // Used by SettingsEncryptionTest
     .addPlugin(pluginArtifact("settings-encryption-plugin"))
index f743ad74fc4de4014668faea71439604a9220527..57ea1d1553aa89aef1338270a83b6374500e2572 100644 (file)
@@ -70,7 +70,6 @@ public class Category4Suite {
 
   @ClassRule
   public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
-    .setContext("/")
     .addPlugin(xooPlugin())
     .build();
 }
index b9a761165a284d0eb2893b10a46f63a118ceb124..81d219aa56dfce6885470580277088d978462d52 100644 (file)
@@ -24,7 +24,8 @@ import com.sonar.orchestrator.Orchestrator;
 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;
@@ -405,7 +406,7 @@ public class IssuesModeTest {
   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<>();
@@ -414,7 +415,7 @@ public class IssuesModeTest {
       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);
         }
       });
@@ -447,18 +448,18 @@ public class IssuesModeTest {
     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 {
index 7702f25df00c58d7910732c61b0a0befdfeb5faa..7eb6464faa64439a1df32f1101d1475c05119a24 100644 (file)
  * 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;
@@ -67,29 +61,8 @@ public class ItUtils {
   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) {
@@ -118,7 +91,7 @@ public class ItUtils {
    * @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());
     }
@@ -132,11 +105,7 @@ public class ItUtils {
    *                     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");
   }
 
   /**
index 4c4ddb2f1304639c954221a26a3f72122e4cdb9b..dd7a73de8ad153edfa36f6d6bf70cea774b7b7e5 100644 (file)
@@ -80,10 +80,6 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000
 # 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
 
index 4c4ddb2f1304639c954221a26a3f72122e4cdb9b..dd7a73de8ad153edfa36f6d6bf70cea774b7b7e5 100644 (file)
@@ -80,10 +80,6 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000
 # 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
 
index 52659a2afcda01976636f6b5c853936f0ebe976c..f0a128c04d269a51af7558dcecd510c50778184d 100644 (file)
@@ -37,14 +37,14 @@ class Webapp {
 
   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);
@@ -72,16 +72,6 @@ class Webapp {
     }
   }
 
-  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)) {
index 7ab16e8d70d91a97f591aa027c12a24cae99d5fd..444dcd6d61c2c28372f69144f2c312600467455d 100644 (file)
@@ -55,7 +55,6 @@ public final class ServerImpl extends Server implements Startable {
   private String id;
   private String version;
   private String implementationBuild;
-  private String contextPath;
   private File sonarHome;
   private File deployDir;
 
@@ -78,9 +77,6 @@ public final class ServerImpl extends Server implements Startable {
 
       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()) {
@@ -138,7 +134,7 @@ public final class ServerImpl extends Server implements Startable {
 
   @Override
   public String getContextPath() {
-    return contextPath;
+    return "";
   }
 
   @Override
index 234ee29042c384088dd94604b9d3c0e2e79a28b2..197ed81f3874302e11778724eb64ad99bf4c9ba4 100644 (file)
@@ -19,6 +19,8 @@
  */
 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;
@@ -27,9 +29,6 @@ import org.junit.Test;
 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;
@@ -94,31 +93,4 @@ public class WebappTest {
     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("");
-  }
 }
index 6dd519dfe403df9813df8a7b8ca3a93725fd4ff6..052a1fbd8e47a4c05abc0fb88bcfb1a4dc62b8fb 100644 (file)
@@ -124,20 +124,6 @@ public class ServerImplTest {
     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);
index d91368da8b4ab975f1d5478bc2abb67782307d61..275ef0edf4244bb946d9b71653db82bf33583f3f 100644 (file)
@@ -115,7 +115,7 @@ class FakeServer extends Server {
 
   @Override
   public String getContextPath() {
-    return null;
+    return "";
   }
 
   @Override
index 508c5ac7ae184bd2afd1feec1dfdd85c342f753a..99d3093545d598f77596ec1f31febcf89e1bc998 100644 (file)
@@ -80,7 +80,7 @@ class AccountController < ApplicationController
       end
     end
 
-    redirect_to "#{ApplicationController.root_context}/account/notifications"
+    redirect_to "/account/notifications"
   end
 
   private
index d1c1682b30e6f4b01a18f611e4eb7380a4f4f353..55959e331d183990434ce12a086f998110cc38f9 100644 (file)
@@ -43,7 +43,7 @@ class ApplicationController < ActionController::Base
   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
index 982956acd762c91b4d2d4185aaed2ba29876ab09..262665471b97d22136b11dc7019688a0ef2a2089 100644 (file)
@@ -167,9 +167,9 @@ module ApplicationHelper
   #   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
 
@@ -329,10 +329,10 @@ module ApplicationHelper
     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
@@ -345,7 +345,7 @@ module ApplicationHelper
       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]}' " +
@@ -413,7 +413,7 @@ module ApplicationHelper
   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)
@@ -645,7 +645,7 @@ module ApplicationHelper
     # 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]
@@ -679,7 +679,7 @@ module ApplicationHelper
     # 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]
@@ -711,7 +711,7 @@ module ApplicationHelper
   # * <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 } }',
@@ -851,7 +851,7 @@ module ApplicationHelper
     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}&"
@@ -877,7 +877,7 @@ module ApplicationHelper
     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]
@@ -944,7 +944,7 @@ module ApplicationHelper
     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]
@@ -992,7 +992,7 @@ module ApplicationHelper
   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'
@@ -1009,7 +1009,7 @@ module ApplicationHelper
     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
index c62a514c98e2fe6695f268ed540f259903310edf..63b2f0b9cfdd5b83e51f366b1bd7d5e140a1f422 100644 (file)
@@ -1,4 +1,4 @@
-<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>
index e0f6c2f658ff79e2da55dc65ec72367ec9edd0e4..434c160613a493c08e7f2a587111dca755fa0b4c 100644 (file)
@@ -7,7 +7,7 @@
       <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 %>
index 5cb4f630c877656db10d2e70d29644dcfb8652ef..edab056abc59e78a2773b029db26b57800db07ac 100644 (file)
@@ -93,5 +93,5 @@
       ]
     };
   </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 %>
index 29ac2b1ce1d1f28e73328849a8e6d27e806af7c7..728550b5a3ef65d619b8bb8bdb6eee5ba0428829 100644 (file)
@@ -48,7 +48,7 @@
       </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" -%>
@@ -71,5 +71,5 @@
 </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 %>
index e7be46039284d6c627e02a87aefdfb363c2fd37c..6c384f37d0613ce6fa80fd5c8e091efd037351bb 100644 (file)
@@ -4,7 +4,7 @@
     <% 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 %>
@@ -35,7 +35,7 @@
           %>
             <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 %>
@@ -61,7 +61,7 @@
                 <%= link_to message('close'),
                             {:action => 'change_status', :id => @resource.id, :plan_key => plan.key()}, {:method => 'POST', :class => 'link-action'}.merge(close_confirmation_message) -%>
                 &nbsp;
-                <%= 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'),
@@ -98,7 +98,7 @@
                @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'} -%>
                   &nbsp;
-                    <%= 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'),
index 62aedd51b291c5e82a176526e260d912bc23cddf..4d8d2500e2dc341063f4b8db975041c75bfbc2bf 100644 (file)
@@ -2,5 +2,5 @@
   <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 %>
index 18cce998a6f5b780346cb6c4bccb1b25c284423b..8b7563b9081bee0c12adc1a91c5119e4ceafd3b1 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index f5600f6ca038e77994fb461fbf7bee312c01f00a..a805ff002fd04d93bc6d8b5d74ec2b2fa026bfb1 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index 7d421c9d66d178850a03c16e99b3fa90e6b32bcf..21b70621c4efaf363ea7317bf49a02e4ba97c3d5 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index c0058d15a5834ad84fb100effcca8f2a24a95ef7..b94f313facab2aa28658b2ba9509c4d283d0c033 100644 (file)
@@ -69,7 +69,7 @@
     <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/>
index 27fe285b3d7358dc99304b53132a63b5c8d979c2..39ca697ed6e848a7cae64e595371eedecb5b36da 100644 (file)
@@ -9,7 +9,7 @@
       };
     })();
   </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 %>
 
 
index b2b853e610b90982c3e9e799afe55d3919e41738..53629f560208a3803c7dc68590bae36f46996b4c 100644 (file)
@@ -9,5 +9,5 @@
       };
     })();
   </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 %>
index 64f47c4f522d39e20fba6514df471083f50a6b1e..bfecce9911ee77c7b52310000effdaf8b9f272b9 100644 (file)
@@ -11,7 +11,7 @@
     </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>
index 8a7e139e257efa7a20a92b95fc32db3609e896f6..cff02fb111d46ab67ec006839761967086ebdeb8 100644 (file)
@@ -2,5 +2,5 @@
   <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 %>
index a7492f091c97b0f82ce1a9953e418c988ebe06e6..319694faee35c91686cc578fbcb2ea1113b49408 100644 (file)
@@ -1,4 +1,4 @@
-<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>
index 48b2288e5fae3eedb347dd41970fd23b7203c990..296fe1e3e00e8930885d7e167b384fd97ac5c852 100644 (file)
@@ -1,6 +1,6 @@
 <% 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">
index 132fe9ded988941400c2fa525726b3f13729093e..6603843b8708e8479bbc359ebdc49c792c230f5a 100644 (file)
@@ -1,6 +1,6 @@
 <% 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 %>
 
 
index 72416ed82eb84fbd1629caffa5d6a1522c968dce..05f0f5bfb271cef5fccf79f5d6159d9c3cf19f1d 100644 (file)
@@ -14,7 +14,7 @@
       };
     })();
   </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 %>
 
 
index 669f955d295108a1683cb284f947bde31d976a6d..298a8073f34843c1ea0b005e578c54eb274e686a 100644 (file)
@@ -1,4 +1,4 @@
-<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 %>
index 2f369216ac80f99e2deccaa205196c6cf8415fd8..9b44f6643a13a5cd2eb3a414484188e3dd52931b 100644 (file)
@@ -1,4 +1,4 @@
-<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" />
index c96cb3feb0c41ef759d3bbda3efed143c8c5c97a..9309a22c5ff52606ae73542d64677a3958b22b5c 100644 (file)
@@ -1,4 +1,4 @@
-<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" />
index 3e1a68f269f839e0433d5671d5a3d0b5f2656b58..56d086e1fa90f4ae1e372a5e966b5a58f06d1d13 100644 (file)
@@ -2,7 +2,7 @@
   <% 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 %>
index 76265ab10972288fd3cb1c4278cea8301e131025..0de15fd9ff542d7c61ae51e5bf549d3bd8349a65 100644 (file)
@@ -1,4 +1,4 @@
-<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">
@@ -62,7 +62,7 @@
   </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>
index e2624527d17ba6e6842d5064101ed9464bd42413..572d1ea6ea5cfa4eef05836c9b19fb2d3b2bce25 100644 (file)
@@ -17,7 +17,7 @@
                   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();}
index 4b0cb7c2d479532a8b219b789e22913c60c1b042..a2126b5bfcbf1e392e4a58fff6ef6dd086028e47 100644 (file)
@@ -13,7 +13,7 @@
         <form  class="spacer-bottom"
                onsubmit=
                  "$j.ajax({
-                   url:'<%=ApplicationController.root_context-%>/encryption_configuration/encrypt',
+                   url:'/encryption_configuration/encrypt',
                    type:'post',
                    success:function(response)
                      {
@@ -31,7 +31,7 @@
                    });
                    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>
index e3bee63260c5e3098c9dd94672b0072e94bcf0a3..747f7383293aa7b5c43d69cc31bd2554f66f083a 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index e047918ee8155509f59c2c0e4305bba6e1d568d1..1685b1e3f8a086391333c8b1b380e3bf0222ad80 100644 (file)
@@ -25,7 +25,7 @@
      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>
index ad34992b2884deeea086284bfce55c3af4210610..51551254393d345c1a9ab1f41117b515dde0d33e 100644 (file)
@@ -1,4 +1,4 @@
-<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">
index 650e7e19993aea0e9eb53b5540f800d383193c19..c30a633e20202ff36f6b92094d88923225f245e3 100644 (file)
@@ -1,4 +1,4 @@
-<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">
index a771f24bd01ead91e2bdd827d8ba4fb4fabe336e..339e6cde5b775416668ee978e5ceb89984c72c00 100644 (file)
@@ -1,4 +1,4 @@
-<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">
index 737b7e00f53e4578cff98bebadf04d420b7e0c6d..d3019835eb58c1264222217cbe84e3a70af683b8 100644 (file)
@@ -59,7 +59,7 @@
               <%= 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>
               &nbsp;
-              <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>
               &nbsp;
-              <%= 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) %>
                 &nbsp;
-                <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>
                 &nbsp;
-                <%= 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'),
index b1baf27f96c5dd63c454ead3f717b02f8dabd42e..48b7b4b268dea80845dfe3ace1251478cc51e4aa 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index c5dbab53411d3ddedff9f56b7d9febc73638b297..409489b00943910cb5e746f98ae79a8d7bf29463 100644 (file)
@@ -16,7 +16,7 @@
   </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>
index 66c5645c688a3a0fd01aed685048bc09264e7de2..ec1b9db64c7c1a314a01b5046983b5f429a8a449 100644 (file)
@@ -18,7 +18,7 @@
   %>
   <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>
index b793d31198ebae15dde40949abfd9996b23cddcd..94e2eb4f7ebe25f581d58d985037bd1e5950ee03 100644 (file)
@@ -56,7 +56,7 @@
       <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>
index 6ff414fd6570ac5514064b163a87165c3602ed51..52ddb5917606761478af175e4252fea559ec80b7 100644 (file)
@@ -2,8 +2,8 @@
 
 <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>
@@ -24,7 +24,7 @@
     <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>
@@ -36,7 +36,7 @@
   })(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>
index 346aa13f86077f1fbf2ade91652a3c9d9f0eb62d..106956d89d98ce3e9dc2da6a7f1a95190ad85272 100644 (file)
@@ -2,6 +2,6 @@
   <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 %>
 
index 6f667bc45cd3d7021b49837d8b298e9bf7f267f3..84057db8521eb718c9f4b09a62e087b4d6942c53 100644 (file)
@@ -4,5 +4,5 @@
   <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 %>
index 4aac628b14c5f92c175dc16800215946932f90e4..7fa6351ed3da0439b0c897bfea91ee39f08cf332 100644 (file)
@@ -1,4 +1,4 @@
-<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">
@@ -17,4 +17,4 @@
   $j("#copy-filter-form").modalForm({success: function (data) {
     window.location = baseUrl + '/measures/filter/' + data;
   }});
-</script>
\ No newline at end of file
+</script>
index 9a26c12a220116b041d2ffad3a4bfb23addea3bb..dff381e9e19db64ba615470299645d86641acef1 100644 (file)
@@ -1,4 +1,4 @@
-<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">
@@ -17,4 +17,4 @@
   $j("#edit-filter-form").modalForm({success: function (data) {
     window.location = baseUrl + '/measures/filter/' + data;
   }});
-</script>
\ No newline at end of file
+</script>
index 77124eb9e981c3fd8e7a5a7bda891cb9abbfb7fd..d12704e559d87c4f2456c9e394ebf4957214f3a2 100644 (file)
@@ -3,10 +3,10 @@
   <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>
index 6bfdc3ae1c14c1e670f09a0e5a2f4681b948e2b4..b43563c5e80793847a5783589b3e143df1a096b3 100644 (file)
@@ -1,4 +1,4 @@
-<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>
@@ -18,4 +18,4 @@
   $j("#save-as-filter-form").modalForm({success:function (data) {
     window.location = baseUrl + '/measures/filter/' + data;
   }});
-</script>
\ No newline at end of file
+</script>
index fa098e9775049cbba7696cdd4e997c2a5f60890a..6c4c3581a50721f0cf3c488cf74491ec25401225 100644 (file)
@@ -24,7 +24,7 @@
 
   <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? %>
index 70516106f19e78acda2fe268ef8d92a95acd5c7e..802605fe3e1c076fdef0096274ae5f9caede9855 100644 (file)
                 <% 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>
                 &nbsp;
-                <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>
                 &nbsp;
-                <%= 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) %>
                   &nbsp;
-                  <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>
                   &nbsp;
-                  <%= 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'),
index fff811989ea8f17e979f6fd16f5c9cd13714b1b0..5d0bd1c595bf018458d7fd207c184452b024e4ab 100644 (file)
@@ -16,7 +16,7 @@
 
 
 <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 %>
@@ -93,5 +93,5 @@
     ];
   </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 %>
index 5a8e0641d976875e9e53a228510b81a8df00240a..e8879ceb4320df166724934c8b996997be080c49 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index 43d4cedebee04d9e46c4d2ef67ec161094db113b..b3823ee05e044bce9a6b17c4292e5bbc87b37a26 100644 (file)
       };
     })();
   </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 %>
index fb97f387c59fd54f930aa79d8a3f125ad098a247..7597579ae760a5d9bf75cf53f13c9241ea8a32e6 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index 3c52faf87d933af3ee7eedf285b8ed0f7d535228..898ed10342f6aca8ede81adf09183aec3dc3aef4 100644 (file)
@@ -2,5 +2,5 @@
   <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 %>
index 79c73cd6f8255b464ac2d80e2f6d6f54ac69f27e..f4fddfc43915b43f116fbe3c7fcc73b76b565134 100644 (file)
@@ -1,5 +1,5 @@
 <% 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>
@@ -18,7 +18,7 @@
   $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)-%>';
         },
index ba6d27a4da6148bf5c12d68bcbc31ccaa3849083..096a2eb2f8b78a6ed4ca37cf9503a8f80f150dbb 100644 (file)
@@ -2,5 +2,5 @@
   <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 %>
index 73bdb62f6bef669f7b04c4b8fa3a2f6b945c0db3..8f9f509b939b93e67299485f5b1e45bb6a69c3e2 100644 (file)
@@ -12,7 +12,7 @@
     <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>
index d24f845572e5d0aa41173f356abcf40d8029ec23..399e50a65c2e4ef34ca2838b6d98c5ffe08578aa 100644 (file)
@@ -19,7 +19,7 @@
       <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() -%>"/>
 
index cd6e5a57567b46151cf2811c563c3ab06a233dbd..d14507675a018885db13ff1bca7b389d7e1b849a 100644 (file)
@@ -4,7 +4,7 @@
     <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 -%>"/>
 
index 02610e495e4d9e5fac72a0e3d2dcc503b8b358d8..70938e7cad1712b9618c0813c40fbf0eb2c10e2d 100644 (file)
@@ -56,7 +56,7 @@
             <%= 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()] %>
               &nbsp;<b><%= h( commentAuthor.nil? ? last_comment.userLogin() : commentAuthor.name() ) -%> :</b>
               <%= Internal.text.markdownToHtml(last_comment.markdownText) -%>
index 2ffe436320a8dfb4218111ba58159fb7b09a62f0..57b2c1ab069a96b8820a5b816ef60a41b7607ac9 100644 (file)
@@ -2,5 +2,5 @@
   <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 %>
index e9c8ffd9ad8506e3f552e4865f1362303d2ad48f..290a9ac5f9f7c1a8e974fd044f1a6d2056ada199 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index 54b071e6e5a17138aa78a89808811f760310dd96..ed03db047c09f27f107d576821ede99f1b6552c5 100644 (file)
@@ -2,5 +2,5 @@
   <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 %>
index 3c79bb2feca566f738448260d59c76e8f4f98cae..1b84a1069deddabf4b864df28056d9bd78eb2aab 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index df0126ffd091829d2c4a609d1f5e6fa433b20121..b37e4b37e9258ba2b81b84ec4c88f39de2a36fba 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index 6e7bb79fa362ddc035edf19dd4df4a9896ed9d31..feede78b06eaa0d973ceca6a2a684eed5b4bf270 100644 (file)
@@ -1,4 +1,4 @@
-<form method="post" action="<%= ApplicationController.root_context -%>/server_id_configuration/generate">
+<form method="post" action="/server_id_configuration/generate">
   <table class="marginbottom10">
     <thead>
     <tr>
index adeb267fbf45881f18dfff288c0fb706943b3097..556822c9e877bc4c60a88f6d77508ce6dc440fdd 100644 (file)
     <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>
 
index 9ef0f8ba55df0cd8e553b108cce84778d9fc716e..7d87eabaa49f3d839e980015e8d79dc79be5077b 100644 (file)
@@ -85,7 +85,7 @@
       <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 %>
 
index a06263ce4456e773df56820267137e0e69cfe928..2d20d38d06fd9e41690b52b311b1fb9ed185c06f 100644 (file)
@@ -2,6 +2,6 @@
   <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 %>
 
index 1cb1986738883d44fdea7a1f594cc5e013dbe30f..cd47108111d84a6414893f00c13ef80160676406 100644 (file)
@@ -1,4 +1,4 @@
 <% 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 %>
 
index 21e4db24e3a326469179c35582179828c8bc6325..d98e537dcfb9ff02b0d3f1aada3eda9d6dd8c0b4 100644 (file)
@@ -2,6 +2,6 @@
   <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 %>
 
index 17fc622e6007aecf058cac45f5aec0bad9ac1c55..8e36411a411dc11907c55864bea8fb1c432b4993 100644 (file)
@@ -1,4 +1,4 @@
-<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>
index 56d012090af0b4e15f371a394974f35cfcaf126c..12257ae3f4d87ee85cd1e037b076d0ac9b8ac036 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index f5600f6ca038e77994fb461fbf7bee312c01f00a..a805ff002fd04d93bc6d8b5d74ec2b2fa026bfb1 100644 (file)
@@ -1,3 +1,3 @@
 <% 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 %>
index 3d718d0a954509628a00ba629646ed2daf763f17..d2ca0b0b9c3afd8f22a35f24902b6140f9958a13 100644 (file)
@@ -1,6 +1,6 @@
 <% 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 -%>">
@@ -41,4 +41,4 @@
 
     <div style="clear: both;"></div>
   </div>
-</div>
\ No newline at end of file
+</div>
index ae9b419daf322b7ebdb775967dda39913b57fca1..b0093dda0f94d09dc74d4f8df1d2a85404e9b2be 100644 (file)
 # 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
 
index b747438a9f578e278aafa952cdd1bc8652e7151c..3136f4a311216e491ab48f3b42ba1994356a0752 100644 (file)
@@ -80,7 +80,7 @@ public class DefaultServer extends Server {
 
   @Override
   public String getContextPath() {
-    return null;
+    return "";
   }
 
   @Override
index 4fa6a3a5d1adc21565319b0ed86942b2dfe6ebee..c68cbd2370bda19a3322db16ca9e7097be9ea518 100644 (file)
@@ -43,6 +43,10 @@ public abstract class Server {
   @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();
 
   /**