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.7 KB
Raw Blame
<%=
  component_wrapper do
    render(Primer::OpenProject::SidePanel::Section.new) do |section|
      section.with_title { t(:label_meeting_state) }

      case @meeting.state
      when "open"
        flex_layout(classes: "op-meeting-sidebar-state") do |open_state|
          open_state.with_row do
            status_button
          end

          open_state.with_row(mt: 3, classes: "hidden-for-mobile") do
            render(Primer::Beta::Text.new(color: :subtle)) { t("text_meeting_open_description") }
          end

          if edit_enabled?
            section.with_footer_button(
              color: :accent,
              tag: :a,
              href: href("in_progress"),
              classes: "hide-when-print",
              test_selector: "close-meeting-button",
              data: button_data_attributes(href("in_progress"))
            ) do |button|
              button.with_leading_visual_icon(icon: :play)
              t("label_meeting_in_progress_action")
            end
          end
        end

      when "closed"
        flex_layout(classes: "op-meeting-sidebar-state") do |closed_state|
          closed_state.with_row do
            status_button
          end

          closed_state.with_row(mt: 3, classes: "hidden-for-mobile") do
            render(Primer::Beta::Text.new(color: :subtle)) { t("text_meeting_closed_description") }
          end

          if edit_enabled?
            section.with_footer_button(
              color: :accent,
              tag: :a,
              scheme: :link,
              href: href("open"),
              classes: "hide-when-print",
              data: button_data_attributes(href("open"))
            ) do |button|
              button.with_leading_visual_icon(icon: :unlock)
              t("label_meeting_reopen_action")
            end
          end
        end

      when "in_progress"
        flex_layout(classes: "op-meeting-sidebar-state") do |in_progress_state|
          in_progress_state.with_row do
            status_button
          end

          in_progress_state.with_row(mt: 3, classes: "hidden-for-mobile") do
            render(Primer::Beta::Text.new(color: :subtle)) { t("text_meeting_in_progress_description") }
          end

          if edit_enabled?
            section.with_footer_button(
              color: :accent,
              tag: :a,
              scheme: :link,
              href: href("closed"),
              classes: "hide-when-print",
              test_selector: "close-meeting-button",
              data: button_data_attributes(href("closed"))
            ) do |button|
              button.with_leading_visual_icon(icon: :unlock)
              t("label_meeting_close_action")
            end
          end
        end
      end
    end
  end
%>