diff options
author | David O'Regan <doregan@gitlab.com> | 2020-07-15 03:00:04 +0300 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2020-07-15 03:00:04 +0300 |
commit | c830fa5f1ceffdc4d3ba7da0e63a95c67df62e2e (patch) | |
tree | ec50fa1d3819aafa2ebeaf3940f13de0b3fa2ee9 /layouts/footer.html | |
parent | 2e3648751f5c74c83f3078776bb1fff3a5aee5ef (diff) |
Update footer links
Diffstat (limited to 'layouts/footer.html')
-rw-r--r-- | layouts/footer.html | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/layouts/footer.html b/layouts/footer.html index 11aacd84..775970f7 100644 --- a/layouts/footer.html +++ b/layouts/footer.html @@ -1,8 +1,11 @@ <footer class="pl-4 pr-3 border-top footer"> <div class="row py-2"> <div class="col-9"> - <a href="<%= edit_on_gitlab(@item) %>"><span class="text-decoration-underline">Edit this page</span></a> - <a href="<%= edit_on_gitlab(@item, editor: :webide) %>">(<span class="text-decoration-underline">Web IDE</span>)</a> + <% if is_production? && ENV['CI_COMMIT_REF_NAME'] == 'master' %> + <%# Show Edit button only in production and on master branch (hide archives) %> + <a href="<%= edit_on_gitlab(@item) %>"><span class="text-decoration-underline">Edit this page</span></a> + <a href="<%= edit_on_gitlab(@item, editor: :webide) %>">(<span class="text-decoration-underline">Web IDE</span>)</a> + <% end %> </div> <div class="col-3 p-0 m-0"> <div class="d-none d-md-flex justify-content-end"> @@ -29,18 +32,23 @@ </div> <div class="col-12 py-1"> <ul class="list-unstyled list-inline my-0 d-flex flex-wrap"> - <li> - <a href='https://gitlab.com/gitlab-org/gitlab' target='_blank' class="text-dark font-weight-bold pr-2 text-decoration-none">GitLab</a> - </li> - <li> - <a href='https://gitlab.com/gitlab-org/omnibus-gitlab' target='_blank' class="text-dark font-weight-bold px-2 text-decoration-none">Omnibus</a> - </li> - <li> - <a href='https://gitlab.com/gitlab-org/gitlab-runner' target='_blank' class="text-dark font-weight-bold px-2 text-decoration-none">Runner</a> - </li> - <li> - <a href='https://gitlab.com/gitlab-org/charts/gitlab' target='_blank' class="text-dark font-weight-bold px-2 text-decoration-none">Charts</a> - </li> + <% if is_production? %> + <% @config[:products].each do |name, product| %> + <% if product[:expose] == true %> + <li> + <a href='<%= @items["/#{product[:slug]}/#{product[:index_file]}"].path %>' target='_blank' class="text-dark font-weight-bold text-decoration-none <% if product[:short_name] == 'GitLab' %> pr-2 <% else %> px-2 <% end %>"><%= product[:short_name] %></a> + </li> + <% end %> + <% end %> + <% else %> + <% @config[:products].each do |name, product| %> + <% if Dir.exist?("#{@config[:content_dir]}/#{product[:slug]}")%> + <li> + <a href='<%= @items["/#{product[:slug]}/#{product[:index_file]}"].path %>' target='_blank' class="text-dark font-weight-bold text-decoration-none <% if product[:short_name] == 'GitLab' %> pr-2 <% else %> px-2 <% end %>"><%= product[:short_name] %></a> + </li> + <% end %> + <% end %> + <% end %> </ul> </div> <div class="col-12 py-1"> |