mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
自定义用户信息页面背景图片
This commit is contained in:
1 parent
a8bddb4519
commit
d14b63883e
5 files changed
+17
-16
No files matched your search
@@ -158,11 +158,16 @@ class HomeSettingsHandler extends Handler {
|
||||
}
|
||||
|
||||
async get({ category }) {
|
||||
const path = [
|
||||
['Hydro', '/'],
|
||||
['home_settings', null],
|
||||
];
|
||||
this.response.template = 'home_settings.html';
|
||||
this.response.body = {
|
||||
category,
|
||||
page_name: `home_${category}`,
|
||||
current: this.user,
|
||||
path,
|
||||
};
|
||||
if (category === 'preference') {
|
||||
this.response.body.settings = setting.PREFERENCE_SETTINGS;
|
||||
|
||||
@@ -4,7 +4,6 @@ const token = require('../model/token');
|
||||
const system = require('../model/system');
|
||||
const { sendMail } = require('../lib/mail');
|
||||
const misc = require('../lib/misc');
|
||||
const { PERM_LOGGEDIN } = require('../permission');
|
||||
const {
|
||||
UserAlreadyExistError, InvalidTokenError, VerifyPasswordError,
|
||||
UserNotFoundError, LoginError, SystemError,
|
||||
@@ -165,7 +164,7 @@ async function apply() {
|
||||
Route('/login', UserLoginHandler);
|
||||
Route('/register', UserRegisterHandler);
|
||||
Route('/register/:code', UserRegisterWithCodeHandler);
|
||||
Route('/logout', UserLogoutHandler, PERM_LOGGEDIN);
|
||||
Route('/logout', UserLogoutHandler);
|
||||
Route('/lostpass', UserLostPassHandler);
|
||||
Route('/lostpass/:code', UserLostPassWithCodeHandler);
|
||||
Route('/user/search', UserSearchHandler);
|
||||
|
||||
@@ -5,9 +5,9 @@ const i18n = require('../lib/i18n');
|
||||
const Setting = (
|
||||
family, key, range = null,
|
||||
value = null, ui = 'text', name = '',
|
||||
desc = '', imageClass = '',
|
||||
desc = '',
|
||||
) => ({
|
||||
family, key, range, value, ui, name, desc, imageClass,
|
||||
family, key, range, value, ui, name, desc,
|
||||
});
|
||||
|
||||
const PREFERENCE_SETTINGS = [
|
||||
@@ -32,10 +32,9 @@ const ACCOUNT_SETTINGS = [
|
||||
null, 'select', 'Gender'),
|
||||
Setting('setting_info', 'bio', null,
|
||||
null, 'markdown', 'Bio'),
|
||||
Setting('setting_customize', 'background_img', builtin.BACKGROUND_RANGE,
|
||||
null, 'image_radio', 'Profile Background Image',
|
||||
'Choose the background image in your profile page.',
|
||||
'user-profile-bg--thumbnail-{0}'),
|
||||
Setting('setting_customize', 'backgroundImage', null,
|
||||
'/components/background/profile/backgrounds/1.jpg', 'text', 'Profile Background Image',
|
||||
'Choose the background image in your profile page.'),
|
||||
];
|
||||
|
||||
const SETTINGS = [...PREFERENCE_SETTINGS, ...ACCOUNT_SETTINGS];
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
{% import "components/home.html" as home with context %}
|
||||
{% extends "layout/basic.html" %}
|
||||
{% block content %}
|
||||
<style>
|
||||
.user-profile-bg {
|
||||
background-image : "{{ udoc.backgroundImage }}";
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
<div class="section">
|
||||
<div class="profile-header user-profile-bg--{{ udoc.background_img or 1 }}">
|
||||
<div class="profile-header user-profile-bg">
|
||||
<div class="profile-header__content">
|
||||
<div class="media">
|
||||
<div class="media__left">
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
.user-profile-avatar
|
||||
border-radius: 50%
|
||||
|
||||
for n in (1..21)
|
||||
.user-profile-bg--{n}
|
||||
background-image: url('backgrounds/' + n + '.jpg')
|
||||
|
||||
.user-profile-bg--thumbnail-{n}
|
||||
background-image: url('backgrounds/thumbnail/' + n + '.jpg')
|
||||
|
||||
.user-profile-badge
|
||||
display: inline-block
|
||||
font-size: rem(12px)
|
||||
|
||||
Reference in new issue
Block a user