Skip to content

Commit

Permalink
[#51015] Mobile, the participant section should move to details section
Browse files Browse the repository at this point in the history
  • Loading branch information
dombesz committed Nov 23, 2023
1 parent dc92729 commit 10607d1
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions modules/meeting/app/components/_index.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "./meeting_agenda_items/item_component/show_component.sass"
@import "./meeting_agenda_items/form_component.sass"
@import "./meetings/sidebar/state_component.sass"
@import "./meetings/sidebar/participants_component.sass"
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,36 @@
end
end
end

details.with_row(mt: 2, classes: 'meeting-detail-participants') do
render_meeting_attribute_row(:people) do
flex_layout do |duration|
duration.with_column(mr: 2) do
render(Primer::Beta::Text.new) do
[
@meeting.invited_or_attended_participants.count,
Meeting.human_attribute_name(
:participants,
count: @meeting.invited_or_attended_participants.count
)
].join(" ")
end
end

if @meeting.editable?
duration.with_column(mr: 2) do
render(Primer::Beta::Button.new(
font_weight: :normal,
scheme: :link,
data: { 'show-dialog-id': "edit-participants-dialog" }
)) do |link|
t("label_meeting_show_all_participants")
end
end
end
end
end
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@import 'helpers'

.meeting-detail-participants
visibility: collapse

@media screen and (max-width: $breakpoint-sm)
#meetings-sidebar-component
.BorderGrid-row:nth-child(3)
visibility: collapse
#participants-component
.Overlay-backdrop--center
visibility: visible
.meeting-detail-participants
visibility: visible
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.op-meeting-sidebar-state
flex-direction: row !important
justify-content: space-between
align-items: center
align-items: center
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
render(Primer::OpenProject::BorderGrid.new) do |border_grid|
border_grid.with_row { render(Meetings::Sidebar::DetailsComponent.new(meeting: @meeting)) }
border_grid.with_row { render(Meetings::Sidebar::StateComponent.new(meeting: @meeting)) }
border_grid.with_row { render(Meetings::Sidebar::ParticipantsComponent.new(meeting: @meeting)) }
border_grid.with_row(id: 'participants-component') do
render(Meetings::Sidebar::ParticipantsComponent.new(meeting: @meeting))
end
end
end
%>
1 change: 1 addition & 0 deletions modules/meeting/app/controllers/meetings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def update_participants
if @meeting.errors.any?
update_sidebar_participants_form_component_via_turbo_stream
else
update_sidebar_details_component_via_turbo_stream
update_sidebar_participants_component_via_turbo_stream
end

Expand Down
1 change: 1 addition & 0 deletions modules/meeting/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ en:
label_meeting_manage_participants: "Manage participants"
label_meeting_no_participants: "No participants"
label_meeting_show_hide_participants: "Show/hide %{count} more"
label_meeting_show_all_participants: "Show all"
label_meeting_add_participants: "Add participants"

text_meeting_not_editable_anymore: "This meeting is not editable anymore."
Expand Down

0 comments on commit 10607d1

Please sign in to comment.