Merge pull request #5410 from svbergerem/configurable-source-url

Make source code url configurable

Conflicts:
	config/diaspora.yml.example
This commit is contained in:
Jonne Haß 2014-11-29 23:46:02 +01:00
commit 2ab16d473c
5 changed files with 14 additions and 3 deletions

View file

@ -116,6 +116,7 @@ This is disabled by default since it requires the installation of additional pac
* Display diaspora handle in search results [#5419](https://github.com/diaspora/diaspora/pull/5419) * Display diaspora handle in search results [#5419](https://github.com/diaspora/diaspora/pull/5419)
* Show a message on the ignored users page when there are none [#5434](https://github.com/diaspora/diaspora/pull/5434) * Show a message on the ignored users page when there are none [#5434](https://github.com/diaspora/diaspora/pull/5434)
* Truncate too long OpenGraph descriptions [#5387](https://github.com/diaspora/diaspora/pull/5387) * Truncate too long OpenGraph descriptions [#5387](https://github.com/diaspora/diaspora/pull/5387)
* Make the source code URL configurable [#5410](https://github.com/diaspora/diaspora/pull/5410)
# 0.4.1.2 # 0.4.1.2

View file

@ -4,11 +4,11 @@
module ApplicationHelper module ApplicationHelper
def pod_name def pod_name
AppConfig.settings.pod_name.present? ? AppConfig.settings.pod_name : "diaspora*" AppConfig.settings.pod_name
end end
def pod_version def pod_version
AppConfig.version.number.present? ? AppConfig.version.number : "" AppConfig.version.number
end end
def changelog_url def changelog_url
@ -17,6 +17,10 @@ module ApplicationHelper
url url
end end
def source_url
AppConfig.settings.source_url.presence || "#{root_path.chomp('/')}/source.tar.gz"
end
def timeago(time, options={}) def timeago(time, options={})
timeago_tag(time, options.merge(:class => 'timeago', :title => time.iso8601, :force => true)) if time timeago_tag(time, options.merge(:class => 'timeago', :title => time.iso8601, :force => true)) if time
end end

View file

@ -1,7 +1,7 @@
%li= link_to 'diasporafoundation.org', "https://diasporafoundation.org" %li= link_to 'diasporafoundation.org', "https://diasporafoundation.org"
%li= link_to 'wiki', "https://wiki.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.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) %li= link_to(t('layouts.application.toggle'), toggle_mobile_path)
- if AppConfig.settings.terms.enable? - if AppConfig.settings.terms.enable?
%li= link_to(t('_terms'), terms_path) %li= link_to(t('_terms'), terms_path)

View file

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

View file

@ -505,6 +505,11 @@ configuration: ## Section
## Limit queuing for removal per day. ## Limit queuing for removal per day.
#limit_removals_to_per_day: 100 #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). ## Posting from Diaspora to external services (all are disabled by default).
services: ## Section services: ## Section