]> cat aescling's git repositories - mastodon.git/commitdiff
Adds version to about/more and API (#2181)
authorAsh Furrow <ash@ashfurrow.com>
Fri, 21 Apr 2017 01:30:59 +0000 (21:30 -0400)
committerEugen <eugen@zeonfederated.com>
Fri, 21 Apr 2017 01:30:59 +0000 (03:30 +0200)
* Adds version.

* Cleans up code.

* Removes standalone endpoint and adds version to instance endpoint.

* Addresses feedback from #2181.

app/presenters/instance_presenter.rb
app/views/about/_version.html.haml [new file with mode: 0644]
app/views/about/more.html.haml
app/views/api/v1/instances/show.rabl
config/application.rb
config/locales/en.yml
lib/mastodon/version.rb [new file with mode: 0644]

index 4188650d53bb351e3f0b9cae78b0ed8db4aaff03..e583a38d0ef9cff95270499734e5b440451ee41b 100644 (file)
@@ -25,4 +25,8 @@ class InstancePresenter
   def domain_count
     Rails.cache.fetch('distinct_domain_count') { Account.distinct.count(:domain) }
   end
+
+  def version_number
+    Mastodon::VERSION
+  end
 end
diff --git a/app/views/about/_version.html.haml b/app/views/about/_version.html.haml
new file mode 100644 (file)
index 0000000..f8ebc4c
--- /dev/null
@@ -0,0 +1,4 @@
+.panel
+  .panel-header= t 'about.version'
+  .panel-body
+    %strong= version.version_number
index 8f9cd2f6a0f075091d3c6102f543696e9eec9b28..ab5b21850f5433e3e6e343a010a0c439845ebd3f 100644 (file)
@@ -30,3 +30,4 @@
     .sidebar
       = render 'contact', contact: @instance_presenter
       = render 'links'
+      = render 'version', version: @instance_presenter
index f5598fde386af14f2a50a316895bfc8dd02f03dd..e1d4700a0c36fef28681b66ef8179ce193b8a647 100644 (file)
@@ -4,3 +4,4 @@ node(:uri)         { site_hostname }
 node(:title)       { Setting.site_title }
 node(:description) { Setting.site_description }
 node(:email)       { Setting.site_contact_email }
+node(:version)     { Mastodon::VERSION }
index 59aa7b5f5a256ea2fe630596f9674304a36b870f..e67e3e051e127e288423d153b331f39642e39144 100644 (file)
@@ -9,6 +9,7 @@ Bundler.require(*Rails.groups)
 require_relative '../app/lib/exceptions'
 require_relative '../lib/paperclip/gif_transcoder'
 require_relative '../lib/paperclip/video_transcoder'
+require_relative '../lib/mastodon/version'
 
 Dotenv::Railtie.load
 
index c7b6a17d68f88ff31263fb15e2aa528f2a499fda..c1438134f7eb0e1d2f6073d567c7fa668a66e936 100644 (file)
@@ -29,6 +29,7 @@ en:
     terms: Terms
     user_count_after: users
     user_count_before: Home to
+    version: Version
   accounts:
     follow: Follow
     followers: Followers
diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb
new file mode 100644 (file)
index 0000000..51cf2e5
--- /dev/null
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+module Mastodon
+  VERSION = '1.2.2'
+end