-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #1098, replaces mass_upload finished notify by email
- Loading branch information
Michael Jurke
committed
Nov 27, 2014
1 parent
daf01b4
commit 454d4a8
Showing
14 changed files
with
166 additions
and
28 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
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
8 changes: 6 additions & 2 deletions
8
...er/mass_upload_deletion_message.html.slim → ...iler/mass_upload_failed_message.html.slim
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,11 +1,15 @@ | ||
h3 | ||
= t('email.greeting', name: @mass_upload.user_nickname) | ||
= t('email.article.mass_deletion.text') | ||
= t('email.article.mass_upload_finished.failure') | ||
p | ||
= t('email.article.mass_deletion.to_csv') | ||
= link_to @mass_upload.file_file_name, mass_upload_url(@mass_upload) | ||
br | ||
= t('email.close') | ||
|
||
= link_to 'Unsere AGB', "#{root_url}/assets/AGB.pdf" | ||
br | ||
= link_to 'Kostenloses PDF Anzeigeprogramm herunter laden.', 'http://get.adobe.com/reader/otherversions/' | ||
|
||
- content_for 'sidebar' do | ||
= render 'shared/email/social_buttons' |
32 changes: 32 additions & 0 deletions
32
app/views/article_mailer/mass_upload_finished_message.html.slim
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,32 @@ | ||
h3 | ||
= t('email.greeting', name: @mass_upload.user_nickname) | ||
= t('email.article.mass_upload_finished.success') | ||
- if @mass_upload.articles_for_mass_activation.any? | ||
p | ||
= t('email.article.mass_upload_finished.to_activate', count: @mass_upload.articles_for_mass_activation) | ||
ul | ||
- if @created_count > 0 | ||
li= t('email.article.mass_upload_finished.created_articles', count: @created_count) | ||
- if @updated_count > 0 | ||
li= t('email.article.mass_upload_finished.updated_articles', count: @updated_count) | ||
- if @activated_count > 0 | ||
li= t('email.article.mass_upload_finished.activated_articles', count: @activated_count) | ||
|
||
= link_to t('email.article.mass_upload_finished.activate_now'), mass_upload_url(@mass_upload) | ||
- if @mass_upload.deleted_articles.any? | ||
p | ||
= t('email.article.mass_upload_finished.deleted_articles', count: @deleted_count) | ||
- if @mass_upload.deactivated_articles.any? | ||
p | ||
= t('email.article.mass_upload_finished.deactivated_articles', count: @deactivated_count) | ||
|
||
br | ||
= t('email.close') | ||
|
||
= link_to 'Unsere AGB', "#{root_url}/assets/AGB.pdf" | ||
br | ||
= link_to 'Kostenloses PDF Anzeigeprogramm herunter laden.', 'http://get.adobe.com/reader/otherversions/' | ||
|
||
- content_for 'sidebar' do | ||
= render 'shared/email/social_buttons' |
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 @@ | ||
# encoding: UTF-8 | ||
# | ||
# == License: | ||
# Fairmondo - Fairmondo is an open-source online marketplace. | ||
# Copyright (C) 2013 Fairmondo eG | ||
# | ||
# This file is part of Fairmondo. | ||
# | ||
# Fairmondo is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Fairmondo 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 Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with Fairmondo. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
class MassUploadsFinishWorker | ||
include Sidekiq::Worker | ||
sidekiq_options queue: :mass_uploads_finish, | ||
retry: 20, | ||
backtrace: true | ||
|
||
include Sidetiq::Schedulable | ||
|
||
recurrence { | ||
hourly.minute_of_hour(*((0..5).to_a.map{|d|d*10})) | ||
} | ||
|
||
def perform | ||
MassUpload.processing.each do |mass_upload| | ||
mass_upload.finish | ||
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
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,14 @@ | ||
require "test_helper" | ||
|
||
describe MassUploadsFinishWorker do | ||
it "finishes a processing mass_upload" do | ||
mass_upload = FactoryGirl.create(:mass_upload_to_finish) | ||
MassUploadsFinishWorker.new.perform | ||
mass_upload.reload | ||
mass_upload.state.must_equal "finished" | ||
end | ||
end | ||
|
||
|
||
|
||
|