summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/doc.go6
-rw-r--r--system/admin/admin.go9
-rw-r--r--system/db/config.go11
3 files changed, 11 insertions, 15 deletions
diff --git a/content/doc.go b/content/doc.go
new file mode 100644
index 0000000..3e15b11
--- /dev/null
+++ b/content/doc.go
@@ -0,0 +1,6 @@
+// Package content contains all user-supplied content which the system is to
+// manage. Generate content types by using the Ponzu command line tool 'ponzu'
+// by running `$ ponzu generate <contentName> <fieldName:type...>`
+// Note: doc.go file is required to build the Ponzu command since main.go
+// imports content package to a blank identifier.
+package content
diff --git a/system/admin/admin.go b/system/admin/admin.go
index 0e17924..768a740 100644
--- a/system/admin/admin.go
+++ b/system/admin/admin.go
@@ -147,7 +147,6 @@ var initAdminHTML = `
<input placeholder="Enter a strong password" class="validate required" type="password" id="password" name="password"/>
<label for="password" class="active">Password</label>
</div>
- <input type="hidden" name="http_port" value="{{.HTTPPort}}"/>
<button class="btn waves-effect waves-light right">Start</button>
</form>
</div>
@@ -180,14 +179,8 @@ func Init() ([]byte, error) {
name = []byte("")
}
- port, err := db.Config("http_port")
- if err != nil {
- return nil, err
- }
-
a := admin{
- Logo: string(name),
- HTTPPort: string(port),
+ Logo: string(name),
}
buf := &bytes.Buffer{}
diff --git a/system/db/config.go b/system/db/config.go
index 91813dc..6e86f3d 100644
--- a/system/db/config.go
+++ b/system/db/config.go
@@ -135,8 +135,6 @@ func PutConfig(key string, value interface{}) error {
return err
}
- fmt.Println(kv)
-
data := make(url.Values)
for k, v := range kv {
switch v.(type) {
@@ -146,11 +144,7 @@ func PutConfig(key string, value interface{}) error {
case []string:
vv := v.([]string)
for i := range vv {
- if i == 0 {
- data.Set(k, vv[i])
- } else {
- data.Add(k, vv[i])
- }
+ data.Add(k, vv[i])
}
default:
@@ -159,6 +153,9 @@ func PutConfig(key string, value interface{}) error {
}
}
+ fmt.Println("data should match 2 lines below:")
+ fmt.Println("PutConfig:", data)
+
err = SetConfig(data)
if err != nil {
return err