Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/dev' into 30_4.6_PrintAp…
…plications # Conflicts: # app/controllers/events_controller.rb # app/models/ability.rb # config/locales/de.events.yml
- Loading branch information
Showing
58 changed files
with
1,098 additions
and
265 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,5 @@ deploy: | |
run: | ||
- rake db:schema:load | ||
- rake db:seed | ||
- rake db:populate_sample_data | ||
- restart |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Place all the behaviors and hooks related to the matching controller here. | ||
// All this logic will automatically be available in application.js. | ||
|
||
jQuery(function() { | ||
$(document).on('click', "#send-emails-clipboard", function() { | ||
$("#email_recipients").select(); | ||
try { | ||
document.execCommand('copy'); | ||
} catch (err) { | ||
console.log('Unable to copy emails to the clipboard'); | ||
} | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.email-content { | ||
width: 100%; | ||
} | ||
|
||
.email-submit { | ||
float: right; | ||
} |
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,4 @@ | ||
/* | ||
Place all the styles related to the matching controller here. | ||
They will automatically be included in application.css. | ||
*/ |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class EmailsController < ApplicationController | ||
def send_email | ||
@email = Email.new(email_params) | ||
Mailer.send_generic_email(@email.hide_recipients, @email.recipients, @email.reply_to, @email.subject, @email.content) | ||
redirect_to :events, notice: t('.sending_successful') | ||
end | ||
|
||
private | ||
|
||
# Only allow a trusted parameter "white list" through. | ||
def email_params | ||
params.require(:email).permit(:hide_recipients, :recipients, :reply_to, :subject, :content) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module EmailsHelper | ||
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 |
---|---|---|
@@ -1,17 +1,12 @@ | ||
class PortalMailer < ApplicationMailer | ||
|
||
# @param hide_recipients [Boolean] - identify whether recipients should be hidden from each other (true) or not (false) | ||
# @param recipients [Array<String>] - email addresses of recipients | ||
# @param reply_to [Array<String>] - email addresses of recipient of the answer | ||
|
||
# @param recipients [Array<String>] - email addresses of recipients - can be a string of comma separated email adresses too | ||
# @param reply_to [Array<String>] - email addresses of recipient of the answer - can be a string of comma separated email adresses too | ||
# @param subject [String] - subject of the mail | ||
# @param content [String] - content of the mail | ||
# @return [ActionMailer::MessageDelivery] a mail object with the given parameters. | ||
def generic_email(hide_recipients, recipients, reply_to, subject, content) | ||
def generic_email(recipients, reply_to, subject, content) | ||
@content = content | ||
if (hide_recipients) | ||
mail(bcc: recipients, reply_to: reply_to, subject: subject) | ||
else | ||
mail(to: recipients, reply_to: reply_to, subject: subject) | ||
end | ||
mail(to: recipients, reply_to: reply_to, subject: subject) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class Email | ||
include ActiveAttr::TypecastedAttributes | ||
include ActiveModel::Validations | ||
include ActiveModel::Conversion | ||
extend ActiveModel::Naming | ||
|
||
attribute :hide_recipients, :type => Boolean | ||
attribute :recipients, :type => String | ||
attribute :reply_to, :type => String | ||
attribute :subject, :type => String | ||
attribute :content, :type => String | ||
|
||
validates_presence_of :hide_recipients, :recipients, :reply_to, :subject, :content | ||
|
||
def initialize(attributes = {}) | ||
attributes.each do |name, value| | ||
send("#{name}=", value) | ||
end | ||
end | ||
|
||
def persisted? | ||
false | ||
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
Oops, something went wrong.