diff options
-rw-r--r-- | app/views/services/_add_remove_services.haml | 24 | ||||
-rw-r--r-- | app/views/services/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/_add_remove_services.haml | 19 | ||||
-rw-r--r-- | config/locales/diaspora/en.yml | 15 |
4 files changed, 34 insertions, 26 deletions
diff --git a/app/views/services/_add_remove_services.haml b/app/views/services/_add_remove_services.haml new file mode 100644 index 000000000..35190c8fd --- /dev/null +++ b/app/views/services/_add_remove_services.haml @@ -0,0 +1,24 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +- if AppConfig.configured_services.count > 0 + - AppConfig.configured_services.each do |provider| + %h3= t("services.provider.#{provider}") + - services_for_provider = @services.select{|x| x.provider == provider.to_s} + - if services_for_provider.count > 0 + - services_for_provider.each do |service| + != t("services.index.logged_in_as", nickname: content_tag(:strong, service.nickname )) + = link_to t("services.index.disconnect"), + service_path(service), + data: { confirm: t("services.index.really_disconnect", service: t("services.provider.#{provider}")) }, + method: :delete + + - else + = t("services.index.not_logged_in") + = link_to(t("services.index.connect"), "/auth/#{provider}") + +- else + .well + %h4 + = t("services.index.no_services_available") diff --git a/app/views/services/index.html.haml b/app/views/services/index.html.haml index 16c8cf1dc..cea937b11 100644 --- a/app/views/services/index.html.haml +++ b/app/views/services/index.html.haml @@ -15,7 +15,7 @@ .row-fluid .span7 - = render 'shared/add_remove_services' + = render 'add_remove_services' .span5 %p diff --git a/app/views/shared/_add_remove_services.haml b/app/views/shared/_add_remove_services.haml deleted file mode 100644 index 32ea14d50..000000000 --- a/app/views/shared/_add_remove_services.haml +++ /dev/null @@ -1,19 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -%ul.stream#service_stream - - if @services.count > 0 - - for service in @services - %h3 - %b= service.provider - = t('services.index.logged_in_as') - %b= service.nickname - = link_to t('services.index.disconnect'), service_path(service), :data => { :confirm => t('services.index.really_disconnect', :service => service.provider) }, :method => :delete - - else - = t('services.index.no_services') - -- AppConfig.configured_services.each do |service| - - unless @services.any?{|x| x.provider == service.to_s} - %h4= link_to(t("services.index.connect_to_#{service}"), "/auth/#{service}") diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 2f26d3ad3..df5c10490 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -1074,16 +1074,19 @@ en: failure: "There was an error resharing this post." comment_email_subject: "%{resharer}’s reshare of %{author}’s post" services: + provider: + facebook: "Facebook" + tumblr: "Tumblr" + twitter: "Twitter" + wordpress: "WordPress" index: - logged_in_as: "Logged in as" + connect: "Connect" disconnect: "Disconnect" + logged_in_as: "Logged in as %{nickname}." + no_services_available: "There are no services on this pod available." + not_logged_in: "Currently not logged in." really_disconnect: "Disconnect %{service}?" - connect_to_twitter: "Connect to Twitter" - connect_to_facebook: "Connect to Facebook" - connect_to_tumblr: "Connect to Tumblr" - connect_to_wordpress: "Connect to WordPress" edit_services: "Edit services" - no_services: "You have not connected any services yet." services_explanation: "Connecting to services gives you the ability to publish your posts to them as you write them in diaspora*." create: success: "Authentication successful." |