tweak login ui
This commit is contained in:
parent
aa8fa01209
commit
3795081098
6 changed files with 387 additions and 269 deletions
|
@ -1,19 +1,85 @@
|
||||||
.login-page {
|
.login-page {
|
||||||
input:invalid {
|
article {
|
||||||
border: var(--pico-primary) dashed 2px;
|
header {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
input:invalid {
|
||||||
|
background-image: var(--pico-icon-invalid);
|
||||||
|
padding-right: calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;
|
||||||
|
padding-left: var(--pico-form-element-spacing-horizontal);
|
||||||
|
padding-inline-start: var(--pico-form-element-spacing-horizontal)!important;
|
||||||
|
padding-inline-end: calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;
|
||||||
|
background-position: center right .75rem;
|
||||||
|
background-size: 1rem auto;
|
||||||
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
mark {
|
mark {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
:where(.autoComplete_wrapper)+small {
|
||||||
.autoComplete_wrapper>ul {
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
color: var(--pico-muted-color);
|
||||||
|
}
|
||||||
|
.autoComplete_wrapper {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.autoComplete_wrapper>input {
|
||||||
|
margin-bottom:0;
|
||||||
|
}
|
||||||
|
.autoComplete_wrapper > ul {
|
||||||
|
position: absolute;
|
||||||
|
max-height: 226px;
|
||||||
|
overflow-y: scroll;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
margin: 0.25rem 0 0 0;
|
||||||
|
border-radius: 0.6rem;
|
||||||
|
background-color: var(--pico-background-color);
|
||||||
|
box-shadow: 0 3px 6px rgba(149, 157, 165, 0.15);
|
||||||
|
border: 1px solid rgba(33, 33, 33, 0.07);
|
||||||
|
z-index: 1000;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
.autoComplete_wrapper > ul[hidden],
|
||||||
|
.autoComplete_wrapper > ul:empty {
|
||||||
|
display: block;
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0);
|
||||||
|
}
|
||||||
|
.autoComplete_wrapper > ul > li {
|
||||||
|
margin: 0.3rem;
|
||||||
|
padding: 0.3rem 0.5rem;
|
||||||
|
list-style: none;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 1rem;
|
||||||
|
color: var(--pico-muted-color);
|
||||||
|
transition: all 0.1s ease-in-out;
|
||||||
|
border-radius: 0.35rem;
|
||||||
|
--background-color: rgba(255, 255, 255, 1);
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.autoComplete_wrapper>ul li {
|
.autoComplete_wrapper > ul > li::selection {
|
||||||
list-style: none;
|
--color: rgba(#ffffff, 0);
|
||||||
padding: 0 var(--pico-spacing);
|
--background-color: rgba(#ffffff, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.autoComplete_wrapper > ul > li mark {
|
||||||
|
background-color: transparent;
|
||||||
|
--color: rgba(255, 122, 122, 1);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.autoComplete_wrapper > ul > li mark::selection {
|
||||||
|
--color: rgba(#ffffff, 0);
|
||||||
|
--background-color: rgba(#ffffff, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.autoComplete_wrapper>ul>li:hover {
|
.autoComplete_wrapper>ul>li:hover {
|
||||||
|
|
|
@ -6,7 +6,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-06-20 21:41-0400\n"
|
"POT-Creation-Date: 2024-06-23 17:34-0400\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -675,7 +675,7 @@ msgstr "显示更多"
|
||||||
#: catalog/templates/_item_reviews.html:47
|
#: catalog/templates/_item_reviews.html:47
|
||||||
#: catalog/templates/podcast_episode_data.html:44
|
#: catalog/templates/podcast_episode_data.html:44
|
||||||
#: social/templates/events.html:43 social/templates/feed_data.html:44
|
#: social/templates/events.html:43 social/templates/feed_data.html:44
|
||||||
#: social/templates/feed_events.html:131
|
#: social/templates/feed_events.html:133
|
||||||
msgid "nothing more."
|
msgid "nothing more."
|
||||||
msgstr "没有更多内容了。"
|
msgstr "没有更多内容了。"
|
||||||
|
|
||||||
|
@ -1470,7 +1470,7 @@ msgstr "开发者"
|
||||||
msgid "Source Code"
|
msgid "Source Code"
|
||||||
msgstr "源代码"
|
msgstr "源代码"
|
||||||
|
|
||||||
#: common/templates/_footer.html:16 users/templates/users/login.html:166
|
#: common/templates/_footer.html:16 users/templates/users/login.html:161
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "You are visiting an alternative domain for %(site_name)s, please always use <a href=\"%(site_url)s%(request.get_full_path)s\">original version</a> if possible."
|
msgid "You are visiting an alternative domain for %(site_name)s, please always use <a href=\"%(site_url)s%(request.get_full_path)s\">original version</a> if possible."
|
||||||
msgstr "这是%(site_name)s的临时镜像,请尽可能使用<a href=\"%(site_url)s%(request.get_full_path)s\">原始站点</a>。"
|
msgstr "这是%(site_name)s的临时镜像,请尽可能使用<a href=\"%(site_url)s%(request.get_full_path)s\">原始站点</a>。"
|
||||||
|
@ -2761,54 +2761,42 @@ msgstr "分享我的收藏单"
|
||||||
msgid "shared {username}'s collection"
|
msgid "shared {username}'s collection"
|
||||||
msgstr "分享 {username} 的收藏单"
|
msgstr "分享 {username} 的收藏单"
|
||||||
|
|
||||||
#: mastodon/models.py:14
|
#: mastodon/models.py:7
|
||||||
msgid "site domain name"
|
msgid "site domain name"
|
||||||
msgstr "实例域名"
|
msgstr "实例域名"
|
||||||
|
|
||||||
#: mastodon/models.py:15
|
#: mastodon/models.py:8
|
||||||
msgid "domain for api call"
|
msgid "domain for api call"
|
||||||
msgstr "实例API域名"
|
msgstr "实例API域名"
|
||||||
|
|
||||||
#: mastodon/models.py:16
|
#: mastodon/models.py:9
|
||||||
msgid "type and verion"
|
msgid "type and verion"
|
||||||
msgstr "实例版本"
|
msgstr "实例版本"
|
||||||
|
|
||||||
#: mastodon/models.py:17
|
#: mastodon/models.py:10
|
||||||
msgid "in-site app id"
|
msgid "in-site app id"
|
||||||
msgstr "实例应用id"
|
msgstr "实例应用id"
|
||||||
|
|
||||||
#: mastodon/models.py:18
|
#: mastodon/models.py:11
|
||||||
msgid "client id"
|
msgid "client id"
|
||||||
msgstr "实例应用Client ID"
|
msgstr "实例应用Client ID"
|
||||||
|
|
||||||
#: mastodon/models.py:19
|
#: mastodon/models.py:12
|
||||||
msgid "client secret"
|
msgid "client secret"
|
||||||
msgstr "实例应用Client Secret"
|
msgstr "实例应用Client Secret"
|
||||||
|
|
||||||
#: mastodon/models.py:20
|
#: mastodon/models.py:13
|
||||||
msgid "vapid key"
|
msgid "vapid key"
|
||||||
msgstr "实例应用VAPID Key"
|
msgstr "实例应用VAPID Key"
|
||||||
|
|
||||||
#: mastodon/models.py:22
|
#: mastodon/models.py:15
|
||||||
msgid "0: custom emoji; 1: unicode moon; 2: text"
|
msgid "0: custom emoji; 1: unicode moon; 2: text"
|
||||||
msgstr "实例表情模式"
|
msgstr "实例表情模式"
|
||||||
|
|
||||||
#: mastodon/models.py:25
|
#: mastodon/models.py:18
|
||||||
msgid "max toot len"
|
msgid "max toot len"
|
||||||
msgstr "帖文长度限制"
|
msgstr "帖文长度限制"
|
||||||
|
|
||||||
#: mastodon/models.py:38
|
|
||||||
msgid "username and original site"
|
|
||||||
msgstr "用户标识"
|
|
||||||
|
|
||||||
#: mastodon/models.py:40
|
|
||||||
msgid "local database id"
|
|
||||||
msgstr "本地标识"
|
|
||||||
|
|
||||||
#: mastodon/models.py:42
|
|
||||||
msgid "target site domain name"
|
|
||||||
msgstr "目标实例域名"
|
|
||||||
|
|
||||||
#: social/templates/activity/comment_child_item.html:12
|
#: social/templates/activity/comment_child_item.html:12
|
||||||
#: social/templates/feed_events.html:40
|
#: social/templates/feed_events.html:40
|
||||||
msgid "play"
|
msgid "play"
|
||||||
|
@ -3016,7 +3004,7 @@ msgstr "仅书影音"
|
||||||
msgid "Notifications"
|
msgid "Notifications"
|
||||||
msgstr "通知"
|
msgstr "通知"
|
||||||
|
|
||||||
#: social/templates/feed_data.html:48 social/templates/feed_events.html:135
|
#: social/templates/feed_data.html:48 social/templates/feed_events.html:137
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Find and mark some books/movies/podcasts/games, <a href=\"%(import_url)s\">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow %(site_name)s users on the fediverse, so their recent activities and yours will show up here."
|
msgid "Find and mark some books/movies/podcasts/games, <a href=\"%(import_url)s\">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow %(site_name)s users on the fediverse, so their recent activities and yours will show up here."
|
||||||
msgstr "搜索并标记一些书影音/播客/游戏,<a href=\"%(import_url)s\">导入你的豆瓣、Letterboxd或Goodreads记录</a>,去联邦宇宙(长毛象)关注一些正在使用%(site_name)s的用户,这里就会显示你和她们的近期动态。"
|
msgstr "搜索并标记一些书影音/播客/游戏,<a href=\"%(import_url)s\">导入你的豆瓣、Letterboxd或Goodreads记录</a>,去联邦宇宙(长毛象)关注一些正在使用%(site_name)s的用户,这里就会显示你和她们的近期动态。"
|
||||||
|
@ -3301,7 +3289,7 @@ msgstr "必填,限英文字母数字下划线,最多30个字符。"
|
||||||
msgid "A user with that username already exists."
|
msgid "A user with that username already exists."
|
||||||
msgstr "使用该用户名的用户已存在。"
|
msgstr "使用该用户名的用户已存在。"
|
||||||
|
|
||||||
#: users/models/user.py:92 users/templates/users/login.html:60
|
#: users/models/user.py:92
|
||||||
msgid "email address"
|
msgid "email address"
|
||||||
msgstr "电子邮件地址"
|
msgstr "电子邮件地址"
|
||||||
|
|
||||||
|
@ -3568,12 +3556,11 @@ msgstr "无法找到用户,请确认拼写正确;也可能服务器正忙,
|
||||||
msgid "Searching the fediverse"
|
msgid "Searching the fediverse"
|
||||||
msgstr "正在搜索联邦宇宙"
|
msgstr "正在搜索联邦宇宙"
|
||||||
|
|
||||||
#: users/templates/users/login.html:16 users/templates/users/login.html:84
|
#: users/templates/users/login.html:16 users/templates/users/register.html:8
|
||||||
#: users/templates/users/register.html:8
|
|
||||||
msgid "Register"
|
msgid "Register"
|
||||||
msgstr "注册"
|
msgstr "注册"
|
||||||
|
|
||||||
#: users/templates/users/login.html:16 users/templates/users/login.html:84
|
#: users/templates/users/login.html:16
|
||||||
msgid "Login"
|
msgid "Login"
|
||||||
msgstr "登录"
|
msgstr "登录"
|
||||||
|
|
||||||
|
@ -3582,58 +3569,86 @@ msgstr "登录"
|
||||||
msgid "back to your home page."
|
msgid "back to your home page."
|
||||||
msgstr "返回首页"
|
msgstr "返回首页"
|
||||||
|
|
||||||
#: users/templates/users/login.html:69
|
#: users/templates/users/login.html:56
|
||||||
msgid "domain name of your instance, e.g. mastodon.social"
|
msgid "Email"
|
||||||
|
msgstr "电子邮件"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:61
|
||||||
|
msgid "Fediverse (Mastodon)"
|
||||||
|
msgstr "联邦宇宙(有时也被称为长毛象)"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:71
|
||||||
|
msgid "Threads"
|
||||||
|
msgstr "Threads"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:74
|
||||||
|
msgid "Bluesky"
|
||||||
|
msgstr "Bluesky"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:89
|
||||||
|
msgid "Enter your email address"
|
||||||
|
msgstr "输入电子邮件地址"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:91
|
||||||
|
msgid "Verify Email"
|
||||||
|
msgstr "验证电子邮件"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:106
|
||||||
|
msgid "domain of your instance, e.g. mastodon.social"
|
||||||
msgstr "实例域名(不含@和@之前的部分),如mastodon.social"
|
msgstr "实例域名(不含@和@之前的部分),如mastodon.social"
|
||||||
|
|
||||||
#: users/templates/users/login.html:78
|
|
||||||
msgid "Login Method"
|
|
||||||
msgstr "选择登录方式"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:79
|
|
||||||
msgid "Fediverse Identity"
|
|
||||||
msgstr "联邦宇宙授权"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:80
|
|
||||||
msgid "Email Verification"
|
|
||||||
msgstr "电子邮件验证"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:112
|
#: users/templates/users/login.html:112
|
||||||
msgid "select or input domain name of your instance (excl. @)"
|
msgid "Please enter domain of your instance; e.g. if your id is <i>@neodb@mastodon.social</i>, only enter <i>mastodon.social</i>."
|
||||||
msgstr "输入或选择实例域名(不含@和@之前的部分)"
|
msgstr "请输入你的实例域名(不含@和@之前的部分);如果你的联邦账号是<i>@neodb@mastodon.social</i>只需要在此输入<i>mastodon.social</i>。"
|
||||||
|
|
||||||
#: users/templates/users/login.html:145
|
#: users/templates/users/login.html:115 users/templates/users/login.html:145
|
||||||
msgid "Authorize"
|
msgid "Authorize via Fediverse instance"
|
||||||
msgstr "授权"
|
msgstr "去联邦实例授权注册或登录"
|
||||||
|
|
||||||
#: users/templates/users/login.html:150
|
#: users/templates/users/login.html:117
|
||||||
|
msgid "If you don't have a <a href=\"https://joinmastodon.org/servers\" target=\"_blank\">Fediverse (Mastodon) account</a> yet, you may register or login with Email first, and link it with Fediverse (Mastodon) later in account settings."
|
||||||
|
msgstr "如果你还没有或不便注册<a href=\"https://joinmastodon.org/servers\" target=\"_blank\">联邦实例</a>账号,也可先通过电子邮件或其它平台注册登录,未来再作关联。"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:127
|
||||||
|
msgid "Authorize via Threads"
|
||||||
|
msgstr "去Threads授权注册或登录"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:128
|
||||||
|
msgid "If you have already account here registered via a different way, you may login through there and link with your Threads account in account settings."
|
||||||
|
msgstr "如果你已通过其它方式注册过本站帐号,请用该方式登录后再关联Threads。"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:137
|
||||||
|
msgid "Authorize via Bluesky"
|
||||||
|
msgstr "去Bluesky授权注册或登录"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:138
|
||||||
|
msgid "If you have already account here registered via a different way, you may login through there and link with your Bluesky account in account settings."
|
||||||
|
msgstr "如果你已通过其它方式注册过本站帐号,请用该方式登录后再关联Bluesky。"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:151
|
||||||
msgid "Valid invitation code, please login or register."
|
msgid "Valid invitation code, please login or register."
|
||||||
msgstr "邀请链接有效,可注册新用户"
|
msgstr "邀请链接有效,可注册新用户"
|
||||||
|
|
||||||
#: users/templates/users/login.html:152
|
#: users/templates/users/login.html:153
|
||||||
msgid "Please use invitation link to register a new account; existing user may login."
|
msgid "Please use invitation link to register a new account; existing user may login."
|
||||||
msgstr "本站目前为邀请注册,已有账户可直接登入,新用户请使用有效邀请链接注册"
|
msgstr "本站目前为邀请注册,已有账户可直接登入,新用户请使用有效邀请链接注册"
|
||||||
|
|
||||||
#: users/templates/users/login.html:154
|
#: users/templates/users/login.html:155
|
||||||
msgid "Invitation code invalid or expired."
|
msgid "Invitation code invalid or expired."
|
||||||
msgstr "邀请链接无效,已有账户可直接登入,新用户请使用有效邀请链接注册"
|
msgstr "邀请链接无效,已有账户可直接登入,新用户请使用有效邀请链接注册"
|
||||||
|
|
||||||
#: users/templates/users/login.html:159
|
#: users/templates/users/login.html:163
|
||||||
msgid "Select Email Verification if you don't have a <a href=\"https://joinmastodon.org/servers\" target=\"_blank\">Fediverse account</a>."
|
|
||||||
msgstr "如不便或尚未<a href=\"https://joinmastodon.org/zh/servers\" target=\"_blank\">注册联邦宇宙</a>,也可以在上方选择「电子邮件验证」注册登录本站。"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:161
|
|
||||||
msgid "Enter your email address to register or sign in if you don't have a Fediverse account, or have associated your email with your Fediverse account before; otherwise please sign in via Fediverse, and associate your email address once logged in."
|
|
||||||
msgstr "现有用户通过联邦宇宙登录后关联电子邮件地址,即可通过邮件登录本站;如不便使用联邦宇宙,也可在此输入邮件地址注册账号,未来再关联到联邦宇宙。"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:168
|
|
||||||
msgid "Loading timed out, please check your network (VPN) settings."
|
msgid "Loading timed out, please check your network (VPN) settings."
|
||||||
msgstr "部分模块加载超时,请检查网络(翻墙)设置。"
|
msgstr "部分模块加载超时,请检查网络(翻墙)设置。"
|
||||||
|
|
||||||
#: users/templates/users/login.html:174
|
#: users/templates/users/login.html:169
|
||||||
msgid "Using this site implies consent of our <a href=\"/pages/rules/\">rules</a> and <a href=\"/pages/terms/\">terms</a>, and use of cookies to provide necessary functionality."
|
msgid "Using this site implies consent of our <a href=\"/pages/rules/\">rules</a> and <a href=\"/pages/terms/\">terms</a>, and use of cookies to provide necessary functionality."
|
||||||
msgstr "继续访问或注册视为同意<a href=\"/pages/rules/\">站规</a>与<a href=\"/pages/terms/\">协议</a>,及使用cookie提供必要功能"
|
msgstr "继续访问或注册视为同意<a href=\"/pages/rules/\">站规</a>与<a href=\"/pages/terms/\">协议</a>,及使用cookie提供必要功能"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:175
|
||||||
|
msgid "select or input domain name of your instance (excl. @)"
|
||||||
|
msgstr "输入或选择实例域名(不含@和@之前的部分)"
|
||||||
|
|
||||||
#: users/templates/users/preferences.html:26
|
#: users/templates/users/preferences.html:26
|
||||||
msgid "Default view once logged in"
|
msgid "Default view once logged in"
|
||||||
msgstr "登录后默认显示"
|
msgstr "登录后默认显示"
|
||||||
|
|
|
@ -6,7 +6,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-06-20 21:41-0400\n"
|
"POT-Creation-Date: 2024-06-23 17:34-0400\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -675,7 +675,7 @@ msgstr "顯示更多"
|
||||||
#: catalog/templates/_item_reviews.html:47
|
#: catalog/templates/_item_reviews.html:47
|
||||||
#: catalog/templates/podcast_episode_data.html:44
|
#: catalog/templates/podcast_episode_data.html:44
|
||||||
#: social/templates/events.html:43 social/templates/feed_data.html:44
|
#: social/templates/events.html:43 social/templates/feed_data.html:44
|
||||||
#: social/templates/feed_events.html:131
|
#: social/templates/feed_events.html:133
|
||||||
msgid "nothing more."
|
msgid "nothing more."
|
||||||
msgstr "沒有更多內容了。"
|
msgstr "沒有更多內容了。"
|
||||||
|
|
||||||
|
@ -1470,7 +1470,7 @@ msgstr "開發者"
|
||||||
msgid "Source Code"
|
msgid "Source Code"
|
||||||
msgstr "源代碼"
|
msgstr "源代碼"
|
||||||
|
|
||||||
#: common/templates/_footer.html:16 users/templates/users/login.html:166
|
#: common/templates/_footer.html:16 users/templates/users/login.html:161
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "You are visiting an alternative domain for %(site_name)s, please always use <a href=\"%(site_url)s%(request.get_full_path)s\">original version</a> if possible."
|
msgid "You are visiting an alternative domain for %(site_name)s, please always use <a href=\"%(site_url)s%(request.get_full_path)s\">original version</a> if possible."
|
||||||
msgstr "這是%(site_name)s的臨時鏡像,請儘可能使用<a href=\"%(site_url)s%(request.get_full_path)s\">原始站點</a>。"
|
msgstr "這是%(site_name)s的臨時鏡像,請儘可能使用<a href=\"%(site_url)s%(request.get_full_path)s\">原始站點</a>。"
|
||||||
|
@ -2761,54 +2761,42 @@ msgstr "分享我的收藏單"
|
||||||
msgid "shared {username}'s collection"
|
msgid "shared {username}'s collection"
|
||||||
msgstr "分享 {username} 的收藏單"
|
msgstr "分享 {username} 的收藏單"
|
||||||
|
|
||||||
#: mastodon/models.py:14
|
#: mastodon/models.py:7
|
||||||
msgid "site domain name"
|
msgid "site domain name"
|
||||||
msgstr "實例域名"
|
msgstr "實例域名"
|
||||||
|
|
||||||
#: mastodon/models.py:15
|
#: mastodon/models.py:8
|
||||||
msgid "domain for api call"
|
msgid "domain for api call"
|
||||||
msgstr "實例API域名"
|
msgstr "實例API域名"
|
||||||
|
|
||||||
#: mastodon/models.py:16
|
#: mastodon/models.py:9
|
||||||
msgid "type and verion"
|
msgid "type and verion"
|
||||||
msgstr "實例版本"
|
msgstr "實例版本"
|
||||||
|
|
||||||
#: mastodon/models.py:17
|
#: mastodon/models.py:10
|
||||||
msgid "in-site app id"
|
msgid "in-site app id"
|
||||||
msgstr "實例應用id"
|
msgstr "實例應用id"
|
||||||
|
|
||||||
#: mastodon/models.py:18
|
#: mastodon/models.py:11
|
||||||
msgid "client id"
|
msgid "client id"
|
||||||
msgstr "實例應用Client ID"
|
msgstr "實例應用Client ID"
|
||||||
|
|
||||||
#: mastodon/models.py:19
|
#: mastodon/models.py:12
|
||||||
msgid "client secret"
|
msgid "client secret"
|
||||||
msgstr "實例應用Client Secret"
|
msgstr "實例應用Client Secret"
|
||||||
|
|
||||||
#: mastodon/models.py:20
|
#: mastodon/models.py:13
|
||||||
msgid "vapid key"
|
msgid "vapid key"
|
||||||
msgstr "實例應用VAPID Key"
|
msgstr "實例應用VAPID Key"
|
||||||
|
|
||||||
#: mastodon/models.py:22
|
#: mastodon/models.py:15
|
||||||
msgid "0: custom emoji; 1: unicode moon; 2: text"
|
msgid "0: custom emoji; 1: unicode moon; 2: text"
|
||||||
msgstr "實例表情模式"
|
msgstr "實例表情模式"
|
||||||
|
|
||||||
#: mastodon/models.py:25
|
#: mastodon/models.py:18
|
||||||
msgid "max toot len"
|
msgid "max toot len"
|
||||||
msgstr "帖文長度限制"
|
msgstr "帖文長度限制"
|
||||||
|
|
||||||
#: mastodon/models.py:38
|
|
||||||
msgid "username and original site"
|
|
||||||
msgstr "用戶標識"
|
|
||||||
|
|
||||||
#: mastodon/models.py:40
|
|
||||||
msgid "local database id"
|
|
||||||
msgstr "本地標識"
|
|
||||||
|
|
||||||
#: mastodon/models.py:42
|
|
||||||
msgid "target site domain name"
|
|
||||||
msgstr "目標實例域名"
|
|
||||||
|
|
||||||
#: social/templates/activity/comment_child_item.html:12
|
#: social/templates/activity/comment_child_item.html:12
|
||||||
#: social/templates/feed_events.html:40
|
#: social/templates/feed_events.html:40
|
||||||
msgid "play"
|
msgid "play"
|
||||||
|
@ -3016,7 +3004,7 @@ msgstr "僅書影音"
|
||||||
msgid "Notifications"
|
msgid "Notifications"
|
||||||
msgstr "通知"
|
msgstr "通知"
|
||||||
|
|
||||||
#: social/templates/feed_data.html:48 social/templates/feed_events.html:135
|
#: social/templates/feed_data.html:48 social/templates/feed_events.html:137
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Find and mark some books/movies/podcasts/games, <a href=\"%(import_url)s\">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow %(site_name)s users on the fediverse, so their recent activities and yours will show up here."
|
msgid "Find and mark some books/movies/podcasts/games, <a href=\"%(import_url)s\">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow %(site_name)s users on the fediverse, so their recent activities and yours will show up here."
|
||||||
msgstr "搜索並標記一些書影音/播客/遊戲,<a href=\"%(import_url)s\">導入你的豆瓣、Letterboxd或Goodreads記錄</a>,去聯邦宇宙(長毛象)關注一些正在使用%(site_name)s的用戶,這裏就會顯示你和她們的近期動態。"
|
msgstr "搜索並標記一些書影音/播客/遊戲,<a href=\"%(import_url)s\">導入你的豆瓣、Letterboxd或Goodreads記錄</a>,去聯邦宇宙(長毛象)關注一些正在使用%(site_name)s的用戶,這裏就會顯示你和她們的近期動態。"
|
||||||
|
@ -3301,7 +3289,7 @@ msgstr "必填,限英文字母數字下劃線,最多30個字符。"
|
||||||
msgid "A user with that username already exists."
|
msgid "A user with that username already exists."
|
||||||
msgstr "使用該用戶名的用戶已存在。"
|
msgstr "使用該用戶名的用戶已存在。"
|
||||||
|
|
||||||
#: users/models/user.py:92 users/templates/users/login.html:60
|
#: users/models/user.py:92
|
||||||
msgid "email address"
|
msgid "email address"
|
||||||
msgstr "電子郵件地址"
|
msgstr "電子郵件地址"
|
||||||
|
|
||||||
|
@ -3568,12 +3556,11 @@ msgstr "無法找到用戶,請確認拼寫正確;也可能服務器正忙,
|
||||||
msgid "Searching the fediverse"
|
msgid "Searching the fediverse"
|
||||||
msgstr "正在搜索聯邦宇宙"
|
msgstr "正在搜索聯邦宇宙"
|
||||||
|
|
||||||
#: users/templates/users/login.html:16 users/templates/users/login.html:84
|
#: users/templates/users/login.html:16 users/templates/users/register.html:8
|
||||||
#: users/templates/users/register.html:8
|
|
||||||
msgid "Register"
|
msgid "Register"
|
||||||
msgstr "註冊"
|
msgstr "註冊"
|
||||||
|
|
||||||
#: users/templates/users/login.html:16 users/templates/users/login.html:84
|
#: users/templates/users/login.html:16
|
||||||
msgid "Login"
|
msgid "Login"
|
||||||
msgstr "登錄"
|
msgstr "登錄"
|
||||||
|
|
||||||
|
@ -3582,58 +3569,86 @@ msgstr "登錄"
|
||||||
msgid "back to your home page."
|
msgid "back to your home page."
|
||||||
msgstr "返回首頁"
|
msgstr "返回首頁"
|
||||||
|
|
||||||
#: users/templates/users/login.html:69
|
#: users/templates/users/login.html:56
|
||||||
msgid "domain name of your instance, e.g. mastodon.social"
|
msgid "Email"
|
||||||
|
msgstr "電子郵件"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:61
|
||||||
|
msgid "Fediverse (Mastodon)"
|
||||||
|
msgstr "聯邦宇宙(有時也被稱爲長毛象)"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:71
|
||||||
|
msgid "Threads"
|
||||||
|
msgstr "Threads"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:74
|
||||||
|
msgid "Bluesky"
|
||||||
|
msgstr "Bluesky"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:89
|
||||||
|
msgid "Enter your email address"
|
||||||
|
msgstr "輸入電子郵件地址"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:91
|
||||||
|
msgid "Verify Email"
|
||||||
|
msgstr "驗證電子郵件"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:106
|
||||||
|
msgid "domain of your instance, e.g. mastodon.social"
|
||||||
msgstr "實例域名(不含@和@之前的部分),如mastodon.social"
|
msgstr "實例域名(不含@和@之前的部分),如mastodon.social"
|
||||||
|
|
||||||
#: users/templates/users/login.html:78
|
|
||||||
msgid "Login Method"
|
|
||||||
msgstr "選擇登錄方式"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:79
|
|
||||||
msgid "Fediverse Identity"
|
|
||||||
msgstr "聯邦宇宙授權"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:80
|
|
||||||
msgid "Email Verification"
|
|
||||||
msgstr "電子郵件驗證"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:112
|
#: users/templates/users/login.html:112
|
||||||
msgid "select or input domain name of your instance (excl. @)"
|
msgid "Please enter domain of your instance; e.g. if your id is <i>@neodb@mastodon.social</i>, only enter <i>mastodon.social</i>."
|
||||||
msgstr "輸入或選擇實例域名(不含@和@之前的部分)"
|
msgstr "請輸入你的實例域名(不含@和@之前的部分);如果你的聯邦賬號是<i>@neodb@mastodon.social</i>只需要在此輸入<i>mastodon.social</i>。"
|
||||||
|
|
||||||
#: users/templates/users/login.html:145
|
#: users/templates/users/login.html:115 users/templates/users/login.html:145
|
||||||
msgid "Authorize"
|
msgid "Authorize via Fediverse instance"
|
||||||
msgstr "授權"
|
msgstr "去聯邦實例授權註冊或登錄"
|
||||||
|
|
||||||
#: users/templates/users/login.html:150
|
#: users/templates/users/login.html:117
|
||||||
|
msgid "If you don't have a <a href=\"https://joinmastodon.org/servers\" target=\"_blank\">Fediverse (Mastodon) account</a> yet, you may register or login with Email first, and link it with Fediverse (Mastodon) later in account settings."
|
||||||
|
msgstr "如果你還沒有或不便註冊<a href=\"https://joinmastodon.org/servers\" target=\"_blank\">聯邦實例</a>賬號,也可先通過電子郵件或其它平臺註冊登錄,未來再作關聯。"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:127
|
||||||
|
msgid "Authorize via Threads"
|
||||||
|
msgstr "去Threads授權註冊或登錄"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:128
|
||||||
|
msgid "If you have already account here registered via a different way, you may login through there and link with your Threads account in account settings."
|
||||||
|
msgstr "如果你已通過其它方式註冊過本站帳號,請用該方式登錄後再關聯Threads。"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:137
|
||||||
|
msgid "Authorize via Bluesky"
|
||||||
|
msgstr "去Bluesky授權註冊或登錄"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:138
|
||||||
|
msgid "If you have already account here registered via a different way, you may login through there and link with your Bluesky account in account settings."
|
||||||
|
msgstr "如果你已通過其它方式註冊過本站帳號,請用該方式登錄後再關聯Bluesky。"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:151
|
||||||
msgid "Valid invitation code, please login or register."
|
msgid "Valid invitation code, please login or register."
|
||||||
msgstr "邀請鏈接有效,可註冊新用戶"
|
msgstr "邀請鏈接有效,可註冊新用戶"
|
||||||
|
|
||||||
#: users/templates/users/login.html:152
|
#: users/templates/users/login.html:153
|
||||||
msgid "Please use invitation link to register a new account; existing user may login."
|
msgid "Please use invitation link to register a new account; existing user may login."
|
||||||
msgstr "本站目前爲邀請註冊,已有賬戶可直接登入,新用戶請使用有效邀請鏈接註冊"
|
msgstr "本站目前爲邀請註冊,已有賬戶可直接登入,新用戶請使用有效邀請鏈接註冊"
|
||||||
|
|
||||||
#: users/templates/users/login.html:154
|
#: users/templates/users/login.html:155
|
||||||
msgid "Invitation code invalid or expired."
|
msgid "Invitation code invalid or expired."
|
||||||
msgstr "邀請鏈接無效,已有賬戶可直接登入,新用戶請使用有效邀請鏈接註冊"
|
msgstr "邀請鏈接無效,已有賬戶可直接登入,新用戶請使用有效邀請鏈接註冊"
|
||||||
|
|
||||||
#: users/templates/users/login.html:159
|
#: users/templates/users/login.html:163
|
||||||
msgid "Select Email Verification if you don't have a <a href=\"https://joinmastodon.org/servers\" target=\"_blank\">Fediverse account</a>."
|
|
||||||
msgstr "如不便或尚未<a href=\"https://joinmastodon.org/zh/servers\" target=\"_blank\">註冊聯邦宇宙</a>,也可以在上方選擇「電子郵件驗證」註冊登錄本站。"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:161
|
|
||||||
msgid "Enter your email address to register or sign in if you don't have a Fediverse account, or have associated your email with your Fediverse account before; otherwise please sign in via Fediverse, and associate your email address once logged in."
|
|
||||||
msgstr "現有用戶通過聯邦宇宙登錄後關聯電子郵件地址,即可通過郵件登錄本站;如不便使用聯邦宇宙,也可在此輸入郵件地址註冊賬號,未來再關聯到聯邦宇宙。"
|
|
||||||
|
|
||||||
#: users/templates/users/login.html:168
|
|
||||||
msgid "Loading timed out, please check your network (VPN) settings."
|
msgid "Loading timed out, please check your network (VPN) settings."
|
||||||
msgstr "部分模塊加載超時,請檢查網絡(翻牆)設置。"
|
msgstr "部分模塊加載超時,請檢查網絡(翻牆)設置。"
|
||||||
|
|
||||||
#: users/templates/users/login.html:174
|
#: users/templates/users/login.html:169
|
||||||
msgid "Using this site implies consent of our <a href=\"/pages/rules/\">rules</a> and <a href=\"/pages/terms/\">terms</a>, and use of cookies to provide necessary functionality."
|
msgid "Using this site implies consent of our <a href=\"/pages/rules/\">rules</a> and <a href=\"/pages/terms/\">terms</a>, and use of cookies to provide necessary functionality."
|
||||||
msgstr "繼續訪問或註冊視爲同意<a href=\"/pages/rules/\">站規</a>與<a href=\"/pages/terms/\">協議</a>,及使用cookie提供必要功能"
|
msgstr "繼續訪問或註冊視爲同意<a href=\"/pages/rules/\">站規</a>與<a href=\"/pages/terms/\">協議</a>,及使用cookie提供必要功能"
|
||||||
|
|
||||||
|
#: users/templates/users/login.html:175
|
||||||
|
msgid "select or input domain name of your instance (excl. @)"
|
||||||
|
msgstr "輸入或選擇實例域名(不含@和@之前的部分)"
|
||||||
|
|
||||||
#: users/templates/users/preferences.html:26
|
#: users/templates/users/preferences.html:26
|
||||||
msgid "Default view once logged in"
|
msgid "Default view once logged in"
|
||||||
msgstr "登錄後默認顯示"
|
msgstr "登錄後默認顯示"
|
||||||
|
|
|
@ -3,13 +3,6 @@ from django.utils import timezone
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class MastodonError(Exception):
|
|
||||||
instance: str
|
|
||||||
|
|
||||||
def __init__(self, *args: object) -> None:
|
|
||||||
super().__init__(args)
|
|
||||||
|
|
||||||
|
|
||||||
class MastodonApplication(models.Model):
|
class MastodonApplication(models.Model):
|
||||||
domain_name = models.CharField(_("site domain name"), max_length=200, unique=True)
|
domain_name = models.CharField(_("site domain name"), max_length=200, unique=True)
|
||||||
api_domain = models.CharField(_("domain for api call"), max_length=200, blank=True)
|
api_domain = models.CharField(_("domain for api call"), max_length=200, blank=True)
|
||||||
|
@ -31,24 +24,3 @@ class MastodonApplication(models.Model):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.domain_name
|
return self.domain_name
|
||||||
|
|
||||||
|
|
||||||
class CrossSiteUserInfo(models.Model):
|
|
||||||
# username@original_site
|
|
||||||
uid = models.CharField(_("username and original site"), max_length=200)
|
|
||||||
# pk in the boofilsic db
|
|
||||||
local_id = models.PositiveIntegerField(_("local database id"))
|
|
||||||
# target site domain name
|
|
||||||
target_site = models.CharField(_("target site domain name"), max_length=100)
|
|
||||||
# target site id
|
|
||||||
site_id = models.CharField(max_length=100, blank=False)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
constraints = [
|
|
||||||
models.UniqueConstraint(
|
|
||||||
fields=["uid", "target_site"], name="unique_cross_site_user_info"
|
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return f"{self.uid}({self.local_id}) in {self.target_site}({self.site_id})"
|
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
{% trans "wrote a note" %}
|
{% trans "wrote a note" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
{% if piece and piece.classname != 'note' %}
|
{% if piece and item and piece.classname != 'note' %}
|
||||||
<article>{% include "_item_card.html" with item=item allow_embed=1 %}</article>
|
<article>{% include "_item_card.html" with item=item allow_embed=1 %}</article>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div>{{ post.summary|default:'' }}</div>
|
<div>{{ post.summary|default:'' }}</div>
|
||||||
|
|
|
@ -43,123 +43,120 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<article>
|
<article>
|
||||||
<header style="text-align: center;">
|
<header>
|
||||||
<img src="{{ site_logo }}" class="logo" alt="logo">
|
<img src="{{ site_logo }}" class="logo" alt="logo">
|
||||||
</header>
|
</header>
|
||||||
<div>
|
<div>
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<a href="{{ request.session.next_url | default:'/' }}" class="button">{% trans 'back to your home page.' %}</a>
|
<a href="{{ request.session.next_url | default:'/' }}" class="button">{% trans 'back to your home page.' %}</a>
|
||||||
{% else %}
|
{% elif allow_any_site %}
|
||||||
<form action="{% url 'users:connect' %}" method="post">
|
<div role="group">
|
||||||
|
<button class="platform outline" _="on click add .outline to .platform then remove .outline from me then hide
|
||||||
|
<form/>
|
||||||
|
then show #login-email" id="platform-email" title="{% trans "Email" %}">
|
||||||
|
<i class="fa-solid fa-envelope"></i>
|
||||||
|
</button>
|
||||||
|
<button class="platform outline" _="on click add .outline to .platform then remove .outline from me then hide
|
||||||
|
<form/>
|
||||||
|
then show #login-mastodon" id="platform-mastodon" title="{% trans "Fediverse (Mastodon)" %}">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="64 163 873 873"
|
||||||
|
style="width: 1em;
|
||||||
|
color: var(--pico-color);
|
||||||
|
padding-bottom: 0.2em">
|
||||||
|
<path d="M539 176q-32 0 -55 22t-25 55t20.5 58t56 27t58.5 -20.5t27 -56t-20.5 -59t-56.5 -26.5h-5zM452 271l-232 118q20 20 25 48l231 -118q-19 -20 -24 -48zM619 298q-13 25 -38 38l183 184q13 -25 39 -38zM477 320l-135 265l40 40l143 -280q-28 -5 -48 -25zM581 336 q-22 11 -46 10l-8 -1l21 132l56 9zM155 370q-32 0 -55 22.5t-25 55t20.5 58t56.5 27t59 -21t26.5 -56t-21 -58.5t-55.5 -27h-6zM245 438q1 9 1 18q-1 19 -10 35l132 21l26 -50zM470 474l-26 51l311 49q-1 -8 -1 -17q1 -19 10 -36zM842 480q-32 1 -55 23t-24.5 55t21 58 t56 27t58.5 -20.5t27 -56.5t-20.5 -59t-56.5 -27h-6zM236 493q-13 25 -39 38l210 210l51 -25zM196 531q-21 11 -44 10l-9 -1l40 256q21 -10 45 -9l8 1zM560 553l48 311q21 -10 44 -9l10 1l-46 -294zM755 576l-118 60l8 56l135 -68q-20 -20 -25 -48zM781 625l-119 231 q28 5 48 25l119 -231q-28 -5 -48 -25zM306 654l-68 134q28 5 48 25l60 -119zM568 671l-281 143q19 20 24 48l265 -135zM513 771l-51 25l106 107q13 -25 39 -38zM222 795q-32 0 -55.5 22.5t-25 55t21 57.5t56 27t58.5 -20.5t27 -56t-20.5 -58.5t-56.5 -27h-5zM311 863 q2 9 1 18q-1 19 -9 35l256 41q-1 -9 -1 -18q1 -18 10 -35zM646 863q-32 0 -55 22.5t-24.5 55t20.5 58t56 27t59 -21t27 -56t-20.5 -58.5t-56.5 -27h-6z" />
|
||||||
|
</svg>
|
||||||
|
<!--<i class="fa-brands fa-mastodon"></i>-->
|
||||||
|
</button>
|
||||||
|
<!-- <button class="platform outline" _="on click add .outline to .platform then remove .outline from me then hide <form/> then show #login-threads" id="platform-threads" title="{% trans "Threads" %}">
|
||||||
|
<i class="fa-brands fa-threads"></i>
|
||||||
|
</button>
|
||||||
|
<button class="platform outline" _="on click add .outline to .platform then remove .outline from me then hide <form/> then show #login-bluesky" id="platform-bluesky" title="{% trans "Bluesky" %}">
|
||||||
|
<i class="fa-brands fa-bluesky" style="font-size:85%"></i>
|
||||||
|
</button> -->
|
||||||
|
</div>
|
||||||
|
<form id="login-email"
|
||||||
|
style="display:none"
|
||||||
|
action="{% url 'users:connect' %}"
|
||||||
|
method="post"
|
||||||
|
onsubmit="return login(this);">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% if allow_any_site %}
|
<input name="method" value="email" type="hidden" />
|
||||||
<input required
|
<input required
|
||||||
name="email"
|
name="email"
|
||||||
id="email"
|
id="email"
|
||||||
type="email"
|
type="email"
|
||||||
placeholder="{% trans "email address" %}"
|
placeholder="{% trans 'Enter your email address' %}"
|
||||||
disabled
|
autocomplete="email" />
|
||||||
autocomplete="email"
|
<input type='submit' value="{% trans 'Verify Email' %}" />
|
||||||
style="display:none" />
|
|
||||||
<input required
|
|
||||||
name="domain"
|
|
||||||
id="domain"
|
|
||||||
autofocus
|
|
||||||
pattern="(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,})"
|
|
||||||
placeholder="{% trans "domain name of your instance, e.g. mastodon.social" %}"
|
|
||||||
autocorrect="off"
|
|
||||||
autocapitalize="off"
|
|
||||||
spellcheck="false" />
|
|
||||||
<div role="group" style="width:100%">
|
|
||||||
<select style="width:max-content"
|
|
||||||
required
|
|
||||||
onchange="switch_login()"
|
|
||||||
name="method">
|
|
||||||
<option disabled value="">{% trans "Login Method" %}</option>
|
|
||||||
<option selected value="fedi">{% trans "Fediverse Identity" %}</option>
|
|
||||||
<option value="email">{% trans "Email Verification" %}</option>
|
|
||||||
</select>
|
|
||||||
<input style="width:100%"
|
|
||||||
type='submit'
|
|
||||||
value="{% trans 'Register' %} / {% trans "Login" %}"
|
|
||||||
id="loginButton"
|
|
||||||
disabled />
|
|
||||||
</div>
|
|
||||||
{{ sites|json_script:"sites-data" }}
|
|
||||||
<script>
|
|
||||||
function switch_login(){
|
|
||||||
if ($('select').val() == 'email') {
|
|
||||||
$('#domain').prop("disabled", true);
|
|
||||||
$('#domain').hide();
|
|
||||||
$('#email').prop("disabled", false);
|
|
||||||
$('#email').show();
|
|
||||||
$('#email')[0].focus();
|
|
||||||
//$('#domain').val('');
|
|
||||||
$('#fedi-tips').hide();
|
|
||||||
$('#email-tips').show();
|
|
||||||
} else {
|
|
||||||
$('#email').prop("disabled", true);
|
|
||||||
$('#email').hide();
|
|
||||||
$('#domain').prop("disabled", false);
|
|
||||||
$('#domain').show();
|
|
||||||
$('#domain')[0].focus();
|
|
||||||
//$('#email').val('');
|
|
||||||
$('#fedi-tips').show();
|
|
||||||
$('#email-tips').hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const sites = JSON.parse(document.getElementById('sites-data').textContent);
|
|
||||||
const autoCompleteJS = new autoComplete({ placeHolder: "{% trans "select or input domain name of your instance (excl. @)" %}",
|
|
||||||
selector: "#domain",
|
|
||||||
data: {
|
|
||||||
src: sites
|
|
||||||
},
|
|
||||||
submit: true,
|
|
||||||
resultsList: {
|
|
||||||
tabSelect: true,
|
|
||||||
maxResults: 10
|
|
||||||
},
|
|
||||||
events: {
|
|
||||||
input: {
|
|
||||||
selection: (event) => {
|
|
||||||
const selection = event.detail.selection.value;
|
|
||||||
autoCompleteJS.input.value = selection;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var d = Cookies.get('mastodon_domain');
|
|
||||||
if (d) {
|
|
||||||
if (d == "@") {
|
|
||||||
$('select').val('email');
|
|
||||||
switch_login()
|
|
||||||
} else {
|
|
||||||
$('#domain').val(Cookies.get('mastodon_domain'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
{% else %}
|
|
||||||
<select name="domain">
|
|
||||||
{% for site in sites %}<option value="{{ site }}">@{{ site }}</option>{% endfor %}
|
|
||||||
</select>
|
|
||||||
<input type='submit' value="{% trans 'Authorize' %}" id="loginButton" />
|
|
||||||
{% endif %}
|
|
||||||
{% if invite_status %}
|
|
||||||
<small>
|
|
||||||
{% if invite_status == 1 %}
|
|
||||||
<i class="fa-solid fa-circle-check"></i> {% trans "Valid invitation code, please login or register." %}
|
|
||||||
{% elif invite_status == -1 %}
|
|
||||||
<i class="fa-solid fa-person-circle-question"></i> {% trans "Please use invitation link to register a new account; existing user may login." %}
|
|
||||||
{% elif invite_status == -2 %}
|
|
||||||
<i class="fa-solid fa-circle-xmark"></i> {% trans "Invitation code invalid or expired." %}
|
|
||||||
{% endif %}
|
|
||||||
</small>
|
|
||||||
{% endif %}
|
|
||||||
<small id="fedi-tips">
|
|
||||||
{% blocktrans %}Select Email Verification if you don't have a <a href="https://joinmastodon.org/servers" target="_blank">Fediverse account</a>.{% endblocktrans %}
|
|
||||||
</small>
|
|
||||||
<small id="email-tips" style="display:none;">{% trans "Enter your email address to register or sign in if you don't have a Fediverse account, or have associated your email with your Fediverse account before; otherwise please sign in via Fediverse, and associate your email address once logged in." %}</small>
|
|
||||||
</form>
|
</form>
|
||||||
|
<form id="login-mastodon"
|
||||||
|
style="display:none"
|
||||||
|
action="{% url 'users:connect' %}"
|
||||||
|
method="post"
|
||||||
|
onsubmit="return login(this);">
|
||||||
|
{% csrf_token %}
|
||||||
|
<input name="method" value="mastodon" type="hidden" />
|
||||||
|
<input required
|
||||||
|
type="text"
|
||||||
|
name="domain"
|
||||||
|
id="domain"
|
||||||
|
autofocus
|
||||||
|
pattern="(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,})"
|
||||||
|
placeholder="{% trans 'domain of your instance, e.g. mastodon.social' %}"
|
||||||
|
autocorrect="off"
|
||||||
|
autocapitalize="off"
|
||||||
|
autocomplete="off"
|
||||||
|
spellcheck="false" />
|
||||||
|
<small id="mastodon">
|
||||||
|
{% blocktrans %}Please enter domain of your instance; e.g. if your id is <i>@neodb@mastodon.social</i>, only enter <i>mastodon.social</i>.{% endblocktrans %}
|
||||||
|
</small>
|
||||||
|
<br>
|
||||||
|
<input type='submit' value="{% trans 'Authorize via Fediverse instance' %}" />
|
||||||
|
<small>
|
||||||
|
{% blocktrans %}If you don't have a <a href="https://joinmastodon.org/servers" target="_blank">Fediverse (Mastodon) account</a> yet, you may register or login with Email first, and link it with Fediverse (Mastodon) later in account settings.{% endblocktrans %}
|
||||||
|
</small>
|
||||||
|
</form>
|
||||||
|
<form id="login-threads"
|
||||||
|
style="display:none"
|
||||||
|
action="{% url 'users:connect' %}"
|
||||||
|
method="post"
|
||||||
|
onsubmit="return login(this);">
|
||||||
|
{% csrf_token %}
|
||||||
|
<input name="method" value="threads" type="hidden" />
|
||||||
|
<input type='submit' value="{% trans 'Authorize via Threads' %}" />
|
||||||
|
<small>{% trans "If you have already account here registered via a different way, you may login through there and link with your Threads account in account settings." %}</small>
|
||||||
|
</form>
|
||||||
|
<form id="login-bluesky"
|
||||||
|
style="display:none"
|
||||||
|
action="{% url 'users:connect' %}"
|
||||||
|
method="post"
|
||||||
|
onsubmit="return login(this);">
|
||||||
|
{% csrf_token %}
|
||||||
|
<input name="method" value="bluesky" type="hidden" />
|
||||||
|
<input type='submit' value="{% trans 'Authorize via Bluesky' %}" />
|
||||||
|
<small>{% trans "If you have already account here registered via a different way, you may login through there and link with your Bluesky account in account settings." %}</small>
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<form>
|
||||||
|
<select name="domain">
|
||||||
|
{% for site in sites %}<option value="{{ site }}">@{{ site }}</option>{% endfor %}
|
||||||
|
</select>
|
||||||
|
<input type='submit'
|
||||||
|
value="{% trans 'Authorize via Fediverse instance' %}"
|
||||||
|
id="loginButton" />
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
{% if invite_status %}
|
||||||
|
<small>
|
||||||
|
{% if invite_status == 1 %}
|
||||||
|
<i class="fa-solid fa-circle-check"></i> {% trans "Valid invitation code, please login or register." %}
|
||||||
|
{% elif invite_status == -1 %}
|
||||||
|
<i class="fa-solid fa-person-circle-question"></i> {% trans "Please use invitation link to register a new account; existing user may login." %}
|
||||||
|
{% elif invite_status == -2 %}
|
||||||
|
<i class="fa-solid fa-circle-xmark"></i> {% trans "Invitation code invalid or expired." %}
|
||||||
|
{% endif %}
|
||||||
|
</small>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<small class="hide_unless_alter_domain">
|
<small class="hide_unless_alter_domain">
|
||||||
<br>
|
<br>
|
||||||
|
@ -174,5 +171,58 @@
|
||||||
{% blocktrans %}Using this site implies consent of our <a href="/pages/rules/">rules</a> and <a href="/pages/terms/">terms</a>, and use of cookies to provide necessary functionality.{% endblocktrans %}
|
{% blocktrans %}Using this site implies consent of our <a href="/pages/rules/">rules</a> and <a href="/pages/terms/">terms</a>, and use of cookies to provide necessary functionality.{% endblocktrans %}
|
||||||
</small>
|
</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
{{ sites|json_script:"sites-data" }}
|
||||||
|
<script>
|
||||||
|
const sites = JSON.parse(document.getElementById('sites-data').textContent);
|
||||||
|
const autoCompleteJS = new autoComplete({ placeHolder: "{% trans 'select or input domain name of your instance (excl. @)' %}",
|
||||||
|
selector: "#domain",
|
||||||
|
// wrapper: false,
|
||||||
|
data: {
|
||||||
|
src: sites
|
||||||
|
},
|
||||||
|
submit: true,
|
||||||
|
resultsList: {
|
||||||
|
tabSelect: true,
|
||||||
|
maxResults: 10
|
||||||
|
},
|
||||||
|
events: {
|
||||||
|
input: {
|
||||||
|
selection: (event) => {
|
||||||
|
const selection = event.detail.selection.value;
|
||||||
|
autoCompleteJS.input.value = selection;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function login(f){
|
||||||
|
localStorage.login_method = $(f).find('input[name="method"]').val();
|
||||||
|
localStorage.mastodon_domain = $('#domain').val();
|
||||||
|
localStorage.email = $('#email').val();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
$(()=>{
|
||||||
|
var method = localStorage.login_method;
|
||||||
|
if (!!method) {
|
||||||
|
$('#domain').val(localStorage.mastodon_domain);
|
||||||
|
$('#email').val(localStorage.email);
|
||||||
|
} else {
|
||||||
|
// restire cookie from previous versions
|
||||||
|
var d = Cookies.get('mastodon_domain');
|
||||||
|
if (d) {
|
||||||
|
if (d == "@") {
|
||||||
|
method = "email";
|
||||||
|
} else {
|
||||||
|
method = "mastodon";
|
||||||
|
$('#domain').val(Cookies.get('mastodon_domain'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!!method) {
|
||||||
|
$('#platform-' + method).removeClass('outline');
|
||||||
|
$('#login-' + method).show();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue