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
|
def edit
|
||||||
@task = Task.find(params[:id])
|
@task = Task.find(params[:id])
|
||||||
@task.current_user_id = current_user.id
|
@task.current_user_id = current_user.id
|
||||||
|
if @task.periodic?
|
||||||
|
flash.now[:alert] = I18n.t('tasks.edit.warning_periodic').html_safe
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@task = Task.find(params[:id])
|
@task = Task.find(params[:id])
|
||||||
|
was_periodic = @task.periodic?
|
||||||
@task.attributes=(params[:task])
|
@task.attributes=(params[:task])
|
||||||
if @task.errors.empty? && @task.save
|
if @task.errors.empty? && @task.save
|
||||||
flash[:notice] = I18n.t('tasks.update.notice')
|
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
|
if @task.workgroup
|
||||||
redirect_to workgroup_tasks_url(workgroup_id: @task.workgroup_id)
|
redirect_to workgroup_tasks_url(workgroup_id: @task.workgroup_id)
|
||||||
else
|
else
|
||||||
|
|
|
@ -1757,6 +1757,7 @@ de:
|
||||||
notice: Aufgabe wurde gelöscht
|
notice: Aufgabe wurde gelöscht
|
||||||
edit:
|
edit:
|
||||||
title: Aufgabe bearbeiten
|
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
|
error_not_found: Keine Arbeitsgruppe gefunden
|
||||||
form:
|
form:
|
||||||
search:
|
search:
|
||||||
|
@ -1802,6 +1803,7 @@ de:
|
||||||
title: Aufgabe anzeigen
|
title: Aufgabe anzeigen
|
||||||
update:
|
update:
|
||||||
notice: Aufgabe wurde aktualisiert
|
notice: Aufgabe wurde aktualisiert
|
||||||
|
notice_converted: Aufgabe wurde aktualisiert und in eine gewöhnliche Aufgabe umgewandelt
|
||||||
user:
|
user:
|
||||||
more: Nichts zu tun? %{tasks_link} gibt es bestimmt Arbeit
|
more: Nichts zu tun? %{tasks_link} gibt es bestimmt Arbeit
|
||||||
tasks_link: Hier
|
tasks_link: Hier
|
||||||
|
|
|
@ -1764,6 +1764,7 @@ en:
|
||||||
notice: Task has been deleted
|
notice: Task has been deleted
|
||||||
edit:
|
edit:
|
||||||
title: Edit task
|
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
|
error_not_found: No workgroup found
|
||||||
form:
|
form:
|
||||||
search:
|
search:
|
||||||
|
@ -1809,6 +1810,7 @@ en:
|
||||||
title: Show task
|
title: Show task
|
||||||
update:
|
update:
|
||||||
notice: Task has been updated
|
notice: Task has been updated
|
||||||
|
notice_converted: Task has been updated and was converted to a regular task
|
||||||
user:
|
user:
|
||||||
more: Nothing to do? %{tasks_link} are tasks for sure.
|
more: Nothing to do? %{tasks_link} are tasks for sure.
|
||||||
tasks_link: Here
|
tasks_link: Here
|
||||||
|
|
Loading…
Reference in a new issue