Alter the caption text format for services.

"(Twitter) knu" -> "Twitter: knu"
This commit is contained in:
Akinori MUSHA 2014-10-10 19:37:10 +09:00
parent 5b89bcdb68
commit 082cffce5f
2 changed files with 5 additions and 1 deletions

View file

@ -60,4 +60,8 @@ module ApplicationHelper
content_tag(:span, "Authenticate with #{omniauth_provider_name(provider)}")
].join.html_safe, user_omniauth_authorize_path(provider), class: "btn btn-default btn-service service-#{provider}"
end
def service_label_text(service)
"#{omniauth_provider_name(service.provider)} - #{service.name}"
end
end

View file

@ -1,6 +1,6 @@
<% if agent.try(:oauthable?) %>
<div class="form-group type-select">
<%= label_tag :service %>
<%= select_tag 'agent[service_id]', options_for_select(agent.valid_services_for(current_user).collect { |s| ["(#{s.provider}) #{s.name}", s.id]}, agent.service_id), class: 'form-control' %>
<%= select_tag 'agent[service_id]', options_for_select(agent.valid_services_for(current_user).collect { |s| [service_label_text(s), s.id] }, agent.service_id), class: 'form-control' %>
</div>
<% end %>