mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 16:15:14 +08:00
Remove obsolete per topic unsubscribe page.
This commit is contained in:
parent
035d92d2e1
commit
9353ae4b5d
|
@ -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"),
|
||||
|
||||
});
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,13 +0,0 @@
|
|||
<div class='topic-unsubscribe'>
|
||||
<div class="container">
|
||||
<p>
|
||||
{{{stopNotificiationsText}}}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{{i18n "topic.unsubscribe.change_notification_state"}}
|
||||
</p>
|
||||
|
||||
{{topic-notifications-button notificationLevel=model.details.notification_level topic=model}}
|
||||
</div>
|
||||
</div>
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1595,9 +1595,6 @@ en:
|
|||
search: "There are no more search results."
|
||||
|
||||
topic:
|
||||
unsubscribe:
|
||||
stop_notifications: "You will now receive less notifications for <strong>{{title}}</strong>"
|
||||
change_notification_state: "Your current notification state is "
|
||||
filter_to:
|
||||
one: "1 post in topic"
|
||||
other: "{{count}} posts in topic"
|
||||
|
|
|
@ -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+/ }
|
||||
|
|
Loading…
Reference in New Issue
Block a user