remove references to tag subscriptions
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
class TagSubscriptionsController < ApplicationController
|
||||
before_filter :member_only, :only => [:destroy, :migrate]
|
||||
respond_to :html, :xml, :json
|
||||
|
||||
def index
|
||||
@user = CurrentUser.user
|
||||
@query = TagSubscription.order("name").search(params[:search])
|
||||
@tag_subscriptions = @query.paginate(params[:page], :limit => params[:limit])
|
||||
respond_with(@tag_subscriptions)
|
||||
end
|
||||
|
||||
def destroy
|
||||
@tag_subscription = TagSubscription.find(params[:id])
|
||||
check_privilege(@tag_subscription)
|
||||
@tag_subscription.destroy
|
||||
respond_with(@tag_subscription)
|
||||
end
|
||||
|
||||
def migrate
|
||||
@tag_subscription = TagSubscription.find(params[:id])
|
||||
check_privilege(@tag_subscription)
|
||||
@tag_subscription.migrate_to_saved_searches
|
||||
flash[:notice] = "Tag subscription will be migrated to a saved search. Please wait a few minutes for the search to refresh."
|
||||
redirect_to tag_subscriptions_path
|
||||
end
|
||||
|
||||
private
|
||||
def check_privilege(tag_subscription)
|
||||
raise User::PrivilegeError unless tag_subscription.editable_by?(CurrentUser.user)
|
||||
end
|
||||
end
|
||||
@@ -186,7 +186,7 @@ module ApplicationHelper
|
||||
protected
|
||||
def nav_link_match(controller, url)
|
||||
url =~ case controller
|
||||
when "sessions", "users", "maintenance/user/login_reminders", "maintenance/user/password_resets", "admin/users", "tag_subscriptions"
|
||||
when "sessions", "users", "maintenance/user/login_reminders", "maintenance/user/password_resets", "admin/users"
|
||||
/^\/(session|users)/
|
||||
|
||||
when "forum_posts"
|
||||
|
||||
@@ -68,10 +68,6 @@ class AnonymousUser
|
||||
true
|
||||
end
|
||||
|
||||
def tag_subscriptions
|
||||
[]
|
||||
end
|
||||
|
||||
def favorite_tags
|
||||
nil
|
||||
end
|
||||
|
||||
@@ -21,7 +21,6 @@ class UserDeletion
|
||||
validate
|
||||
clear_user_settings
|
||||
remove_favorites
|
||||
clear_tag_subscriptions
|
||||
clear_saved_searches
|
||||
rename
|
||||
reset_password
|
||||
@@ -34,10 +33,6 @@ private
|
||||
ModAction.log("user ##{user.id} deleted")
|
||||
end
|
||||
|
||||
def clear_tag_subscriptions
|
||||
TagSubscription.where(:creator_id => user.id).destroy_all
|
||||
end
|
||||
|
||||
def clear_saved_searches
|
||||
SavedSearch.where(user_id: user.id).destroy_all
|
||||
end
|
||||
|
||||
@@ -97,7 +97,6 @@ class User < ApplicationRecord
|
||||
has_one :dmail_filter
|
||||
has_one :super_voter
|
||||
has_one :token_bucket
|
||||
has_many :subscriptions, lambda {order("tag_subscriptions.name")}, :class_name => "TagSubscription", :foreign_key => "creator_id"
|
||||
has_many :note_versions, :foreign_key => "updater_id"
|
||||
has_many :dmails, lambda {order("dmails.id desc")}, :foreign_key => "owner_id"
|
||||
has_many :saved_searches
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<li><%= link_to("Cheat sheet", wiki_pages_path(:title => "help:cheatsheet")) %></li>
|
||||
<li><%= link_to("Aliases", tag_aliases_path) %></li>
|
||||
<li><%= link_to("Implications", tag_implications_path) %></li>
|
||||
<li><%= link_to("Subscriptions",tag_subscriptions_path) %></li>
|
||||
<li><%= link_to("Listing", tags_path) %></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<% content_for(:secondary_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Listing", tag_subscriptions_path %></li>
|
||||
<li><%= link_to "Help", wiki_pages_path(:title => "help:tag_subscriptions") %></li>
|
||||
|
||||
<% if @tag_subscription && !@tag_subscription.new_record? && @tag_subscription.editable_by?(CurrentUser.user) %>
|
||||
<li>|</li>
|
||||
<li><%= link_to "Show", tag_subscription_path(@tag_subscription) %></li>
|
||||
<li><%= link_to "Delete", tag_subscription_path(@tag_subscription, :method => :delete, :data => {:confirm => "Are you sure you want to delete this tag subscription?"}) %></li>
|
||||
<% end %>
|
||||
</menu>
|
||||
<% end %>
|
||||
@@ -1,35 +0,0 @@
|
||||
<div id="c-tag-subscriptions">
|
||||
<div id="a-index">
|
||||
<h1>Tag Subscriptions</h1>
|
||||
|
||||
<p class="info">The tag subscription feature is being deprecated. You can move your current tag subscriptions to saved searches by clicking the "migrate" link below.</p>
|
||||
|
||||
<table class="striped" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Tag Query</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @tag_subscriptions.each do |tag_subscription| %>
|
||||
<tr>
|
||||
<td><%= tag_subscription.pretty_name %></td>
|
||||
<td><%= tag_subscription.pretty_tag_query %></td>
|
||||
<td>
|
||||
<%= link_to "delete", tag_subscription_path(tag_subscription), :method => :delete, :data => {:confirm => "Are you sure you want to delete this subscription?"} %>
|
||||
| <%= link_to "migrate", migrate_tag_subscription_path(tag_subscription), :method => :post %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
Tag Subscriptions - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
@@ -161,13 +161,6 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th>Subscriptions</th>
|
||||
<td>
|
||||
<em>This feature has been disabled. <%= link_to "Migrate your tag subscriptions to saved searches", tag_subscriptions_path %>.</em>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>API Key</th>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user