-
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.
Merge branch 'dev' into implementation/59721-add-setedit-reminder-but…
…tondialog-to-workpackage-page
- Loading branch information
Showing
521 changed files
with
13,065 additions
and
1,963 deletions.
There are no files selected for viewing
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
60 changes: 60 additions & 0 deletions
60
app/components/messages/show_page_header_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,60 @@ | ||
<%= | ||
render Primer::OpenProject::PageHeader.new do |header| | ||
header.with_title { @topic.subject } | ||
header.with_breadcrumbs(breadcrumb_items) | ||
|
||
watcher_button_args = watcher_button_arguments(@topic, User.current) | ||
header.with_action_button(**watcher_button_args) do |button| | ||
button.with_leading_visual_icon(icon: watcher_button_args[:mobile_icon]) | ||
watcher_button_args[:mobile_label] | ||
end | ||
|
||
if [email protected]? && authorize_for('messages', 'reply') | ||
header.with_action_button(tag: :a, | ||
scheme: :default, | ||
mobile_icon: :quote, | ||
mobile_label: t(:button_quote), | ||
size: :medium, | ||
href: url_for({ action: 'quote', id: @topic }), | ||
aria: { label: I18n.t(:button_delete) }, | ||
data: { 'action': 'forum-messages#quote', test_selector: "message-quote-button" }, | ||
title: t(:button_quote)) do |button| | ||
button.with_leading_visual_icon(icon: :quote) | ||
t(:button_quote) | ||
end | ||
end | ||
|
||
if @message.editable_by?(User.current) | ||
header.with_action_button(tag: :a, | ||
scheme: :default, | ||
mobile_icon: :pencil, | ||
mobile_label: t(:button_edit), | ||
size: :medium, | ||
href: edit_topic_path(@topic), | ||
aria: { label: t(:button_edit) }, | ||
data: { test_selector: "message-edit-button" }, | ||
title: t(:button_edit)) do |button| | ||
button.with_leading_visual_icon(icon: :pencil) | ||
t(:button_edit) | ||
end | ||
end | ||
|
||
if @message.destroyable_by?(User.current) | ||
header.with_action_button(tag: :a, | ||
scheme: :danger, | ||
mobile_icon: :trash, | ||
mobile_label: t(:button_delete), | ||
size: :medium, | ||
href: topic_path(@topic), | ||
aria: { label: I18n.t(:button_delete) }, | ||
data: { | ||
confirm: I18n.t(:text_are_you_sure), | ||
method: :delete | ||
}, | ||
title: I18n.t(:button_delete)) do |button| | ||
button.with_leading_visual_icon(icon: :trash) | ||
t(:button_delete) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# frozen_string_literal: true | ||
|
||
# -- 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 Messages | ||
class ShowPageHeaderComponent < ApplicationComponent | ||
include OpPrimer::ComponentHelpers | ||
include ApplicationHelper | ||
include WatchersHelper | ||
|
||
def initialize(topic:, message:, forum:, project:) | ||
super | ||
@topic = topic | ||
@message = message | ||
@forum = forum | ||
@project = project | ||
end | ||
|
||
def breadcrumb_items | ||
[ | ||
{ href: project_overview_path(@project.id), text: @project.name }, | ||
{ href: project_forums_path(@project), text: t(:label_forum_plural) }, | ||
{ href: project_forum_path(@project, @forum), text: @forum.name }, | ||
@topic.subject | ||
] | ||
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
100 changes: 100 additions & 0 deletions
100
app/components/projects/settings/index_page_header_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,100 @@ | ||
<%= | ||
render Primer::OpenProject::PageHeader.new do |header| | ||
header.with_title { t(:label_information_plural) } | ||
header.with_breadcrumbs( [ | ||
{ href: project_overview_path(@project.id), text: @project.name }, | ||
{ href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") }, | ||
t(:label_information_plural) | ||
]) | ||
|
||
if User.current.allowed_in_project?(:add_subprojects, @project) | ||
header.with_action_button(scheme: :primary, | ||
mobile_icon: :plus, | ||
mobile_label: t(:label_subproject_new), | ||
aria: { label: t(:label_subproject_new) }, | ||
title: t(:label_subproject_new), | ||
tag: :a, | ||
href: new_project_path(parent_id: @project.id)) do |button| | ||
button.with_leading_visual_icon(icon: :plus) | ||
t(:label_subproject) | ||
end | ||
end | ||
|
||
header.with_action_button(tag: :a, | ||
mobile_icon: :pencil, | ||
mobile_label: t('projects.settings.change_identifier'), | ||
size: :medium, | ||
href: project_identifier_path(@project), | ||
aria: { label: t('projects.settings.change_identifier') }, | ||
title: t('projects.settings.change_identifier')) do |button| | ||
button.with_leading_visual_icon(icon: :pencil) | ||
t('projects.settings.change_identifier') | ||
end | ||
|
||
header.with_action_menu( | ||
menu_arguments: { | ||
anchor_align: :end | ||
}, | ||
button_arguments: { | ||
icon: "op-kebab-vertical", | ||
"aria-label": t(:label_more), | ||
test_selector: "project-settings-more-menu" | ||
} | ||
) do |menu| | ||
if @project.copy_allowed? | ||
menu.with_item( | ||
label:t(:button_copy), | ||
href: copy_project_path(@project), | ||
content_arguments: { | ||
data: { turbo: false }, | ||
test_selector: "project-settings--copy" | ||
}, | ||
accesskey: helpers.accesskey(:copy), | ||
) do |item| | ||
item.with_leading_visual_icon(icon: :copy) | ||
end | ||
end | ||
|
||
if User.current.allowed_in_project?(:archive_project, @project) | ||
menu.with_item( | ||
tag: :a, | ||
label: t(:button_archive), | ||
href: project_archive_path(@project, status: '', name: @project.name), | ||
content_arguments: { | ||
data: { confirm: t('project.archive.are_you_sure', name: @project.name), method: :post, }, | ||
test_selector: "project-settings--archive" | ||
} | ||
) do |item| | ||
item.with_leading_visual_icon(icon: 'lock') | ||
end | ||
end | ||
if User.current.admin? | ||
label = @project.templated ? 'remove_from_templates' : 'make_template' | ||
menu.with_item( | ||
tag: :a, | ||
label: t("project.template.#{label}"), | ||
href: project_templated_path(@project), | ||
content_arguments: { | ||
data: { method: @project.templated ? :delete : :post }, | ||
test_selector: "project-settings--mark-template" | ||
} | ||
) do |item| | ||
item.with_leading_visual_icon(icon: @project.templated ? :"file-removed" : :"file-added") | ||
end | ||
|
||
menu.with_item( | ||
tag: :a, | ||
scheme: :danger, | ||
label: t(:button_delete), | ||
href: confirm_destroy_project_path(@project), | ||
content_arguments: { | ||
data: { turbo: false }, | ||
test_selector: "project-settings--delete" | ||
} | ||
) do |item| | ||
item.with_leading_visual_icon(icon: :trash) | ||
end | ||
end | ||
end | ||
end | ||
%> |
39 changes: 39 additions & 0 deletions
39
app/components/projects/settings/index_page_header_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,39 @@ | ||
# frozen_string_literal: true | ||
|
||
# -- 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. | ||
# ++ | ||
|
||
class Projects::Settings::IndexPageHeaderComponent < ApplicationComponent | ||
include OpPrimer::ComponentHelpers | ||
|
||
def initialize(project:) | ||
super | ||
|
||
@project = project | ||
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.