Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2018-03-23 16:44:20 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2018-03-23 16:44:20 +0300
commite701ed398ab9b2ac252742a056ec4c232ff75a71 (patch)
treea4f31395e39a033a223c820bd1c17f9a3072e727 /layouts
parente3984c342e48ab8de7d78965c8d5a48174f9d8d9 (diff)
Hide Edit button from archives, show only on master
Diffstat (limited to 'layouts')
-rw-r--r--layouts/default.html3
-rw-r--r--layouts/footer.html3
2 files changed, 6 insertions, 0 deletions
diff --git a/layouts/default.html b/layouts/default.html
index d09455d9..b08da70f 100644
--- a/layouts/default.html
+++ b/layouts/default.html
@@ -43,9 +43,12 @@
<div class="article-content js-article-content">
<%= yield %>
</div>
+ <% if ENV['NANOC_ENV'] == 'production' && ENV['CI_COMMIT_REF_NAME'] == 'master' %>
+ <%# Show Edit button only in production and on master branch (hide archives) %>
<div class="edit-on">
<%= edit_on_gitlab(@item) %>
</div>
+ <% end %>
<% if @item[:last_updated] %>
<hr>
<p class="last-updated">
diff --git a/layouts/footer.html b/layouts/footer.html
index 8212535d..384a4393 100644
--- a/layouts/footer.html
+++ b/layouts/footer.html
@@ -2,9 +2,12 @@
<%= render '/footer_links.*' %>
<div class='animated text-center source-link'>
<a href='https://gitlab.com/gitlab-com/gitlab-docs' target='_blank'>Created</a> with Nanoc, hosted on <a href='https://about.gitlab.com/features/pages/' target='_blank'>GitLab Pages</a>
+ <% if ENV['NANOC_ENV'] == 'production' && ENV['CI_COMMIT_REF_NAME'] == 'master' %>
+ <%# Show Edit button only in production and on master branch (hide archives) %>
<div class="edit-on">
<i class="fa fa-code-fork" aria-hidden="true"></i>
<%= edit_on_gitlab(@item) %>
</div>
+ <% end %>
</div>
</footer>