From b7cf758fbed204f117350bc8636fc3d610f60eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Tue, 25 Jul 2017 21:54:12 +0200 Subject: [PATCH] Fix JS errors and add back commit hash --- .../mastodon/features/compose/components/compose_form.js | 1 - app/presenters/instance_presenter.rb | 4 ++-- app/views/about/more.html.haml | 8 ++++++-- app/views/about/show.html.haml | 8 ++++++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 708978481..67906594f 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -19,7 +19,6 @@ import WarningContainer from '../containers/warning_container'; import { isMobile } from '../../../is_mobile'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { length } from 'stringz'; -import { isMobile } from '../../../is_mobile'; const messages = defineMessages({ placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What is on your mind?' }, diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb index 19bedcc21..4de6b5e0d 100644 --- a/app/presenters/instance_presenter.rb +++ b/app/presenters/instance_presenter.rb @@ -35,9 +35,9 @@ class InstancePresenter def commit_hash current_release_file = Pathname.new('CURRENT_RELEASE').expand_path if current_release_file.file? - IO.read(current_release_file) + IO.read(current_release_file).strip! else - "" + '' end end end diff --git a/app/views/about/more.html.haml b/app/views/about/more.html.haml index 11315fefa..ed491495b 100644 --- a/app/views/about/more.html.haml +++ b/app/views/about/more.html.haml @@ -60,5 +60,9 @@ .footer-links .container %p - = link_to t('about.source_code'), 'https://github.com/tootsuite/mastodon' - = " (#{@instance_presenter.version_number})" + = link_to t('about.source_code'), 'https://github.com/glitch-soc/mastodon' + - if @instance_presenter.commit_hash == "" + %strong= @instance_presenter.version_number + - else + %strong= "#{@instance_presenter.version_number}, " + %strong= "#{@instance_presenter.commit_hash}" diff --git a/app/views/about/show.html.haml b/app/views/about/show.html.haml index a3c8e4a84..b78e181ec 100644 --- a/app/views/about/show.html.haml +++ b/app/views/about/show.html.haml @@ -73,5 +73,9 @@ .footer-links .container %p - = link_to t('about.source_code'), 'https://github.com/tootsuite/mastodon' - = " (#{@instance_presenter.version_number})" + = link_to t('about.source_code'), 'https://github.com/glitch-soc/mastodon' + - if @instance_presenter.commit_hash == "" + %strong= " (#{@instance_presenter.version_number})" + - else + %strong= " (#{@instance_presenter.version_number}, " + %strong= " #{@instance_presenter.commit_hash})"