From e0ef7f9d79ce0bd8307e6bf77a4dd77d83214809 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Wed, 27 Dec 2017 11:29:49 +0900 Subject: Fix XML oEmbed support discovery (#6104) --- app/lib/provider_discovery.rb | 2 +- spec/fixtures/requests/oembed_json_xml.html | 8 +++++++- spec/fixtures/requests/oembed_xml.html | 8 +++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/lib/provider_discovery.rb b/app/lib/provider_discovery.rb index 04ba38101..5732e4fcb 100644 --- a/app/lib/provider_discovery.rb +++ b/app/lib/provider_discovery.rb @@ -29,7 +29,7 @@ class ProviderDiscovery < OEmbed::ProviderDiscovery end if format.nil? || format == :xml - provider_endpoint ||= html.at_xpath('//link[@type="application/xml+oembed"]')&.attribute('href')&.value + provider_endpoint ||= html.at_xpath('//link[@type="text/xml+oembed"]')&.attribute('href')&.value format ||= :xml if provider_endpoint end diff --git a/spec/fixtures/requests/oembed_json_xml.html b/spec/fixtures/requests/oembed_json_xml.html index b5fc9bed0..8afd8e997 100644 --- a/spec/fixtures/requests/oembed_json_xml.html +++ b/spec/fixtures/requests/oembed_json_xml.html @@ -1,8 +1,14 @@ + - + diff --git a/spec/fixtures/requests/oembed_xml.html b/spec/fixtures/requests/oembed_xml.html index 5d7633e71..bdfcca170 100644 --- a/spec/fixtures/requests/oembed_xml.html +++ b/spec/fixtures/requests/oembed_xml.html @@ -1,7 +1,13 @@ - + + -- cgit From 65f30f65a2816d5b25c096be0f237bbca17608e5 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Wed, 27 Dec 2017 11:31:30 +0900 Subject: Move the mastodon on Getting Started column to drawer column (#6109) Getting Started column obtained many links, and it became much taller. Because of its height, Getting Started column required long scrolling on devices with small screen, such as 4 inch phones and 10 inch laptops. This change moves the mastodon which took large space on the column to drawer column. The drawer column has only the compose form and has more space. --- app/javascript/images/mastodon-drawer.png | Bin 0 -> 32449 bytes app/javascript/images/mastodon-getting-started.png | Bin 34539 -> 0 bytes app/javascript/images/wave-drawer.png | Bin 0 -> 3269 bytes app/javascript/mastodon/features/compose/index.js | 1 + .../mastodon/features/getting_started/index.js | 24 ++++++++++----------- app/javascript/styles/mastodon/components.scss | 16 ++++++-------- 6 files changed, 19 insertions(+), 22 deletions(-) create mode 100644 app/javascript/images/mastodon-drawer.png delete mode 100644 app/javascript/images/mastodon-getting-started.png create mode 100644 app/javascript/images/wave-drawer.png diff --git a/app/javascript/images/mastodon-drawer.png b/app/javascript/images/mastodon-drawer.png new file mode 100644 index 000000000..a1fb642a0 Binary files /dev/null and b/app/javascript/images/mastodon-drawer.png differ diff --git a/app/javascript/images/mastodon-getting-started.png b/app/javascript/images/mastodon-getting-started.png deleted file mode 100644 index e05dd493f..000000000 Binary files a/app/javascript/images/mastodon-getting-started.png and /dev/null differ diff --git a/app/javascript/images/wave-drawer.png b/app/javascript/images/wave-drawer.png new file mode 100644 index 000000000..ca9f9e1d8 Binary files /dev/null and b/app/javascript/images/wave-drawer.png differ diff --git a/app/javascript/mastodon/features/compose/index.js b/app/javascript/mastodon/features/compose/index.js index 0c66585c9..c3e936ab9 100644 --- a/app/javascript/mastodon/features/compose/index.js +++ b/app/javascript/mastodon/features/compose/index.js @@ -94,6 +94,7 @@ export default class Compose extends React.PureComponent {
+
diff --git a/app/javascript/mastodon/features/getting_started/index.js b/app/javascript/mastodon/features/getting_started/index.js index 11fb6d365..2f02f245f 100644 --- a/app/javascript/mastodon/features/getting_started/index.js +++ b/app/javascript/mastodon/features/getting_started/index.js @@ -98,19 +98,17 @@ export default class GettingStarted extends ImmutablePureComponent {
-
-
-

- -

-

- tootsuite/mastodon }} - /> -

-
+
+

+ +

+

+ tootsuite/mastodon }} + /> +

); diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 63664d607..3240b38a4 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1758,7 +1758,7 @@ position: absolute; top: 0; left: 0; - background: lighten($ui-base-color, 13%); + background: lighten($ui-base-color, 13%) url('../images/wave-drawer.png') no-repeat bottom / 100% auto; box-sizing: border-box; padding: 0; display: flex; @@ -1771,6 +1771,11 @@ &.darker { background: $ui-base-color; } + + > .mastodon { + background: url('../images/mastodon-drawer.png') no-repeat left bottom / contain; + flex: 1; + } } .pseudo-drawer { @@ -2072,15 +2077,8 @@ overflow-y: auto; } -.getting-started__footer { - display: flex; - flex-direction: column; -} - .getting-started { - box-sizing: border-box; - padding-bottom: 235px; - background: url('../images/mastodon-getting-started.png') no-repeat 0 100%; + background: $ui-base-color; flex: 1 0 auto; p { -- cgit From 868568d1c11227319228ec4066c7017621b9f522 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 27 Dec 2017 18:21:12 +0100 Subject: Make host_meta/webfinger replies cacheable (fixes #6100) (#6101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make host_meta/webfinger replies cacheable (fixes #6100) Drop common code for handling users and sessions as webfinger queries are very basic, public APIs. Also explicitly mark results as cacheable with “expires_in”. * Add “Vary: Accept” header for caching since content-negociation is used --- app/controllers/well_known/host_meta_controller.rb | 6 +++++- app/controllers/well_known/webfinger_controller.rb | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/well_known/host_meta_controller.rb b/app/controllers/well_known/host_meta_controller.rb index 40f96eaa2..5fb70288a 100644 --- a/app/controllers/well_known/host_meta_controller.rb +++ b/app/controllers/well_known/host_meta_controller.rb @@ -1,15 +1,19 @@ # frozen_string_literal: true module WellKnown - class HostMetaController < ApplicationController + class HostMetaController < ActionController::Base include RoutingHelper + before_action { response.headers['Vary'] = 'Accept' } + def show @webfinger_template = "#{webfinger_url}?resource={uri}" respond_to do |format| format.xml { render content_type: 'application/xrd+xml' } end + + expires_in(3.days, public: true) end end end diff --git a/app/controllers/well_known/webfinger_controller.rb b/app/controllers/well_known/webfinger_controller.rb index 5cc606808..28654b61d 100644 --- a/app/controllers/well_known/webfinger_controller.rb +++ b/app/controllers/well_known/webfinger_controller.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module WellKnown - class WebfingerController < ApplicationController + class WebfingerController < ActionController::Base include RoutingHelper + before_action { response.headers['Vary'] = 'Accept' } + def show @account = Account.find_local!(username_from_resource) @@ -16,6 +18,8 @@ module WellKnown render content_type: 'application/xrd+xml' end end + + expires_in(3.days, public: true) rescue ActiveRecord::RecordNotFound head 404 end -- cgit From 511c6f96251a4492f7c5bea1f13018d61cfb9ce0 Mon Sep 17 00:00:00 2001 From: MitarashiDango Date: Fri, 29 Dec 2017 00:20:34 +0900 Subject: bug fix (WebPush does not work) (#6120) --- app/javascript/mastodon/actions/push_notifications/registerer.js | 2 +- app/javascript/mastodon/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/actions/push_notifications/registerer.js b/app/javascript/mastodon/actions/push_notifications/registerer.js index f851c311c..1d040bc8c 100644 --- a/app/javascript/mastodon/actions/push_notifications/registerer.js +++ b/app/javascript/mastodon/actions/push_notifications/registerer.js @@ -51,7 +51,7 @@ const sendSubscriptionToBackend = (subscription, me) => { // Last one checks for payload support: https://web-push-book.gauntface.com/chapter-06/01-non-standards-browsers/#no-payload const supportsPushNotifications = ('serviceWorker' in navigator && 'PushManager' in window && 'getKey' in PushSubscription.prototype); -export default function register () { +export function register () { return (dispatch, getState) => { dispatch(setBrowserSupport(supportsPushNotifications)); const me = getState().getIn(['meta', 'me']); diff --git a/app/javascript/mastodon/main.js b/app/javascript/mastodon/main.js index 9b18465f5..5d73caa10 100644 --- a/app/javascript/mastodon/main.js +++ b/app/javascript/mastodon/main.js @@ -1,4 +1,4 @@ -import { register as registerPushNotifications } from './actions/push_notifications'; +import * as registerPushNotifications from './actions/push_notifications'; import { default as Mastodon, store } from './containers/mastodon'; import React from 'react'; import ReactDOM from 'react-dom'; -- cgit From 38fc1b498d971f7b33532c583b12e5dd3469af3c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 29 Dec 2017 19:52:04 +0100 Subject: Add more instance stats APIs (#6125) * Add GET /api/v1/instance/peers API to reveal known domains * Add GET /api/v1/instance/activity API * Make new APIs disableable, exclude private statuses from activity stats * Fix code style issue * Fix week timestamps --- app/controllers/admin/settings_controller.rb | 4 +++ .../api/v1/instances/activity_controller.rb | 36 ++++++++++++++++++++++ .../api/v1/instances/peers_controller.rb | 17 ++++++++++ app/controllers/application_controller.rb | 9 ++++++ app/controllers/auth/confirmations_controller.rb | 6 ---- app/controllers/concerns/user_tracking_concern.rb | 1 + app/lib/activity_tracker.rb | 31 +++++++++++++++++++ app/models/form/admin_settings.rb | 4 +++ app/models/status.rb | 6 ++++ app/models/user.rb | 15 +++++++++ app/views/admin/settings/edit.html.haml | 8 +++++ config/locales/en.yml | 6 ++++ config/routes.rb | 6 +++- config/settings.yml | 3 +- 14 files changed, 144 insertions(+), 8 deletions(-) create mode 100644 app/controllers/api/v1/instances/activity_controller.rb create mode 100644 app/controllers/api/v1/instances/peers_controller.rb create mode 100644 app/lib/activity_tracker.rb diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index eed5fb6b5..487282dc3 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -17,6 +17,8 @@ module Admin bootstrap_timeline_accounts thumbnail min_invite_role + activity_api_enabled + peers_api_enabled ).freeze BOOLEAN_SETTINGS = %w( @@ -24,6 +26,8 @@ module Admin open_deletion timeline_preview show_staff_badge + activity_api_enabled + peers_api_enabled ).freeze UPLOAD_SETTINGS = %w( diff --git a/app/controllers/api/v1/instances/activity_controller.rb b/app/controllers/api/v1/instances/activity_controller.rb new file mode 100644 index 000000000..36f52c38d --- /dev/null +++ b/app/controllers/api/v1/instances/activity_controller.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class Api::V1::Instances::ActivityController < Api::BaseController + before_action :require_enabled_api! + + respond_to :json + + def show + render_cached_json('api:v1:instances:activity:show', expires_in: 1.day) { activity } + end + + private + + def activity + weeks = [] + + 12.times do |i| + day = i.weeks.ago.to_date + week_id = day.cweek + week = Date.commercial(day.cwyear, week_id) + + weeks << { + week: week.to_time.to_i.to_s, + statuses: Redis.current.get("activity:statuses:local:#{week_id}") || 0, + logins: Redis.current.pfcount("activity:logins:#{week_id}"), + registrations: Redis.current.get("activity:accounts:local:#{week_id}") || 0, + } + end + + weeks + end + + def require_enabled_api! + head 404 unless Setting.activity_api_enabled + end +end diff --git a/app/controllers/api/v1/instances/peers_controller.rb b/app/controllers/api/v1/instances/peers_controller.rb new file mode 100644 index 000000000..2070c487d --- /dev/null +++ b/app/controllers/api/v1/instances/peers_controller.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class Api::V1::Instances::PeersController < Api::BaseController + before_action :require_enabled_api! + + respond_to :json + + def index + render_cached_json('api:v1:instances:peers:index', expires_in: 1.day) { Account.remote.domains } + end + + private + + def require_enabled_api! + head 404 unless Setting.peers_api_enabled + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a213302cb..51a978f44 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -121,4 +121,13 @@ class ApplicationController < ActionController::Base end end end + + def render_cached_json(cache_key, **options) + data = Rails.cache.fetch(cache_key, { raw: true }.merge(options)) do + yield.to_json + end + + expires_in options[:expires_in], public: true + render json: data + end end diff --git a/app/controllers/auth/confirmations_controller.rb b/app/controllers/auth/confirmations_controller.rb index d5e8e58ed..2fdb281f4 100644 --- a/app/controllers/auth/confirmations_controller.rb +++ b/app/controllers/auth/confirmations_controller.rb @@ -2,10 +2,4 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController layout 'auth' - - def show - super do |user| - BootstrapTimelineWorker.perform_async(user.account_id) if user.errors.empty? - end - end end diff --git a/app/controllers/concerns/user_tracking_concern.rb b/app/controllers/concerns/user_tracking_concern.rb index 8663c3086..1e3132941 100644 --- a/app/controllers/concerns/user_tracking_concern.rb +++ b/app/controllers/concerns/user_tracking_concern.rb @@ -17,6 +17,7 @@ module UserTrackingConcern # Mark as signed-in today current_user.update_tracked_fields!(request) + ActivityTracker.record('activity:logins', current_user.id) # Regenerate feed if needed regenerate_feed! if user_needs_feed_update? diff --git a/app/lib/activity_tracker.rb b/app/lib/activity_tracker.rb new file mode 100644 index 000000000..50e927b0c --- /dev/null +++ b/app/lib/activity_tracker.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class ActivityTracker + EXPIRE_AFTER = 90.days.seconds + + class << self + def increment(prefix) + key = [prefix, current_week].join(':') + + redis.incrby(key, 1) + redis.expire(key, EXPIRE_AFTER) + end + + def record(prefix, value) + key = [prefix, current_week].join(':') + + redis.pfadd(key, value) + redis.expire(key, value) + end + + private + + def redis + Redis.current + end + + def current_week + Time.zone.today.cweek + end + end +end diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index c1d2cf420..dd629279c 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -30,6 +30,10 @@ class Form::AdminSettings :bootstrap_timeline_accounts=, :min_invite_role, :min_invite_role=, + :activity_api_enabled, + :activity_api_enabled=, + :peers_api_enabled, + :peers_api_enabled=, to: Setting ) end diff --git a/app/models/status.rb b/app/models/status.rb index 8579ff9e4..00dcec624 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -135,6 +135,7 @@ class Status < ApplicationRecord end after_create_commit :store_uri, if: :local? + after_create_commit :update_statistics, if: :local? around_create Mastodon::Snowflake::Callbacks @@ -308,4 +309,9 @@ class Status < ApplicationRecord def set_local self.local = account.local? end + + def update_statistics + return unless public_visibility? || unlisted_visibility? + ActivityTracker.increment('activity:statuses:local') + end end diff --git a/app/models/user.rb b/app/models/user.rb index 578622fdf..3ce6517a6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -122,9 +122,19 @@ class User < ApplicationRecord update!(disabled: false) end + def confirm + return if confirmed? + + super + update_statistics! + end + def confirm! + return if confirmed? + skip_confirmation! save! + update_statistics! end def promote! @@ -202,4 +212,9 @@ class User < ApplicationRecord def sanitize_languages filtered_languages.reject!(&:blank?) end + + def update_statistics! + BootstrapTimelineWorker.perform_async(account_id) + ActivityTracker.increment('activity:accounts:local') + end end diff --git a/app/views/admin/settings/edit.html.haml b/app/views/admin/settings/edit.html.haml index c7c25f528..4f9115ed2 100644 --- a/app/views/admin/settings/edit.html.haml +++ b/app/views/admin/settings/edit.html.haml @@ -46,5 +46,13 @@ .fields-group = f.input :bootstrap_timeline_accounts, wrapper: :with_block_label, label: t('admin.settings.bootstrap_timeline_accounts.title'), hint: t('admin.settings.bootstrap_timeline_accounts.desc_html') + %hr/ + + .fields-group + = f.input :activity_api_enabled, as: :boolean, wrapper: :with_label, label: t('admin.settings.activity_api_enabled.title'), hint: t('admin.settings.activity_api_enabled.desc_html') + + .fields-group + = f.input :peers_api_enabled, as: :boolean, wrapper: :with_label, label: t('admin.settings.peers_api_enabled.title'), hint: t('admin.settings.peers_api_enabled.desc_html') + .actions = f.button :button, t('generic.save_changes'), type: :submit diff --git a/config/locales/en.yml b/config/locales/en.yml index 325391cfd..e4425b424 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -265,12 +265,18 @@ en: unresolved: Unresolved view: View settings: + activity_api_enabled: + desc_html: Counts of locally posted statuses, active users, and new registrations in weekly buckets + title: Publish aggregate statistics about user activity bootstrap_timeline_accounts: desc_html: Separate multiple usernames by comma. Only local and unlocked accounts will work. Default when empty is all local admins. title: Default follows for new users contact_information: email: Business e-mail username: Contact username + peers_api_enabled: + desc_html: Domain names this instance has encountered in the fediverse + title: Publish list of discovered instances registrations: closed_message: desc_html: Displayed on frontpage when registrations are closed. You can use HTML tags diff --git a/config/routes.rb b/config/routes.rb index 467849c03..80a2c6d13 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -241,7 +241,11 @@ Rails.application.routes.draw do resources :apps, only: [:create] - resource :instance, only: [:show] + resource :instance, only: [:show] do + resources :peers, only: [:index], controller: 'instances/peers' + resource :activity, only: [:show], controller: 'instances/activity' + end + resource :domain_blocks, only: [:show, :create, :destroy] resources :follow_requests, only: [:index] do diff --git a/config/settings.yml b/config/settings.yml index f03a32e50..4a2519464 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -47,7 +47,8 @@ defaults: &defaults - webmaster - administrator bootstrap_timeline_accounts: '' - + activity_api_enabled: true + peers_api_enabled: true development: <<: *defaults -- cgit From a56c4742d316a3c6f3e7afa927f1a537890317b0 Mon Sep 17 00:00:00 2001 From: beatrix Date: Fri, 29 Dec 2017 20:43:43 -0500 Subject: keep the same filters and page when doing custom emojo stuff (fixes #6112) (#6114) --- app/controllers/admin/custom_emojis_controller.rb | 24 +++++++++++++++------- .../admin/custom_emojis/_custom_emoji.html.haml | 14 ++++++------- app/views/admin/custom_emojis/index.html.haml | 2 +- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/app/controllers/admin/custom_emojis_controller.rb b/app/controllers/admin/custom_emojis_controller.rb index ccab03de4..d61bafdf0 100644 --- a/app/controllers/admin/custom_emojis_controller.rb +++ b/app/controllers/admin/custom_emojis_controller.rb @@ -3,6 +3,7 @@ module Admin class CustomEmojisController < BaseController before_action :set_custom_emoji, except: [:index, :new, :create] + before_action :set_filter_params def index authorize :custom_emoji, :index? @@ -32,23 +33,26 @@ module Admin if @custom_emoji.update(resource_params) log_action :update, @custom_emoji - redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.updated_msg') + flash[:notice] = I18n.t('admin.custom_emojis.updated_msg') else - redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.update_failed_msg') + flash[:alert] = I18n.t('admin.custom_emojis.update_failed_msg') end + redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params) end def destroy authorize @custom_emoji, :destroy? @custom_emoji.destroy! log_action :destroy, @custom_emoji - redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.destroyed_msg') + flash[:notice] = I18n.t('admin.custom_emojis.destroyed_msg') + redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params) end def copy authorize @custom_emoji, :copy? - emoji = CustomEmoji.find_or_initialize_by(domain: nil, shortcode: @custom_emoji.shortcode) + emoji = CustomEmoji.find_or_initialize_by(domain: nil, + shortcode: @custom_emoji.shortcode) emoji.image = @custom_emoji.image if emoji.save @@ -58,21 +62,23 @@ module Admin flash[:alert] = I18n.t('admin.custom_emojis.copy_failed_msg') end - redirect_to admin_custom_emojis_path(page: params[:page]) + redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params) end def enable authorize @custom_emoji, :enable? @custom_emoji.update!(disabled: false) log_action :enable, @custom_emoji - redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.enabled_msg') + flash[:notice] = I18n.t('admin.custom_emojis.enabled_msg') + redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params) end def disable authorize @custom_emoji, :disable? @custom_emoji.update!(disabled: true) log_action :disable, @custom_emoji - redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.disabled_msg') + flash[:notice] = I18n.t('admin.custom_emojis.disabled_msg') + redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params) end private @@ -81,6 +87,10 @@ module Admin @custom_emoji = CustomEmoji.find(params[:id]) end + def set_filter_params + @filter_params = filter_params.to_hash.symbolize_keys + end + def resource_params params.require(:custom_emoji).permit(:shortcode, :image, :visible_in_picker) end diff --git a/app/views/admin/custom_emojis/_custom_emoji.html.haml b/app/views/admin/custom_emojis/_custom_emoji.html.haml index f7fd2538c..fbaa9a174 100644 --- a/app/views/admin/custom_emojis/_custom_emoji.html.haml +++ b/app/views/admin/custom_emojis/_custom_emoji.html.haml @@ -11,18 +11,18 @@ %td - if custom_emoji.local? - if custom_emoji.visible_in_picker - = table_link_to 'eye', t('admin.custom_emojis.listed'), admin_custom_emoji_path(custom_emoji, custom_emoji: { visible_in_picker: false }), method: :patch + = table_link_to 'eye', t('admin.custom_emojis.listed'), admin_custom_emoji_path(custom_emoji, custom_emoji: { visible_in_picker: false }, page: params[:page], **@filter_params), method: :patch - else - = table_link_to 'eye-slash', t('admin.custom_emojis.unlisted'), admin_custom_emoji_path(custom_emoji, custom_emoji: { visible_in_picker: true }), method: :patch + = table_link_to 'eye-slash', t('admin.custom_emojis.unlisted'), admin_custom_emoji_path(custom_emoji, custom_emoji: { visible_in_picker: true }, page: params[:page], **@filter_params), method: :patch - else - if custom_emoji.local_counterpart.present? - = link_to safe_join([custom_emoji_tag(custom_emoji.local_counterpart), t('admin.custom_emojis.overwrite')]), copy_admin_custom_emoji_path(custom_emoji, page: params[:page]), method: :post, class: 'table-action-link' + = link_to safe_join([custom_emoji_tag(custom_emoji.local_counterpart), t('admin.custom_emojis.overwrite')]), copy_admin_custom_emoji_path(custom_emoji, page: params[:page], **@filter_params), method: :post, class: 'table-action-link' - else - = table_link_to 'copy', t('admin.custom_emojis.copy'), copy_admin_custom_emoji_path(custom_emoji, page: params[:page]), method: :post + = table_link_to 'copy', t('admin.custom_emojis.copy'), copy_admin_custom_emoji_path(custom_emoji, page: params[:page], **@filter_params), method: :post %td - if custom_emoji.disabled? - = table_link_to 'power-off', t('admin.custom_emojis.enable'), enable_admin_custom_emoji_path(custom_emoji), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } + = table_link_to 'power-off', t('admin.custom_emojis.enable'), enable_admin_custom_emoji_path(custom_emoji, page: params[:page], **@filter_params), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } - else - = table_link_to 'power-off', t('admin.custom_emojis.disable'), disable_admin_custom_emoji_path(custom_emoji), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } + = table_link_to 'power-off', t('admin.custom_emojis.disable'), disable_admin_custom_emoji_path(custom_emoji, page: params[:page], **@filter_params), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } %td - = table_link_to 'times', t('admin.custom_emojis.delete'), admin_custom_emoji_path(custom_emoji), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } + = table_link_to 'times', t('admin.custom_emojis.delete'), admin_custom_emoji_path(custom_emoji, page: params[:page], **@filter_params), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } diff --git a/app/views/admin/custom_emojis/index.html.haml b/app/views/admin/custom_emojis/index.html.haml index 89ea3a6fe..3a119276c 100644 --- a/app/views/admin/custom_emojis/index.html.haml +++ b/app/views/admin/custom_emojis/index.html.haml @@ -29,7 +29,7 @@ .actions %button= t('admin.accounts.search') - = link_to t('admin.accounts.reset'), admin_accounts_path, class: 'button negative' + = link_to t('admin.accounts.reset'), admin_custom_emojis_path, class: 'button negative' .table-wrapper %table.table -- cgit From f4b80e6511f21b60f71ed182bb66ca6ef0ba9f66 Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Sat, 30 Dec 2017 10:44:19 +0900 Subject: Translate Korean (#6131) Relates to #6125, #6099 --- app/javascript/mastodon/locales/ko.json | 2 ++ config/locales/ko.yml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/app/javascript/mastodon/locales/ko.json b/app/javascript/mastodon/locales/ko.json index 0798fa7cf..7e77b7824 100644 --- a/app/javascript/mastodon/locales/ko.json +++ b/app/javascript/mastodon/locales/ko.json @@ -213,6 +213,7 @@ "search_popout.tips.user": "유저", "search_results.total": "{count, number}건의 결과", "standalone.public_title": "A look inside...", + "status.block": "@{name} 차단", "status.cannot_reblog": "이 포스트는 부스트 할 수 없습니다", "status.delete": "삭제", "status.embed": "공유하기", @@ -221,6 +222,7 @@ "status.media_hidden": "미디어 숨겨짐", "status.mention": "답장", "status.more": "자세히", + "status.mute": "@{name} 뮤트", "status.mute_conversation": "이 대화를 뮤트", "status.open": "상세 정보 표시", "status.pin": "고정", diff --git a/config/locales/ko.yml b/config/locales/ko.yml index a60884b27..9e3505a72 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -265,12 +265,18 @@ ko: unresolved: 미해결 view: 표시 settings: + activity_api_enabled: + desc_html: 주별 로컬에 게시 된 글, 활성 사용자 및 새로운 가입자 수 + title: 유저 활동에 대한 통계 발행 bootstrap_timeline_accounts: desc_html: 콤마로 여러 유저명을 구분. 로컬의 잠기지 않은 계정만 가능합니다. 비워 둘 경우 모든 로컬 관리자가 기본으로 사용 됩니다. title: 새 유저가 팔로우 할 계정들 contact_information: email: 공개할 메일 주소를 입력 username: 아이디를 입력 + peers_api_enabled: + desc_html: 이 인스턴스가 페디버스에서 만났던 도메인 네임들 + title: 발견 된 인스턴스들의 리스트 발행 registrations: closed_message: desc_html: 신규 등록을 받지 않을 때 프론트 페이지에 표시됩니다.
HTML 태그를 사용할 수 있습니다. -- cgit From 513d982f29f4ce4df163c53e4891663ce6742a39 Mon Sep 17 00:00:00 2001 From: David Yip Date: Sat, 30 Dec 2017 17:15:20 -0600 Subject: Use ~ notation in components for image references This uses (more or less) absolute references to external assets, which allows imported stylesheets (like components.scss) to work from other locations that may not have the expected path structure (e.g. the win95 theme). --- app/javascript/styles/mastodon/components.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 207406cc0..0366d7cba 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1758,7 +1758,7 @@ position: absolute; top: 0; left: 0; - background: lighten($ui-base-color, 13%) url('../images/wave-drawer.png') no-repeat bottom / 100% auto; + background: lighten($ui-base-color, 13%) url('~images/wave-drawer.png') no-repeat bottom / 100% auto; box-sizing: border-box; padding: 0; display: flex; @@ -1773,7 +1773,7 @@ } > .mastodon { - background: url('../images/mastodon-drawer.png') no-repeat left bottom / contain; + background: url('~images/mastodon-drawer.png') no-repeat left bottom / contain; flex: 1; } } -- cgit From e4944d065b6bd6c6718c27700971be832ed4861a Mon Sep 17 00:00:00 2001 From: David Yip Date: Sat, 30 Dec 2017 17:17:37 -0600 Subject: Switch to tootsuite's elephant friend for the drawer This version has a transparent background, which works better with the wave. --- app/javascript/images/mastodon-drawer.png | Bin 46174 -> 32449 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/app/javascript/images/mastodon-drawer.png b/app/javascript/images/mastodon-drawer.png index 8fe0df76a..a1fb642a0 100644 Binary files a/app/javascript/images/mastodon-drawer.png and b/app/javascript/images/mastodon-drawer.png differ -- cgit