2019-03-26 15:32:20 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-01-02 17:19:25 +00:00
|
|
|
Rails.application.routes.draw do
|
2019-07-03 23:25:23 +00:00
|
|
|
devise_for :usuaries
|
2020-02-06 17:06:47 +00:00
|
|
|
mount Blazer::Engine, at: 'blazer'
|
2018-01-29 18:09:30 +00:00
|
|
|
|
2019-07-03 23:25:23 +00:00
|
|
|
root 'application#index'
|
2018-02-26 22:08:21 +00:00
|
|
|
|
2019-09-11 16:31:14 +00:00
|
|
|
direct :mutual_aid do |channel|
|
|
|
|
"https://chat.#{Site.domain}/?channels=#{channel}"
|
|
|
|
end
|
|
|
|
|
2018-02-25 01:10:37 +00:00
|
|
|
get 'markdown', to: 'application#markdown'
|
2018-01-29 18:09:30 +00:00
|
|
|
|
2019-09-05 18:56:24 +00:00
|
|
|
constraints subdomain: 'api' do
|
|
|
|
scope module: 'api' do
|
|
|
|
namespace :v1 do
|
2020-02-06 16:11:17 +00:00
|
|
|
resources :csp_reports, only: %i[create]
|
2020-02-11 15:06:36 +00:00
|
|
|
resources :sites, only: %i[index], constraints: { site_id: /[a-z0-9\-\.]+/, id: /[a-z0-9\-\.]+/ } do
|
|
|
|
get 'invitades/cookie', to: 'invitades#cookie'
|
|
|
|
resources :posts, only: %i[create]
|
2020-05-30 19:43:25 +00:00
|
|
|
get :'contact/cookie', to: 'invitades#contact_cookie'
|
|
|
|
post 'contact/:form', to: 'contact#receive'
|
2020-02-11 15:06:36 +00:00
|
|
|
end
|
2019-09-05 18:56:24 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-07-12 23:40:44 +00:00
|
|
|
resources :sites, constraints: { site_id: %r{[^/]+}, id: %r{[^/]+} } do
|
2018-10-02 18:47:26 +00:00
|
|
|
get 'public/:type/:basename', to: 'sites#send_public_file'
|
2019-07-03 23:25:23 +00:00
|
|
|
|
2019-07-16 19:47:44 +00:00
|
|
|
# Gestionar actualizaciones del sitio
|
|
|
|
get 'pull', to: 'sites#fetch'
|
|
|
|
post 'pull', to: 'sites#merge'
|
|
|
|
|
2019-07-04 16:23:43 +00:00
|
|
|
# Gestionar usuaries
|
2019-07-05 23:55:59 +00:00
|
|
|
get 'usuaries/invite', to: 'usuaries#invite'
|
|
|
|
post 'usuaries/invite', to: 'usuaries#send_invitations'
|
2019-07-08 17:55:19 +00:00
|
|
|
patch 'usuaries/accept_invitation', to: 'usuaries#accept_invitation'
|
|
|
|
patch 'usuaries/reject_invitation', to: 'usuaries#reject_invitation'
|
2019-07-04 16:23:43 +00:00
|
|
|
resources :usuaries do
|
|
|
|
patch 'demote', to: 'usuaries#demote'
|
|
|
|
patch 'promote', to: 'usuaries#promote'
|
2018-09-28 14:34:37 +00:00
|
|
|
end
|
2018-02-09 21:28:27 +00:00
|
|
|
|
2019-07-08 20:58:14 +00:00
|
|
|
get 'collaborate', to: 'collaborations#collaborate'
|
|
|
|
post 'collaborate', to: 'collaborations#accept_collaboration'
|
|
|
|
|
2020-05-23 15:38:03 +00:00
|
|
|
# Gestionar artículos según idioma
|
|
|
|
nested do
|
|
|
|
scope '(:locale)' do
|
|
|
|
post :'posts/reorder', to: 'posts#reorder'
|
|
|
|
resources :posts
|
|
|
|
end
|
|
|
|
end
|
2019-07-04 16:23:43 +00:00
|
|
|
|
|
|
|
# Gestionar traducciones
|
2018-02-09 21:28:27 +00:00
|
|
|
get 'i18n', to: 'i18n#index'
|
|
|
|
get 'i18n/edit', to: 'i18n#edit'
|
|
|
|
post 'i18n', to: 'i18n#update'
|
2018-02-20 17:47:11 +00:00
|
|
|
|
2019-07-04 16:23:43 +00:00
|
|
|
# Compilar el sitio
|
2018-02-20 17:47:11 +00:00
|
|
|
post 'enqueue', to: 'sites#enqueue'
|
2018-04-27 20:24:28 +00:00
|
|
|
post 'reorder_posts', to: 'sites#reorder_posts'
|
2019-08-02 00:20:42 +00:00
|
|
|
|
|
|
|
resources :stats, only: [:index]
|
2018-01-29 18:09:30 +00:00
|
|
|
end
|
2018-01-02 17:19:25 +00:00
|
|
|
end
|