webui: Add user birthday settings
- Store birth month and day in user_pref with default 10/18 - Migrate existing user_pref rows to fill missing birthday fields - Expose birthday editing in the webui profile page - Replace hardcoded birthday values in user info, top info, and product list responses - Fix birthday month/day field alignment in the profile form Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
@@ -15,6 +15,22 @@
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.profile-birth-row {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.profile-birth-field {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.profile-birth-sep {
|
||||
color: #666;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.profile-action-row .layui-btn+.layui-btn {
|
||||
margin-left: 0;
|
||||
}
|
||||
@@ -24,6 +40,10 @@
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.profile-birth-row {
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@@ -93,6 +113,24 @@
|
||||
<div class="layui-form-mid layui-word-aux">填 0 时按体力上限返回给客户端。</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">生日</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="profile-birth-row">
|
||||
<div class="profile-birth-field">
|
||||
<input type="number" name="birth_month" min="1" max="12" required lay-verify="required"
|
||||
autocomplete="off" class="layui-input" value="{{ .pref.EffectiveBirthMonth }}">
|
||||
</div>
|
||||
<div class="profile-birth-sep">月</div>
|
||||
<div class="profile-birth-field">
|
||||
<input type="number" name="birth_day" min="1" max="31" required lay-verify="required"
|
||||
autocomplete="off" class="layui-input" value="{{ .pref.EffectiveBirthDay }}">
|
||||
</div>
|
||||
<div class="profile-birth-sep">日</div>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">格式为 月 / 日,默认 10 / 18。</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户 ID</label>
|
||||
<div class="layui-input-block">
|
||||
|
||||
Reference in New Issue
Block a user