pull/9611/head
commit
b405acf252
@ -0,0 +1,33 @@ |
||||
#-- encoding: UTF-8 |
||||
|
||||
#-- copyright |
||||
# OpenProject is an open source project management software. |
||||
# Copyright (C) 2012-2021 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 Queries::Notifications::Filters::ProjectFilter < Queries::Notifications::Filters::NotificationFilter |
||||
include Queries::Filters::Shared::ProjectFilter |
||||
end |
@ -0,0 +1,44 @@ |
||||
#-- encoding: UTF-8 |
||||
|
||||
#-- copyright |
||||
# OpenProject is an open source project management software. |
||||
# Copyright (C) 2012-2021 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 Queries::Notifications::Filters::ReasonFilter < Queries::Notifications::Filters::NotificationFilter |
||||
def allowed_values |
||||
Notification.reason_ians.keys.map { |reason| [reason, reason] } |
||||
end |
||||
|
||||
def type |
||||
:list |
||||
end |
||||
|
||||
def where |
||||
id_values = values.map { |value| Notification.reason_ians[value] } |
||||
operator_strategy.sql_for_field(id_values, self.class.model.table_name, :reason_ian) |
||||
end |
||||
end |
@ -1,30 +1,57 @@ |
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-bottom: 1px solid #cccccc; margin-bottom: 32px;"> |
||||
<table <%= placeholder_table_styles(width:'100%',style: "width:100%;min-width:100%") %>> |
||||
<tr> |
||||
<td width="100%" style="padding-top: 8px; padding-left: 12px;"> |
||||
<table> |
||||
<td> |
||||
<table <%= placeholder_table_styles %>> |
||||
<tr> |
||||
<td style="font-size: 24px; color: #333333; padding-bottom: 5px;"> |
||||
<%= I18n.t(:'mail.salutation', user: @user.firstname) %> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
<td> |
||||
<table <%= placeholder_table_styles(width:'100%',style: "width:100%") %>> |
||||
<tr> |
||||
<td> |
||||
<span style="font-size: 24px; color: #333333;"> |
||||
<%= I18n.t(:'mail.salutation', user: @user.firstname) %> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<%= placeholder_cell('8px', vertical: false) %> |
||||
</tr> |
||||
<tr> |
||||
<td> |
||||
<span style="font-size:16px; color: #1A67A3; font-weight: bold;"> |
||||
<%= summary %> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<%= placeholder_cell('24px', vertical: false) %> |
||||
</tr> |
||||
<tr> |
||||
<td> |
||||
<a href="<%= notifications_center_url %>" |
||||
target="_blank" |
||||
style="background: #D1E5F5; padding: 8px 12px; color: #1A67A3; border: 1px solid #1A67A3; border-radius: 16px; text-decoration: none;font-size: 14px;"> |
||||
<%= I18n.t(:'mail.notification.center') %> |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<%= placeholder_cell('40px', vertical: false) %> |
||||
</tr> |
||||
</table> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td style="font-size:16px; color: #1A67A3; font-weight: bold; padding-bottom: 10px;"> |
||||
<%= summary %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td style="padding: 10px 0 32px 0;"> |
||||
<a href="<%= notifications_center_url %>" |
||||
target="_blank" |
||||
style="background: #D1E5F5; padding: 8px 12px; color: #1A67A3; border: 1px solid #1A67A3; border-radius: 16px; text-decoration: none;"> |
||||
<%= I18n.t(:'mail.notification.center') %> |
||||
</a> |
||||
<%= placeholder_cell('16px', vertical: true) %> |
||||
<td style="vertical-align: top;"> |
||||
<table <%= placeholder_table_styles %>> |
||||
<tr> |
||||
<td style="width: 96px; height: 96px;"> |
||||
<%= logo_tag({ alt: "#{Setting.app_title} #{I18n.t(:'mail.logo_alt_text')}", style: "height: 96px;max-width: 240px;"}) %> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
</td> |
||||
<td style="width: 96px; height: 96px; vertical-align: top;"> |
||||
<%= logo_tag({ alt: "#{Setting.app_title} #{I18n.t(:'mail.logo_alt_text')}", style: "height: 96px;"}) %> |
||||
</td> |
||||
</tr> |
||||
</table> |
@ -1,57 +1,106 @@ |
||||
<a style="border: 1px solid #E0E0E0; |
||||
margin-bottom: 16px; |
||||
padding: 12px 12px 16px 12px; |
||||
border-radius: 10px; |
||||
text-decoration: none; |
||||
display: block;" |
||||
<a style="text-decoration: none;display: block;" |
||||
href="<%= notifications_path(work_package.id) %>" |
||||
target="_blank"> |
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-bottom: 9px; font-size: 14px;"> |
||||
<table <%= placeholder_table_styles(width:'100%',style: "width:100%;border-width:1px;border-color:#E0E0E0;border-style:solid;border-radius:10px") %>> |
||||
<tr> |
||||
<td > |
||||
<div style="color: #333333; |
||||
background-color: #FFFFFF; |
||||
<%= status_colors(work_package.status) %> |
||||
white-space: nowrap; |
||||
padding: 2px 12px; |
||||
height: 16px;"> |
||||
<%= work_package.status %> |
||||
</div> |
||||
</td> |
||||
<td width="100%" style="padding-left: 8px; |
||||
color: #878787;"> |
||||
|
||||
#<%= work_package.id %> - <%= work_package.project %> |
||||
<% unique_reasons = unique_reasons_of_notifications(notifications_by_work_package) %> |
||||
<%= ' - ' unless unique_reasons.length === 1 && unique_reasons.first.nil? %> |
||||
<% unique_reasons.each_with_index do |reason, index| %> |
||||
<%= I18n.t( |
||||
:"mail.digests.work_packages.reason.#{reason || :unknown}", |
||||
default: '') %><%= ', ' unless unique_reasons.size-1 == index %> |
||||
<% end %> |
||||
</td> |
||||
<td style="text-align: right;"> |
||||
<span style="background-color: #00A3FF; |
||||
color: white; |
||||
border-radius: 8px; |
||||
padding: 0px 8px; |
||||
font-size: 14px;"> |
||||
<%= notifications_by_work_package.length %> |
||||
</span> |
||||
</td> |
||||
<%= placeholder_cell('12px', vertical: false) %> |
||||
</tr> |
||||
</table> |
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-bottom: 9px; font-size: 16px; font-weight: bold;"> |
||||
<tr> |
||||
<td style="color: <%= type_color(work_package.type, '#333333') %>; |
||||
white-space: nowrap;"> |
||||
<%= work_package.type.to_s.upcase %> |
||||
</td> |
||||
<td width="100%" style="padding-left: 5px; color: #333333;"> |
||||
<%= work_package.subject %> |
||||
<td> |
||||
<table <%= placeholder_table_styles(width:'100%',style: 'width:100%;font-size:14px;') %>> |
||||
<tr> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
<td> |
||||
<table <%= placeholder_table_styles %>> |
||||
<tr> |
||||
<td> |
||||
<table <%= placeholder_table_styles %>> |
||||
<tr> |
||||
<td style="color: #333333; |
||||
background-color: #FFFFFF; |
||||
<%= status_colors(work_package.status) %> |
||||
white-space: nowrap; |
||||
padding: 2px 12px; |
||||
height: 18px;"> |
||||
<%= work_package.status %> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
</td> |
||||
<%= placeholder_cell('8px', vertical: true) %> |
||||
<td width="100%" style="color: #878787;"> |
||||
#<%= work_package.id %> - <%= work_package.project %> |
||||
<% unique_reasons = unique_reasons_of_notifications(notifications_by_work_package) %> |
||||
<%= ' - ' unless unique_reasons.length === 1 && unique_reasons.first.nil? %> |
||||
<% unique_reasons.each_with_index do |reason, index| %> |
||||
<%= I18n.t( |
||||
:"mail.digests.work_packages.reason.#{reason || :unknown}", |
||||
default: '') %><%= ', ' unless unique_reasons.size-1 == index %> |
||||
<% end %> |
||||
</td> |
||||
<td> |
||||
<table <%= placeholder_table_styles %>> |
||||
<tr> |
||||
<td style="background-color: #00A3FF; |
||||
color: white; |
||||
border-radius: 10px; |
||||
padding: 2px 8px; |
||||
font-size: 14px; |
||||
height: 18px; |
||||
line-height: 18px;"> |
||||
<%= notifications_by_work_package.length %> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
</td> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
</tr> |
||||
<tr> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
<%= placeholder_cell('16px', vertical: false) %> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
</tr> |
||||
<tr> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
<td> |
||||
<table <%= placeholder_table_styles(style: 'font-size:16px;font-weight:bold') %>> |
||||
<tr> |
||||
<td style="color: <%= type_color(work_package.type, '#333333') %>;white-space: nowrap;"> |
||||
<%= work_package.type.to_s.upcase %> |
||||
</td> |
||||
<%= placeholder_cell('4px', vertical: true) %> |
||||
<td width="100%" style="color: #333333;"> |
||||
<%= work_package.subject %> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
</td> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
</tr> |
||||
<tr> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
<%= placeholder_cell('12px', vertical: false) %> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
</tr> |
||||
<tr> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
<td><%= yield %></td> |
||||
<%= placeholder_cell('12px', vertical: true) %> |
||||
</tr> |
||||
</table> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<%= placeholder_cell('12px', vertical: false) %> |
||||
</tr> |
||||
</table> |
||||
|
||||
<%= yield %> |
||||
<table> |
||||
<tr> |
||||
<%= placeholder_cell('20px', vertical: false) %> |
||||
</tr> |
||||
</table> |
||||
</a> |
@ -0,0 +1,47 @@ |
||||
#-- encoding: UTF-8 |
||||
|
||||
#-- copyright |
||||
# OpenProject is an open source project management software. |
||||
# Copyright (C) 2012-2021 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 OpenProject::TextFormatting |
||||
module Filters |
||||
class LinkAttributeFilter < HTML::Pipeline::Filter |
||||
def call |
||||
links.each do |node| |
||||
node['target'] = context[:target] if context[:target].present? |
||||
end |
||||
|
||||
doc |
||||
end |
||||
|
||||
def links |
||||
doc.xpath(".//a[contains(@href,'/')]") |
||||
end |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue