Skip to content

Commit

Permalink
Merge branch 'main' into agenda-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
SebouChu committed Feb 28, 2025
2 parents 0a893a7 + a067895 commit 574d5f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/assets/javascripts/extranet.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//= require simple_form_bs5_file_input
//= require summernote/summernote-bs5
//= require autocomplete-rails
//= require hashcash
//= require_tree ./application/plugins
//= require_tree ./extranet
//= require osuny-hugo-theme/script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def publish_batch
target_posts.each do |post|
l10n = post.localization_for(current_language)
next unless l10n.present?
l10n.publish!
is_published ? l10n.publish! : l10n.unpublish!
post.save_and_sync
end
redirect_back fallback_location: admin_communication_website_posts_path,
Expand Down
6 changes: 6 additions & 0 deletions app/models/concerns/with_publication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ def publish!
save
end

def unpublish!
self.published = false
self.published_at = nil
save
end

def draft?
!published
end
Expand Down

0 comments on commit 574d5f5

Please sign in to comment.