Retrospring/app/views/settings/_services.html.haml

28 lines
1.2 KiB
Plaintext
Raw Normal View History

2020-04-25 08:04:23 -07:00
.card
.card-body
2022-01-27 13:15:39 -08:00
= t(".services", count: services.count)
2020-04-25 08:04:23 -07:00
2022-01-27 13:15:39 -08:00
- APP_CONFIG["sharing"].each do |service, service_options|
- if service_options["enabled"] && services.none? { |x| x.provider == service.to_s }
2022-10-11 23:58:22 -07:00
%p= button_to t(".connect", service: service.capitalize), "/auth/#{service}", method: :post, class: "btn btn-info",
form: { data: { turbo: false } }
2020-04-25 08:04:23 -07:00
2022-01-27 13:15:39 -08:00
- if services.count.positive?
2020-04-25 08:04:23 -07:00
%ul.list-group
2022-01-27 13:15:39 -08:00
- services.each do |service|
2020-04-25 08:04:23 -07:00
%li.list-group-item
2020-05-10 01:40:48 -07:00
%i{ class: "fa fa-#{service.provider}" }
2020-04-25 08:04:23 -07:00
%strong= service.provider.capitalize
(#{service.nickname})
2022-01-27 11:19:06 -08:00
= button_to t(".disconnect"),
2020-05-10 01:40:48 -07:00
service_path(service),
2022-01-27 11:19:06 -08:00
data: { confirm: t(".confirm", service: service.provider.capitalize) },
method: :delete,
2022-01-27 13:15:39 -08:00
class: "btn btn-link text-danger",
2022-10-11 23:58:22 -07:00
form: { class: "d-inline", data: { turbo: false } }
.col-md-6.mt-2
2022-10-11 23:58:22 -07:00
= bootstrap_form_for(service, as: "service", url: update_service_path(service), data: { turbo: false }) do |f|
2022-01-27 11:19:06 -08:00
= f.text_field :post_tag, label_as_placeholder: true,
2022-01-27 13:15:39 -08:00
append: f.submit(t("voc.update"), class: "btn btn-primary"), maxlength: 20, pattern: "^[^@]*$"