landed code for creating community (untested)

This commit is contained in:
2025-10-18 22:38:27 -06:00
parent fcbff708a5
commit 021807e53e
9 changed files with 426 additions and 30 deletions
-3
View File
@@ -13,9 +13,6 @@ title: "Edit Community Profile:"
subtitle: "[CNAME]"
action: "/comm/[CID]/admin/profile"
fields:
- type: "hidden"
name: "cc"
value: ""
- type: "header"
name: "header1"
caption: "Basic Information"
+107
View File
@@ -0,0 +1,107 @@
#
# Amsterdam Web Communities System
# Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
name: "create.community"
formName: "createcommform"
menuSelector: "top"
title: "Create New Community"
action: "/create_comm"
fields:
- type: "header"
name: "header1"
caption: "Basic Information"
- type: "text"
name: "name"
caption: "Community Name"
required: true
size: 32
maxlength: 128
- type: "ams_id"
name: "alias"
caption: "Community Alias"
required: true
size: 32
maxlength: 32
- type: "text"
name: "synopsis"
caption: "Synopsis"
size: 32
maxlength: 255
- type: "text"
name: "rules"
caption: "Rules"
size: 32
maxlength: 255
- type: "localelist"
name: "language"
caption: "Primary Language"
required: true
- type: "header"
name: "header2"
caption: "Location"
- type: "text"
name: "loc"
caption: "City"
required: true
size: 32
maxlength: 64
- type: "text"
name: "reg"
caption: "State/Province"
required: true
size: 32
maxlength: 64
- type: "text"
name: "pcode"
caption: "Zip/Postal Code"
required: true
size: 32
maxlength: 64
- type: "countrylist"
name: "country"
caption: "Country"
required: true
- type: "header"
name: "header3"
caption: "Security"
- type: "dropdown"
name: "comtype"
caption: "Community type"
required: true
choices:
- id: "0"
text: "Public"
default: true
- id: "1"
text: "Private"
- type: "text"
name: "joinkey"
caption: "Join Key"
subcaption: "(for private communities)"
size: 32
maxlength: 64
- type: "dropdown"
name: "hidemode"
caption: "Community visibility"
required: true
choices:
- id: "NONE"
text: "Show in both directory and search"
default: true
- id: "DIRECTORY"
text: "Hide in directory, but not in search"
- id: "BOTH"
text: "Hide in both directory and search"
- type: "button"
name: "create"
caption: "Create"
param: "blue"
- type: "button"
name: "cancel"
caption: "Cancel"
param: "red"
+11 -11
View File
@@ -14,17 +14,17 @@
</div>
<div class="bg-blue-400 px-2 py-2 rounded-b">
<div class="space-y-2">
{{ if len(sb.Items) > 0 }}
{{ range sb.Items }}
<div class="flex items-center">
<span class="mr-2">🟣</span>
<a href="{{ .Link }}" class="text-blue-700 hover:text-blue-900 font-bold text-sm">{{ .Text }}</a>
{{ if .Flags["admin"] }}<span class="ml-1">👑</span>{{ end }}
</div>
{{ end }}
{{ else }}
<div class="text-small">You are not a member of any communities.</div>
{{ if len(sb.Items) > 0 }}
{{ range sb.Items }}
<div class="flex items-center">
<span class="mr-2">🟣</span>
<a href="{{ .Link }}" class="text-blue-700 hover:text-blue-900 font-bold text-sm">{{ .Text }}</a>
{{ if .Flags["admin"] }}<span class="ml-1">👑</span>{{ end }}
</div>
{{ end }}
{{ else }}
<div class="text-small">You are not a member of any communities.</div>
{{ end }}
</div>
{{ if sb.Flags["canManage"] || sb.Flags["canCreate"] }}
<div class="mt-3 text-center">
@@ -35,7 +35,7 @@
{{ if sb.Flags["canCreate"] }}|{{ end }}
{{ end }}
{{ if sb.Flags["canCreate"] }}
<a href="/TODO/create_comm" class="text-blue-700 hover:text-blue-900">Create New</a>
<a href="/create_comm" class="text-blue-700 hover:text-blue-900">Create New</a>
{{ end }}
]
</span>