From e7091074636c519a5c0bd52c8ef85fa3c5df4656 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 14 Jul 2018 03:56:34 +0200 Subject: [PATCH] Display Mastodon version in footer of web UI (#8013) Fix #7846 --- app/javascript/mastodon/features/getting_started/index.js | 4 ++-- app/javascript/mastodon/initial_state.js | 1 + app/serializers/initial_state_serializer.rb | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/features/getting_started/index.js b/app/javascript/mastodon/features/getting_started/index.js index 99642c9115..074ab01c8b 100644 --- a/app/javascript/mastodon/features/getting_started/index.js +++ b/app/javascript/mastodon/features/getting_started/index.js @@ -7,7 +7,7 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { me, invitesEnabled } from '../../initial_state'; +import { me, invitesEnabled, version } from '../../initial_state'; import { fetchFollowRequests } from '../../actions/accounts'; import { List as ImmutableList } from 'immutable'; import { Link } from 'react-router-dom'; @@ -149,7 +149,7 @@ export default class GettingStarted extends ImmutablePureComponent { tootsuite/mastodon }} + values={{ github: tootsuite/mastodon (v{version}) }} />

diff --git a/app/javascript/mastodon/initial_state.js b/app/javascript/mastodon/initial_state.js index 807262fd7b..6ffb4cbfb2 100644 --- a/app/javascript/mastodon/initial_state.js +++ b/app/javascript/mastodon/initial_state.js @@ -12,5 +12,6 @@ export const deleteModal = getMeta('delete_modal'); export const me = getMeta('me'); export const searchEnabled = getMeta('search_enabled'); export const invitesEnabled = getMeta('invites_enabled'); +export const version = getMeta('version'); export default initialState; diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb index 42d0e4bf32..78b96298c5 100644 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@ -14,6 +14,7 @@ class InitialStateSerializer < ActiveModel::Serializer domain: Rails.configuration.x.local_domain, admin: object.admin&.id&.to_s, search_enabled: Chewy.enabled?, + version: Mastodon::Version.to_s, invites_enabled: Setting.min_invite_role == 'user', }