From 55f881da08767254c5e493843bd45ed648f193df Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Sat, 22 Nov 2014 20:03:21 +0100 Subject: [PATCH] Make source code url configurable --- app/helpers/application_helper.rb | 8 ++++++-- app/views/shared/_links.haml | 2 +- config/defaults.yml | 1 + config/diaspora.yml.example | 5 +++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2a8999d3b..80112f31a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -4,11 +4,11 @@ module ApplicationHelper def pod_name - AppConfig.settings.pod_name.present? ? AppConfig.settings.pod_name : "diaspora*" + AppConfig.settings.pod_name end def pod_version - AppConfig.version.number.present? ? AppConfig.version.number : "" + AppConfig.version.number end def changelog_url @@ -17,6 +17,10 @@ module ApplicationHelper url end + def source_url + AppConfig.settings.source_url.presence || "#{root_path.chomp('/')}/source.tar.gz" + end + def timeago(time, options={}) timeago_tag(time, options.merge(:class => 'timeago', :title => time.iso8601, :force => true)) if time end diff --git a/app/views/shared/_links.haml b/app/views/shared/_links.haml index 0607a3e82..9287c3e3d 100644 --- a/app/views/shared/_links.haml +++ b/app/views/shared/_links.haml @@ -1,7 +1,7 @@ %li= link_to 'diasporafoundation.org', "https://diasporafoundation.org" %li= link_to 'wiki', "https://wiki.diasporafoundation.org" %li= link_to t('layouts.application.whats_new'), changelog_url -%li= link_to(t('layouts.header.code') + " " + pod_version, "#{root_path.chomp('/')}/source.tar.gz", {:title => t('layouts.application.source_package')}) unless request.url.match(/joindiaspora.com/) +%li= link_to t('layouts.header.code') + " " + pod_version, "#{source_url}", {:title => t('layouts.application.source_package')} %li= link_to(t('layouts.application.toggle'), toggle_mobile_path) - if AppConfig.settings.terms.enable? %li= link_to(t('_terms'), terms_path) diff --git a/config/defaults.yml b/config/defaults.yml index 1200253a7..4049cc241 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -133,6 +133,7 @@ defaults: after_days: 730 warn_days: 30 limit_removals_to_per_day: 100 + source_url: services: facebook: enable: false diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index 8ee1e2d5f..0f3335151 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -473,6 +473,11 @@ configuration: ## Section ## Limit queuing for removal per day. #limit_removals_to_per_day: 100 + ## Source code URL + ## URL to the source code your pod is currently running. + ## If not set your pod will provide a downloadable archive. + #source_url: 'https://example.org/username/diaspora' + ## Posting from Diaspora to external services (all are disabled by default) services: ## Section