mirror of
https://shylinux.com/x/icebergs
synced 2025-04-28 18:22:02 +08:00
add some
This commit is contained in:
parent
01329fe476
commit
82423b9112
@ -5,12 +5,14 @@ import (
|
|||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
"shylinux.com/x/icebergs/base/web/html"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
INVITE = "invite"
|
INVITER = "inviter"
|
||||||
ACCEPT = "accept"
|
INVITE = "invite"
|
||||||
|
ACCEPT = "accept"
|
||||||
)
|
)
|
||||||
const APPLY = "apply"
|
const APPLY = "apply"
|
||||||
const OFFER = "offer"
|
const OFFER = "offer"
|
||||||
@ -21,9 +23,11 @@ func init() {
|
|||||||
CONTENT_HTML = "content.html"
|
CONTENT_HTML = "content.html"
|
||||||
)
|
)
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
OFFER: {Help: "邀请", Role: VOID, Actions: ice.MergeActions(ice.Actions{
|
OFFER: {Help: "邀请", Role: VOID, Meta: kit.Dict(
|
||||||
|
ice.CTX_TRANS, kit.Dict(html.INPUT, kit.Dict("inviter", "邀请人")),
|
||||||
|
), Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.CREATE: {Name: "create email*='shy@shylinux.com' subject content", Help: "邀请", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create email*='shy@shylinux.com' subject content", Help: "邀请", Hand: func(m *ice.Message, arg ...string) {
|
||||||
h := mdb.HashCreate(m.Spawn(), m.OptionSimple(EMAIL, SUBJECT, CONTENT), INVITE, m.Option(ice.MSG_USERNAME), mdb.STATUS, INVITE)
|
h := mdb.HashCreate(m.Spawn(), m.OptionSimple(EMAIL, SUBJECT, CONTENT), INVITER, m.Option(ice.MSG_USERNAME), mdb.STATUS, INVITE)
|
||||||
SendEmail(m.Options("link", m.Cmdx("host", "publish", m.MergePodCmd("", "", mdb.HASH, h))), "", "", "")
|
SendEmail(m.Options("link", m.Cmdx("host", "publish", m.MergePodCmd("", "", mdb.HASH, h))), "", "", "")
|
||||||
}},
|
}},
|
||||||
ACCEPT: {Help: "接受", Role: VOID, Hand: func(m *ice.Message, arg ...string) {
|
ACCEPT: {Help: "接受", Role: VOID, Hand: func(m *ice.Message, arg ...string) {
|
||||||
@ -37,7 +41,7 @@ func init() {
|
|||||||
mdb.HashModify(m, m.OptionSimple(mdb.HASH), mdb.STATUS, ACCEPT)
|
mdb.HashModify(m, m.OptionSimple(mdb.HASH), mdb.STATUS, ACCEPT)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, mdb.ImportantHashAction(EMAIL, ADMIN, mdb.SHORT, mdb.UNIQ, mdb.FIELD, "time,hash,status,invite,email,title,content")), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.ImportantHashAction(EMAIL, ADMIN, mdb.SHORT, mdb.UNIQ, mdb.FIELD, "time,hash,status,inviter,email,title,content")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if !m.Warn(len(arg) == 0 && m.Option(ice.MSG_USERROLE) == VOID, ice.ErrNotRight) {
|
if !m.Warn(len(arg) == 0 && m.Option(ice.MSG_USERROLE) == VOID, ice.ErrNotRight) {
|
||||||
kit.If(mdb.HashSelect(m, arg...).FieldsIsDetail(), func() {
|
kit.If(mdb.HashSelect(m, arg...).FieldsIsDetail(), func() {
|
||||||
m.Option(ice.MSG_USERHOST, strings.Split(m.Option(ice.MSG_USERHOST), "://")[1])
|
m.Option(ice.MSG_USERHOST, strings.Split(m.Option(ice.MSG_USERHOST), "://")[1])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user