Added warning/ hint when updating periodic task.
This commit is contained in:
parent
e5d790021c
commit
65c0b555c2
3 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -1757,6 +1757,7 @@ de:
|
|||
notice: Aufgabe wurde gelöscht
|
||||
edit:
|
||||
title: Aufgabe bearbeiten
|
||||
warning_periodic: <strong>Warnung:</strong> Diese Aufgabe ist Teil einer Gruppe von <em>wöchentlichen Aufgaben</em>. Beim Speichern wird sie aus der Gruppe ausgeschlossen und in eine <em>gewöhnliche Aufgabe</em> 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
|
||||
|
|
|
@ -1764,6 +1764,7 @@ en:
|
|||
notice: Task has been deleted
|
||||
edit:
|
||||
title: Edit task
|
||||
warning_periodic: <strong>Warning:</strong> This task is part of a group of <em>weekly tasks</em>. When saving it will be excluded from the group and it will be converted to a <em>regular task</em>.
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue