From d14b63883e1e5563910b520db188e6458c0b210a Mon Sep 17 00:00:00 2001 From: masnn Date: Thu, 11 Jun 2020 12:49:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2=E8=83=8C=E6=99=AF=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hydro/handler/home.js | 5 +++++ hydro/handler/user.js | 3 +-- hydro/model/setting.js | 11 +++++------ templates/user_detail.html | 7 ++++++- ui/components/profile/profile.page.styl | 7 ------- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/hydro/handler/home.js b/hydro/handler/home.js index 7e74332b..6942e7fc 100644 --- a/hydro/handler/home.js +++ b/hydro/handler/home.js @@ -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; diff --git a/hydro/handler/user.js b/hydro/handler/user.js index a54d52a4..72e006d5 100644 --- a/hydro/handler/user.js +++ b/hydro/handler/user.js @@ -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); diff --git a/hydro/model/setting.js b/hydro/model/setting.js index d317bfab..04a73f4c 100644 --- a/hydro/model/setting.js +++ b/hydro/model/setting.js @@ -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]; diff --git a/templates/user_detail.html b/templates/user_detail.html index bfec4c14..3d3af506 100644 --- a/templates/user_detail.html +++ b/templates/user_detail.html @@ -1,10 +1,15 @@ {% import "components/home.html" as home with context %} {% extends "layout/basic.html" %} {% block content %} +
-