diff options
author | jessib <jessib@riseup.net> | 2013-12-17 12:02:07 -0800 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-12-17 12:02:07 -0800 |
commit | 98a247acb4d1be484c2982d48ec038eed3de3d55 (patch) | |
tree | f176092fa43145b9d8ce00a180fab70cf62da456 /core/app/helpers | |
parent | 634db9875cc8f6f6b9a4a83dfc6b8d53728eb2b5 (diff) | |
parent | 83cd3d95b78b6df9ac33a8ee169e570f4d3e2eeb (diff) |
Merge branch 'develop' into feature/billing-no-authenticated-payments
Conflicts:
billing/config/locales/en.yml
Diffstat (limited to 'core/app/helpers')
-rw-r--r-- | core/app/helpers/core_helper.rb | 2 | ||||
-rw-r--r-- | core/app/helpers/download_helper.rb | 33 |
2 files changed, 34 insertions, 1 deletions
diff --git a/core/app/helpers/core_helper.rb b/core/app/helpers/core_helper.rb index a496144..4126906 100644 --- a/core/app/helpers/core_helper.rb +++ b/core/app/helpers/core_helper.rb @@ -10,4 +10,4 @@ module CoreHelper render 'common/home_page_buttons' end -end
\ No newline at end of file +end diff --git a/core/app/helpers/download_helper.rb b/core/app/helpers/download_helper.rb new file mode 100644 index 0000000..ee0fe73 --- /dev/null +++ b/core/app/helpers/download_helper.rb @@ -0,0 +1,33 @@ +module DownloadHelper + + def alternative_client_links(os = nil) + alternative_clients(os).map do |client| + link_to(I18n.t("os."+client), client_download_url(client)) + end + end + + def alternative_clients(os = nil) + available_clients - [os] + end + + def client_download_url(os = nil) + client_download_domain + client_download_path(os) + end + + def client_download_path(os) + download_paths[os.to_s] || download_paths['other'] || '' + end + + def available_clients + APP_CONFIG[:available_clients] || [] + end + + def client_download_domain + APP_CONFIG[:client_download_domain] || '' + end + + def download_paths + APP_CONFIG[:download_paths] || {} + end + +end |