filters translation

git-svn-id: http://redmine.rubyforge.org/svn/branches/work@87 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2006-12-16 10:45:03 +00:00
1 parent ded14f7c38
commit c524fd0423
9 files changed
+104 -54

No files matched your search

@@ -29,6 +29,8 @@ class ProjectsController < ApplicationController
helper :ifpdf helper :ifpdf
include IfpdfHelper include IfpdfHelper
helper IssuesHelper helper IssuesHelper
helper :queries
include QueriesHelper
def index def index
list list
@@ -1,2 +1,6 @@
module QueriesHelper module QueriesHelper
def operators_for_select(filter_type)
Query.operators_by_filter_type[filter_type].collect {|o| [l(Query.operators[o]), o]}
end
end end
+21 -22
View File
@@ -24,21 +24,23 @@ class Query < ActiveRecord::Base
validates_presence_of :name, :on => :save validates_presence_of :name, :on => :save
@@operators = { "=" => "Egal", @@operators = { "=" => :label_equals,
"!" => "Different", "!" => :label_not_equals,
"o" => "Ouvert", "o" => :label_open_issues,
"c" => "Ferme", "c" => :label_closed_issues,
"!*" => "Aucun", "!*" => :label_none,
"*" => "Tous", "*" => :label_all,
"<t+" => "Dans moins de", "<t+" => :label_in_less_than,
">t+" => "Dans plus de", ">t+" => :label_in_more_than,
"t+" => "Dans exactement", "t+" => :label_in,
"t" => "Aujourd'hui", "t" => :label_today,
">t-" => "Il y a moins de", ">t-" => :label_less_than_ago,
"<t-" => "Il y a plus de", "<t-" => :label_more_than_ago,
"t-" => "Il y a exactement", "t-" => :label_ago,
"~" => "Contient", "~" => :label_contains,
"!~" => "Ne contient pas" } "!~" => :label_not_contains }
cattr_reader :operators
@@operators_by_filter_type = { :list => [ "=", "!" ], @@operators_by_filter_type = { :list => [ "=", "!" ],
:list_status => [ "o", "=", "!", "c", "*" ], :list_status => [ "o", "=", "!", "c", "*" ],
@@ -46,7 +48,9 @@ class Query < ActiveRecord::Base
:date => [ "<t+", ">t+", "t+", "t", ">t-", "<t-", "t-" ], :date => [ "<t+", ">t+", "t+", "t", ">t-", "<t-", "t-" ],
:date_past => [ ">t-", "<t-", "t-", "t" ], :date_past => [ ">t-", "<t-", "t-", "t" ],
:text => [ "~", "!~" ] } :text => [ "~", "!~" ] }
cattr_reader :operators_by_filter_type
def initialize(attributes = nil) def initialize(attributes = nil)
super attributes super attributes
self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} } self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
@@ -155,12 +159,7 @@ class Query < ActiveRecord::Base
when "!~" when "!~"
sql = sql + "issues.#{field} NOT LIKE '%#{connection.quote_string(v.first)}%'" sql = sql + "issues.#{field} NOT LIKE '%#{connection.quote_string(v.first)}%'"
end end
end if filters end if filters and valid?
sql sql
end end
def self.operators_for_select(filter_type)
@@operators_by_filter_type[filter_type].collect {|o| [@@operators[o], o]}
end
end end
@@ -69,7 +69,7 @@ function toggle_multi_select(field) {
<label for="cb_<%= field %>"><%= l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) %></label> <label for="cb_<%= field %>"><%= l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) %></label>
</td> </td>
<td valign="top" width="150"> <td valign="top" width="150">
<%= select_tag "operators[#{field}]", options_for_select(Query.operators_for_select(options[:type]), query.operator_for(field)), :onchange => "toggle_operator('#{field}');", :class => "select-small", :style => "vertical-align: top;" %> <%= select_tag "operators[#{field}]", options_for_select(operators_for_select(options[:type]), query.operator_for(field)), :onchange => "toggle_operator('#{field}');", :class => "select-small", :style => "vertical-align: top;" %>
</td> </td>
<td valign="top"> <td valign="top">
<div id="values_div[<%= field %>]"> <div id="values_div[<%= field %>]">
@@ -80,7 +80,7 @@ function toggle_multi_select(field) {
</select> </select>
<%= link_to_function image_tag('expand'), "toggle_multi_select('#{field}');" %> <%= link_to_function image_tag('expand'), "toggle_multi_select('#{field}');" %>
<% when :date, :date_past %> <% when :date, :date_past %>
<%= text_field_tag "values[#{field}][]", query.values_for(field), :size => 3, :class => "select-small" %> jours <%= text_field_tag "values[#{field}][]", query.values_for(field), :size => 3, :class => "select-small" %> <%= l(:label_day_plural) %>
<% when :text %> <% when :text %>
<%= text_field_tag "values[#{field}][]", query.values_for(field), :size => 30, :class => "select-small" %> <%= text_field_tag "values[#{field}][]", query.values_for(field), :size => 30, :class => "select-small" %>
<% end %> <% end %>
+3 -6
View File
@@ -2,17 +2,14 @@
<!--[form:query]--> <!--[form:query]-->
<div class="box"> <div class="box">
<div class="tabular"> <div class="tabular">
<p><label for="query_name">Name</label> <p><label for="query_name"><%=l(:field_name)%></label>
<%= text_field 'query', 'name', :size => 80 %></p> <%= text_field 'query', 'name', :size => 80 %></p>
<p><label for="query_is_public">Public</label> <p><label for="query_is_public"><%=l(:field_is_public)%></label>
<%= check_box 'query', 'is_public' %></p> <%= check_box 'query', 'is_public' %></p>
</div> </div>
<%= render :partial => 'queries/filters', :locals => {:query => query}%> <%= render :partial => 'queries/filters', :locals => {:query => query}%>
</div> </div>
<!--[eoform:query]--> <!--[eoform:query]-->
+18 -6
View File
@@ -236,16 +236,16 @@ label_confirmation: Bestätigung
label_export_to: Export zu label_export_to: Export zu
label_read: Lesen... label_read: Lesen...
label_public_projects: Öffentliche Projekte label_public_projects: Öffentliche Projekte
label_open_issues: Geöffnet label_open_issues: geöffnet
label_open_issues_plural: Geöffnet label_open_issues_plural: geöffnet
label_closed_issues: Geschlossen label_closed_issues: geschlossen
label_closed_issues_plural: Geschlossen label_closed_issues_plural: geschlossen
label_total: Gesamtzahl label_total: Gesamtzahl
label_permissions: Berechtigungen label_permissions: Berechtigungen
label_current_status: Gegenwärtiger Status label_current_status: Gegenwärtiger Status
label_new_statuses_allowed: Neue Status gewährten label_new_statuses_allowed: Neue Status gewährten
label_all: Alle label_all: alle
label_none: Kein label_none: kein
label_next: Weiter label_next: Weiter
label_previous: Zurück label_previous: Zurück
label_used_by: Benutzt von label_used_by: Benutzt von
@@ -264,6 +264,18 @@ label_query_plural: Benutzerdefinierte Fragen
label_query_new: Neue Frage label_query_new: Neue Frage
label_filter_add: Filter addieren label_filter_add: Filter addieren
label_filter_plural: Filter label_filter_plural: Filter
label_equals: ist
label_not_equals: ist nicht
label_in_less_than: an weniger als
label_in_more_than: an mehr als
label_in: an
label_today: heute
label_less_than_ago: vor weniger als
label_more_than_ago: vor mehr als
label_ago: vor
label_contains: enthält
label_not_contains: enthält nicht
label_day_plural: Tage
button_login: Einloggen button_login: Einloggen
button_submit: Einreichen button_submit: Einreichen
+18 -6
View File
@@ -236,16 +236,16 @@ label_confirmation: Confirmation
label_export_to: Export to label_export_to: Export to
label_read: Read... label_read: Read...
label_public_projects: Public projects label_public_projects: Public projects
label_open_issues: Open label_open_issues: open
label_open_issues_plural: Open label_open_issues_plural: open
label_closed_issues: Closed label_closed_issues: closed
label_closed_issues_plural: Closed label_closed_issues_plural: closed
label_total: Total label_total: Total
label_permissions: Permissions label_permissions: Permissions
label_current_status: Current status label_current_status: Current status
label_new_statuses_allowed: New statuses allowed label_new_statuses_allowed: New statuses allowed
label_all: All label_all: all
label_none: None label_none: none
label_next: Next label_next: Next
label_previous: Previous label_previous: Previous
label_used_by: Used by label_used_by: Used by
@@ -264,6 +264,18 @@ label_query_plural: Custom queries
label_query_new: New query label_query_new: New query
label_filter_add: Add filter label_filter_add: Add filter
label_filter_plural: Filters label_filter_plural: Filters
label_equals: is
label_not_equals: is not
label_in_less_than: in less than
label_in_more_than: in more than
label_in: in
label_today: today
label_less_than_ago: less than days ago
label_more_than_ago: more than days ago
label_ago: days ago
label_contains: contains
label_not_contains: doesn't contain
label_day_plural: days
button_login: Login button_login: Login
button_submit: Submit button_submit: Submit
+18 -6
View File
@@ -236,16 +236,16 @@ label_confirmation: Confirmación
label_export_to: Exportar a label_export_to: Exportar a
label_read: Leer... label_read: Leer...
label_public_projects: Proyectos publicos label_public_projects: Proyectos publicos
label_open_issues: Abierta label_open_issues: abierto
label_open_issues_plural: Abiertas label_open_issues_plural: abiertos
label_closed_issues: Cerrada label_closed_issues: cerrado
label_closed_issues_plural: Cerradas label_closed_issues_plural: cerrados
label_total: Total label_total: Total
label_permissions: Permisos label_permissions: Permisos
label_current_status: Estado actual label_current_status: Estado actual
label_new_statuses_allowed: Nuevos estatutos autorizados label_new_statuses_allowed: Nuevos estatutos autorizados
label_all: Todos label_all: todos
label_none: Ninguno label_none: ninguno
label_next: Próximo label_next: Próximo
label_previous: Precedente label_previous: Precedente
label_used_by: Utilizado por label_used_by: Utilizado por
@@ -264,6 +264,18 @@ label_query_plural: Preguntas personalizadas
label_query_new: Nueva preguntas label_query_new: Nueva preguntas
label_filter_add: Agregar el filtro label_filter_add: Agregar el filtro
label_filter_plural: Filtros label_filter_plural: Filtros
label_equals: igual
label_not_equals: no igual
label_in_less_than: en menos que
label_in_more_than: en más que
label_in: en
label_today: hoy
label_less_than_ago: hace menos de
label_more_than_ago: hace más de
label_ago: hace
label_contains: contiene
label_not_contains: no contiene
label_day_plural: días
button_login: Conexión button_login: Conexión
button_submit: Someter button_submit: Someter
+18 -6
View File
@@ -237,16 +237,16 @@ label_confirmation: Confirmation
label_export_to: Exporter en label_export_to: Exporter en
label_read: Lire... label_read: Lire...
label_public_projects: Projets publics label_public_projects: Projets publics
label_open_issues: Ouverte label_open_issues: ouvert
label_open_issues_plural: Ouvertes label_open_issues_plural: ouverts
label_closed_issues: Fermée label_closed_issues: fermé
label_closed_issues_plural: Fermées label_closed_issues_plural: fermés
label_total: Total label_total: Total
label_permissions: Permissions label_permissions: Permissions
label_current_status: Statut actuel label_current_status: Statut actuel
label_new_statuses_allowed: Nouveaux statuts autorisés label_new_statuses_allowed: Nouveaux statuts autorisés
label_all: Tous label_all: tous
label_none: Aucun label_none: aucun
label_next: Suivant label_next: Suivant
label_previous: Précédent label_previous: Précédent
label_used_by: Utilisé par label_used_by: Utilisé par
@@ -265,6 +265,18 @@ label_query_plural: Rapports personnalisés
label_query_new: Nouveau rapport label_query_new: Nouveau rapport
label_filter_add: Ajouter le filtre label_filter_add: Ajouter le filtre
label_filter_plural: Filtres label_filter_plural: Filtres
label_equals: égal
label_not_equals: différent
label_in_less_than: dans moins de
label_in_more_than: dans plus de
label_in: dans
label_today: aujourd'hui
label_less_than_ago: il y a moins de
label_more_than_ago: il y a plus de
label_ago: il y a
label_contains: contient
label_not_contains: ne contient pas
label_day_plural: jours
button_login: Connexion button_login: Connexion
button_submit: Soumettre button_submit: Soumettre