1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-12-01 05:43:04 +00:00

chore(ui): display branch in footer if present

هذا الالتزام موجود في:
Adam Cooke
2024-03-20 14:30:32 +00:00
الأصل bee509832e
التزام 18236171eb
3 ملفات معدلة مع 22 إضافات و1 حذوفات

عرض الملف

@@ -100,4 +100,11 @@ module ApplicationHelper
end.html_safe
end
def postal_version_string
string = Postal.version
string += " (#{Postal.branch})" if Postal.branch &&
Postal.branch != "main"
string
end
end

عرض الملف

@@ -55,6 +55,8 @@
%footer.siteContent__footer
%ul.footer__links
%li.footer__name
Powered by #{link_to "Postal", "https://postalserver.io", target: '_blank'} #{Postal.version}.
Powered by
#{link_to "Postal", "https://postalserver.io", target: '_blank'}
#{postal_version_string}
%li= link_to "Documentation", "https://docs.postalserver.io", target: '_blank'
%li= link_to "Ask for help", "https://discussions.postalserver.io", target: '_blank'

عرض الملف

@@ -153,6 +153,18 @@ module Postal
ActiveRecord::Base.establish_connection(config.merge(pool: new_size))
end
# Return the branch name which created this release
#
# @return [String, nil]
def branch
return @branch if instance_variable_defined?("@branch")
@branch = begin
path = Rails.root.join("BRANCH")
File.read(path).strip if File.exist?(path)
end
end
end
Config = initialize_config