-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improving documentation and refactor (#21)
* Fix rubocop * Improve installation instructions (#16) * Fix compat range (#17) * Fix compat range * Fix offenses * Fix lint * Fix tests * Fix/no email (#18) * Fix rubocop * Don't query deleted users * Don't query empty email users * Bump gem to prepare release * refactor module, use warning timestamps * lint * Update lib/decidim/cleaner.rb Co-authored-by: Armand Fardeau <armandfardeau@users.noreply.github.com> * Update lib/decidim/cleaner.rb Co-authored-by: Armand Fardeau <armandfardeau@users.noreply.github.com> * Update lib/decidim/cleaner.rb Co-authored-by: Armand Fardeau <armandfardeau@users.noreply.github.com> * add notes for env variables in readme * rollback config in ENV * Revert "rollback config in ENV" This reverts commit d074afc. --------- Co-authored-by: armandfardeau <fardeauarmand@gmail.com> Co-authored-by: Armand Fardeau <armandfardeau@users.noreply.github.com>
- Loading branch information
1 parent
92c56db
commit c2dcdfd
Showing
13 changed files
with
113 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module Cleaner | ||
module DelaysHelper | ||
def email_inactive_after(organization) | ||
organization.delete_inactive_users_email_after || Decidim::Cleaner.delete_inactive_users_email_after | ||
end | ||
|
||
def delete_inactive_after(organization) | ||
organization.delete_inactive_users_after || Decidim::Cleaner.delete_inactive_users_after | ||
end | ||
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
2 changes: 1 addition & 1 deletion
2
app/views/decidim/cleaner/inactive_users_mailer/warning_deletion.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
4 changes: 2 additions & 2 deletions
4
app/views/decidim/cleaner/inactive_users_mailer/warning_inactive.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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<p class="email-greeting"><%= t ".hello" %></p> | ||
|
||
<p class="email-instructions"><%= t ".body_1", organization_name: h(@organization.name), days: @organization.delete_inactive_users_email_after %></p> | ||
<p class="email-instructions"><%= t ".body_1", organization_name: h(@organization.name), days: email_inactive_after(@organization) %></p> | ||
|
||
<p class="email-instructions"><%= t(".body_2", remaining_days: (@organization.delete_inactive_users_after||390) - (@organization.delete_inactive_users_email_after||365), organization_url: decidim.root_url(host: @organization.host)).html_safe %></p> | ||
<p class="email-instructions"><%= t(".body_2", remaining_days: delete_inactive_after(@organization), organization_url: decidim.root_url(host: @organization.host)).html_safe %></p> | ||
|
||
<p class="email-closing"><%= t(".greetings", organization_name: h(@organization.name), organization_url: decidim.root_url(host: @organization.host)).html_safe %></p> |
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,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddWarningDateToUsers < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :decidim_users, :warning_date, :datetime | ||
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