finish tasks i18n

This commit is contained in:
wvengen 2013-04-12 00:00:02 +02:00
parent 6c65799025
commit 1a8c8537a4
14 changed files with 139 additions and 67 deletions

View File

@ -19,7 +19,7 @@ class TasksController < ApplicationController
def create
@task = Task.new(params[:task])
if @task.save
redirect_to tasks_url, :notice => "Aufgabe wurde erstellt"
redirect_to tasks_url, :notice => I18n.t('tasks.create.notice')
else
render :template => "tasks/new"
end
@ -38,7 +38,7 @@ class TasksController < ApplicationController
@task = Task.find(params[:id])
@task.attributes=(params[:task])
if @task.errors.empty? && @task.save
flash[:notice] = "Aufgabe wurde aktualisiert"
flash[:notice] = I18n.t('tasks.update.notice')
if @task.workgroup
redirect_to workgroup_tasks_url(workgroup_id: @task.workgroup_id)
else
@ -56,7 +56,7 @@ class TasksController < ApplicationController
task.destroy
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
# assign current_user to the task and set the assignment to "accepted"
@ -68,7 +68,7 @@ class TasksController < ApplicationController
else
task.assignments.create(:user => current_user, :accepted => true)
end
redirect_to user_tasks_path, :notice => "Du hast die Aufgabe übernommen"
redirect_to user_tasks_path, :notice => I18n.t('tasks.accept.notice')
end
# deletes assignment between current_user and given task
@ -79,7 +79,7 @@ class TasksController < ApplicationController
def set_done
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
# Shows all tasks, which are already done
@ -91,7 +91,7 @@ class TasksController < ApplicationController
def workgroup
@group = Group.find(params[:workgroup_id])
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

View File

@ -5,13 +5,13 @@
%table.table.table-striped
%thead
%tr
%th Fälligkeitsdatum
%th Betreff
%th Verantwortliche Menschen
%th= t '.due_date'
%th= t '.task'
%th= t '.who'
%th
%tbody
- @tasks.each do |task|
%tr
%td= task.due_date unless task.due_date.nil?
%td= link_to "#{task.name} (#{task.duration}h)", :controller => "tasks", :action => "show", :id => task
%td= task_assignments task
%td= link_to t('.task_format', name: task.name, duration: task.duration), :controller => "tasks", :action => "show", :id => task
%td= task_assignments task

View File

@ -4,9 +4,9 @@
$("#task_user_list").tokenInput("#{users_path(:format => :json)}", {
crossDomain: false,
prePopulate: $("#task_user_list").data("pre"),
hintText: 'Nach Nutzerin suchen',
noResultText: 'Keine Nutzerin gefunden',
searchingText: 'Suche ...',
hintText: '#{escape_javascript(t('.search.hint'))}',
noResultText: '#{escape_javascript(t('.search.noresult'))}',
searchingText: '#{escape_javascript(t('.search.placeholder'))}',
theme: 'facebook'
});
});
@ -26,4 +26,4 @@
= f.input :done
.form-actions
= f.submit class: 'btn'
= link_to 'oder abbrechen', :back
= link_to t('ui.or_cancel'), :back

View File

@ -1,29 +1,27 @@
%table.table.table-striped
%thead
%tr
%th Fälligkeit
%th Betreff
%th= t '.due_date'
%th= t '.task'
%th{:colspan => '2'}
Wer machts?
%small (Wie viele werden noch benötigt?)
= t '.who'
%small= t '.who_hint'
%tbody
- tasks.each do |task|
- done = task.done ? " done" : ""
%tr{:class => done }
%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
= task_assignments task
= highlighted_required_users task
%td
- if !task.is_accepted?(current_user)
= link_to "Aufgabe übernehmen", 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('.accept_task'), accept_task_path(task), method: :post, class: 'btn btn-small'
= link_to t('.reject_task'), reject_task_path(task), method: :post, class: 'btn btn-small' if task.is_assigned?(current_user)
- elsif !task.done
= link_to set_done_task_path(task), method: :post, class: 'btn btn-small',
title: 'Aufgabe als erledigt markieren' do
%i.icon-ok
Erledigt?
title: t('.mark_done') do
%i.icon-ok= t '.done_q'
- else
%i.icon-ok
Erledigt
%i.icon-ok= t '.done'

View File

@ -1,13 +1,13 @@
- 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
.well.well-small
%ul.nav.nav-list
%li.nav-header Seiten
%li= link_to "Meine Aufgaben", user_tasks_path
%li= link_to "Alle Aufgaben", tasks_path
%li= link_to "Erledigte Aufgaben (Archiv)", archive_tasks_path
%li.nav-header Gruppenaufgaben
%li= link_to t('.my_tasks'), user_tasks_path
%li= link_to t('.all_tasks'), tasks_path
%li= link_to t('.archive'), archive_tasks_path
%li.nav-header= t '.group_tasks'
- 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)

View File

@ -1,4 +1,4 @@
- title "Aufgabenarchiv"
- title t('.title')
= render 'nav'
#tasks= render 'archive_tasks'

View File

@ -1,3 +1,3 @@
- title "Aufgabe bearbeiten"
- title t('.title')
= render 'form'
= render 'form'

View File

@ -1,9 +1,9 @@
- title "Aufgaben"
- title t('.title')
= render 'nav'
- unless @non_group_tasks.empty?
%section
%h3 Aufgaben für alle!
%h3= t '.title_non_group'
= render 'list', tasks: @non_group_tasks
@ -13,6 +13,6 @@
%section
%h3
= 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
= link_to_top
= link_to_top

View File

@ -1,3 +1,3 @@
- title "Neue Aufgabe erstellen"
- title t('.title')
= render 'form'

View File

@ -1,31 +1,31 @@
- title "Aufgabe anzeigen"
- title t('.title')
= render 'nav'
%section
%dl.dl-horizontal
%dt Name
%dt= t 'simple_form.labels.task.name'
%dd= @task.name
- if @task.description.present?
%dt Beschreibung
%dt= t 'simple_form.labels.defaults.description'
%dd= simple_format(@task.description)
- if @task.due_date.present?
%dt Fälligkeitsdatum
%dt= t '.due_date'
%dd= format_date(@task.due_date)
%dt Dauer in Stunden
%dd= @task.duration
%dt Verantwortliche Menschen
%dt= t 'simple_form.labels.task.duration'
%dd= t('.hours', count: @task.duration)
%dt= t 'simple_form.labels.task.user_list'
%dd= task_assignments(@task)
%dt Arbeitsgruppe
%dt= t 'simple_form.labels.task.workgroup'
%dd
- if @task.workgroup
= link_to @task.workgroup.name, workgroup_tasks_path(workgroup_id: @task.workgroup_id)
%p
- 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)
= 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?
= link_to 'Als erledigt markieren', set_done_task_path(@task), method: :post, class: 'btn'
= link_to "Bearbeiten", edit_task_path(@task), class: 'btn'
= link_to "Löschen", task_path(@task), :method => :delete, :confirm => "Die Aufgabe wirklich löschen?",
= link_to t('.mark_done'), set_done_task_path(@task), method: :post, class: 'btn'
= link_to t('ui.edit'), edit_task_path(@task), class: 'btn'
= link_to t('ui.delete'), task_path(@task), :method => :delete, :confirm => "Die Aufgabe wirklich löschen?",
class: 'btn btn-danger'

View File

@ -3,17 +3,15 @@
- unless @unaccepted_tasks.empty?
%section
%h3 Offene Aufgaben
%h3= t '.title_open'
= render 'list', tasks: @unaccepted_tasks
%section
%h3 Anstehende Aufgaben
%h3= t '.title_accepted'
- unless @accepted_tasks.empty?
= render 'list', tasks: @accepted_tasks
- else
Nichts zu tun?
= link_to "Hier", tasks_path
gibt es bestimmt Arbeit.
= t('.more', tasks_link: link_to(t('.tasks_link'), tasks_path)).html_safe
%br/
= link_to_top

View File

@ -1,21 +1,20 @@
- title "Aufgaben für #{@group.name}"
- title t('.title', workgroup: @group.name)
= render 'nav'
%section.well
%h3 Wöchentliche Aufgaben
%h3= t '.weekly.title'
- if @group.weekly_task
%p Jeden <b>#{weekday(@group.weekday)}</b> hat diese Arbeitsgruppe folgenden Job: <b>#{@group.task_name}</b>
%p Die Wochenaufgaben werden von der Foodsoft automatisch erstellt. Eintragen müsst Ihr Euch aber selber.
= t('.weekly.desc', weekday: weekday(@group.weekday), task: @group.task_name).html_safe
- else
Noch keine Wochenaufgaben angelegt.
= t('.weekly.empty').html_safe
- 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
%h3 Alle Aufgaben der Gruppe
%h3= t '.title_all'
= render 'list', tasks: @group.open_tasks
%br/
= link_to_top

View File

@ -49,6 +49,7 @@ de:
contact_address: "Adresse"
ignore_apple_restriction: "Bestellstop bei zu wenig Äpfeln ignorieren"
task:
name: 'Name'
duration: 'Dauer'
user_list: 'Verantwortliche'
required_users: 'Anzahl'

View 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'