patch_file/config/routes.rb

34 lines
1.2 KiB
Ruby
Raw Normal View History

2019-09-28 11:48:59 +00:00
Rails.application.routes.draw do
2022-10-16 11:55:32 +00:00
Thread.new do
patchfile_field = Patchfilefield.where(:title=>'patchfile').first
if patchfile_field
used_font = patchfile_field.used_font
if used_font.present?
File.open("app/assets/javascripts/ckeditor/custom_fonts.txt","w+") do |f|
f.write(used_font.join(";"))
end
end
end
end
2019-09-28 11:48:59 +00:00
locales = Site.first.in_use_locales rescue I18n.available_locales
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
namespace :admin do
get 'patchfiles' , to: 'patchfiles#index'
get 'patchfiles/repair_module' , to: 'patchfiles#repair_module'
get 'patchfiles/showckeditor' , to: 'patchfiles#showckeditor'
get 'patchfiles/editckeditor' , to: 'patchfiles#editckeditor'
get 'patchfiles/editfontfile' , to: 'patchfiles#editfontfile'
post 'patchfiles/newfont' , to: 'patchfiles#newfont'
get 'patchfiles/newfont' , to: 'patchfiles#newfont'
patch 'patchfiles/newfont' , to: 'patchfiles#newfont'
post 'patchfiles/edit' , to: 'patchfiles#edit'
get 'patchfiles/edit' , to: 'patchfiles#edit'
patch 'patchfiles/edit' , to: 'patchfiles#edit'
resources :patchfiles
2019-09-28 11:48:59 +00:00
end
end
end