Skip to content

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

2.5 KB
Raw Blame
<%= component_wrapper(tag: "turbo-frame") do %>
  <%= primer_form_with(
        model: reminder,
        url: submit_path,
        id: FORM_ID
      ) do |f| %>
    <%= flex_layout(classes: "reminder-modal-body--form-flex-container") do |form_flex_container| %>
      <%= form_flex_container.with_row do %>
        <%= render(WorkPackages::Reminder::RemindAtDate.new(f, initial_value: remind_at_date_initial_value)) %>
      <% end %>
      <%= form_flex_container.with_row do %>
        <%= render(WorkPackages::Reminder::RemindAtTime.new(f, initial_value: remind_at_time_initial_value)) %>
      <% end %>
      <%= form_flex_container.with_row do %>
        <%= render(WorkPackages::Reminder::Note.new(f)) %>
      <% end %>
      <% if reminder.persisted? %>
        <%= form_flex_container.with_row(
              flex_layout: true,
              justify_content: :space_between
            ) do |actions_row| %>
          <%= actions_row.with_column do %>
            <%= render(
                  Primer::Beta::Button.new(
                    scheme: :danger,
                    type: :submit,
                    formaction: work_package_reminder_path(remindable, reminder),
                    formmethod: :delete
                  )
                ) { I18n.t(:button_remove_reminder) } %>
          <% end %>
          <%= actions_row.with_column(flex_layout: true) do |actions_sub_row| %>
            <%= actions_sub_row.with_column(mr: 2) do %>
              <%= render(Primer::Beta::Button.new(**cancel_button_props)) { I18n.t(:button_cancel) } %>
            <% end %>
            <%= actions_sub_row.with_column do %>
              <%= render(
                    Primer::Beta::Button.new(
                      scheme: :primary,
                      type: :submit
                    )
                  ) { I18n.t(:button_save) } %>
            <% end %>
          <% end %>
        <% end %>
      <% else %>
        <%= form_flex_container.with_row(
              flex_layout: true,
              justify_content: :flex_end
            ) do |actions_row| %>
          <%= actions_row.with_column(mr: 2) do %>
            <%= render(Primer::Beta::Button.new(**cancel_button_props)) { I18n.t(:button_cancel) } %>
          <% end %>
          <%= actions_row.with_column do %>
            <%= render(
                  Primer::Beta::Button.new(
                    scheme: :primary,
                    type: :submit
                  )
                ) { I18n.t(:button_set_reminder) } %>
          <% end %>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
<% end %>