]> cat aescling's git repositories - mastodon.git/commitdiff
Added '(dev)' to the title in development mode (#2524)
authorAshley <expenses@airmail.cc>
Thu, 27 Apr 2017 13:17:55 +0000 (01:17 +1200)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 27 Apr 2017 13:17:55 +0000 (15:17 +0200)
* Added different title for dev

* Changed indentation

app/helpers/application_helper.rb
app/views/layouts/application.html.haml

index d25b12998ab2b2033a732a5f8635fdf6362d775d..14c7447c052a2d449c9f59ed616cdf82db40bd28 100644 (file)
@@ -18,4 +18,8 @@ module ApplicationHelper
     env_suffix = Rails.env.production? ? '' : '-dev'
     asset_path "favicon#{env_suffix}.ico"
   end
+
+  def title
+    Rails.env.production? ? site_title : "#{site_title} (Dev)"
+  end
 end
index 01c42db93572c6bfa58bd0209c9b97edbf69f92e..602d502a9e4b1f272e1b0da6a5029e100faa80c0 100755 (executable)
@@ -17,7 +17,7 @@
       - if content_for?(:page_title)
         = yield(:page_title)
         = ' - '
-      = site_title
+      = title
 
     = stylesheet_link_tag stylesheet_for_layout, media: 'all'
     = csrf_meta_tags