Add ability to filter individual posts (#18945)
* Add database table for status-specific filters * Add REST endpoints, entities and attributes * Show status filters in /filters interface * Perform server-side filtering for individual posts filters * Fix filtering on context mismatch * Refactor `toServerSideType` by moving it to its own module * Move loupe and delete icons to their own module * Add ability to filter individual posts from WebUI * Replace keyword list by warnings (expired, context mismatch) * Refactor server-side filtering code * Add tests
This commit is contained in:
parent
d156e9b823
commit
50487db122
40 changed files with 1138 additions and 63 deletions
|
@ -1181,6 +1181,8 @@ en:
|
|||
edit:
|
||||
add_keyword: Add keyword
|
||||
keywords: Keywords
|
||||
statuses: Individual posts
|
||||
statuses_hint_html: This filter applies to select individual posts regardless of whether they match the keywords below. You can review these posts and remove them from the filter by <a href="%{path}">clicking here</a>.
|
||||
title: Edit filter
|
||||
errors:
|
||||
deprecated_api_multiple_keywords: These parameters cannot be changed from this application because they apply to more than one filter keyword. Use a more recent application or the web interface.
|
||||
|
@ -1194,10 +1196,23 @@ en:
|
|||
keywords:
|
||||
one: "%{count} keyword"
|
||||
other: "%{count} keywords"
|
||||
statuses:
|
||||
one: "%{count} post"
|
||||
other: "%{count} posts"
|
||||
statuses_long:
|
||||
one: "%{count} individual post hidden"
|
||||
other: "%{count} individual posts hidden"
|
||||
title: Filters
|
||||
new:
|
||||
save: Save new filter
|
||||
title: Add new filter
|
||||
statuses:
|
||||
back_to_filter: Back to filter
|
||||
batch:
|
||||
remove: Remove from filter
|
||||
index:
|
||||
hint: This filter applies to select individual posts regardless of other criteria. You can add more posts to this filter from the Web interface.
|
||||
title: Filtered posts
|
||||
footer:
|
||||
developers: Developers
|
||||
more: More…
|
||||
|
|
|
@ -177,7 +177,14 @@ Rails.application.routes.draw do
|
|||
resources :tags, only: [:show]
|
||||
resources :emojis, only: [:show]
|
||||
resources :invites, only: [:index, :create, :destroy]
|
||||
resources :filters, except: [:show]
|
||||
resources :filters, except: [:show] do
|
||||
resources :statuses, only: [:index], controller: 'filters/statuses' do
|
||||
collection do
|
||||
post :batch
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
resource :relationships, only: [:show, :update]
|
||||
resource :statuses_cleanup, controller: :statuses_cleanup, only: [:show, :update]
|
||||
|
||||
|
@ -448,12 +455,14 @@ Rails.application.routes.draw do
|
|||
resources :trends, only: [:index], controller: 'trends/tags'
|
||||
resources :filters, only: [:index, :create, :show, :update, :destroy] do
|
||||
resources :keywords, only: [:index, :create], controller: 'filters/keywords'
|
||||
resources :statuses, only: [:index, :create], controller: 'filters/statuses'
|
||||
end
|
||||
resources :endorsements, only: [:index]
|
||||
resources :markers, only: [:index, :create]
|
||||
|
||||
namespace :filters do
|
||||
resources :keywords, only: [:show, :update, :destroy]
|
||||
resources :statuses, only: [:show, :destroy]
|
||||
end
|
||||
|
||||
namespace :apps do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue