display the new-message bells in the community conference list
This commit is contained in:
@@ -46,6 +46,17 @@ func Conferences(ctxt ui.AmContext) (string, any, error) {
|
|||||||
return ui.ErrorPage(ctxt, err)
|
return ui.ErrorPage(ctxt, err)
|
||||||
}
|
}
|
||||||
ctxt.VarMap().Set("conferences", clist)
|
ctxt.VarMap().Set("conferences", clist)
|
||||||
|
if len(clist) > 0 {
|
||||||
|
newflag := make([]bool, len(clist))
|
||||||
|
for i, conf := range clist {
|
||||||
|
msgCount, err := conf.UnreadMessages(ctxt.Ctx(), ctxt.CurrentUser())
|
||||||
|
if err != nil {
|
||||||
|
return ui.ErrorPage(ctxt, err)
|
||||||
|
}
|
||||||
|
newflag[i] = msgCount > 0
|
||||||
|
}
|
||||||
|
ctxt.VarMap().Set("newflag", newflag)
|
||||||
|
}
|
||||||
ctxt.VarMap().Set("canCreate", comm.TestPermission("Community.Create", ctxt.EffectiveLevel()))
|
ctxt.VarMap().Set("canCreate", comm.TestPermission("Community.Create", ctxt.EffectiveLevel()))
|
||||||
ctxt.VarMap().Set("canManage", comm.TestPermission("Community.Create", ctxt.EffectiveLevel()))
|
ctxt.VarMap().Set("canManage", comm.TestPermission("Community.Create", ctxt.EffectiveLevel()))
|
||||||
return "framed_template", "conflist.jet", err
|
return "framed_template", "conflist.jet", err
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ _(italicized items can be deferred)_
|
|||||||
- ~~Find~~
|
- ~~Find~~
|
||||||
- Manage (reorder/show/hide/delete)
|
- Manage (reorder/show/hide/delete)
|
||||||
- ~~Create New~~
|
- ~~Create New~~
|
||||||
- Conferences List honor "hide in list" flag
|
- ~~Conferences List honor "hide in list" flag~~
|
||||||
- Community Admin Menu:
|
- Community Admin Menu:
|
||||||
- Set Community Category
|
- Set Community Category
|
||||||
- Set Community Services
|
- Set Community Services
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{*
|
{*
|
||||||
* Amsterdam Web Communities System
|
* Amsterdam Web Communities System
|
||||||
* Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved
|
* Copyright (c) 2025-2026 Erbosoft Metaverse Design Solutions, All Rights Reserved
|
||||||
*
|
*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* 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
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<div class="max-w-4xl">
|
<div class="max-w-4xl">
|
||||||
<div class="bg-gray-50 p-6 rounded-lg mb-6">
|
<div class="bg-gray-50 p-6 rounded-lg mb-6">
|
||||||
<div class="space-y-6">
|
<div class="space-y-6">
|
||||||
{{ range _, c := conferences }}
|
{{ range i, c := conferences }}
|
||||||
<div class="flex items-start gap-3">
|
<div class="flex items-start gap-3">
|
||||||
<span class="text-lg pt-0.5 flex-shrink-0">🟣</span>
|
<span class="text-lg pt-0.5 flex-shrink-0">🟣</span>
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
@@ -26,6 +26,9 @@
|
|||||||
<a href="/comm/{{ commAlias }}/conf/{{ c.AliasesQ(.Ctx())[0] }}"
|
<a href="/comm/{{ commAlias }}/conf/{{ c.AliasesQ(.Ctx())[0] }}"
|
||||||
class="text-blue-700 hover:text-blue-900 font-bold text-lg">{{ c.Name }}</a>
|
class="text-blue-700 hover:text-blue-900 font-bold text-lg">{{ c.Name }}</a>
|
||||||
<span class="text-gray-600 text-sm ml-2">- Latest activity: {{ DisplayActivity(c.LastUpdate, .) }}</span>
|
<span class="text-gray-600 text-sm ml-2">- Latest activity: {{ DisplayActivity(c.LastUpdate, .) }}</span>
|
||||||
|
{{ if newflag[i] }}
|
||||||
|
<span class="ml-2" title="There are new messages in this conference">🔔</span>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm text-gray-700 mb-1">
|
<div class="text-sm text-gray-700 mb-1">
|
||||||
{{ hl := c.HostsQ(.Ctx()) }}
|
{{ hl := c.HostsQ(.Ctx()) }}
|
||||||
@@ -35,8 +38,8 @@
|
|||||||
<span class="font-medium">Hosts:</span>
|
<span class="font-medium">Hosts:</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if len(hl) > 0 }}
|
{{ if len(hl) > 0 }}
|
||||||
{{ range i, u := hl }}
|
{{ range j, u := hl }}
|
||||||
{{ if i > 0 }}, {{ end }}
|
{{ if j > 0 }}, {{ end }}
|
||||||
<a href="/users/{{ u.Username }}" class="text-blue-700 hover:text-blue-900">{{ u.Username }}</a>
|
<a href="/users/{{ u.Username }}" class="text-blue-700 hover:text-blue-900">{{ u.Username }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
|||||||
Reference in New Issue
Block a user