Make source code url configurable

This commit is contained in:
Steffen van Bergerem 2014-11-22 20:03:21 +01:00
parent c0aa5565cc
commit 55f881da08
4 changed files with 13 additions and 3 deletions

View file

@ -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

View file

@ -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)

View file

@ -133,6 +133,7 @@ defaults:
after_days: 730
warn_days: 30
limit_removals_to_per_day: 100
source_url:
services:
facebook:
enable: false

View file

@ -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