mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-06 04:34:06 +08:00
Add an environmental variable to toggle version display in navbar
The variable is called NAVBAR_SHOW_VERSION. If not specified, it defaults to the current behavior (version is hidden on production, but visible on development & test environments).
This commit is contained in:
parent
31f6379866
commit
9f998d6fed
1 changed files with 9 additions and 3 deletions
|
@ -10,13 +10,19 @@
|
|||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="<%= root_path %>">
|
||||
<% if Rails.env.production? %>
|
||||
<img src="/images/logo.png" id="logo">
|
||||
<% else %>
|
||||
<%
|
||||
show_version = !Rails.env.production?
|
||||
if ENV['NAVBAR_SHOW_VERSION'].present?
|
||||
show_version = YAML.load(ENV['NAVBAR_SHOW_VERSION'])
|
||||
end
|
||||
%>
|
||||
<% if show_version %>
|
||||
<img src="/images/logo.png" class="with-version" id="logo">
|
||||
<span class="version">
|
||||
<%= Constants::APP_VERSION %>
|
||||
</span>
|
||||
<% else %>
|
||||
<img src="/images/logo.png" id="logo">
|
||||
<% end %>
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue