add a podname app config var, and use it throughout the app
This commit is contained in:
parent
bc41ed839b
commit
82c4e0d577
10 changed files with 35 additions and 15 deletions
|
|
@ -36,7 +36,7 @@
|
|||
<a href="/" id="home-button">
|
||||
<span class="label label-inverse">
|
||||
<span>
|
||||
DIASPORA
|
||||
{{t "pod_name"}}
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
|
|
@ -44,7 +44,9 @@
|
|||
</div>
|
||||
|
||||
<h1>
|
||||
<a href='/stream?ex=true' class='logo'>DIASPORA</a>
|
||||
<a href='/stream?ex=true' class='logo'>
|
||||
{{t "pod_name"}}
|
||||
</a>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@
|
|||
# the COPYRIGHT file.
|
||||
|
||||
module ApplicationHelper
|
||||
def pod_name
|
||||
AppConfig[:pod_name].present? ? AppConfig[:pod_name] : "DIASPORA*"
|
||||
end
|
||||
|
||||
def how_long_ago(obj)
|
||||
timeago(obj.created_at)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ module LanguageHelper
|
|||
defaults.deep_merge!(translations)
|
||||
end
|
||||
|
||||
defaults['pluralization_rule'] = I18n.t 'i18n.plural.js_rule', :locale => language
|
||||
|
||||
defaults['pluralization_rule'] = I18n.t('i18n.plural.js_rule', :locale => language)
|
||||
defaults['pod_name'] = pod_name
|
||||
defaults
|
||||
end
|
||||
|
||||
|
|
@ -26,6 +26,6 @@ module LanguageHelper
|
|||
end
|
||||
|
||||
def rtl?
|
||||
@rtl ||= RTL_LANGUAGES.include? I18n.locale.to_s
|
||||
@rtl ||= RTL_LANGUAGES.include?(I18n.locale.to_s)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
# to do so you may need to add this line to your ApplicationController
|
||||
# helper :layout
|
||||
module LayoutHelper
|
||||
include ApplicationHelper
|
||||
|
||||
def title(page_title, show_title = true)
|
||||
content_for(:title) { page_title.to_s }
|
||||
@show_title = show_title
|
||||
|
|
@ -14,7 +16,7 @@ module LayoutHelper
|
|||
|
||||
def page_title(text=nil)
|
||||
return text unless text.blank?
|
||||
"Diaspora*"
|
||||
pod_name
|
||||
end
|
||||
|
||||
def set_asset_host
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
|
||||
- content_for :page_title do
|
||||
Diaspora*
|
||||
= pod_name
|
||||
|
||||
- begin
|
||||
= render :partial => 'home/show'
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
%html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'}
|
||||
%head
|
||||
%title
|
||||
DIASPORA*
|
||||
= pod_name
|
||||
|
||||
%meta{:name => "description", :content => "Diaspora* Mobile"}
|
||||
%meta{:name => "author", :content => "Diaspora, Inc."}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
= content_for :page_title do
|
||||
= "Diaspora* / #{t('devise.sessions.new.sign_in')}"
|
||||
= "#{pod_name} / #{t('devise.sessions.new.sign_in')}"
|
||||
|
||||
= content_for :head do
|
||||
= javascript_include_tag :login
|
||||
|
|
|
|||
|
|
@ -89,6 +89,9 @@ defaults: &defaults
|
|||
# General Pod Settings
|
||||
######################################################
|
||||
|
||||
## Name of your pod
|
||||
pod_name: "Diaspora*"
|
||||
|
||||
## Set this to true to prevent people from signing up for your pod
|
||||
## without an invitation. Note that this needs to be true even for
|
||||
## the first registration (you).
|
||||
|
|
@ -104,11 +107,6 @@ defaults: &defaults
|
|||
#the 'admin' account for your pod... ie for jd.com, this is diasporahq
|
||||
admin_account: ''
|
||||
|
||||
## Here, you can turn specific users into admins
|
||||
admins:
|
||||
#- 'admin'
|
||||
#- 'me'
|
||||
|
||||
## Settings about invitations
|
||||
|
||||
# Set this to true if you want users to invite as many people as they want
|
||||
|
|
|
|||
|
|
@ -83,4 +83,17 @@ describe ApplicationHelper do
|
|||
jquery_include_tag.should match(/jQuery\.ajaxSetup/)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#pod_name' do
|
||||
it 'defaults to Diaspora*' do
|
||||
pod_name.should == 'DIASPORA*'
|
||||
end
|
||||
|
||||
it 'displays the supplied AppConfig[:pod_name] if it is set' do
|
||||
old_name = AppConfig[:pod_name]
|
||||
AppConfig[:pod_name] = "Catspora"
|
||||
pod_name.should == "Catspora"
|
||||
AppConfig[:pod_name] = old_name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe LayoutHelper do
|
||||
include ApplicationHelper
|
||||
before do
|
||||
@user = alice
|
||||
end
|
||||
|
|
@ -18,7 +19,7 @@ describe LayoutHelper do
|
|||
|
||||
context "passed blank text" do
|
||||
it "returns Diaspora*" do
|
||||
page_title.should == "Diaspora*"
|
||||
page_title.should == pod_name
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue