Skip to content
Snippets Groups Projects
Commit 1dddc052 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

wip

parent 292aa565
No related branches found
No related tags found
No related merge requests found
......@@ -59,8 +59,6 @@ class Admin::Communication::WebsitesController < Admin::Communication::Websites:
def update
if @website.update_and_sync(website_params)
# TODO better place, background job once w week?
@website.screenshot!
redirect_to [:admin, @website], notice: t('admin.successfully_updated_html', model: @website.to_s)
else
breadcrumb
......
......@@ -21,6 +21,7 @@ module Communication::Website::WithConnectedObjects
sync_with_git_without_delay
destroy_obsolete_git_files_without_delay
get_current_theme_version!
screenshot!
end
handle_asynchronously :clean_and_rebuild, queue: :cleanup
......@@ -88,9 +89,9 @@ module Communication::Website::WithConnectedObjects
University::Organization.where(id: ids)
end
def connected_publications
ids = connections.where(indirect_object_type: 'Research::Publication').pluck(:indirect_object_id)
Research::Publication.where(id: ids)
def connected_hal_publications
ids = connections.where(indirect_object_type: 'Research::Hal::Publication').pluck(:indirect_object_id)
Research::Hal::Publication.where(id: ids)
end
# ensure the object "website" respond to both is_direct_object? and is_indirect_object? as website doesn't include neither as_direct_object nor as_indirect_object
......
......@@ -23,6 +23,9 @@ class Screenshot
meta: false,
waitUntil: 'load',
device: 'Macbook Pro 15'
},
headers: {
x-api-key: ENV['MICROLINK_API_KEY']
}
})
data = JSON.parse(response.body)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment