diff --git a/app/assets/javascripts/discourse/controllers/topic-unsubscribe.js.es6 b/app/assets/javascripts/discourse/controllers/topic-unsubscribe.js.es6 deleted file mode 100644 index a2611ebdcbd..00000000000 --- a/app/assets/javascripts/discourse/controllers/topic-unsubscribe.js.es6 +++ /dev/null @@ -1,7 +0,0 @@ -export default Ember.Controller.extend({ - - stopNotificiationsText: function() { - return I18n.t("topic.unsubscribe.stop_notifications", { title: this.get("model.fancyTitle") }); - }.property("model.fancyTitle"), - -}); diff --git a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 index f489faf4bbf..da873ecf9dd 100644 --- a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 +++ b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 @@ -14,7 +14,6 @@ export default function() { }); this.route('topicBySlugOrId', { path: '/t/:slugOrId', resetNamespace: true }); - this.route('topicUnsubscribe', { path: '/t/:slug/:id/unsubscribe' }); this.route('discovery', { path: '/', resetNamespace: true }, function() { // top diff --git a/app/assets/javascripts/discourse/routes/topic-unsubscribe.js.es6 b/app/assets/javascripts/discourse/routes/topic-unsubscribe.js.es6 deleted file mode 100644 index 2faf69d0fb5..00000000000 --- a/app/assets/javascripts/discourse/routes/topic-unsubscribe.js.es6 +++ /dev/null @@ -1,19 +0,0 @@ -import { loadTopicView } from 'discourse/models/topic'; - -export default Discourse.Route.extend({ - model(params) { - const topic = this.store.createRecord("topic", { id: params.id }); - return loadTopicView(topic).then(() => topic); - }, - - afterModel(topic) { - topic.set("details.notificationReasonText", null); - }, - - actions: { - didTransition() { - this.controllerFor("application").set("showFooter", true); - return true; - } - } -}); diff --git a/app/assets/javascripts/discourse/templates/topic/unsubscribe.hbs b/app/assets/javascripts/discourse/templates/topic/unsubscribe.hbs deleted file mode 100644 index 17a4df882eb..00000000000 --- a/app/assets/javascripts/discourse/templates/topic/unsubscribe.hbs +++ /dev/null @@ -1,13 +0,0 @@ -
-
-

- {{{stopNotificiationsText}}} -

- -

- {{i18n "topic.unsubscribe.change_notification_state"}} -

- - {{topic-notifications-button notificationLevel=model.details.notification_level topic=model}} -
-
diff --git a/app/assets/stylesheets/common/base/topic.scss b/app/assets/stylesheets/common/base/topic.scss index fba521fcbaf..8bf9f292618 100644 --- a/app/assets/stylesheets/common/base/topic.scss +++ b/app/assets/stylesheets/common/base/topic.scss @@ -192,20 +192,6 @@ a.badge-category { align-items: center; } -.topic-unsubscribe { - .notifications-button { - display: inline-block; - float: none; - line-height: $line-height-large; - .dropdown-toggle { - float: none; - } - .dropdown-menu { - bottom: initial; - } - } -} - .post-links-container { @include unselectable; clear: both; diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index 9f4fe20b35d..b9334d490d7 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -38,7 +38,7 @@ class TopicsController < ApplicationController before_action :consider_user_for_promotion, only: :show - skip_before_action :check_xhr, only: [:show, :unsubscribe, :feed] + skip_before_action :check_xhr, only: [:show, :feed] def id_for_slug topic = Topic.find_by(slug: params[:slug].downcase) @@ -154,30 +154,6 @@ class TopicsController < ApplicationController render_serialized(topic.reload, BasicTopicSerializer) end - def unsubscribe - if current_user.blank? - cookies[:destination_url] = request.fullpath - return redirect_to "/login-preferences" - end - - @topic_view = TopicView.new(params[:topic_id], current_user) - - if slugs_do_not_match || (!request.format.json? && params[:slug].blank?) - return redirect_to @topic_view.topic.unsubscribe_url, status: 301 - end - - tu = TopicUser.find_by(user_id: current_user.id, topic_id: params[:topic_id]) - - if tu && tu.notification_level > TopicUser.notification_levels[:regular] - tu.notification_level = TopicUser.notification_levels[:regular] - tu.save! - else - TopicUser.change(current_user.id, params[:topic_id].to_i, notification_level: TopicUser.notification_levels[:muted]) - end - - perform_show_response - end - def wordpress params.require(:best) params.require(:topic_id) diff --git a/app/models/topic.rb b/app/models/topic.rb index abc0f5f2701..efc4cf1ae5d 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -1007,10 +1007,6 @@ SQL Topic.relative_url(id, slug, post_number) end - def unsubscribe_url - "#{url}/unsubscribe" - end - def clear_pin_for(user) return unless user.present? TopicUser.change(user.id, id, cleared_pinned_at: Time.now) diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 592af7dacbf..f904bebf8ac 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1595,9 +1595,6 @@ en: search: "There are no more search results." topic: - unsubscribe: - stop_notifications: "You will now receive less notifications for {{title}}" - change_notification_state: "Your current notification state is " filter_to: one: "1 post in topic" other: "{{count}} posts in topic" diff --git a/config/routes.rb b/config/routes.rb index a34e74a148e..cc191d986a8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -650,8 +650,6 @@ Discourse::Application.routes.draw do get "t/:topic_id/wordpress" => "topics#wordpress", constraints: { topic_id: /\d+/ } get "t/:slug/:topic_id/moderator-liked" => "topics#moderator_liked", constraints: { topic_id: /\d+/ } get "t/:slug/:topic_id/summary" => "topics#show", defaults: { summary: true }, constraints: { topic_id: /\d+/ } - get "t/:slug/:topic_id/unsubscribe" => "topics#unsubscribe", constraints: { topic_id: /\d+/ } - get "t/:topic_id/unsubscribe" => "topics#unsubscribe", constraints: { topic_id: /\d+/ } get "t/:topic_id/summary" => "topics#show", constraints: { topic_id: /\d+/ } put "t/:slug/:topic_id" => "topics#update", constraints: { topic_id: /\d+/ } put "t/:slug/:topic_id/star" => "topics#star", constraints: { topic_id: /\d+/ }