diff --git a/assets/css/base.css b/assets/css/base.css index 30d263d..826c2aa 100644 --- a/assets/css/base.css +++ b/assets/css/base.css @@ -19,7 +19,8 @@ body { } input, -button { +button, +textarea { font-size: inherit; font-family: inherit; padding: 8px 10px; @@ -35,11 +36,17 @@ button { cursor: pointer; } +textarea { + resize: vertical; +} + input:focus, input:hover, button:active, button:hover, -button:focus { +button:focus, +textarea:focus, +textarea:hover { border-color: #812abd; } diff --git a/assets/css/import.css b/assets/css/import.css new file mode 100644 index 0000000..d635e23 --- /dev/null +++ b/assets/css/import.css @@ -0,0 +1,31 @@ +body { + padding: 2em 1em; +} + +@media screen and (min-width: 800px) { + body { + padding: 2em 10em; + } +} + +p { + max-width: 400px; + margin-top: 2em; +} + +form { + width: 100%; + max-width: 400px; + margin-top: 2em; +} + +form textarea { + width: 100%; + margin-top: 10px; + margin-bottom: 10px; + min-height: 100px; +} + +form button { + width: 100%; +} diff --git a/assets/css/settings.css b/assets/css/settings.css index 9020098..3c833d4 100644 --- a/assets/css/settings.css +++ b/assets/css/settings.css @@ -2,6 +2,21 @@ body { padding: 2em 1em; } +.actions { + display: flex; + gap: 2em; +} + +.actions a { + display: flex; + align-items: center; + gap: 8px; +} + +.actions a img { + filter: invert(100%); +} + .row { display: flex; gap: 10px; diff --git a/database/groups.go b/database/groups.go index 3f744ea..ccb2e2e 100644 --- a/database/groups.go +++ b/database/groups.go @@ -1,9 +1,9 @@ package database type Group struct { - ID int - Name string - Links []Link + ID int `json:"id"` + Name string `json:"name"` + Links []Link `json:"links"` } func GetGroupsWithLinks() ([]Group, error) { diff --git a/database/links.go b/database/links.go index aed805c..5b898dd 100644 --- a/database/links.go +++ b/database/links.go @@ -1,11 +1,11 @@ package database type Link struct { - ID int - Name string - Href string - GroupID int - Icon *string + ID int `json:"id"` + Name string `json:"name"` + Href string `json:"href"` + GroupID int `json:"-"` + Icon *string `json:"icon,omitempty"` } func GetLinksFromGroup(groupID int) ([]Link, error) { diff --git a/templates/import.html.tmpl b/templates/import.html.tmpl new file mode 100644 index 0000000..8d0eadd --- /dev/null +++ b/templates/import.html.tmpl @@ -0,0 +1,27 @@ + + +
+ {{template "head" .}} + + + ++ Importing does not erase existing links, but may create duplicates. +
+ + + + diff --git a/templates/settings.html.tmpl b/templates/settings.html.tmpl index b096583..4fcedf9 100644 --- a/templates/settings.html.tmpl +++ b/templates/settings.html.tmpl @@ -6,7 +6,18 @@