package ca.corefacility.bioinformatics.irida.web.controller.thymeleaf;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * The Thymeleaf portion of the web project is powered by an AngularJS single-page application. This controller is
 * responsible for only responding with a Thymeleaf index page, then the AngularJS application takes over and queries
 * the server for resources using the REST api.
 */
@Controller
@RequestMapping("/**")
public class RootController {
    @RequestMapping
    public String getRoot() {
        return "index";
    }
}

@@ -65,16 +65,73 @@
 eleaf;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 import o
@@ -168,24 +168,24 @@
 Controller;%0A
-
 import org.s
@@ -234,16 +234,69 @@
 Mapping;
+%0Aimport org.springframework.web.servlet.ModelAndView;
 %0A%0A/**%0A *
@@ -594,31 +594,8 @@
 ler%0A
-@RequestMapping(%22/**%22)%0A
 publ
@@ -628,53 +628,441 @@
     
-@RequestMapping%0A    public String getRoot() %7B
+private static final Logger logger = LoggerFactory.getLogger(RootController.class);%0A%0A    /**%0A     * Get the index for any request that does not contain the string %22css%22, %22js%22,%0A     * or %22font%22 for thymeleaf to render.%0A     * @return the name of the index page%0A     */%0A    @RequestMapping(value = %7B%22%7Bpath:(?!css%7Cjs%7Cfont).*$%7D%22, %22%7Bpath:(?!css%7Cjs%7Cfont).*$%7D/**%22, %22/%22%7D)%0A    public String getRoot() %7B%0A        logger.debug(%22Loading index.%22);
 %0A   

Load the index page for *all* requests (except those that should be handled as resources by spring).