Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
diaspora
Commits
82c4e0d5
Commit
82c4e0d5
authored
May 30, 2012
by
Maxwell Salzberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a podname app config var, and use it throughout the app
parent
bc41ed83
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
15 deletions
+35
-15
app/assets/templates/stream.jst.hbs
app/assets/templates/stream.jst.hbs
+4
-2
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+4
-0
app/helpers/language_helper.rb
app/helpers/language_helper.rb
+3
-3
app/helpers/layout_helper.rb
app/helpers/layout_helper.rb
+3
-1
app/views/home/show.html.haml
app/views/home/show.html.haml
+1
-1
app/views/layouts/application.mobile.haml
app/views/layouts/application.mobile.haml
+1
-1
app/views/sessions/new.haml
app/views/sessions/new.haml
+1
-1
config/application.yml.example
config/application.yml.example
+3
-5
spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
+13
-0
spec/helpers/layout_helper_spec.rb
spec/helpers/layout_helper_spec.rb
+2
-1
No files found.
app/assets/templates/stream.jst.hbs
View file @
82c4e0d5
...
...
@@ -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>
...
...
app/helpers/application_helper.rb
View file @
82c4e0d5
...
...
@@ -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
...
...
app/helpers/language_helper.rb
View file @
82c4e0d5
...
...
@@ -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
app/helpers/layout_helper.rb
View file @
82c4e0d5
...
...
@@ -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
...
...
app/views/home/show.html.haml
View file @
82c4e0d5
...
...
@@ -4,7 +4,7 @@
-
content_for
:page_title
do
Diaspora*
=
pod_name
-
begin
=
render
:partial
=>
'home/show'
...
...
app/views/layouts/application.mobile.haml
View file @
82c4e0d5
...
...
@@ -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."
}
...
...
app/views/sessions/new.haml
View file @
82c4e0d5
...
...
@@ -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
...
...
config/application.yml.example
View file @
82c4e0d5
...
...
@@ -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
...
...
spec/helpers/application_helper_spec.rb
View file @
82c4e0d5
...
...
@@ -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
spec/helpers/layout_helper_spec.rb
View file @
82c4e0d5
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment