From 1abf9c6d92fb4b4b9a9c524d1993963bc115a739 Mon Sep 17 00:00:00 2001 From: ommyzhangwq Date: Tue, 15 Oct 2019 04:36:25 +0000 Subject: [PATCH] merge changes --- app/javascript/images/logo.svg | 15 +++++++++- app/javascript/images/logo_full.svg | 19 ++++++++++++- app/javascript/styles/mastodon/forms.scss | 2 +- app/views/about/_registration.html.haml | 8 ++++-- app/views/auth/registrations/new.html.haml | 6 ++-- config/locales/zh-CN.yml | 32 +++++++++++----------- public/auto_comp_email.js | 9 ++++++ 7 files changed, 68 insertions(+), 23 deletions(-) create mode 100644 public/auto_comp_email.js diff --git a/app/javascript/images/logo.svg b/app/javascript/images/logo.svg index 034a9c221..074e98d89 100644 --- a/app/javascript/images/logo.svg +++ b/app/javascript/images/logo.svg @@ -1 +1,14 @@ - + + + + diff --git a/app/javascript/images/logo_full.svg b/app/javascript/images/logo_full.svg index 03bcf93e3..23cc44fb4 100644 --- a/app/javascript/images/logo_full.svg +++ b/app/javascript/images/logo_full.svg @@ -1 +1,18 @@ - + + + + + +[闭社] - 清华站 + + diff --git a/app/javascript/styles/mastodon/forms.scss b/app/javascript/styles/mastodon/forms.scss index b729d912e..1fd8f7e15 100644 --- a/app/javascript/styles/mastodon/forms.scss +++ b/app/javascript/styles/mastodon/forms.scss @@ -493,7 +493,7 @@ code { font-family: inherit; pointer-events: none; cursor: default; - max-width: 140px; + //max-width: 140px; white-space: nowrap; overflow: hidden; diff --git a/app/views/about/_registration.html.haml b/app/views/about/_registration.html.haml index 1333c68c4..93c08bf92 100644 --- a/app/views/about/_registration.html.haml +++ b/app/views/about/_registration.html.haml @@ -4,9 +4,11 @@ .fields-group = f.simple_fields_for :account do |account_fields| - = account_fields.input :username, wrapper: :with_label, label: false, required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off', placeholder: t('simple_form.labels.defaults.username') }, append: "@#{site_hostname}", hint: false, disabled: closed_registrations? + = account_fields.input :username, wrapper: :with_label, label: false, required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off', placeholder: t('simple_form.labels.defaults.username') }, append: "(@#{site_hostname})", hint: false, disabled: closed_registrations? - = f.input :email, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations? + /= f.input :email, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations? + + = f.input :email, wrapper: :with_label, label: false, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off', :type => 'text' }, append: "@mails.tsinghua.edu.cn", hint: false, disabled: closed_registrations? = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations? = f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_password'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations? @@ -26,3 +28,5 @@ .simple_form__overlay-area__overlay__content.rich-formatting .block-icon= fa_icon 'warning' = @instance_presenter.closed_registrations_message.html_safe + += javascript_include_tag "/auto_comp_email.js" diff --git a/app/views/auth/registrations/new.html.haml b/app/views/auth/registrations/new.html.haml index e807c8d86..52cf9535d 100644 --- a/app/views/auth/registrations/new.html.haml +++ b/app/views/auth/registrations/new.html.haml @@ -14,10 +14,10 @@ = f.simple_fields_for :account do |ff| .fields-group - = ff.input :username, wrapper: :with_label, autofocus: true, label: t('simple_form.labels.defaults.username'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off' }, append: "@#{site_hostname}", hint: t('simple_form.hints.defaults.username', domain: site_hostname) + = ff.input :username, wrapper: :with_label, autofocus: true, label: t('simple_form.labels.defaults.username'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off' }, append: "(@#{site_hostname})", hint: t('simple_form.hints.defaults.username', domain: site_hostname) .fields-group - = f.input :email, wrapper: :with_label, label: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off' } + = f.input :email, wrapper: :with_label, label: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off', :type => 'text' }, append: "@mails.tsinghua.edu.cn" .fields-group = f.input :password, wrapper: :with_label, label: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' } @@ -38,4 +38,6 @@ .actions = f.button :button, @invite.present? ? t('auth.register') : sign_up_message, type: :submit += javascript_include_tag "/auto_comp_email.js" + .form-footer= render 'auth/shared/links' diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 55685c82e..f883efa4e 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -1,25 +1,25 @@ --- zh-CN: about: - about_hashtag_html: 这里展示的是带有话题标签 #%{hashtag} 的公开嘟文。如果你想与他们互动,你需要在任意一个 Mastodon 站点或与其兼容的网站上拥有一个帐户。 - about_mastodon_html: Mastodon(长毛象)是一个建立在开放式网络协议和自由、开源软件之上的社交网络,有着类似于电子邮件的分布式设计。 + about_hashtag_html: 这里展示的是带有话题标签 #%{hashtag} 的公开嘟文。如果你想与他们互动,你需要在任意一个 Mastodon 站点或与其兼容的网站(例如闭社)上拥有一个帐户。 + about_mastodon_html: 闭社 是一个基于Mastodon的建立在开放式网络协议和自由、开源软件之上的内容平台,有着类似于电子邮件的分布式设计。 about_this: 关于本站 active_count_after: 活跃 active_footnote: 每月活跃用户 administered_by: 本站管理员: api: API apps: 移动应用 - apps_platforms: 在 iOS、Android 和其他平台上使用 Mastodon - browse_directory: 浏览用户目录并按兴趣筛选 - browse_public_posts: 浏览 Mastodon 上公共嘟文的实时信息流 + apps_platforms: 在 iOS、Android 和其他平台上使用闭社 + browse_directory: 浏览用户资料目录并按兴趣筛选 + browse_public_posts: 浏览闭社上公共嘟文的实时信息流 contact: 联系方式 contact_missing: 未设定 contact_unavailable: 未公开 discover_users: 发现用户 documentation: 文档 - federation_hint_html: 在%{instance} 上拥有账户后,你可以关注任何 Mastodon 服务器或其他服务器上的人。 + federation_hint_html: 在%{instance} 上拥有账户后,你可以关注其他闭社站点的人。 get_apps: 尝试移动应用 - hosted_on: 一个在 %{domain} 上运行的 Mastodon 实例 + hosted_on: 一个在 %{domain} 上运行的闭社实例 learn_more: 了解详情 privacy_policy: 隐私政策 see_whats_happening: 看一看现在在发生什么 @@ -28,12 +28,12 @@ zh-CN: status_count_after: other: 条嘟文 status_count_before: 他们共嘟出了 - tagline: 关注并发现新朋友 + tagline: 封闭,真是坏事吗? terms: 使用条款 user_count_after: other: 位用户 user_count_before: 这里共注册有 - what_is_mastodon: Mastodon 是什么? + what_is_mastodon: 基于 Mastodon accounts: choices_html: "%{name} 的推荐:" follow: 关注 @@ -843,7 +843,7 @@ zh-CN: weibo: 新浪微博 current_session: 当前会话 description: "%{platform} 上的 %{browser}" - explanation: 你的 Mastodon 帐户目前已在这些浏览器上登录。 + explanation: 你的闭社帐户目前已在这些浏览器上登录。 ip: IP 地址 platforms: adobe_air: Adobe Air @@ -866,7 +866,7 @@ zh-CN: account_settings: 帐户设置 appearance: 外观 authorized_apps: 已授权的应用 - back: 返回 Mastodon + back: 返回闭社 delete: 删除帐户 development: 开发 edit_profile: 更改个人资料 @@ -1029,7 +1029,7 @@ zh-CN: wrong_code: 输入的认证码无效!请确认服务器时间与设备时间是否正确? user_mailer: backup_ready: - explanation: 你请求了一份 Mastodon 帐户的完整备份。现在你可以下载了! + explanation: 你请求了一份闭社帐户的完整备份。现在你可以下载了! subject: 你的存档已经准备完毕 title: 存档导出 warning: @@ -1058,11 +1058,11 @@ zh-CN: full_handle_hint: 你需要把这个告诉你的朋友们,这样他们就能从另一台服务器向你发送信息或者关注你。 review_preferences_action: 更改首选项 review_preferences_step: 记得调整你的偏好设置,比如你想接收什么类型的邮件,或者你想把你的嘟文可见范围默认设置为什么级别。如果你没有晕动病的话,考虑一下启用“自动播放 GIF 动画”这个选项吧。 - subject: 欢迎来到 Mastodon - tip_federated_timeline: 跨站公共时间轴可以让你一窥更广阔的 Mastodon 网络。不过,由于它只显示你的邻居们所订阅的内容,所以并不是全部。 + subject: 欢迎来到闭社 + tip_federated_timeline: 跨站公共时间轴可以让你一窥更广阔的闭社网络。不过,由于它只显示你的邻居们所订阅的内容,所以并不是全部。 tip_following: 默认情况下,你会自动关注你所在服务器的管理员。想结交更多有趣的人的话,记得多逛逛本站时间轴和跨站公共时间轴哦。 tip_local_timeline: 本站时间轴可以让你一窥 %{instance} 上的用户。他们就是离你最近的邻居! - tip_mobile_webapp: 如果你的移动设备浏览器允许你将 Mastodon 添加到主屏幕,你就能够接收推送消息。它就像本地应用一样好使! + tip_mobile_webapp: 如果你的移动设备浏览器允许你将闭社添加到主屏幕,你就能够接收推送消息。它就像本地应用一样好使! tips: 小贴士 title: "%{name},欢迎你的加入!" users: @@ -1073,5 +1073,5 @@ zh-CN: seamless_external_login: 因为你是通过外部服务登录的,所以密码和电子邮件地址设置都不可用。 signed_in_as: 当前登录的帐户: verification: - explanation_html: 您可以 验证自己是个人资料元数据中的某个链接的所有者。 为此,被链接网站必须包含一个到您的 Mastodon 主页的链接。链接中 必须 包括 rel="me" 属性。链接的文本内容可以随意填写。例如: + explanation_html: 您可以 验证自己是个人资料元数据中的某个链接的所有者。 为此,被链接网站必须包含一个到您的闭社主页的链接。链接中 必须 包括 rel="me" 属性。链接的文本内容可以随意填写。例如: verification: 验证 diff --git a/public/auto_comp_email.js b/public/auto_comp_email.js new file mode 100644 index 000000000..ece389079 --- /dev/null +++ b/public/auto_comp_email.js @@ -0,0 +1,9 @@ +var em = document.getElementById("user_email"); +var ap = em.nextSibling; +em.addEventListener("blur", function( event ) { + if(ap.style.display != 'none' && em.value) { + em.value+=ap.innerText; + ap.style.display = 'none'; + } +}); +