refactor AppConfig to guess what services are configured, and clean up the services view for a user. also, add a box so people can realize what they can connect
This commit is contained in:
parent
20e2a16717
commit
2f1118f95f
5 changed files with 33 additions and 10 deletions
|
|
@ -60,6 +60,7 @@ HELP
|
||||||
|
|
||||||
normalize_pod_url
|
normalize_pod_url
|
||||||
normalize_admins
|
normalize_admins
|
||||||
|
normalize_pod_services
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.config_file_is_old_style?
|
def self.config_file_is_old_style?
|
||||||
|
|
@ -92,6 +93,19 @@ HELP
|
||||||
self[:admins].collect! { |username| username.downcase }
|
self[:admins].collect! { |username| username.downcase }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.normalize_pod_services
|
||||||
|
if defined?(SERVICES)
|
||||||
|
puts "in here"
|
||||||
|
connected_services = []
|
||||||
|
SERVICES.keys.each do |service|
|
||||||
|
unless SERVICES[service].keys.any?{|service_key| SERVICES[service][service_key].blank?}
|
||||||
|
connected_services << service
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self['configured_services'] = connected_services
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
load!
|
load!
|
||||||
|
|
||||||
def self.[] (key)
|
def self.[] (key)
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,18 @@
|
||||||
= t('.cubbies.explanation')
|
= t('.cubbies.explanation')
|
||||||
= link_to t('.cubbies.learn_more'), token_path
|
= link_to t('.cubbies.learn_more'), token_path
|
||||||
|
|
||||||
|
.section
|
||||||
|
.title
|
||||||
|
= image_tag('/images/icons/monotone_wrench_settings.png')
|
||||||
|
%h5
|
||||||
|
= t('.services.heading')
|
||||||
|
.content
|
||||||
|
= t('.services.content')
|
||||||
|
- AppConfig.configured_services.each do |service|
|
||||||
|
- unless current_user.services.any?{|x| x.provider == service}
|
||||||
|
%br= link_to service.titleize, "/auth/#{service}"
|
||||||
|
|
||||||
|
|
||||||
- if @invites > 0
|
- if @invites > 0
|
||||||
.section
|
.section
|
||||||
.title
|
.title
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,6 @@
|
||||||
- else
|
- else
|
||||||
You haven't connected any services yet.
|
You haven't connected any services yet.
|
||||||
|
|
||||||
- unless @services.any?{|x| x.provider == 'twitter'}
|
- AppConfig.configured_services.each do |service|
|
||||||
%h4= link_to t('services.index.connect_to_twitter'), "/auth/twitter" if SERVICES['twitter'] && SERVICES['twitter']['consumer_key']!= ""
|
- unless @services.any?{|x| x.provider == service}
|
||||||
|
%h4= link_to t("services.index.connect_to_#{service}"), "/auth/#{service}"
|
||||||
- unless @services.any?{|x| x.provider == 'facebook'}
|
|
||||||
%h4= link_to t('services.index.connect_to_facebook'), "/auth/facebook" if SERVICES['facebook'] && SERVICES['facebook']['app_id'] !=""
|
|
||||||
|
|
||||||
- unless @services.any?{|x| x.provider == 'tumblr'}
|
|
||||||
%h4= link_to t('services.index.connect_to_tumblr'), "/auth/tumblr" if SERVICES['tumblr'] && SERVICES['tumblr']['consumer_key'] !=""
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ en:
|
||||||
seed:
|
seed:
|
||||||
family: "Family"
|
family: "Family"
|
||||||
work: "Work"
|
work: "Work"
|
||||||
index:
|
index:
|
||||||
your_aspects: "Your Aspects"
|
your_aspects: "Your Aspects"
|
||||||
handle_explanation: "This is your diaspora id. Like an email address, you can give this to people to reach you."
|
handle_explanation: "This is your diaspora id. Like an email address, you can give this to people to reach you."
|
||||||
no_contacts: "No contacts"
|
no_contacts: "No contacts"
|
||||||
|
|
@ -157,7 +157,9 @@ en:
|
||||||
heading: "Diaspora ID"
|
heading: "Diaspora ID"
|
||||||
content_1: "Your Diaspora ID is:"
|
content_1: "Your Diaspora ID is:"
|
||||||
content_2: "Give it to anyone and they'll be able to find you on Diaspora."
|
content_2: "Give it to anyone and they'll be able to find you on Diaspora."
|
||||||
|
services:
|
||||||
|
heading: "Connect Services"
|
||||||
|
content: "You can connect the following services to Diaspora:"
|
||||||
aspect_memberships:
|
aspect_memberships:
|
||||||
destroy:
|
destroy:
|
||||||
success: "Successfully removed person from aspect"
|
success: "Successfully removed person from aspect"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue