portal/wwwroot/portal_userinfo.ui
Hermes Agent f34ebcae43 feat: 主页右上角添加用户信息组件
- index.ui: 拆分导航栏为HBox(logo+链接+CTA | 用户信息)
- portal_userinfo.ui: 未登录显示登录/注册按钮,已登录显示用户头像+用户名
- user_menu.ui: 登录后下拉菜单(个人信息、退出登录)
- cms_styles.css: 添加用户信息区域样式
2026-06-16 11:07:04 +08:00

90 lines
1.4 KiB
XML

{% if get_user() %}
{
"widgettype": "HBox",
"options": {
"css": "portal-user-info clickable",
"width": "auto"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"popup_options": {
"eventpos": true,
"cwidth": 10,
"dismiss_events": ["command"]
},
"target": "Popup",
"options": {
"url": "{{entire_url('user_menu.ui')}}"
}
}
],
"subwidgets": [
{
"widgettype": "Svg",
"options": {
"url": "{{entire_url('/bricks/imgs/user.svg')}}",
"rate": 1.3
}
},
{
"widgettype": "Text",
"options": {
"css": "portal-username",
"text": "{{get_username()}}"
}
}
]
}
{% else %}
{
"widgettype": "HBox",
"options": {
"css": "portal-user-info",
"width": "auto"
},
"subwidgets": [
{
"widgettype": "Button",
"options": {
"label": "登录",
"css": "portal-login-btn",
"i18n": true
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "self",
"options": {
"url": "{{entire_url('/rbac/user/login.ui')}}"
}
}
]
},
{
"widgettype": "Button",
"options": {
"label": "注册",
"css": "portal-register-btn",
"i18n": true
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "self",
"options": {
"url": "{{entire_url('/rbac/user/register.ui')}}"
}
}
]
}
]
}
{% endif %}