diff --git a/app/controllers/inbox_controller.rb b/app/controllers/inbox_controller.rb index a31080e8..0d4313c4 100644 --- a/app/controllers/inbox_controller.rb +++ b/app/controllers/inbox_controller.rb @@ -18,12 +18,11 @@ class InboxController < ApplicationController @delete_id = find_delete_id @disabled = true if @inbox.empty? - services = current_user.services.to_a respond_to do |format| - format.html { render "show", locals: { services: } } + format.html { render "show" } format.turbo_stream do - render "show", locals: { services: }, layout: false, status: :see_other + render "show", layout: false, status: :see_other # rubocop disabled as just flipping a flag doesn't need to have validations to be run @inbox.update_all(new: false) # rubocop:disable Rails/SkipsModelValidations diff --git a/app/views/inbox/show.html.haml b/app/views/inbox/show.html.haml index 94d7d883..5c5de4e4 100644 --- a/app/views/inbox/show.html.haml +++ b/app/views/inbox/show.html.haml @@ -1,6 +1,6 @@ #entries - @inbox.each do |i| - = render "inbox/entry", services:, i: + = render "inbox/entry", i: - if @inbox.empty? %p.empty= t(".empty") diff --git a/app/views/question/show.html.haml b/app/views/question/show.html.haml index 614a62e7..57137240 100644 --- a/app/views/question/show.html.haml +++ b/app/views/question/show.html.haml @@ -22,7 +22,3 @@ %br/ %button.btn.btn-success#q-answer-btn{ data: { q_id: @question.id } } = t("voc.answer") - - current_user.services.each do |service| - %label - %input{ type: "checkbox", name: "share", checked: :checked, data: { q_id: @question.id, service: service.provider } } - = t("inbox.entry.sharing.post_to", service: service.provider.capitalize) diff --git a/app/views/services/index.html.haml b/app/views/services/index.html.haml deleted file mode 100644 index 0863d21d..00000000 --- a/app/views/services/index.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -= render "settings/services", services: @services - -- provide(:title, generate_title(t(".title"))) -- parent_layout "user/settings" diff --git a/app/views/settings/_services.html.haml b/app/views/settings/_services.html.haml deleted file mode 100644 index d92b6a72..00000000 --- a/app/views/settings/_services.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -.card - .card-body - = t(".services", count: services.count) - - - APP_CONFIG["sharing"].each do |service, service_options| - - if service_options["enabled"] && services.none? { |x| x.provider == service.to_s } - %p= button_to t(".connect", service: service.capitalize), "/auth/#{service}", method: :post, class: "btn btn-info", - form: { data: { turbo: false } } - - - if services.count.positive? - %ul.list-group - - services.each do |service| - %li.list-group-item - %i{ class: "fa fa-#{service.provider}" } - %strong= service.provider.capitalize - (#{service.nickname}) - = button_to t(".disconnect"), - service_path(service), - data: { confirm: t(".confirm", service: service.provider.capitalize) }, - method: :delete, - class: "btn btn-link text-danger", - form: { class: "d-inline", data: { turbo: false } } - - .col-md-6.mt-2 - = bootstrap_form_for(service, as: "service", url: update_service_path(service), data: { turbo: false }) do |f| - = f.text_field :post_tag, label_as_placeholder: true, - append: f.submit(t("voc.update"), class: "btn btn-primary"), maxlength: 20, pattern: "^[^@]*$"