-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front controller path/routing adjustment (#687)
the new filter ui changes also introduces a couple more filtering parameters in the form of controller path params, for threads/entries listing it looks fine and relatively staightforward, but for microblog posts listing, what used to be a simple `/microblog` is now something like `/all/hot/∞/all/all/microblog`, which hinders the user experience on url readability and memorability compared to the previous scheme, for those who still care this changes tries to adjust the path/routing of these front controller especially for the microblog part, to make it more simpler and could omit some default filter parameters if they aren't set, similar to the previous path scheme Co-authored-by: e-five <[email protected]>
- Loading branch information
Showing
12 changed files
with
313 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,94 @@ | ||
front: | ||
controller: App\Controller\Entry\EntryFrontController::front | ||
defaults: { subscription: home, sortBy: hot, time: '∞', type: all, federation: all, content: threads } | ||
path: /{subscription}/{sortBy}/{time}/{type}/{federation}/{content} | ||
defaults: &front_defaults { subscription: home, content: threads, sortBy: hot, time: '∞', federation: all } | ||
path: /{subscription}/{content}/{sortBy}/{time}/{federation} | ||
methods: [GET] | ||
requirements: | ||
requirements: &front_requirement | ||
subscription: "%default_subscription_options%" | ||
sortBy: "%default_sort_options%" | ||
time: "%default_time_options%" | ||
type: "%default_type_options%" | ||
federation: "%default_federation_options%" | ||
content: "%default_content_options%" | ||
|
||
front_redirect: | ||
controller: App\Controller\Entry\EntryFrontController::front_redirect | ||
defaults: { sortBy: hot, time: '∞', type: all, federation: all, content: threads } | ||
path: /{sortBy}/{time}/{type}/{federation}/{content} | ||
front_sub: | ||
controller: App\Controller\Entry\EntryFrontController::front | ||
defaults: *front_defaults | ||
path: /{subscription}/{sortBy}/{time}/{federation} | ||
methods: [GET] | ||
requirements: | ||
sortBy: "%default_sort_options%" | ||
time: "%default_time_options%" | ||
type: "%default_type_options%" | ||
federation: "%default_federation_options%" | ||
content: "%default_content_options%" | ||
requirements: *front_requirement | ||
|
||
front_content: | ||
controller: App\Controller\Entry\EntryFrontController::front | ||
defaults: *front_defaults | ||
path: /{content}/{sortBy}/{time}/{federation} | ||
methods: [GET] | ||
requirements: *front_requirement | ||
|
||
front_short: | ||
controller: App\Controller\Entry\EntryFrontController::front | ||
defaults: *front_defaults | ||
path: /{sortBy}/{time}/{federation} | ||
methods: [GET] | ||
requirements: *front_requirement | ||
|
||
front_magazine: | ||
controller: App\Controller\Entry\EntryFrontController::magazine | ||
defaults: { sortBy: hot, time: '∞', type: all, federation: all, content: threads } | ||
path: /m/{name}/{sortBy}/{time}/{type}/{federation}/{content} | ||
defaults: &front_magazine_defaults { content: threads, sortBy: hot, time: '∞', federation: all } | ||
path: /m/{name}/{content}/{sortBy}/{time}/{federation} | ||
methods: [GET] | ||
requirements: | ||
sortBy: "%default_sort_options%" | ||
time: "%default_time_options%" | ||
type: "%default_type_options%" | ||
federation: "%default_federation_options%" | ||
content: "%default_content_options%" | ||
requirements: *front_requirement | ||
|
||
front_magazine_short: | ||
controller: App\Controller\Entry\EntryFrontController::magazine | ||
defaults: &front_magazine_defaults | ||
path: /m/{name}/{sortBy}/{time}/{federation} | ||
methods: [GET] | ||
requirements: *front_requirement | ||
|
||
# Microblog compatibility stuff, redirects from the old routes' URLs | ||
|
||
posts_front: | ||
controller: App\Controller\Entry\EntryFrontController::front_redirect | ||
defaults: { sortBy: hot, time: '∞', type: all, federation: all, content: microblog } | ||
controller: App\Controller\Entry\EntryFrontController::frontRedirect | ||
defaults: { sortBy: hot, time: '∞', federation: all, content: microblog } | ||
path: /microblog/{sortBy}/{time} | ||
methods: [ GET ] | ||
requirements: | ||
sortBy: "%default_sort_options%" | ||
time: "%default_time_options%" | ||
|
||
posts_subscribed: | ||
controller: App\Controller\Entry\EntryFrontController::front_redirect | ||
defaults: { sortBy: hot, time: '∞', type: all, federation: all, content: microblog, subscription: 'sub' } | ||
controller: App\Controller\Entry\EntryFrontController::frontRedirect | ||
defaults: { sortBy: hot, time: '∞', federation: all, content: microblog, subscription: 'sub' } | ||
path: /sub/microblog/{sortBy}/{time} | ||
methods: [ GET ] | ||
requirements: | ||
sortBy: "%default_sort_options%" | ||
time: "%default_time_options%" | ||
|
||
posts_moderated: | ||
controller: App\Controller\Entry\EntryFrontController::front_redirect | ||
defaults: { sortBy: hot, time: '∞', type: all, federation: all, content: microblog, subscription: 'mod' } | ||
controller: App\Controller\Entry\EntryFrontController::frontRedirect | ||
defaults: { sortBy: hot, time: '∞', federation: all, content: microblog, subscription: 'mod' } | ||
path: /mod/microblog/{sortBy}/{time} | ||
methods: [ GET ] | ||
requirements: | ||
sortBy: "%default_sort_options%" | ||
time: "%default_time_options%" | ||
|
||
posts_favourite: | ||
controller: App\Controller\Entry\EntryFrontController::front_redirect | ||
defaults: { sortBy: hot, time: '∞', type: all, federation: all, content: microblog, subscription: 'fav' } | ||
controller: App\Controller\Entry\EntryFrontController::frontRedirect | ||
defaults: { sortBy: hot, time: '∞', federation: all, content: microblog, subscription: 'fav' } | ||
path: /fav/microblog/{sortBy}/{time} | ||
methods: [ GET ] | ||
requirements: | ||
sortBy: "%default_sort_options%" | ||
time: "%default_time_options%" | ||
|
||
magazine_posts: | ||
controller: App\Controller\Entry\EntryFrontController::front_redirect | ||
defaults: { sortBy: hot, time: '∞', type: all, federation: all, content: microblog } | ||
path: /m/{name}/microblog/{sortBy}/{time}/{type}/{federation} | ||
controller: App\Controller\Entry\EntryFrontController::magazineRedirect | ||
defaults: { sortBy: hot, time: '∞', federation: all, content: microblog } | ||
path: /m/{name}/microblog/{sortBy}/{time}/{federation} | ||
methods: [ GET ] | ||
requirements: | ||
sortBy: "%default_sort_options%" | ||
time: "%default_time_options%" | ||
type: "%default_type_options%" | ||
federation: "%default_federation_options%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.