announcement-test/config/routes.rb

38 lines
1.6 KiB
Ruby

Rails.application.routes.draw do
locales = Site.first.in_use_locales rescue I18n.available_locales
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
namespace :admin do
post 'announcement/preview', to: 'announcements#preview'
post 'announcement/createfeed', to: 'announcements#createfeed'
post 'announcement/importanns', to: 'announcements#importanns'
get 'announcement/excel_format', to: 'announcements#excel_format'
patch 'announcement/updatefeed', to: 'announcements#updatefeed'
delete 'announcement/deletefeed', to: 'announcements#deletefeed'
get 'announcement/destroy_preview/:slug_title-:uid', to: 'announcements#destroy_preview'
get 'announcement/approve_bulletin', to: 'announcements#approve_bulletin'
get 'announcement/feed', to: 'announcements#feed'
get 'announcements/feedform', to: 'announcements#feedform'
get 'announcement/settings', to: 'announcements#settings'
get 'announcement/import', to: 'announcements#import'
post 'announcement/createsettings', to: 'announcements#createsettings'
patch 'announcement/updatesettings', to: 'announcements#updatesettings'
resources :announcements
end
resources :announcements do
collection do
get ':slug_title-:uid', to: 'announcements#show', as: :display
end
end
get "/xhr/announcements/feed/:uid" => "announcement_feeds#feed"
get "/xhr/announcements/rssfeed/:uid" => "announcement_feeds#rssfeed"
get "/xhr/announcements/feeds" => "announcement_feeds#feeds"
get '/xhr/announcements/announcement.json', to: 'bulletins#get_bulletins'
end
end