From c7875e7f78ba81768b30571ac65712a4647c8183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Wed, 5 Jun 2019 11:52:36 +0200 Subject: [PATCH] Style pages --- .../scm/update/MigrationWizardModule.java | 4 + .../scm/update/MigrationWizardServlet.java | 4 +- .../repository-migration-restart.mustache | 24 ++++- .../templates/repository-migration.mustache | 91 ++++++++++++------- 4 files changed, 88 insertions(+), 35 deletions(-) diff --git a/scm-webapp/src/main/java/sonia/scm/update/MigrationWizardModule.java b/scm-webapp/src/main/java/sonia/scm/update/MigrationWizardModule.java index f067fa799b..55b1644bb8 100644 --- a/scm-webapp/src/main/java/sonia/scm/update/MigrationWizardModule.java +++ b/scm-webapp/src/main/java/sonia/scm/update/MigrationWizardModule.java @@ -3,6 +3,8 @@ package sonia.scm.update; import com.google.inject.servlet.ServletModule; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import sonia.scm.PushStateDispatcher; +import sonia.scm.WebResourceServlet; class MigrationWizardModule extends ServletModule { @@ -15,6 +17,8 @@ class MigrationWizardModule extends ServletModule { LOG.info("= STARTING MIGRATION SERVLET ="); LOG.info("= ="); LOG.info("=========================================================="); + bind(PushStateDispatcher.class).toInstance((request, response, uri) -> {}); + serve("/images/*", "/styles/*").with(WebResourceServlet.class); serve("/*").with(MigrationWizardServlet.class); } } diff --git a/scm-webapp/src/main/java/sonia/scm/update/MigrationWizardServlet.java b/scm-webapp/src/main/java/sonia/scm/update/MigrationWizardServlet.java index d65a8408a0..7eb11cff8a 100644 --- a/scm-webapp/src/main/java/sonia/scm/update/MigrationWizardServlet.java +++ b/scm-webapp/src/main/java/sonia/scm/update/MigrationWizardServlet.java @@ -15,6 +15,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -45,6 +46,7 @@ class MigrationWizardServlet extends HttpServlet { HashMap model = new HashMap<>(); + model.put("contextPath", req.getContextPath()); model.put("submitUrl", req.getRequestURI()); model.put("repositories", missingMigrationStrategies); model.put("strategies", getMigrationStrategies()); @@ -68,7 +70,7 @@ class MigrationWizardServlet extends HttpServlet { MustacheFactory mf = new DefaultMustacheFactory(); Mustache mustache = mf.compile("templates/repository-migration-restart.mustache"); - mustache.execute(resp.getWriter(), new Object()).flush(); + mustache.execute(resp.getWriter(), Collections.singletonMap("contextPath", req.getContextPath())).flush(); ScmEventBus.getInstance().post(new RestartEvent(MigrationWizardServlet.class, "wrote migration data")); } diff --git a/scm-webapp/src/main/resources/templates/repository-migration-restart.mustache b/scm-webapp/src/main/resources/templates/repository-migration-restart.mustache index e47945174a..2374861fe2 100644 --- a/scm-webapp/src/main/resources/templates/repository-migration-restart.mustache +++ b/scm-webapp/src/main/resources/templates/repository-migration-restart.mustache @@ -2,9 +2,31 @@ SCM-Manager Restart + -SCM-Manager will restart to migrate the data. +
+
+
+
+
+
+
+
SCM-Manager
+
+
+
+
+
+
+
+

SCM-Manager will restart to migrate the data.

+
+
+
+
+
+
diff --git a/scm-webapp/src/main/resources/templates/repository-migration.mustache b/scm-webapp/src/main/resources/templates/repository-migration.mustache index 07447bedbc..bfc421cd35 100644 --- a/scm-webapp/src/main/resources/templates/repository-migration.mustache +++ b/scm-webapp/src/main/resources/templates/repository-migration.mustache @@ -2,41 +2,66 @@ SCM-Manager Migration + -

SCM-Manager Migration

-You have migrated from SCM-Manager v1 to SCM-Manager v2. -
- - - - - - - - {{#repositories}} - - - - - - - {{/repositories}} -
original nametypenew namespace/nameStrategy
- {{name}} - - {{type}} - - {{newNamespace}}/{{newName}} - - -
- -
+
+
+
+
+
+
+
+
SCM-Manager
+
+
+
+
+
+
+
+

SCM-Manager Migration

+

You have migrated from SCM-Manager v1 to SCM-Manager v2.

+
+ + + + + + + + {{#repositories}} + + + + + + + {{/repositories}} +
Original nameTypeNew namespace and nameStrategy
+ {{name}} + + {{type}} + + {{newNamespace}}/{{newName}} + +
+
+ +
+
+
+ +
+
+
+
+
+