#!/usr/bin/env perl
use Mojo::Base -strict, -signatures;
use feature qw(unicode_strings);
my $default_page = {'страница' => 'коренъ', 'ѩꙁыкъ' => 'bg'};
my %default_to   = (to => 'stranici#execute', name => 'коренъ');
{
  routes => [

    #{get  => '/',       to => 'example#welcome'},
    # root page in all domains needs to have alias 'коренъ'
    # change the value for 'страница' for example to 'index'
    # if you want your root page to have alias 'index'.
    {any => {'/index.html' => $default_page}, %default_to},
    {any => {'/'           => $default_page}, %default_to},
    {get  => '/входъ',  to => 'auth#form',     name => 'authform'},
    {post => '/входъ',  to => 'auth#sign_in',  name => 'sign_in'},
    {get  => '/изходъ', to => 'auth#sign_out', name => 'sign_out'},
    {
      get  => '/първи-входъ/<token:fl_token>',
      to   => 'auth#first_login_form',
      name => 'first_login_form'
    },
    {post => '/първи-входъ', to => 'auth#first_login', name => 'first_login'},
    {
      any  => '/загубенъ-ключъ',
      to   => 'auth#lost_password_form',
      name => 'lost_password_form'
    },
    {
      under  => '/Ꙋправленѥ',
      to     => 'auth#under_management',
      name   => 'under_management',
      routes => [
        {any  => '/',                to => 'upravlenie#index', name => 'home_upravlenie'},
        {get  => '/groups',          to => 'groups#index',     name => 'home_groups'},
        {get  => '/groups/create',   to => 'groups#create',    name => 'create_groups'},
        {get  => '/groups/:id',      to => 'groups#show',      name => 'show_groups'},
        {post => '/groups',          to => 'groups#store',     name => 'store_groups'},
        {get  => '/groups/:id/edit', to => 'groups#edit',      name => 'edit_groups'},
        {put  => '/groups/:id',      to => 'groups#update',    name => 'update_groups'},
        {delete => '/groups/:id',   to => 'groups#remove', name => 'remove_groups'},
        {get    => '/users',        to => 'users#index',   name => 'home_users'},
        {get    => '/users/create', to => 'users#create',  name => 'create_users'},
        {get    => '/users/:id',    to => 'users#show',    name => 'show_users'},
        {post   => '/users',        to => 'users#store',   name => 'store_users'},
        {
          get  => '/users/store_result/:jid',
          to   => 'users#store_result',
          name => 'users_store_result'
        },
        {get    => '/users/:id/edit',  to => 'users#edit',     name => 'edit_users'},
        {put    => '/users/:id',       to => 'users#update',   name => 'update_users'},
        {delete => '/users/:id',       to => 'users#remove',   name => 'remove_users'},
        {get    => '/domove',          to => 'domove#index',   name => 'home_domove'},
        {get    => '/domove/create',   to => 'domove#create',  name => 'create_domove'},
        {get    => '/domove/:id',      to => 'domove#show',    name => 'show_domove'},
        {post   => '/domove',          to => 'domove#store',   name => 'store_domove'},
        {get    => '/domove/:id/edit', to => 'domove#edit',    name => 'edit_domove'},
        {put    => '/domove/:id',      to => 'domove#update',  name => 'update_domove'},
        {delete => '/domove/:id',      to => 'domove#remove',  name => 'remove_domove'},
        {get    => '/stranici',        to => 'stranici#index', name => 'home_stranici'},
        {get  => '/stranici/create', to => 'stranici#create', name => 'create_stranici'},
        {get  => '/stranici/:id',    to => 'stranici#show',   name => 'show_stranici'},
        {post => '/stranici',        to => 'stranici#store',  name => 'store_stranici'},
        {get => '/stranici/:id/edit', to => 'stranici#edit',   name => 'edit_stranici'},
        {put => '/stranici/:id',      to => 'stranici#update', name => 'update_stranici'},
        {delete => '/stranici/:id',  to => 'stranici#remove', name => 'remove_stranici'},
        {get    => '/celini',        to => 'celini#index',    name => 'home_celini'},
        {get    => '/celini/create', to => 'celini#create',   name => 'create_celini'},
        {get    => '/celini/:id',    to => 'celini#show',     name => 'show_celini'},
        {post   => '/celini',        to => 'celini#store',    name => 'store_celini'},
        {get    => '/celini/:id/edit', to => 'celini#edit',   name => 'edit_celini'},
        {put    => '/celini/:id',      to => 'celini#update', name => 'update_celini'},
        {delete => '/celini/:id',      to => 'celini#remove', name => 'remove_celini'},
        {under => '/minion/', name => 'home_minion', to => 'auth#under_minion',},
      ],
    },

    {
      any  => '/<страница:str>/<цѣлина:cel>.<ѩꙁыкъ:lng>.html',
      to   => 'celini#execute',
      name => 'цѣлина_с_ѩꙁыкъ'
    },
    {
      any  => '/<страница:str>.<ѩꙁыкъ:lng>.html',
      to   => 'stranici#execute',
      name => 'страница_с_ѩꙁыкъ'
    },
    {
      any  => '/<страница:str>/<цѣлина:cel>.html',
      to   => 'celini#execute',
      name => 'цѣлина'
    },
    {any => '/<страница:str>.html', to => 'stranici#execute', name => 'страница'},
  ]}