Remove service-related views

This commit is contained in:
Andreas Nedbal 2023-02-05 18:06:48 +01:00 committed by Andreas Nedbal
parent a86dcde30a
commit 52ae7fbb81
5 changed files with 3 additions and 39 deletions

View File

@ -18,12 +18,11 @@ class InboxController < ApplicationController
@delete_id = find_delete_id @delete_id = find_delete_id
@disabled = true if @inbox.empty? @disabled = true if @inbox.empty?
services = current_user.services.to_a
respond_to do |format| respond_to do |format|
format.html { render "show", locals: { services: } } format.html { render "show" }
format.turbo_stream do 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 # 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 @inbox.update_all(new: false) # rubocop:disable Rails/SkipsModelValidations

View File

@ -1,6 +1,6 @@
#entries #entries
- @inbox.each do |i| - @inbox.each do |i|
= render "inbox/entry", services:, i: = render "inbox/entry", i:
- if @inbox.empty? - if @inbox.empty?
%p.empty= t(".empty") %p.empty= t(".empty")

View File

@ -22,7 +22,3 @@
%br/ %br/
%button.btn.btn-success#q-answer-btn{ data: { q_id: @question.id } } %button.btn.btn-success#q-answer-btn{ data: { q_id: @question.id } }
= t("voc.answer") = 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)

View File

@ -1,4 +0,0 @@
= render "settings/services", services: @services
- provide(:title, generate_title(t(".title")))
- parent_layout "user/settings"

View File

@ -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: "^[^@]*$"