Refactor available services settings
This commit is contained in:
parent
4812dc7a23
commit
895d38de21
4 changed files with 34 additions and 26 deletions
24
app/views/services/_add_remove_services.haml
Normal file
24
app/views/services/_add_remove_services.haml
Normal file
|
|
@ -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")
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
.row-fluid
|
||||
.span7
|
||||
= render 'shared/add_remove_services'
|
||||
= render 'add_remove_services'
|
||||
|
||||
.span5
|
||||
%p
|
||||
|
|
|
|||
|
|
@ -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}")
|
||||
|
|
@ -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."
|
||||
|
|
|
|||
Loading…
Reference in a new issue