- @pagetitle = 'Create News Item'
.row
  .col
    .card
      .card-body
        .row
          .col-12
            %h3= @pagetitle
          .col-12.col-md-9.col-lg-6
            = form_for(StatusMessage.new, url: news_items_path) do |f|
              .mb-3
                = f.label(:message) do
                  Message:
                  = render partial: 'webui/shared/required_label_mark'
                = render WriteAndPreviewComponent.new(form: f, preview_message_url: preview_news_items_path,
                                                      message_body_param: 'status_message[message]')
              .mb-3
                = f.label(:severity) do
                  Severity:
                  = render partial: 'webui/shared/required_label_mark'
                  %small.form-text With "Announcement", the message will be displayed on the top and all over the web site.
                - options = StatusMessage.severities.keys.map { |severity| [severity.humanize, severity] }
                = f.select(:severity, options_for_select(options), {}, class: 'form-select')
              .mb-3
                = f.label(:communication_scope, 'Communication Scope:')
                - options = StatusMessage.communication_scopes.keys.map { |scope| [scope.humanize, scope] }
                = f.select(:communication_scope, options_for_select(options), {}, class: 'form-select')
              = f.submit 'Create', class: 'btn btn-primary'
              = link_to('Back', request.referer.presence || news_items_path, class: 'btn btn-outline-secondary', role: 'button')
