finish tasks i18n
This commit is contained in:
parent
6c65799025
commit
1a8c8537a4
14 changed files with 139 additions and 67 deletions
|
@ -19,7 +19,7 @@ class TasksController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@task = Task.new(params[:task])
|
@task = Task.new(params[:task])
|
||||||
if @task.save
|
if @task.save
|
||||||
redirect_to tasks_url, :notice => "Aufgabe wurde erstellt"
|
redirect_to tasks_url, :notice => I18n.t('tasks.create.notice')
|
||||||
else
|
else
|
||||||
render :template => "tasks/new"
|
render :template => "tasks/new"
|
||||||
end
|
end
|
||||||
|
@ -38,7 +38,7 @@ class TasksController < ApplicationController
|
||||||
@task = Task.find(params[:id])
|
@task = Task.find(params[:id])
|
||||||
@task.attributes=(params[:task])
|
@task.attributes=(params[:task])
|
||||||
if @task.errors.empty? && @task.save
|
if @task.errors.empty? && @task.save
|
||||||
flash[:notice] = "Aufgabe wurde aktualisiert"
|
flash[:notice] = I18n.t('tasks.update.notice')
|
||||||
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
|
||||||
|
@ -56,7 +56,7 @@ class TasksController < ApplicationController
|
||||||
task.destroy
|
task.destroy
|
||||||
task.update_ordergroup_stats(user_ids)
|
task.update_ordergroup_stats(user_ids)
|
||||||
|
|
||||||
redirect_to tasks_url, :notice => "Aufgabe wurde gelöscht"
|
redirect_to tasks_url, :notice => I18n.t('tasks.destroy.notice')
|
||||||
end
|
end
|
||||||
|
|
||||||
# assign current_user to the task and set the assignment to "accepted"
|
# assign current_user to the task and set the assignment to "accepted"
|
||||||
|
@ -68,7 +68,7 @@ class TasksController < ApplicationController
|
||||||
else
|
else
|
||||||
task.assignments.create(:user => current_user, :accepted => true)
|
task.assignments.create(:user => current_user, :accepted => true)
|
||||||
end
|
end
|
||||||
redirect_to user_tasks_path, :notice => "Du hast die Aufgabe übernommen"
|
redirect_to user_tasks_path, :notice => I18n.t('tasks.accept.notice')
|
||||||
end
|
end
|
||||||
|
|
||||||
# deletes assignment between current_user and given task
|
# deletes assignment between current_user and given task
|
||||||
|
@ -79,7 +79,7 @@ class TasksController < ApplicationController
|
||||||
|
|
||||||
def set_done
|
def set_done
|
||||||
Task.find(params[:id]).update_attribute :done, true
|
Task.find(params[:id]).update_attribute :done, true
|
||||||
redirect_to tasks_url, :notice => "Aufgabenstatus wurde aktualisiert"
|
redirect_to tasks_url, :notice => I18n.t('tasks.set_done.notice')
|
||||||
end
|
end
|
||||||
|
|
||||||
# Shows all tasks, which are already done
|
# Shows all tasks, which are already done
|
||||||
|
@ -91,7 +91,7 @@ class TasksController < ApplicationController
|
||||||
def workgroup
|
def workgroup
|
||||||
@group = Group.find(params[:workgroup_id])
|
@group = Group.find(params[:workgroup_id])
|
||||||
if @group.is_a? Ordergroup
|
if @group.is_a? Ordergroup
|
||||||
redirect_to tasks_url, :alert => "Keine Arbeitsgruppe gefunden"
|
redirect_to tasks_url, :alert => I18n.t('tasks.workgroup.error_not_found')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
%table.table.table-striped
|
%table.table.table-striped
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th Fälligkeitsdatum
|
%th= t '.due_date'
|
||||||
%th Betreff
|
%th= t '.task'
|
||||||
%th Verantwortliche Menschen
|
%th= t '.who'
|
||||||
%th
|
%th
|
||||||
%tbody
|
%tbody
|
||||||
- @tasks.each do |task|
|
- @tasks.each do |task|
|
||||||
%tr
|
%tr
|
||||||
%td= task.due_date unless task.due_date.nil?
|
%td= task.due_date unless task.due_date.nil?
|
||||||
%td= link_to "#{task.name} (#{task.duration}h)", :controller => "tasks", :action => "show", :id => task
|
%td= link_to t('.task_format', name: task.name, duration: task.duration), :controller => "tasks", :action => "show", :id => task
|
||||||
%td= task_assignments task
|
%td= task_assignments task
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
$("#task_user_list").tokenInput("#{users_path(:format => :json)}", {
|
$("#task_user_list").tokenInput("#{users_path(:format => :json)}", {
|
||||||
crossDomain: false,
|
crossDomain: false,
|
||||||
prePopulate: $("#task_user_list").data("pre"),
|
prePopulate: $("#task_user_list").data("pre"),
|
||||||
hintText: 'Nach Nutzerin suchen',
|
hintText: '#{escape_javascript(t('.search.hint'))}',
|
||||||
noResultText: 'Keine Nutzerin gefunden',
|
noResultText: '#{escape_javascript(t('.search.noresult'))}',
|
||||||
searchingText: 'Suche ...',
|
searchingText: '#{escape_javascript(t('.search.placeholder'))}',
|
||||||
theme: 'facebook'
|
theme: 'facebook'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -26,4 +26,4 @@
|
||||||
= f.input :done
|
= f.input :done
|
||||||
.form-actions
|
.form-actions
|
||||||
= f.submit class: 'btn'
|
= f.submit class: 'btn'
|
||||||
= link_to 'oder abbrechen', :back
|
= link_to t('ui.or_cancel'), :back
|
||||||
|
|
|
@ -1,29 +1,27 @@
|
||||||
%table.table.table-striped
|
%table.table.table-striped
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th Fälligkeit
|
%th= t '.due_date'
|
||||||
%th Betreff
|
%th= t '.task'
|
||||||
%th{:colspan => '2'}
|
%th{:colspan => '2'}
|
||||||
Wer machts?
|
= t '.who'
|
||||||
%small (Wie viele werden noch benötigt?)
|
%small= t '.who_hint'
|
||||||
%tbody
|
%tbody
|
||||||
- tasks.each do |task|
|
- tasks.each do |task|
|
||||||
- done = task.done ? " done" : ""
|
- done = task.done ? " done" : ""
|
||||||
%tr{:class => done }
|
%tr{:class => done }
|
||||||
%td= format_date(task.due_date) unless task.due_date.nil?
|
%td= format_date(task.due_date) unless task.due_date.nil?
|
||||||
%td= link_to "#{task.name} (#{task.duration}h)", task_path(task)
|
%td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task)
|
||||||
%td
|
%td
|
||||||
= task_assignments task
|
= task_assignments task
|
||||||
= highlighted_required_users task
|
= highlighted_required_users task
|
||||||
%td
|
%td
|
||||||
- if !task.is_accepted?(current_user)
|
- if !task.is_accepted?(current_user)
|
||||||
= link_to "Aufgabe übernehmen", accept_task_path(task), method: :post, class: 'btn btn-small'
|
= link_to t('.accept_task'), accept_task_path(task), method: :post, class: 'btn btn-small'
|
||||||
= link_to "Aufgabe ablehnen", reject_task_path(task), method: :post, class: 'btn btn-small' if task.is_assigned?(current_user)
|
= link_to t('.reject_task'), reject_task_path(task), method: :post, class: 'btn btn-small' if task.is_assigned?(current_user)
|
||||||
- elsif !task.done
|
- elsif !task.done
|
||||||
= link_to set_done_task_path(task), method: :post, class: 'btn btn-small',
|
= link_to set_done_task_path(task), method: :post, class: 'btn btn-small',
|
||||||
title: 'Aufgabe als erledigt markieren' do
|
title: t('.mark_done') do
|
||||||
%i.icon-ok
|
%i.icon-ok= t '.done_q'
|
||||||
Erledigt?
|
|
||||||
- else
|
- else
|
||||||
%i.icon-ok
|
%i.icon-ok= t '.done'
|
||||||
Erledigt
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
- content_for :actionbar do
|
- content_for :actionbar do
|
||||||
= link_to "Neue Aufgabe erstellen", new_task_path, class: 'btn btn-primary'
|
= link_to t('.new_task'), new_task_path, class: 'btn btn-primary'
|
||||||
|
|
||||||
- content_for :sidebar do
|
- content_for :sidebar do
|
||||||
.well.well-small
|
.well.well-small
|
||||||
%ul.nav.nav-list
|
%ul.nav.nav-list
|
||||||
%li.nav-header Seiten
|
%li.nav-header Seiten
|
||||||
%li= link_to "Meine Aufgaben", user_tasks_path
|
%li= link_to t('.my_tasks'), user_tasks_path
|
||||||
%li= link_to "Alle Aufgaben", tasks_path
|
%li= link_to t('.all_tasks'), tasks_path
|
||||||
%li= link_to "Erledigte Aufgaben (Archiv)", archive_tasks_path
|
%li= link_to t('.archive'), archive_tasks_path
|
||||||
%li.nav-header Gruppenaufgaben
|
%li.nav-header= t '.group_tasks'
|
||||||
- for group in Workgroup.all
|
- for group in Workgroup.all
|
||||||
%li= link_to group.name, workgroup_tasks_path(workgroup_id: group.id)
|
%li= link_to group.name, workgroup_tasks_path(workgroup_id: group.id)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
- title "Aufgabenarchiv"
|
- title t('.title')
|
||||||
= render 'nav'
|
= render 'nav'
|
||||||
|
|
||||||
#tasks= render 'archive_tasks'
|
#tasks= render 'archive_tasks'
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
- title "Aufgabe bearbeiten"
|
- title t('.title')
|
||||||
|
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
- title "Aufgaben"
|
- title t('.title')
|
||||||
= render 'nav'
|
= render 'nav'
|
||||||
|
|
||||||
- unless @non_group_tasks.empty?
|
- unless @non_group_tasks.empty?
|
||||||
%section
|
%section
|
||||||
%h3 Aufgaben für alle!
|
%h3= t '.title_non_group'
|
||||||
= render 'list', tasks: @non_group_tasks
|
= render 'list', tasks: @non_group_tasks
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,6 +13,6 @@
|
||||||
%section
|
%section
|
||||||
%h3
|
%h3
|
||||||
= group.name
|
= group.name
|
||||||
%small= link_to "Gruppenaufgaben anzeigen", workgroup_tasks_path(group)
|
%small= link_to t('.show_group_tasks'), workgroup_tasks_path(group)
|
||||||
= render 'list', tasks: tasks
|
= render 'list', tasks: tasks
|
||||||
= link_to_top
|
= link_to_top
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
- title "Neue Aufgabe erstellen"
|
- title t('.title')
|
||||||
|
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
- title "Aufgabe anzeigen"
|
- title t('.title')
|
||||||
= render 'nav'
|
= render 'nav'
|
||||||
|
|
||||||
%section
|
%section
|
||||||
%dl.dl-horizontal
|
%dl.dl-horizontal
|
||||||
%dt Name
|
%dt= t 'simple_form.labels.task.name'
|
||||||
%dd= @task.name
|
%dd= @task.name
|
||||||
- if @task.description.present?
|
- if @task.description.present?
|
||||||
%dt Beschreibung
|
%dt= t 'simple_form.labels.defaults.description'
|
||||||
%dd= simple_format(@task.description)
|
%dd= simple_format(@task.description)
|
||||||
- if @task.due_date.present?
|
- if @task.due_date.present?
|
||||||
%dt Fälligkeitsdatum
|
%dt= t '.due_date'
|
||||||
%dd= format_date(@task.due_date)
|
%dd= format_date(@task.due_date)
|
||||||
%dt Dauer in Stunden
|
%dt= t 'simple_form.labels.task.duration'
|
||||||
%dd= @task.duration
|
%dd= t('.hours', count: @task.duration)
|
||||||
%dt Verantwortliche Menschen
|
%dt= t 'simple_form.labels.task.user_list'
|
||||||
%dd= task_assignments(@task)
|
%dd= task_assignments(@task)
|
||||||
%dt Arbeitsgruppe
|
%dt= t 'simple_form.labels.task.workgroup'
|
||||||
%dd
|
%dd
|
||||||
- if @task.workgroup
|
- if @task.workgroup
|
||||||
= link_to @task.workgroup.name, workgroup_tasks_path(workgroup_id: @task.workgroup_id)
|
= link_to @task.workgroup.name, workgroup_tasks_path(workgroup_id: @task.workgroup_id)
|
||||||
%p
|
%p
|
||||||
- if !@task.is_accepted?(current_user)
|
- if !@task.is_accepted?(current_user)
|
||||||
= link_to "Aufgabe übernehmen", accept_task_path(@task), method: :post, class: 'btn btn-success'
|
= link_to t('.accept_task'), accept_task_path(@task), method: :post, class: 'btn btn-success'
|
||||||
- if @task.is_assigned?(current_user)
|
- if @task.is_assigned?(current_user)
|
||||||
= link_to "Aufgabe ablehnen", reject_task_path(@task), method: :post, class: 'btn'
|
= link_to t('.reject_task'), reject_task_path(@task), method: :post, class: 'btn'
|
||||||
- unless @task.done?
|
- unless @task.done?
|
||||||
= link_to 'Als erledigt markieren', set_done_task_path(@task), method: :post, class: 'btn'
|
= link_to t('.mark_done'), set_done_task_path(@task), method: :post, class: 'btn'
|
||||||
= link_to "Bearbeiten", edit_task_path(@task), class: 'btn'
|
= link_to t('ui.edit'), edit_task_path(@task), class: 'btn'
|
||||||
= link_to "Löschen", task_path(@task), :method => :delete, :confirm => "Die Aufgabe wirklich löschen?",
|
= link_to t('ui.delete'), task_path(@task), :method => :delete, :confirm => "Die Aufgabe wirklich löschen?",
|
||||||
class: 'btn btn-danger'
|
class: 'btn btn-danger'
|
||||||
|
|
|
@ -3,17 +3,15 @@
|
||||||
|
|
||||||
- unless @unaccepted_tasks.empty?
|
- unless @unaccepted_tasks.empty?
|
||||||
%section
|
%section
|
||||||
%h3 Offene Aufgaben
|
%h3= t '.title_open'
|
||||||
= render 'list', tasks: @unaccepted_tasks
|
= render 'list', tasks: @unaccepted_tasks
|
||||||
|
|
||||||
%section
|
%section
|
||||||
%h3 Anstehende Aufgaben
|
%h3= t '.title_accepted'
|
||||||
- unless @accepted_tasks.empty?
|
- unless @accepted_tasks.empty?
|
||||||
= render 'list', tasks: @accepted_tasks
|
= render 'list', tasks: @accepted_tasks
|
||||||
- else
|
- else
|
||||||
Nichts zu tun?
|
= t('.more', tasks_link: link_to(t('.tasks_link'), tasks_path)).html_safe
|
||||||
= link_to "Hier", tasks_path
|
|
||||||
gibt es bestimmt Arbeit.
|
|
||||||
%br/
|
%br/
|
||||||
= link_to_top
|
= link_to_top
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,20 @@
|
||||||
- title "Aufgaben für #{@group.name}"
|
- title t('.title', workgroup: @group.name)
|
||||||
= render 'nav'
|
= render 'nav'
|
||||||
|
|
||||||
%section.well
|
%section.well
|
||||||
%h3 Wöchentliche Aufgaben
|
%h3= t '.weekly.title'
|
||||||
- if @group.weekly_task
|
- if @group.weekly_task
|
||||||
%p Jeden <b>#{weekday(@group.weekday)}</b> hat diese Arbeitsgruppe folgenden Job: <b>#{@group.task_name}</b>
|
= t('.weekly.desc', weekday: weekday(@group.weekday), task: @group.task_name).html_safe
|
||||||
%p Die Wochenaufgaben werden von der Foodsoft automatisch erstellt. Eintragen müsst Ihr Euch aber selber.
|
|
||||||
- else
|
- else
|
||||||
Noch keine Wochenaufgaben angelegt.
|
= t('.weekly.empty').html_safe
|
||||||
|
|
||||||
- if @current_user.member_of?(@group) or @current_user.role_admin?
|
- if @current_user.member_of?(@group) or @current_user.role_admin?
|
||||||
= link_to "Wöchentliche Aufgaben anpassen", edit_foodcoop_workgroup_path(@group), class: 'btn'
|
= link_to t('.weekly.edit'), edit_foodcoop_workgroup_path(@group), class: 'btn'
|
||||||
|
|
||||||
%section
|
%section
|
||||||
%h3 Alle Aufgaben der Gruppe
|
%h3= t '.title_all'
|
||||||
= render 'list', tasks: @group.open_tasks
|
= render 'list', tasks: @group.open_tasks
|
||||||
%br/
|
%br/
|
||||||
= link_to_top
|
= link_to_top
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ de:
|
||||||
contact_address: "Adresse"
|
contact_address: "Adresse"
|
||||||
ignore_apple_restriction: "Bestellstop bei zu wenig Äpfeln ignorieren"
|
ignore_apple_restriction: "Bestellstop bei zu wenig Äpfeln ignorieren"
|
||||||
task:
|
task:
|
||||||
|
name: 'Name'
|
||||||
duration: 'Dauer'
|
duration: 'Dauer'
|
||||||
user_list: 'Verantwortliche'
|
user_list: 'Verantwortliche'
|
||||||
required_users: 'Anzahl'
|
required_users: 'Anzahl'
|
||||||
|
|
76
config/locales/de/de.tasks.yml
Normal file
76
config/locales/de/de.tasks.yml
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
de:
|
||||||
|
tasks:
|
||||||
|
archive:
|
||||||
|
title: 'Aufgabenarchiv'
|
||||||
|
archive_tasks:
|
||||||
|
due_date: 'Fälligkeitsdatum'
|
||||||
|
task: 'Betreff'
|
||||||
|
who: 'Verantwortliche Menschen'
|
||||||
|
task_format: '%{name} (%{duration}h)'
|
||||||
|
edit:
|
||||||
|
title: 'Aufgabe bearbeiten'
|
||||||
|
form:
|
||||||
|
search:
|
||||||
|
hint: "Nach Nutzerin suchen"
|
||||||
|
noresult: 'Keine Nutzerin gefunden'
|
||||||
|
placeholder: 'Suche ...'
|
||||||
|
index:
|
||||||
|
title: 'Aufgaben'
|
||||||
|
title_non_group: 'Aufgaben für alle!'
|
||||||
|
show_group_tasks: 'Gruppenaufgaben anzeigen'
|
||||||
|
list:
|
||||||
|
due_date: 'Fälligkeit'
|
||||||
|
task: 'Betreff'
|
||||||
|
who: 'Wer machts?'
|
||||||
|
who_hint: '(Wie viele werden noch benötigt?)'
|
||||||
|
task_format: '%{name} (%{duration}h)'
|
||||||
|
accept_task: 'Aufgabe übernehmen'
|
||||||
|
reject_task: 'Aufgabe ablehnen'
|
||||||
|
mark_done: 'Aufgabe als erledigt markieren'
|
||||||
|
done_q: 'Erledigt?'
|
||||||
|
done: 'Erledigt'
|
||||||
|
nav:
|
||||||
|
new_task: 'Neue Aufgabe erstellen'
|
||||||
|
my_tasks: 'Meine Aufgaben'
|
||||||
|
all_tasks: 'Alle Aufgaben'
|
||||||
|
archive: 'Erledigte Aufgaben (Archiv)'
|
||||||
|
group_tasks: 'Gruppenaufgaben'
|
||||||
|
new:
|
||||||
|
title: 'Neue Aufgabe erstellen'
|
||||||
|
show:
|
||||||
|
title: 'Aufgabe anzeigen'
|
||||||
|
hours: '%{count}h'
|
||||||
|
due_date: 'Fälligkeitsdatum'
|
||||||
|
accept_task: 'Aufgabe übernehmen'
|
||||||
|
reject_task: 'Aufgabe ablehnen'
|
||||||
|
mark_done: 'Als erledigt markieren'
|
||||||
|
user:
|
||||||
|
title: 'Meine Aufgaben'
|
||||||
|
title_open: 'Offene Aufgaben'
|
||||||
|
title_accepted: 'Anstehende Aufgaben'
|
||||||
|
more: 'Nichts zu tun? %{tasks_link} gibt es bestimmt Arbeit'
|
||||||
|
tasks_link: 'Hier'
|
||||||
|
workgroup:
|
||||||
|
title: 'Aufgaben für %{workgroup}'
|
||||||
|
weekly:
|
||||||
|
title: 'Wöchentliche Aufgaben'
|
||||||
|
desc: >
|
||||||
|
<p>Jeden <b>%{weekday}</b> hat diese Arbeitsgruppe folgenden Job: <b>%{task}</b></p>
|
||||||
|
<p>Die Wochenaufgaben werden von der Foodsoft automatisch erstellt. Eintragen müsst Ihr Euch aber selber.</p>
|
||||||
|
empty: 'Noch keine Wochenaufgaben angelegt.'
|
||||||
|
edit: 'Wöchentliche Aufgaben anpassen'
|
||||||
|
title_all: 'Alle Aufgaben der Gruppe'
|
||||||
|
|
||||||
|
# used by controller
|
||||||
|
create:
|
||||||
|
notice: 'Aufgabe wurde erstellt'
|
||||||
|
update:
|
||||||
|
notice: 'Aufgabe wurde aktualisiert'
|
||||||
|
destroy:
|
||||||
|
notice: 'Aufgabe wurde gelöscht'
|
||||||
|
accept:
|
||||||
|
notice: 'Du hast die Aufgabe übernommen'
|
||||||
|
set_done:
|
||||||
|
notice: 'Aufgabenstatus wurde aktualisiert'
|
||||||
|
<< workgroup:
|
||||||
|
error_not_found: 'Keine Arbeitsgruppe gefunden'
|
Loading…
Reference in a new issue