From 8c4455c5caabe405ca57d0ec3c656dfdba826c97 Mon Sep 17 00:00:00 2001 From: Elliott Stoneham Date: Mon, 18 Jul 2016 16:41:45 +0100 Subject: [PATCH 1/2] fix offline mode --- documize/api/request/init.go | 15 ++- documize/database/templates/offline.html | 136 +++++++++++++++++++++++ 2 files changed, 145 insertions(+), 6 deletions(-) create mode 100644 documize/database/templates/offline.html diff --git a/documize/api/request/init.go b/documize/api/request/init.go index f843fe55..74b609f3 100644 --- a/documize/api/request/init.go +++ b/documize/api/request/init.go @@ -19,6 +19,7 @@ import ( "github.com/jmoiron/sqlx" "github.com/documize/community/documize/database" + "github.com/documize/community/documize/web" "github.com/documize/community/wordsmith/environment" "github.com/documize/community/wordsmith/log" "github.com/documize/community/wordsmith/utility" @@ -68,13 +69,15 @@ func init() { } // go into setup mode if required - if database.Check(Db, connectionString) { - if err := database.Migrate(true /* the config table exists */); err != nil { - log.Error("Unable to run database migration: ", err) - os.Exit(2) + if web.SiteMode != web.SiteModeOffline { + if database.Check(Db, connectionString) { + if err := database.Migrate(true /* the config table exists */); err != nil { + log.Error("Unable to run database migration: ", err) + os.Exit(2) + } + } else { + log.Info("database.Check(Db) !OK, going into setup mode") } - } else { - log.Info("database.Check(Db) !OK, going into setup mode") } return false // value not changed diff --git a/documize/database/templates/offline.html b/documize/database/templates/offline.html new file mode 100644 index 00000000..1206b958 --- /dev/null +++ b/documize/database/templates/offline.html @@ -0,0 +1,136 @@ + + + + + + + + + Documize - Essential Maintenance + + + + + + + +
+
+ + + +
+
+ Down For Maintenance +
+
+

Essential Maintenance

+

We're currently updating Documize, back real soon.

+
+
+ +
+
+ + + From dc5a90ee10f85a2591e5e57824bae6c27297d1bc Mon Sep 17 00:00:00 2001 From: Elliott Stoneham Date: Mon, 18 Jul 2016 18:09:10 +0100 Subject: [PATCH 2/2] fix page icon for off-line page --- documize/database/templates/offline.html | 152 +++++++++++------------ 1 file changed, 71 insertions(+), 81 deletions(-) diff --git a/documize/database/templates/offline.html b/documize/database/templates/offline.html index 1206b958..942a3e20 100644 --- a/documize/database/templates/offline.html +++ b/documize/database/templates/offline.html @@ -1,136 +1,126 @@ - - - - - - - Documize - Essential Maintenance + + + + + + + Documize - Essential Maintenance - - + -
-
+ + +
+
-
-
- Down For Maintenance -
-
-

Essential Maintenance

+
+
+ Down For Maintenance +
+
+

Essential Maintenance

We're currently updating Documize, back real soon.

-
-
+
+
-
+
- - + + + \ No newline at end of file