mirror of
https://github.com/kovetskiy/mark.git
synced 2026-04-23 23:52:34 +00:00
Add user profile macro
This commit is contained in:
@@ -136,7 +136,11 @@ func templates(api *confluence.API) (*template.Template, error) {
|
||||
`ac:link:user`: text(
|
||||
`{{ with .Name | user }}`,
|
||||
/**/ `<ac:link>`,
|
||||
/**/ `<ri:user ri:account-id="{{ .AccountID }}"/>`,
|
||||
/**/ `{{ with .AccountID }}`,
|
||||
/****/ `<ri:user ri:account-id="{{ .AccountID }}" />`,
|
||||
/**/ `{{ else }}`,
|
||||
/****/ `<ri:user ri:userkey="{{ .UserKey }}" />`,
|
||||
/**/ `{{ end }}`,
|
||||
/**/ `</ac:link>`,
|
||||
`{{ else }}`,
|
||||
/**/ `{{ .Name }}`,
|
||||
@@ -319,6 +323,22 @@ func templates(api *confluence.API) (*template.Template, error) {
|
||||
`</ac:structured-macro>`,
|
||||
),
|
||||
|
||||
/* https://confluence.atlassian.com/conf59/user-profile-macro-792499223.html */
|
||||
|
||||
`ac:profile`: text(
|
||||
`{{ with .Name | user }}`,
|
||||
`<ac:structured-macro ac:name="profile">{{printf "\n"}}`,
|
||||
`<ac:parameter ac:name="user">{{printf "\n"}}`,
|
||||
`{{ with .AccountID }}`,
|
||||
/**/ `<ri:user ri:account-id="{{ .AccountID }}" />{{printf "\n"}}`,
|
||||
`{{ else }}`,
|
||||
/**/ `<ri:user ri:userkey="{{ .UserKey }}" />`,
|
||||
`{{ end }}`,
|
||||
`</ac:parameter>{{printf "\n"}}`,
|
||||
`</ac:structured-macro>{{printf "\n"}}`,
|
||||
`{{ end }}`,
|
||||
),
|
||||
|
||||
// TODO(seletskiy): more templates here
|
||||
} {
|
||||
templates, err = templates.New(name).Parse(body)
|
||||
|
||||
Reference in New Issue
Block a user