diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index 017a9a8a..ee4c05cd 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -35,13 +35,20 @@ class TasksController < ApplicationController def edit @task = Task.find(params[:id]) @task.current_user_id = current_user.id + if @task.periodic? + flash.now[:alert] = I18n.t('tasks.edit.warning_periodic').html_safe + end end def update @task = Task.find(params[:id]) + was_periodic = @task.periodic? @task.attributes=(params[:task]) if @task.errors.empty? && @task.save flash[:notice] = I18n.t('tasks.update.notice') + if was_periodic and not @task.periodic? + flash[:notice] = I18n.t('tasks.update.notice_converted') + end if @task.workgroup redirect_to workgroup_tasks_url(workgroup_id: @task.workgroup_id) else diff --git a/config/locales/de.yml b/config/locales/de.yml index ffd5a82b..c2e5f8b9 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1757,6 +1757,7 @@ de: notice: Aufgabe wurde gelöscht edit: title: Aufgabe bearbeiten + warning_periodic: Warnung: Diese Aufgabe ist Teil einer Gruppe von wöchentlichen Aufgaben. Beim Speichern wird sie aus der Gruppe ausgeschlossen und in eine gewöhnliche Aufgabe umgewandelt. error_not_found: Keine Arbeitsgruppe gefunden form: search: @@ -1802,6 +1803,7 @@ de: title: Aufgabe anzeigen update: notice: Aufgabe wurde aktualisiert + notice_converted: Aufgabe wurde aktualisiert und in eine gewöhnliche Aufgabe umgewandelt user: more: Nichts zu tun? %{tasks_link} gibt es bestimmt Arbeit tasks_link: Hier diff --git a/config/locales/en.yml b/config/locales/en.yml index a2042a46..b6b2901a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1764,6 +1764,7 @@ en: notice: Task has been deleted edit: title: Edit task + warning_periodic: Warning: This task is part of a group of weekly tasks. When saving it will be excluded from the group and it will be converted to a regular task. error_not_found: No workgroup found form: search: @@ -1809,6 +1810,7 @@ en: title: Show task update: notice: Task has been updated + notice_converted: Task has been updated and was converted to a regular task user: more: Nothing to do? %{tasks_link} are tasks for sure. tasks_link: Here