Class: Lcms::Engine::Admin::DocumentsController
Constant Summary
AdminController::RE_GOOGLE_FOLDER
Instance Method Summary
collapse
Methods included from PathHelper
#dynamic_document_path, #dynamic_material_path, #dynamic_path
settings
Instance Method Details
#create ⇒ Object
20
21
22
23
24
25
26
|
# File 'app/controllers/lcms/engine/admin/documents_controller.rb', line 20
def create
@document = DocumentForm.new(form_params.except(:async, :with_materials))
return create_multiple if form_params[:link].match?(RE_GOOGLE_FOLDER)
form_params[:async].to_i.zero? ? create_sync : create_async
end
|
#destroy ⇒ Object
28
29
30
31
32
|
# File 'app/controllers/lcms/engine/admin/documents_controller.rb', line 28
def destroy
@document = Document.find(params[:id])
@document.destroy
redirect_to lcms_engine.admin_documents_path(query: @query_params), notice: t('.success')
end
|
#destroy_selected ⇒ Object
34
35
36
37
|
# File 'app/controllers/lcms/engine/admin/documents_controller.rb', line 34
def destroy_selected
count = @documents.destroy_all.count
redirect_to lcms_engine.admin_documents_path(query: @query_params), notice: t('.success', count: count)
end
|
#import_status ⇒ Object
39
40
41
42
|
# File 'app/controllers/lcms/engine/admin/documents_controller.rb', line 39
def import_status
data = import_status_for DocumentGenerator.document_parse_job
render json: data, status: :ok
end
|
#index ⇒ Object
14
15
16
17
18
|
# File 'app/controllers/lcms/engine/admin/documents_controller.rb', line 14
def index
@query = OpenStruct.new @query_params @documents = DocTemplate.config['queries']['document'].constantize.call(@query, page: params[:page])
render_customized_view
end
|
#new ⇒ Object
44
45
46
|
# File 'app/controllers/lcms/engine/admin/documents_controller.rb', line 44
def new
@document = DocumentForm.new
end
|
#reimport_selected ⇒ Object
48
49
50
51
|
# File 'app/controllers/lcms/engine/admin/documents_controller.rb', line 48
def reimport_selected
bulk_import @documents
render :import
end
|