Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new url helper for progress.com and updated footer links #2038

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/supermarket/app/helpers/custom_url_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def chef_domain
ENV["CHEF_DOMAIN"] || "chef.io"
end

def progress_domain
ENV["PROGRESS_DOMAIN"] || "progress.com"
end

def chef_server_url
ENV["CHEF_SERVER_URL"] || "https://api.chef.io"
end
Expand All @@ -18,6 +22,11 @@ def chef_www_url(extra = nil)
extra_dispatch(url, extra)
end

def progress_www_url(extra = nil)
url = ENV["CHEF_WWW_URL"] || "https://www.#{progress_domain}"
extra_dispatch(url, extra)
end

def chef_blog_url(extra = nil)
url = ENV["CHEF_BLOG_URL"] || "#{chef_www_url}/blog"
extra_dispatch(url, extra)
Expand Down
6 changes: 3 additions & 3 deletions src/supermarket/app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
<footer class="footer">
&copy; 2008&thinsp;&ndash;&thinsp;<%= Time.new.year %> Chef Software, Inc. All Rights Reserved.
<br><br><%= link_to 'Code of Conduct', chef_docs_url('community_guidelines.html') %>
<%= link_to 'Terms and Conditions of Use', chef_www_url('terms-of-service') %>
<%= link_to 'Privacy Policy', chef_www_url('privacy-policy') %>
<%= link_to 'Trademark Policy', chef_www_url('trademark-policy') %>
<%= link_to 'Terms and Conditions of Use', progress_www_url('legal/terms-of-use') %>
<%= link_to 'Privacy Policy', progress_www_url('legal/privacy-policy') %>
<%= link_to 'Trademark Policy', progress_www_url('legal/trademarks') %>
<%= link_to 'Status', chef_status_url %>
</footer>

Expand Down
5 changes: 5 additions & 0 deletions src/supermarket/spec/helpers/custom_url_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
expect(helper.chef_domain).to eql("chef.io")
end

it "should have a default progress domain" do
expect(ENV["PROGRESS_DOMAIN"]).to be_nil
expect(helper.progress_domain).to eql("progress.com")
end

it "should have a server url" do
expect(ENV["CHEF_SERVER_URL"]).to be_nil
expect(helper.chef_server_url).to eql("https://api.chef.io")
Expand Down