forked from hitobito/hitobito_pbs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/hitobito/hitobito_pbs
- Loading branch information
Showing
24 changed files
with
524 additions
and
85 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,35 @@ | ||
# encoding: utf-8 | ||
|
||
# Copyright (c) 2012-2014, Pfadibewegung Schweiz. This file is part of | ||
# hitobito_pbs and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito_pbs. | ||
|
||
class GroupMembershipJob < BaseJob | ||
|
||
self.parameters = [:recipient_id, :actuator_id, :group_id, :locale] | ||
|
||
def initialize(recipient, actuator, group) | ||
super() | ||
@recipient_id = recipient.id | ||
@actuator_id = actuator.id | ||
@group_id = group.id | ||
end | ||
|
||
def perform | ||
set_locale | ||
GroupMembershipMailer.added_to_group(recipient, actuator, group).deliver | ||
end | ||
|
||
def recipient | ||
@recipient ||= Person.find(@recipient_id) | ||
end | ||
|
||
def actuator | ||
@actuator ||= Person.find(@actuator_id) | ||
end | ||
|
||
def group | ||
@group ||= Group.find(@group_id) | ||
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,34 @@ | ||
# encoding: utf-8 | ||
|
||
# Copyright (c) 2012-2014, Pfadibewegung Schweiz. This file is part of | ||
# hitobito_pbs and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito_pbs. | ||
|
||
class GroupMembershipMailer < ActionMailer::Base | ||
|
||
CONTENT_GROUP_MEMBERSHIP = 'group_membership' | ||
|
||
def added_to_group(recipient, actuator, group) | ||
content = CustomContent.get(CONTENT_GROUP_MEMBERSHIP) | ||
values = { | ||
'recipient-name' => recipient.greeting_name, | ||
'actuator-name' => actuator.to_s, | ||
'group-link' => group_link_with_layer(group) | ||
} | ||
|
||
# This email is only sent to the main email address. | ||
mail(to: recipient.email, subject: content.subject) do |format| | ||
format.html { render text: content.body_with_values(values) } | ||
end | ||
end | ||
|
||
private | ||
|
||
def group_link_with_layer(group) | ||
group_links = group.with_layer.map do |g| | ||
"<a href=\"#{group_url(g)}\">#{g}</a>" | ||
end | ||
group_links.join(' / ') | ||
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,18 @@ | ||
# encoding: utf-8 | ||
|
||
# Copyright (c) 2014, Pfadibewegung Schweiz. This file is part of | ||
# hitobito and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito. | ||
|
||
module Pbs::GroupSerializer | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
extension(:attrs) do |_| | ||
map_properties(*item.used_attributes(:pbs_shortname, :website, :bank_account, :pta, :vkp, | ||
:pbs_material_insurance, :description)) | ||
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,18 @@ | ||
# encoding: utf-8 | ||
|
||
# Copyright (c) 2014, Pfadibewegung Schweiz. This file is part of | ||
# hitobito and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito. | ||
|
||
module Pbs::PersonSerializer | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
extension(:details) do |_| | ||
map_properties :pbs_number, :j_s_number, :salutation_value, :correspondence_language, | ||
:grade_of_school, :brother_and_sisters, :entry_date, :leaving_date | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
# Settings relevant for the jubla wagon | ||
# Overrides settings from the main application | ||
application: | ||
#name: Pfadi | ||
|
||
languages: | ||
de: Deutsch | ||
|
@@ -16,4 +15,5 @@ application: | |
# The person with this email has root access to everything | ||
# This person should only be used by the operators of the application, not the customers. | ||
# Initially, a password reset token may be mailed from the application to this address to set a password. | ||
root_email: [email protected] | ||
root_email: [email protected] | ||
|
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,36 @@ | ||
# encoding: utf-8 | ||
|
||
# Copyright (c) 2012-2014, Pfadibewegung Schweiz. This file is part of | ||
# hitobito_pbs and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito_pbs. | ||
|
||
CustomContent.seed_once(:key, | ||
{ key: GroupMembershipMailer::CONTENT_GROUP_MEMBERSHIP, | ||
placeholders_required: 'actuator-name, group-link', | ||
placeholders_optional: 'recipient-name' } | ||
) | ||
|
||
group_membership_id = CustomContent.where(key: GroupMembershipMailer::CONTENT_GROUP_MEMBERSHIP).first.id | ||
|
||
CustomContent::Translation.seed_once(:custom_content_id, :locale, | ||
{ custom_content_id: group_membership_id, | ||
locale: 'de', | ||
label: 'Information bei neuer Gruppenzugehörigkeit', | ||
subject: "Aufnahme in Gruppe", | ||
body: "Hallo {recipient-name}<br/><br/>" \ | ||
"{actuator-name} hat dich zur Gruppe {group-link} hinzugefügt.<br/><br/>" \ | ||
"Bis bald!" }, | ||
|
||
{ custom_content_id: group_membership_id, | ||
locale: 'fr', | ||
label: 'Informations pour les nouveau membres du groupe', | ||
subject: 'Admission dans le groupe', | ||
body: "Salut {recipient-name}<br/><br/>" \ | ||
"{actuator-name} t\'as ajouté au groupe {group-link}.<br/><br/>" \ | ||
"A bientôt!"}, | ||
|
||
{ custom_content_id: group_membership_id, | ||
locale: 'it', | ||
label: 'Informazioni per la nuova appartenenza al gruppo' } | ||
) |
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 |
---|---|---|
|
@@ -22,7 +22,9 @@ def amount(role_type) | |
'Pierre Fritsch', | ||
'Andreas Maierhofer', | ||
'Andre Kunz', | ||
'Roland Studer'] | ||
'Roland Studer', | ||
'Mathis Hofer', | ||
'Bruno Santschi'] | ||
|
||
devs = {'Olivier Brian' => '[email protected]'} | ||
puzzlers.each do |puz| | ||
|
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.