competition-8.x-1.x-dev/competition.routing.yml
competition.routing.yml
# Competition entity routes.
entity.competition.settings:
path: '/admin/structure/competition/settings'
defaults:
_form: '\Drupal\competition\Form\CompetitionSettingsForm'
_title: 'Competition settings'
requirements:
_permission: 'administer competitions'
entity.competition.canonical:
path: '/competition/{competition}/enter'
defaults:
_controller: '\Drupal\competition\Controller\CompetitionEntryController::getForm'
_title_callback: '\Drupal\competition\Controller\CompetitionEntryController::getFormTitleAdd'
is_reentry: FALSE
requirements:
# 2017-02-14, Tory:
# Replace this with entity access control, for flexibility and alter hook
# invocations.
# @see CompetitionEntryAccessControlHandler::checkCreateAccess()
# _permission: 'access content'
_entity_create_access: 'competition_entry:{competition}'
entity.competition.collection:
path: '/admin/structure/competition'
defaults:
_entity_list: 'competition'
_title: 'Competitions'
requirements:
_permission: 'administer competitions'
entity.competition.add_form:
path: '/admin/structure/competition/add'
defaults:
_entity_form: 'competition.add'
_title: 'Add competition'
requirements:
_permission: 'administer competitions'
entity.competition.edit_form:
path: '/admin/structure/competition/{competition}'
defaults:
_entity_form: 'competition.edit'
_title: 'Edit competition'
requirements:
_permission: 'administer competitions'
entity.competition.delete_form:
path: '/admin/structure/competition/{competition}/delete'
defaults:
_entity_form: 'competition.delete'
_title: 'Delete competition'
requirements:
_permission: 'administer competitions'
# Per-competition user forms.
# @see user.routing.yml - user.register
competition.user_register:
path: '/competition/{competition}/register'
defaults:
# This would render the register form directly. Use a callback instead
# to gracefully redirect logged-in users.
# _entity_form: 'user.register'
_controller: '\Drupal\competition\Controller\CompetitionEntryController::competitionRegister'
_title: 'Create new account'
requirements:
# This requirement throws Access Denied if user is logged in. The user
# module intercepts it and redirects in AccessDeniedSubscriber. We instead
# use our controller callback to check access and redirect instead.
# _access_user_register: 'TRUE'
_permission: 'access content'
options:
parameters:
competition:
type: entity:competition
# @see user.routing.yml - user.login
competition.user_login:
path: '/competition/{competition}/login'
defaults:
_form: '\Drupal\user\Form\UserLoginForm'
_title: 'Log in'
requirements:
_user_is_logged_in: 'FALSE'
options:
parameters:
competition:
type: entity:competition
# Competition entry entity routes.
entity.competition_entry.collection:
path: '/admin/content/competition'
defaults:
_entity_list: 'competition_entry'
_title: 'Competition entries'
requirements:
_permission: 'administer competition entries'
entity.competition_entry.reports:
path: '/admin/content/competition/reports'
defaults:
_title: 'Reports'
_controller: '\Drupal\competition\Controller\CompetitionEntryController::adminReports'
requirements:
_permission: 'administer competition entries'
entity.competition_entry.report_generate:
path: '/admin/content/competition/reports/generate'
defaults:
_title: 'Generate Report'
_controller: '\Drupal\competition\Controller\CompetitionEntryController::generateReport'
requirements:
_permission: 'administer competition entries'
entity.competition_entry.report_download:
path: '/admin/content/competition/reports/download/{filename}'
defaults:
_title: 'Download Report'
_controller: '\Drupal\competition\Controller\CompetitionEntryController::downloadReportCsv'
requirements:
_permission: 'administer competition entries'
entity.competition_entry.report_update:
path: '/admin/content/competition/reports/update'
defaults:
_title: 'Update Reporting Data'
_controller: '\Drupal\competition\Controller\CompetitionEntryController::updateReportData'
requirements:
_permission: 'administer competition entries'
entity.competition_entry.judging:
path: '/admin/content/competition/judging/{competition}/{callback}'
defaults:
_title: 'Judging'
_controller: '\Drupal\competition\Controller\CompetitionEntryController::adminJudging'
competition: NULL
callback: NULL
requirements:
_permission: 'judge competition entries'
entity.competition_entry.judging.entry:
path: '/admin/content/competition/judging/entry/{competition_entry}'
defaults:
_title: 'Judging'
_form: '\Drupal\competition\Form\CompetitionEntryJudgingForm'
requirements:
_permission: 'judge competition entries'
options:
parameters:
competition_entry:
type: entity:competition_entry
entity.competition_entry.judging.score_details:
path: '/admin/content/competition/judging/score/{is_ajax}/{entry}/{round_id}'
defaults:
_controller: 'Drupal\competition\Controller\CompetitionEntryController::showScoreDetails'
requirements:
_permission: 'administer competition judging'
options:
parameters:
entry:
type: entity:competition_entry
entity.competition_entry.page:
path: '/competitions'
defaults:
_controller: '\Drupal\competition\Controller\CompetitionEntryController::add'
_title: 'Competitions'
options:
_admin_route: FALSE
requirements:
_entity_create_access: 'competition_entry'
entity.competition_entry.add_form:
path: '/competition/{competition}/enter'
defaults:
_controller: '\Drupal\competition\Controller\CompetitionEntryController::getForm'
_title_callback: '\Drupal\competition\Controller\CompetitionEntryController::getFormTitleAdd'
is_reentry: FALSE
requirements:
# 2017-02-14, Tory:
# Replace this with entity access control, for flexibility and alter hook
# invocations.
# @see CompetitionEntryAccessControlHandler::checkCreateAccess()
# _permission: 'access content'
_entity_create_access: 'competition_entry:{competition}'
entity.competition_entry.reenter_form:
path: '/competition/{competition}/reenter'
defaults:
_controller: '\Drupal\competition\Controller\CompetitionEntryController::getForm'
_title_callback: '\Drupal\competition\Controller\CompetitionEntryController::getFormTitleAdd'
is_reentry: TRUE
requirements:
_permission: 'access content'
entity.competition_entry.canonical:
path: '/entry/{competition_entry}'
defaults:
_entity_view: 'competition_entry.full'
_title: 'View entry'
requirements:
_entity_access: 'competition_entry.view'
entity.competition_entry.edit_form:
path: '/entry/{competition_entry}/edit'
defaults:
_entity_form: 'competition_entry.edit'
requirements:
_entity_access: 'competition_entry.update'
entity.competition_entry.delete_form:
path: '/entry/{competition_entry}/delete'
defaults:
_entity_form: 'competition_entry.delete'
_title: 'Delete entry'
requirements:
_entity_access: 'competition_entry.delete'
entity.competition_entry.multiple_delete_confirm:
path: '/admin/content/competition/delete'
defaults:
_form: '\Drupal\competition\Form\CompetitionEntryDeleteMultiple'
requirements:
_permission: 'administer competitions'
entity.competition_entry.archives:
path: '/competition/{competition}/archives/{cycle}'
defaults:
_controller: '\Drupal\competition\Controller\CompetitionEntryController::displayArchives'
_title: 'Archives'
requirements:
_permission: 'access content'
entity.competition_entry.archives_current:
path: '/competition/{competition}/archives'
defaults:
_controller: '\Drupal\competition\Controller\CompetitionEntryController::displayArchivesCurrent'
_title: 'Archives'
requirements:
_permission: 'access content'
