-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update meeting series template to allow finalizing the template (#17365
- Loading branch information
1 parent
20a1120
commit 0cffa57
Showing
13 changed files
with
296 additions
and
19 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
modules/meeting/app/components/meeting_agenda_items/blank_slate_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<%= | ||
render(Primer::Beta::Blankslate.new) do |component| | ||
component.with_visual_icon(icon: :book) | ||
component.with_heading(tag: :h2).with_content(title) | ||
component.with_description do | ||
flex_layout do |flex| | ||
if template? | ||
flex.with_row(mb: 2) do | ||
render(Primer::Beta::Text.new(color: :subtle)) { t(:"recurring_meeting.template.description") } | ||
end | ||
end | ||
|
||
flex.with_row(mb: 2) do | ||
render(Primer::Beta::Text.new(color: :subtle)) { t(:text_meeting_empty_description_1) } | ||
end | ||
flex.with_row do | ||
render(Primer::Beta::Text.new(color: :subtle)) { t(:text_meeting_empty_description_2) } | ||
end | ||
if can_finalize_template? | ||
flex.with_row(mt: 2) do | ||
render(Primer::Beta::Text.new(font_weight: :bold, color: :subtle)) do | ||
t(:"recurring_meeting.template.blankslate_finalize", | ||
button_title: t("recurring_meeting.template.button_finalize")) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
%> |
59 changes: 59 additions & 0 deletions
59
modules/meeting/app/components/meeting_agenda_items/blank_slate_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#-- copyright | ||
# OpenProject is an open source project management software. | ||
# Copyright (C) the OpenProject GmbH | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License version 3. | ||
# | ||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
# Copyright (C) 2006-2013 Jean-Philippe Lang | ||
# Copyright (C) 2010-2013 the ChiliProject Team | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
# | ||
# See COPYRIGHT and LICENSE files for more details. | ||
#++ | ||
|
||
module MeetingAgendaItems | ||
class BlankSlateComponent < ApplicationComponent | ||
include ApplicationHelper | ||
include OpTurbo::Streamable | ||
include OpPrimer::ComponentHelpers | ||
|
||
attr_reader :meeting | ||
|
||
def initialize(meeting:) | ||
super | ||
|
||
@meeting = meeting | ||
end | ||
|
||
delegate :template?, to: :meeting | ||
|
||
def title | ||
if template? | ||
t(:"recurring_meeting.template.blank_title") | ||
else | ||
t(:text_meeting_empty_heading) | ||
end | ||
end | ||
|
||
def can_finalize_template? | ||
template? && | ||
User.current.allowed_in_project?(:create_meetings, @meeting.project) && | ||
@meeting.recurring_meeting.scheduled_meetings.none? | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ | |
get :details_dialog | ||
post :init | ||
post :delete_scheduled | ||
post :template_completed | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.