OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add condition to display form checkbox
Mir Bhatia019cebc51699
diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rbindex 3486c3eea6b..a42b145fdd3 100644--- a/modules/meeting/app/controllers/meetings_controller.rb+++ b/modules/meeting/app/controllers/meetings_controller.rb@@ -316,7 +316,7 @@ class MeetingsController < ApplicationController# Force defaults on participants@converted_params[:participants_attributes] ||= {}@converted_params[:participants_attributes].each { |p| p.reverse_merge! attended: false, invited: false }- @converted_params[:send_notifications] = params[:send_notifications] == '1'+ @converted_params[:send_notifications] = ActiveRecord::Type::Boolean.new.cast params[:send_notifications]enddef meeting_paramsdiff --git a/modules/meeting/app/views/meetings/_form.html.erb b/modules/meeting/app/views/meetings/_form.html.erbindex a7503983050..80d13fe1f91 100644--- a/modules/meeting/app/views/meetings/_form.html.erb+++ b/modules/meeting/app/views/meetings/_form.html.erb@@ -192,15 +192,18 @@ See COPYRIGHT and LICENSE files for more details.<%= render partial: 'meetings/participants_section' %>- <div class="form--field">- <%= styled_label_tag 'send_notfications', t(:"meeting.email.send_emails") %>- <div class="form--field-container">- <%= styled_check_box_tag 'send_notifications',- 1,- true %>- </div>- <div class="form--field-instructions">- <%= t(:"meeting.email.send_invitation_emails") %>+<% if @meeting.new_record? || copy_from.present? %>+ <div class="form--field">+ <%= styled_label_tag 'send_notfications', t(:"meeting.email.send_emails") %>+ <div class="form--field-container">+ <%= styled_check_box_tag 'send_notifications',+ 1,+ true %>+ </div>+ <div class="form--field-instructions">+ <%= t(:"meeting.email.send_invitation_emails") %>+ </div></div>- </div>+ <% end %>+</section>