Commit 8bb60b64 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

added a status filter on users/list

git-svn-id: http://redmine.rubyforge.org/svn/trunk@347 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 143be7ee
......@@ -32,11 +32,17 @@ class UsersController < ApplicationController
def list
sort_init 'login', 'asc'
sort_update
@user_count = User.count
@status = params[:status] ? params[:status].to_i : 1
conditions = nil
conditions = ["status=?", @status] unless @status == 0
@user_count = User.count(:conditions => conditions)
@user_pages = Paginator.new self, @user_count,
15,
params['page']
@users = User.find :all,:order => sort_clause,
:conditions => conditions,
:limit => @user_pages.items_per_page,
:offset => @user_pages.current.offset
......
......@@ -77,7 +77,7 @@ module ApplicationHelper
def pagination_links_full(paginator, options={}, html_options={})
html = ''
html << link_to_remote(('&#171; ' + l(:label_previous)),
{:update => "content", :url => { :page => paginator.current.previous }},
{:update => "content", :url => params.merge({ :page => paginator.current.previous })},
{:href => url_for(:action => 'list', :params => params.merge({:page => paginator.current.previous}))}) + ' ' if paginator.current.previous
html << (pagination_links_each(paginator, options) do |n|
......@@ -87,7 +87,7 @@ module ApplicationHelper
end || '')
html << ' ' + link_to_remote((l(:label_next) + ' &#187;'),
{:update => "content", :url => { :page => paginator.current.next }},
{:update => "content", :url => params.merge({ :page => paginator.current.next })},
{:href => url_for(:action => 'list', :params => params.merge({:page => paginator.current.next}))}) if paginator.current.next
html
end
......
......@@ -16,4 +16,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module UsersHelper
def status_options_for_select(selected)
options_for_select([[l(:label_all), "*"],
[l(:status_active), 1],
[l(:status_registered), 2],
[l(:status_locked), 3]], selected)
end
end
......@@ -4,6 +4,15 @@
<h2><%=l(:label_user_plural)%></h2>
<% form_tag() do %>
<fieldset><legend><%= l(:label_filter_plural) %></legend>
<label><%= l(:field_status) %> :</label>
<%= select_tag 'status', status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
<%= submit_tag l(:button_apply), :class => "small" %>
</fieldset>
<% end %>
&nbsp;
<table class="list">
<thead><tr>
<%= sort_header_tag('login', :caption => l(:field_login)) %>
......
......@@ -118,7 +118,6 @@ field_is_in_roadmap: Ansicht der Issues in der Roadmap
field_login: Mitgliedsname
field_mail_notification: Mailbenachrichtigung
field_admin: Administrator
field_locked: Gesperrt
field_last_login_on: Letzte Anmeldung
field_language: Sprache
field_effective_date: Datum
......@@ -357,6 +356,10 @@ button_cancel: Annullieren
button_activate: Aktivieren
button_sort: Sortieren
status_active: active
status_registered: registered
status_locked: locked
text_select_mail_notifications: Aktionen für die Mailbenachrichtigung aktiviert werden soll.
text_regexp_info: eg. ^[A-Z0-9]+$
text_min_max_length_info: 0 heisst keine Beschränkung
......
......@@ -118,7 +118,6 @@ field_is_in_roadmap: Issues displayed in roadmap
field_login: Login
field_mail_notification: Mail notifications
field_admin: Administrator
field_locked: Locked
field_last_login_on: Last connection
field_language: Language
field_effective_date: Date
......@@ -357,6 +356,10 @@ button_cancel: Cancel
button_activate: Activate
button_sort: Sort
status_active: active
status_registered: registered
status_locked: locked
text_select_mail_notifications: Select actions for which mail notifications should be sent.
text_regexp_info: eg. ^[A-Z0-9]+$
text_min_max_length_info: 0 means no restriction
......
......@@ -118,7 +118,6 @@ field_is_in_roadmap: Consultar las peticiones en el roadmap
field_login: Identificador
field_mail_notification: Notificación por mail
field_admin: Administrador
field_locked: Cerrado
field_last_login_on: Última conexión
field_language: Lengua
field_effective_date: Fecha
......@@ -357,6 +356,10 @@ button_cancel: Cancelar
button_activate: Activar
button_sort: Clasificar
status_active: active
status_registered: registered
status_locked: locked
text_select_mail_notifications: Seleccionar las actividades que necesitan la activación de la notificación por mail.
text_regexp_info: eg. ^[A-Z0-9]+$
text_min_max_length_info: 0 para ninguna restricción
......
......@@ -118,7 +118,6 @@ field_is_in_roadmap: Demandes affichées dans la roadmap
field_login: Identifiant
field_mail_notification: Notifications par mail
field_admin: Administrateur
field_locked: Verrouillé
field_last_login_on: Dernière connexion
field_language: Langue
field_effective_date: Date
......@@ -357,6 +356,10 @@ button_cancel: Annuler
button_activate: Activer
button_sort: Trier
status_active: actif
status_registered: enregistré
status_locked: vérouillé
text_select_mail_notifications: Sélectionner les actions pour lesquelles la notification par mail doit être activée.
text_regexp_info: ex. ^[A-Z0-9]+$
text_min_max_length_info: 0 pour aucune restriction
......
......@@ -118,7 +118,6 @@ field_is_in_roadmap: Contesti mostrati nel roadmap
field_login: Login
field_mail_notification: Notifiche via e-mail
field_admin: Amministratore
field_locked: Bloccato
field_last_login_on: Ultima connessione
field_language: Lingua
field_effective_date: Data
......@@ -357,6 +356,10 @@ button_cancel: Annulla
button_activate: Attiva
button_sort: Ordina
status_active: active
status_registered: registered
status_locked: bloccato
text_select_mail_notifications: Select actions for which mail notifications should be sent.
text_regexp_info: eg. ^[A-Z0-9]+$
text_min_max_length_info: 0 means no restriction
......
......@@ -119,7 +119,6 @@ field_is_in_roadmap: Issues displayed in roadmap
field_login: ログイン
field_mail_notification: メール通知
field_admin: 管理者
field_locked: ロック済
field_last_login_on: 最終接続日
field_language: 言語
field_effective_date: 日付
......@@ -358,6 +357,10 @@ button_cancel: キャンセル
button_activate: 有効にする
button_sort: ソート
status_active: active
status_registered: registered
status_locked: ロック済
text_select_mail_notifications: どのメール通知を送信するか、アクションを選択してください。
text_regexp_info: 例) ^[A-Z0-9]+$
text_min_max_length_info: 0だと無制限になります
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment