mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
Move url generation to helper, made it reliable with ssh git checkout
This commit is contained in:
parent
1fabdb6a72
commit
197d199215
6 changed files with 15 additions and 6 deletions
|
@ -33,6 +33,15 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def current_commit_link
|
||||||
|
hash = CURRENT_COMMIT_HASH
|
||||||
|
current_repo = CURRENT_COMMIT_REPO.gsub('com:', 'com/')
|
||||||
|
.gsub('git@', 'https://')
|
||||||
|
.gsub('.git', '')
|
||||||
|
|
||||||
|
link_to hash.to_s, "#{current_repo}/commit/#{hash}", class: 'footer-version-link'
|
||||||
|
end
|
||||||
|
|
||||||
def creator_link(model)
|
def creator_link(model)
|
||||||
return 'not present' if model.blank?
|
return 'not present' if model.blank?
|
||||||
return 'unknown' if model.creator.blank?
|
return 'unknown' if model.creator.blank?
|
||||||
|
@ -96,4 +105,4 @@ module ApplicationHelper
|
||||||
def body_css_class
|
def body_css_class
|
||||||
[controller_path.split('/').map!(&:dasherize), action_name.dasherize, 'page'].join('-')
|
[controller_path.split('/').map!(&:dasherize), action_name.dasherize, 'page'].join('-')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,5 +32,5 @@
|
||||||
|
|
||||||
.footer.text-right
|
.footer.text-right
|
||||||
Version
|
Version
|
||||||
= link_to "#{CURRENT_COMMIT_HASH}", "#{CURRENT_COMMIT_REPO}/commits/#{CURRENT_COMMIT_HASH}", class: 'footer-version-link'
|
= current_commit_link
|
||||||
= javascript_include_tag 'admin-manifest', async: true
|
= javascript_include_tag 'admin-manifest', async: true
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Version
|
Version
|
||||||
<%= link_to(CURRENT_COMMIT_HASH, "#{CURRENT_COMMIT_REPO}/commits/#{CURRENT_COMMIT_HASH}", class: 'footer-version-link') %>
|
<%= current_commit_link %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Version
|
Version
|
||||||
<%= link_to(CURRENT_COMMIT_HASH, "#{CURRENT_COMMIT_REPO}/commits/#{CURRENT_COMMIT_HASH}", class: 'footer-version-link') %>
|
<%= current_commit_link %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Version
|
Version
|
||||||
<%= link_to(CURRENT_COMMIT_HASH, "#{CURRENT_COMMIT_REPO}/commits/#{CURRENT_COMMIT_HASH}", class: 'footer-version-link') %>
|
<%= current_commit_link %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
CURRENT_COMMIT_HASH = `git rev-parse --short HEAD`
|
CURRENT_COMMIT_HASH = `git rev-parse --short HEAD`
|
||||||
CURRENT_COMMIT_REPO = `git remote get-url origin`
|
CURRENT_COMMIT_REPO = `git remote get-url origin`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue