Browse Source

Remove modal msg dialog, added alert

Vova Tkach 6 years ago
parent
commit
230face60e

+ 0 - 3
engine/wrapper/resources/templates/block.modal.sysmsg.go

@@ -1,3 +0,0 @@
-package templates
-
-var BlockModalSysMsg = []byte(`<div class="modal fade" id="sys-modal-msg" tabindex="-1" role="dialog" aria-labelledby="sysModalMsgLabel" aria-hidden="true"><div class="modal-dialog modal-dialog-centered" role="document"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="sysModalMsgLabel"></h5><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button></div><div class="modal-body text-left" id="sysModalMsgBody"></div><div class="modal-footer" id="sysModalMsgButtons"><button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button></div></div></div></div>`)

+ 0 - 16
engine/wrapper/resources/templates/block.modal.sysmsg.html

@@ -1,16 +0,0 @@
-<div class="modal fade" id="sys-modal-msg" tabindex="-1" role="dialog" aria-labelledby="sysModalMsgLabel" aria-hidden="true">
-	<div class="modal-dialog modal-dialog-centered" role="document">
-		<div class="modal-content">
-			<div class="modal-header">
-				<h5 class="modal-title" id="sysModalMsgLabel"></h5>
-				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
-					<span aria-hidden="true">&times;</span>
-				</button>
-			</div>
-			<div class="modal-body text-left" id="sysModalMsgBody"></div>
-			<div class="modal-footer" id="sysModalMsgButtons">
-				<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
-			</div>
-		</div>
-	</div>
-</div>

File diff suppressed because it is too large
+ 0 - 0
engine/wrapper/resources/templates/cp.base.go


+ 0 - 1
engine/wrapper/resources/templates/cp.base.html

@@ -49,7 +49,6 @@
 				</div>
 			</div>
 		</div>
-		{{$.System.BlockModalSysMsg}}
 		<nav class="navbar main navbar-expand-md navbar-dark fixed-top bg-dark">
 			<a class="navbar-brand" href="/">{{$.Data.Title}}</a>
 			<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">

+ 1 - 1
engine/wrapper/resources/templates/cp.firstuser.go

@@ -1,3 +1,3 @@
 package templates
 
-var CpFirstUser = []byte(`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="theme-color" content="#205081" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Creating first user</title><link rel="stylesheet" href="{{$.System.PathCssBootstrap}}"><link rel="stylesheet" href="{{$.System.PathCssCpStyles}}"><link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" /><style type="text/css">html{height:100%;}</style></head><body class="cp-first-user text-center">{{$.System.BlockModalSysMsg}}<form class="form-signin card" action="/cp/" method="post"><input type="hidden" name="action" value="first_user"><h1 class="h3 mb-3 font-weight-normal">Creating first user</h1><label for="first_name" class="sr-only">User first name</label><input type="text" id="first_name" name="first_name" class="form-control mb-3" placeholder="User first name"><label for="last_name" class="sr-only">User last name</label><input type="text" id="last_name" name="last_name" class="form-control mb-3" placeholder="User last name"><label for="email" class="sr-only">User email</label><input type="email" id="email" name="email" class="form-control mb-3" placeholder="User email" required><label for="password" class="sr-only">User password</label><input type="password" id="password" name="password" class="form-control mb-3" placeholder="User password" required><button class="btn btn-lg btn-primary btn-block" type="submit">Create</button></form><script src="{{$.System.PathJsJquery}}"></script><script src="{{$.System.PathJsPopper}}"></script><script src="{{$.System.PathJsBootstrap}}"></script><script src="{{$.System.PathJsCpScripts}}"></script></body></html>`)
+var CpFirstUser = []byte(`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="theme-color" content="#205081" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Creating first user</title><link rel="stylesheet" href="{{$.System.PathCssBootstrap}}"><link rel="stylesheet" href="{{$.System.PathCssCpStyles}}"><link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" /><style type="text/css">html{height:100%;}</style></head><body class="cp-first-user text-center"><form class="form-signin card" action="/cp/" method="post"><input type="hidden" name="action" value="first_user"><h1 class="h3 mb-3 font-weight-normal">Creating first user</h1><label for="first_name" class="sr-only">User first name</label><input type="text" id="first_name" name="first_name" class="form-control mb-3" placeholder="User first name"><label for="last_name" class="sr-only">User last name</label><input type="text" id="last_name" name="last_name" class="form-control mb-3" placeholder="User last name"><label for="email" class="sr-only">User email</label><input type="email" id="email" name="email" class="form-control mb-3" placeholder="User email" required><label for="password" class="sr-only">User password</label><input type="password" id="password" name="password" class="form-control mb-3" placeholder="User password" required><div class="sys-messages"></div><button class="btn btn-lg btn-primary btn-block" type="submit">Create</button></form><script src="{{$.System.PathJsJquery}}"></script><script src="{{$.System.PathJsPopper}}"></script><script src="{{$.System.PathJsBootstrap}}"></script><script src="{{$.System.PathJsCpScripts}}"></script></body></html>`)

+ 1 - 1
engine/wrapper/resources/templates/cp.firstuser.html

@@ -11,7 +11,6 @@
 		<style type="text/css">html{height:100%;}</style>
 	</head>
 	<body class="cp-first-user text-center">
-		{{$.System.BlockModalSysMsg}}
 		<form class="form-signin card" action="/cp/" method="post">
 			<input type="hidden" name="action" value="first_user">
 			<h1 class="h3 mb-3 font-weight-normal">Creating first user</h1>
@@ -23,6 +22,7 @@
 			<input type="email" id="email" name="email" class="form-control mb-3" placeholder="User email" required>
 			<label for="password" class="sr-only">User password</label>
 			<input type="password" id="password" name="password" class="form-control mb-3" placeholder="User password" required>
+			<div class="sys-messages"></div>
 			<button class="btn btn-lg btn-primary btn-block" type="submit">Create</button>
 		</form>
 		<script src="{{$.System.PathJsJquery}}"></script>

+ 1 - 1
engine/wrapper/resources/templates/cp.login.go

@@ -1,3 +1,3 @@
 package templates
 
-var CpLogin = []byte(`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="theme-color" content="#205081" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Please login</title><link rel="stylesheet" href="{{$.System.PathCssBootstrap}}"><link rel="stylesheet" href="{{$.System.PathCssCpStyles}}"><link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" /><style type="text/css">html{height:100%;}</style></head><body class="cp-login text-center">{{$.System.BlockModalSysMsg}}<form class="form-signin card" action="/cp/" method="post"><input type="hidden" name="action" value="signin"><h1 class="h3 mb-3 font-weight-normal">Please login</h1><label for="email" class="sr-only">User email</label><input type="email" id="email" name="email" class="form-control" placeholder="User email" required autofocus><label for="password" class="sr-only">User password</label><input type="password" id="password" name="password" class="form-control mb-3" placeholder="User password" required><button class="btn btn-lg btn-primary btn-block" type="submit">Login</button></form><script src="{{$.System.PathJsJquery}}"></script><script src="{{$.System.PathJsPopper}}"></script><script src="{{$.System.PathJsBootstrap}}"></script><script src="{{$.System.PathJsCpScripts}}"></script></body></html>`)
+var CpLogin = []byte(`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="theme-color" content="#205081" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Please login</title><link rel="stylesheet" href="{{$.System.PathCssBootstrap}}"><link rel="stylesheet" href="{{$.System.PathCssCpStyles}}"><link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" /><style type="text/css">html{height:100%;}</style></head><body class="cp-login text-center"><form class="form-signin card" action="/cp/" method="post"><input type="hidden" name="action" value="signin"><h1 class="h3 mb-3 font-weight-normal">Please login</h1><label for="email" class="sr-only">User email</label><input type="email" id="email" name="email" class="form-control" placeholder="User email" required autofocus><label for="password" class="sr-only">User password</label><input type="password" id="password" name="password" class="form-control mb-3" placeholder="User password" required><div class="sys-messages"></div><button class="btn btn-lg btn-primary btn-block" type="submit">Login</button></form><script src="{{$.System.PathJsJquery}}"></script><script src="{{$.System.PathJsPopper}}"></script><script src="{{$.System.PathJsBootstrap}}"></script><script src="{{$.System.PathJsCpScripts}}"></script></body></html>`)

+ 1 - 1
engine/wrapper/resources/templates/cp.login.html

@@ -11,7 +11,6 @@
 		<style type="text/css">html{height:100%;}</style>
 	</head>
 	<body class="cp-login text-center">
-		{{$.System.BlockModalSysMsg}}
 		<form class="form-signin card" action="/cp/" method="post">
 			<input type="hidden" name="action" value="signin">
 			<h1 class="h3 mb-3 font-weight-normal">Please login</h1>
@@ -19,6 +18,7 @@
 			<input type="email" id="email" name="email" class="form-control" placeholder="User email" required autofocus>
 			<label for="password" class="sr-only">User password</label>
 			<input type="password" id="password" name="password" class="form-control mb-3" placeholder="User password" required>
+			<div class="sys-messages"></div>
 			<button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>
 		</form>
 		<script src="{{$.System.PathJsJquery}}"></script>

+ 1 - 1
engine/wrapper/resources/templates/cp.mysql.go

@@ -1,3 +1,3 @@
 package templates
 
-var CpMySQL = []byte(`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="theme-color" content="#205081" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Configure MySQL</title><link rel="stylesheet" href="{{$.System.PathCssBootstrap}}"><link rel="stylesheet" href="{{$.System.PathCssCpStyles}}"><link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" /><style type="text/css">html{height:100%;}</style></head><body class="cp-mysql text-center">{{$.System.BlockModalSysMsg}}<form class="form-signin card" action="/cp/" method="post"><input type="hidden" name="action" value="mysql"><h1 class="h3 mb-3 font-weight-normal">Configure MySQL</h1><label for="host" class="sr-only">Database host</label><input type="text" id="host" name="host" class="form-control mb-3" placeholder="Database host" value="localhost" required><label for="port" class="sr-only">Database host port</label><input type="text" id="port" name="port" class="form-control mb-3" placeholder="Database host port" value="3306" required><label for="name" class="sr-only">Database name</label><input type="text" id="name" name="name" class="form-control mb-3" placeholder="Database name" required autofocus><label for="user" class="sr-only">Database user name</label><input type="text" id="user" name="user" class="form-control mb-3" placeholder="Database user name" required><label for="password" class="sr-only">Database user password</label><input type="password" id="password" name="password" class="form-control mb-3" placeholder="Database user password"><button class="btn btn-lg btn-primary btn-block" type="submit">Configure</button></form><script src="{{$.System.PathJsJquery}}"></script><script src="{{$.System.PathJsPopper}}"></script><script src="{{$.System.PathJsBootstrap}}"></script><script src="{{$.System.PathJsCpScripts}}"></script></body></html>`)
+var CpMySQL = []byte(`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="theme-color" content="#205081" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Configure MySQL</title><link rel="stylesheet" href="{{$.System.PathCssBootstrap}}"><link rel="stylesheet" href="{{$.System.PathCssCpStyles}}"><link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" /><style type="text/css">html{height:100%;}</style></head><body class="cp-mysql text-center"><form class="form-signin card" action="/cp/" method="post"><input type="hidden" name="action" value="mysql"><h1 class="h3 mb-3 font-weight-normal">Configure MySQL</h1><label for="host" class="sr-only">Database host</label><input type="text" id="host" name="host" class="form-control mb-3" placeholder="Database host" value="localhost" required><label for="port" class="sr-only">Database host port</label><input type="text" id="port" name="port" class="form-control mb-3" placeholder="Database host port" value="3306" required><label for="name" class="sr-only">Database name</label><input type="text" id="name" name="name" class="form-control mb-3" placeholder="Database name" required autofocus><label for="user" class="sr-only">Database user name</label><input type="text" id="user" name="user" class="form-control mb-3" placeholder="Database user name" required><label for="password" class="sr-only">Database user password</label><input type="password" id="password" name="password" class="form-control mb-3" placeholder="Database user password"><div class="sys-messages"></div><button class="btn btn-lg btn-primary btn-block" type="submit">Configure</button></form><script src="{{$.System.PathJsJquery}}"></script><script src="{{$.System.PathJsPopper}}"></script><script src="{{$.System.PathJsBootstrap}}"></script><script src="{{$.System.PathJsCpScripts}}"></script></body></html>`)

+ 1 - 1
engine/wrapper/resources/templates/cp.mysql.html

@@ -11,7 +11,6 @@
 		<style type="text/css">html{height:100%;}</style>
 	</head>
 	<body class="cp-mysql text-center">
-		{{$.System.BlockModalSysMsg}}
 		<form class="form-signin card" action="/cp/" method="post">
 			<input type="hidden" name="action" value="mysql">
 			<h1 class="h3 mb-3 font-weight-normal">Configure MySQL</h1>
@@ -25,6 +24,7 @@
 			<input type="text" id="user" name="user" class="form-control mb-3" placeholder="Database user name" required>
 			<label for="password" class="sr-only">Database user password</label>
 			<input type="password" id="password" name="password" class="form-control mb-3" placeholder="Database user password">
+			<div class="sys-messages"></div>
 			<button class="btn btn-lg btn-primary btn-block" type="submit">Configure</button>
 		</form>
 		<script src="{{$.System.PathJsJquery}}"></script>

+ 0 - 3
engine/wrapper/wrapper.go

@@ -11,7 +11,6 @@ import (
 
 	"golang-fave/constants"
 	"golang-fave/engine/sessions"
-	templates "golang-fave/engine/wrapper/resources/templates"
 )
 
 type handleRun func(wrapper *Wrapper) bool
@@ -26,7 +25,6 @@ type tmplDataSystem struct {
 	PathJsPopper     string
 	PathJsBootstrap  string
 	PathJsCpScripts  string
-	BlockModalSysMsg template.HTML
 }
 
 type TmplDataAll struct {
@@ -164,7 +162,6 @@ func (this *Wrapper) TmplGetSystemData() tmplDataSystem {
 		PathJsPopper:     this.R.URL.Scheme + "://" + this.R.Host + "/assets/sys/popper.js?v=" + constants.AssetsVersion,
 		PathJsBootstrap:  this.R.URL.Scheme + "://" + this.R.Host + "/assets/sys/bootstrap.js?v=" + constants.AssetsVersion,
 		PathJsCpScripts:  this.R.URL.Scheme + "://" + this.R.Host + "/assets/cp/scripts.js?v=" + constants.AssetsVersion,
-		BlockModalSysMsg: template.HTML(templates.BlockModalSysMsg),
 	}
 }
 

Some files were not shown because too many files changed in this diff