Commit f1bcd084 authored by Emma's avatar Emma

remove raddit_app_ prefix from routes

parent 992f4203
......@@ -32,7 +32,7 @@
{% block message '' %}
<nav>
<p><a href="{{ path('raddit_app_front') }}">{{ 'action.go_to_home_page'|trans }}</a></p>
<p><a href="{{ path('front') }}">{{ 'action.go_to_home_page'|trans }}</a></p>
</nav>
</body>
</html>
raddit_app_fetch_title:
fetch_title:
defaults: { _controller: RadditAppBundle:Ajax:fetchTitle, _format: json }
path: /ft.json
methods: [POST]
options: { expose: true }
raddit_app_markdown_preview:
markdown_preview:
defaults: { _controller: RadditAppBundle:Ajax:markdownPreview }
path: /md
methods: [POST]
......
raddit_app_bans:
bans:
defaults: { _controller: RadditAppBundle:Ban:list, page: 1 }
path: /bans/{page}
methods: [GET]
requirements: { page: \d+ }
raddit_app_add_ban:
add_ban:
defaults: { _controller: RadditAppBundle:Ban:add }
path: /add_ban
methods: [GET, POST]
raddit_app_remove_bans:
remove_bans:
defaults: { _controller: RadditAppBundle:Ban:remove }
path: /remove_bans
methods: [POST]
raddit_app_ban_ip_by_submission:
ban_ip_by_submission:
defaults:
_controller: RadditAppBundle:Ban:redirect
entityClass: RadditAppBundle:Submission
methods: [GET]
path: /ban_by_submission/{id}
raddit_app_ban_ip_by_comment:
ban_ip_by_comment:
defaults:
_controller: RadditAppBundle:Ban:redirect
entityClass: RadditAppBundle:Comment
......
raddit_app_comment_form:
comment_form:
defaults: { _controller: RadditAppBundle:Comment:commentForm, comment_id: null }
methods: [GET]
path: /comment_form/{forumName}/{submissionId}/{commentId}
requirements: { submissionId: \d+, commentId: \d+ }
raddit_app_delete_comment:
delete_comment:
defaults: { _controller: RadditAppBundle:Comment:deleteComment }
path: /dc/{id}
methods: [POST]
raddit_app_softdelete_comment:
softdelete_comment:
defaults: { _controller: RadditAppBundle:Comment:softDeleteComment }
path: /sdc/{id}
methods: [POST]
raddit_app_comment_list:
comment_list:
defaults: { _controller: RadditAppBundle:Comment:list, page: 1 }
path: /comments/{page}
methods: [GET]
requirements: { page: \d+ }
raddit_app_comment_vote:
comment_vote:
defaults:
_controller: RadditAppBundle:Vote:vote
_format: html
......
raddit_app_multi:
multi:
defaults: { _controller: RadditAppBundle:Forum:multi, sortBy: hot, page: 1}
path: /f/{names}/{sortBy}/{page}
requirements: { names: '(?:\w{3,25}\+){1,70}\w{3,25}' }
raddit_app_forum:
forum:
defaults: { _controller: RadditAppBundle:Forum:front, sortBy: hot, page: 1 }
path: /f/{forum_name}/{sortBy}/{page}
methods: [GET]
requirements: { sortBy: hot|new|top|controversial, page: \d+ }
raddit_app_comment_post:
comment_post:
defaults:
_controller: RadditAppBundle:Comment:comment
comment_id: ~
path: /f/{forum_name}/{submission_id}/comment_post/{comment_id}
methods: [POST]
raddit_app_edit_comment:
edit_comment:
defaults: { _controller: RadditAppBundle:Comment:editComment }
path: /f/{forum_name}/{submission_id}/edit_comment/{comment_id}
methods: [GET, POST]
raddit_app_edit_forum:
edit_forum:
defaults: { _controller: RadditAppBundle:Forum:editForum }
path: /f/{forum_name}/edit
methods: [GET, POST]
raddit_app_delete_forum:
delete_forum:
defaults: { _controller: RadditAppBundle:Forum:delete }
path: /f/{forum_name}/delete
methods: [GET, POST]
raddit_app_forum_appearance:
forum_appearance:
defaults: { _controller: RadditAppBundle:Forum:appearance }
path: /f/{forum_name}/appearance
methods: [GET, POST]
raddit_app_forum_bans:
forum_bans:
defaults: { _controller: RadditAppBundle:Forum:bans, page: 1 }
path: /f/{forum_name}/bans
methods: [GET]
requirements: { page: \d+ }
raddit_app_forum_ban_history:
forum_ban_history:
defaults: { _controller: RadditAppBundle:Forum:banHistory, page: 1}
path: /f/{forum_name}/bans/history/{username}/{page}
methods: [GET]
requirements: { page: \d+ }
raddit_app_forum_ban:
forum_ban:
defaults: { _controller: RadditAppBundle:Forum:ban }
path: /f/{forum_name}/ban/{username}
methods: [GET, POST]
raddit_app_forum_unban:
forum_unban:
defaults: { _controller: RadditAppBundle:Forum:unban }
path: /f/{forum_name}/unban/{username}
methods: [GET, POST]
raddit_app_forum_moderators:
forum_moderators:
defaults: { _controller: RadditAppBundle:Forum:moderators, page: 1 }
path: /f/{forum_name}/moderators/{page}
methods: [GET]
requirements: { page: \d+ }
raddit_app_add_moderator:
add_moderator:
defaults: { _controller: RadditAppBundle:Forum:addModerator }
path: /f/{forum_name}/add_moderator
methods: [GET, POST]
raddit_app_create_forum:
create_forum:
defaults: { _controller: RadditAppBundle:Forum:createForum }
path: /create_forum
methods: [GET, POST]
raddit_app_forum_list:
forum_list:
defaults: { _controller: RadditAppBundle:Forum:list, page: 1, sortBy: by_submissions }
path: /forums/{sortBy}/{page}
methods: [GET]
requirements: { forums: \d+, sortBy: by_name|by_title|by_subscribers|by_submissions }
raddit_app_forums_by_category:
forums_by_category:
defaults: { _controller: RadditAppBundle:Forum:listCategories }
path: /forums/by_category
methods: [GET]
raddit_app_subscribe:
subscribe:
defaults: { _controller: RadditAppBundle:Forum:subscribe, action: subscribe }
path: /sub/{id}
methods: [POST]
raddit_app_unsubscribe:
unsubscribe:
defaults: { _controller: RadditAppBundle:Forum:subscribe, action: unsubscribe }
path: /unsub/{id}
methods: [POST]
raddit_app_front:
front:
defaults: { _controller: RadditAppBundle:Front:front, sortBy: hot, page: 1 }
path: /{sortBy}/{page}
methods: [GET]
requirements: { sortBy: hot|new|top|controversial, page: \d+ }
raddit_app_featured:
featured:
defaults: { _controller: RadditAppBundle:Front:featured, sortBy: hot, page: 1}
path: /featured/{sortBy}/{page}
methods: [GET]
requirements: { sortBy: hot|new|top|controversial, page: \d+ }
raddit_app_subscribed:
subscribed:
defaults: { _controller: RadditAppBundle:Front:subscribed, sortBy: hot, page: 1 }
path: /subscribed/{sortBy}/{page}
methods: [GET]
requirements: { sortBy: hot|new|top|controversial, page: \d+ }
raddit_app_all:
all:
defaults: { _controller: RadditAppBundle:Front:all, sortBy: hot, page: 1 }
path: /all/{sortBy}/{page}
methods: [GET]
requirements: { sortBy: hot|new|top|controversial, page: \d+ }
raddit_app_moderated:
moderated:
defaults: { _controller: RadditAppBundle:Front:moderated, sortBy: hot, page: 1 }
path: /moderated/{sortBy}/{page}
methods: [GET]
requirements: { sortBy: hot|new|top|controversial, page: \d+ }
raddit_app_featured_feed:
featured_feed:
defaults: { _controller: RadditAppBundle:Front:featuredFeed, sortBy: hot, page: 1 }
path: /featured/{sortBy}/{page}.atom
methods: [GET]
......
raddit_app_message_list:
message_list:
defaults: { _controller: RadditAppBundle:Message:list, page: 1 }
path: /messages/{page}
methods: [GET]
raddit_app_message:
message:
defaults: { _controller: RadditAppBundle:Message:message }
path: /message/{id}
methods: [GET]
raddit_app_compose_message:
compose_message:
defaults: { _controller: RadditAppBundle:Message:compose }
path: /compose_message/{username}
methods: [GET, POST]
raddit_app_reply_to_message:
reply_to_message:
defaults: { _controller: RadditAppBundle:Message:reply }
path: /message_reply/{id}
methods: [POST]
raddit_app_request_password_reset:
request_password_reset:
defaults: { _controller: RadditAppBundle:ResetPassword:requestReset }
path: /reset_password
methods: [GET, POST]
raddit_app_password_reset:
password_reset:
defaults: { _controller: RadditAppBundle:ResetPassword:reset }
path: /reset_password/{id}/{expires}/{checksum}
methods: [GET, POST]
......
raddit_app_login:
login:
defaults: { _controller: RadditAppBundle:Security:login }
path: /login
methods: [GET]
raddit_app_login_check:
login_check:
path: /login_check
methods: [POST]
raddit_app_log_out:
log_out:
path: /log_out
raddit_app_2fa_post:
2fa_post:
path: /
methods: [POST]
raddit_app_comments:
comments:
defaults: { _controller: RadditAppBundle:Submission:commentPage, slug: ~ }
path: /f/{forum_name}/{submission_id}/{slug}
methods: [GET]
requirements:
submission_id: \d+
raddit_app_comment:
comment:
defaults: { _controller: RadditAppBundle:Submission:commentPermalink }
path: /f/{forum_name}/{submission_id}/comment/{comment_id}
methods: [GET]
raddit_app_edit_submission:
edit_submission:
defaults: { _controller: RadditAppBundle:Submission:editSubmission }
path: /f/{forum_name}/edit_submission/{submission_id}
methods: [GET, POST]
raddit_app_lock:
lock:
defaults: { _controller: RadditAppBundle:Submission:lock, lock: true }
path: /f/{forum_name}/{submission_id}/lock
methods: [POST]
requirements: { id: \d+ }
raddit_app_unlock:
unlock:
defaults: { _controller: RadditAppBundle:Submission:lock, lock: false }
path: /f/{forum_name}/{submission_id}/unlock
methods: [POST]
requirements: { id: \d+ }
raddit_app_submit:
submit:
defaults: { _controller: RadditAppBundle:Submission:submit, forum_name: null }
path: /submit/{forum_name}
methods: [GET, POST]
raddit_app_submission_vote:
submission_vote:
defaults:
_controller: RadditAppBundle:Vote:vote
_format: html
......
raddit_app_theme_history:
theme_history:
defaults: { _controller: RadditAppBundle:Theme:history, page: 1}
path: /theme_history/{id}/{page}
methods: [GET]
requirements: { id: "%uuid_regex%", page: \d+ }
raddit_app_create_theme:
create_theme:
defaults: { _controller: RadditAppBundle:Theme:create }
path: /create_theme
methods: [GET, POST]
raddit_app_edit_theme:
edit_theme:
defaults: { _controller: RadditAppBundle:Theme:edit }
path: /edit_theme/{username}/{name}
methods: [GET, POST]
requirements: { name: .+, id: "%uuid_regex%" }
raddit_app_theme_revision_source:
theme_revision_source:
defaults: { _controller: RadditAppBundle:Theme:source }
path: /theme_source/{id}
methods: [GET]
requirements: { id: "%uuid_regex%" }
raddit_app_stylesheet:
stylesheet:
defaults: { _controller: RadditAppBundle:Theme:stylesheet, _format: css }
path: /user_style/{field}/{themeId}.css
methods: [GET]
requirements: { field: common|day|night, themeId: "%uuid_regex%" }
raddit_app_themes:
themes:
defaults: { _controller: RadditAppBundle:Theme:list, page: 1 }
path: /themes/{page}
methods: [GET]
......
raddit_app_user:
user:
defaults: { _controller: RadditAppBundle:User:userPage }
path: /user/{username}
methods: [GET]
raddit_app_user_shortcut:
defaults: { _controller: FrameworkBundle:Redirect:redirect, route: raddit_app_user }
user_shortcut:
defaults: { _controller: FrameworkBundle:Redirect:redirect, route: user }
path: /u/{username}
methods: [GET]
raddit_app_user_submissions:
user_submissions:
defaults: { _controller: RadditAppBundle:User:submissions, page: 1 }
path: /user/{username}/submissions/{page}
methods: [GET]
requirements: { page: \d+ }
raddit_app_user_comments:
user_comments:
defaults: { _controller: RadditAppBundle:User:comments, page: 1 }
path: /user/{username}/comments/{page}
methods: [GET]
requirements: { page: \d+ }
raddit_app_edit_user:
edit_user:
defaults: { _controller: RadditAppBundle:User:editUser }
path: /edit_user/{username}
methods: [GET, POST]
raddit_app_user_settings:
user_settings:
defaults: { _controller: RadditAppBundle:User:userSettings }
path: /user_settings/{username}
methods: [GET, POST]
raddit_app_user_block_list:
user_block_list:
defaults: { _controller: RadditAppBundle:User:blockList, page: 1 }
path: /block_list/{page}
methods: [GET, POST]
requirements: { page: \d+ }
raddit_app_block_user:
block_user:
defaults: { _controller: RadditAppBundle:User:block }
path: /block/{username}
methods: [GET, POST]
raddit_app_unblock_user:
unblock_user:
defaults: { _controller: RadditAppBundle:User:unblock }
path: /unblock/{id}
methods: [POST]
requirements: { id: "%uuid_regex%" }
raddit_app_registration:
registration:
defaults: { _controller: RadditAppBundle:User:registration }
path: /registration
methods: [GET, POST]
raddit_app_mark_user_trusted:
mark_user_trusted:
defaults: { _controller: RadditAppBundle:User:markAsTrusted }
path: /mark_as_trusted/{id}/{trusted}
methods: [POST]
requirements: { trusted: '[01]' }
raddit_app_inbox:
inbox:
defaults: { _controller: RadditAppBundle:User:inbox, page: 1 }
path: /inbox/{page}
methods: [GET]
requirements: { page: \d+ }
raddit_app_clear_inbox:
clear_inbox:
defaults: { _controller: RadditAppBundle:User:clearInbox, _format: html }
path: /clear_inbox.{_format}
methods: [POST]
......
raddit_app_wiki:
wiki:
defaults: { _controller: RadditAppBundle:Wiki:wiki, path: index }
path: /wiki/{path}
methods: [GET]
requirements: { path: "%wiki_page_regex%" }
raddit_app_wiki_create:
wiki_create:
defaults: { _controller: RadditAppBundle:Wiki:create }
path: /wiki/_create/{path}
methods: [GET, POST]
requirements: { path: "%wiki_page_regex%" }
raddit_app_wiki_edit:
wiki_edit:
defaults: { _controller: RadditAppBundle:Wiki:edit }
path: /wiki/_edit/{path}
methods: [GET, POST]
requirements: { path: "%wiki_page_regex%" }
raddit_app_wiki_history:
wiki_history:
defaults: { _controller: RadditAppBundle:Wiki:history, page: 1 }
path: /wiki/_history/{path}/{page}
methods: [GET]
requirements: { path: "%wiki_page_regex%" }
raddit_app_wiki_all:
wiki_all:
defaults: { _controller: RadditAppBundle:Wiki:all, page: 1 }
path: /wiki/_all/{page}
methods: [GET]
raddit_app_wiki_revision:
wiki_revision:
defaults: { _controller: RadditAppBundle:Wiki:revision }
path: /wiki/_revision/{id}
methods: [GET]
......
_raddit_app_ajax:
_ajax:
resource: routes/ajax.yml
_raddit_app_ban:
_ban:
resource: routes/ban.yml
_raddit_app_comment:
_comment:
resource: routes/comment.yml
_raddit_app_forum:
_forum:
resource: routes/forum.yml
_raddit_app_front:
_front:
resource: routes/front.yml
_raddit_app_message:
_message:
resource: routes/message.yml
_raddit_app_reset_password:
_reset_password:
resource: routes/reset_password.yml
_raddit_app_security:
_security:
resource: routes/security.yml
_raddit_app_submission:
_submission:
resource: routes/submission.yml
_raddit_app_theme:
_theme:
resource: routes/theme.yml
_raddit_app_user:
_user:
resource: routes/user.yml
_raddit_app_wiki:
_wiki:
resource: routes/wiki.yml
_bazinga_jstranslation:
......
......@@ -24,13 +24,13 @@ security:
form_login:
csrf_token_generator: security.csrf.token_manager
check_path: raddit_app_login_check
login_path: raddit_app_login
check_path: login_check
login_path: login
logout:
csrf_parameter: token
csrf_token_generator: security.csrf.token_manager
path: raddit_app_log_out
path: log_out
remember_me:
secret: "%secret"
......
......@@ -9,7 +9,7 @@ export default function ($) {
if ($receiver.val().trim() === '' && /^https?:\/\//.test(url)) {
$.ajax({
url: Routing.generate('raddit_app_fetch_title'),
url: Routing.generate('fetch_title'),
method: 'POST',
dataType: 'json',
data: { url: url }
......
......@@ -6,7 +6,7 @@ import $ from 'jquery';
function createPreview() {
$.ajax({
url: Routing.generate('raddit_app_markdown_preview'),
url: Routing.generate('markdown_preview'),
method: 'POST',
dataType: 'html',
data: { markdown: $(this).val() }
......
......@@ -30,12 +30,12 @@ class ForumLinkParser extends AbstractLocalLinkParser {
*/
public function getUrl(string $suffix): string {
if (strpos($suffix, '+') !== false) {
return $this->urlGenerator->generate('raddit_app_multi', [
return $this->urlGenerator->generate('multi', [
'names' => $suffix,
]);
}
return $this->urlGenerator->generate('raddit_app_forum', [
return $this->urlGenerator->generate('forum', [
'forum_name' => $suffix,
]);
}
......
......@@ -25,7 +25,7 @@ class UserLinkParser extends AbstractLocalLinkParser {
* {@inheritdoc}
*/
public function getUrl(string $suffix): string {
return $this->urlGenerator->generate('raddit_app_user', [
return $this->urlGenerator->generate('user', [
'username' => $suffix,
]);
}
......
......@@ -69,7 +69,7 @@ final class BanController extends Controller {
$em->persist($ban);
$em->flush();
return $this->redirectToRoute('raddit_app_bans');
return $this->redirectToRoute('bans');
}
return $this->render('ban/add.html.twig', [
......@@ -91,7 +91,7 @@ final class BanController extends Controller {
public function redirectAction(EntityManager $em, $entityClass, $id) {
$entity = $em->find($entityClass, $id);
return $this->redirectToRoute('raddit_app_add_ban', [
return $this->redirectToRoute('add_ban', [
'ip' => $entity->getIp(),
'user_id' => $entity->getUser()->getId(),
]);
......@@ -123,6 +123,6 @@ final class BanController extends Controller {
$em->flush();
return $this->redirectToRoute('raddit_app_bans');
return $this->redirectToRoute('bans');
}
}
......@@ -60,7 +60,7 @@ final class CommentController extends Controller {
}
$form = $this->createForm(CommentType::class, null, [
'action' => $this->generateUrl('raddit_app_comment_post', $routeParams),
'action' => $this->generateUrl('comment_post', $routeParams),
'forum' => $forumRepository->findOneBy([
'canonicalName' => mb_strtolower($forumName, 'UTF-8'),
]),
......@@ -104,7 +104,7 @@ final class CommentController extends Controller {
$em->persist($reply);
$em->flush();
return $this->redirectToRoute('raddit_app_comment', [
return $this->redirectToRoute('comment', [
'forum_name' => $forum->getName(),
'submission_id' => $submission->getId(),
'comment_id' => $reply->getId(),
......@@ -150,7 +150,7 @@ final class CommentController extends Controller {
$em->flush();
return $this->redirectToRoute('raddit_app_comment', [
return $this->redirectToRoute('comment', [
'forum_name' => $forum->getName(),
'submission_id' => $submission->getId(),
'comment_id' => $comment->getId(),
......@@ -232,7 +232,7 @@ final class CommentController extends Controller {
return $this->redirect($request->headers->get('Referer'));
}
return $this->redirectToRoute('raddit_app_comments', [
return $this->redirectToRoute('comments', [
'forum_name' => $comment->getSubmission()->getForum()->getName(),
'submission_id' => $comment->getSubmission()->getId(),