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
def pagination_links_full(paginator, options={}, html_options={})
html = ''
html << link_to_remote(('« ' + 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|
end || '')
html << ' ' + link_to_remote((l(:label_next) + ' »'),
- {: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
# 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
<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 %>
+
+
<table class="list">
<thead><tr>
<%= sort_header_tag('login', :caption => l(:field_login)) %>
field_login: Mitgliedsname\r
field_mail_notification: Mailbenachrichtigung\r
field_admin: Administrator\r
-field_locked: Gesperrt\r
field_last_login_on: Letzte Anmeldung\r
field_language: Sprache\r
field_effective_date: Datum\r
button_activate: Aktivieren\r
button_sort: Sortieren\r
\r
+status_active: active\r
+status_registered: registered\r
+status_locked: locked\r
+\r
text_select_mail_notifications: Aktionen für die Mailbenachrichtigung aktiviert werden soll.\r
text_regexp_info: eg. ^[A-Z0-9]+$\r
text_min_max_length_info: 0 heisst keine Beschränkung\r
field_login: Login\r
field_mail_notification: Mail notifications\r
field_admin: Administrator\r
-field_locked: Locked\r
field_last_login_on: Last connection\r
field_language: Language\r
field_effective_date: Date\r
button_activate: Activate\r
button_sort: Sort\r
\r
+status_active: active\r
+status_registered: registered\r
+status_locked: locked\r
+\r
text_select_mail_notifications: Select actions for which mail notifications should be sent.\r
text_regexp_info: eg. ^[A-Z0-9]+$\r
text_min_max_length_info: 0 means no restriction\r
field_login: Identificador\r
field_mail_notification: Notificación por mail\r
field_admin: Administrador\r
-field_locked: Cerrado\r
field_last_login_on: Última conexión\r
field_language: Lengua\r
field_effective_date: Fecha\r
button_activate: Activar\r
button_sort: Clasificar\r
\r
+status_active: active\r
+status_registered: registered\r
+status_locked: locked\r
+\r
text_select_mail_notifications: Seleccionar las actividades que necesitan la activación de la notificación por mail.\r
text_regexp_info: eg. ^[A-Z0-9]+$\r
text_min_max_length_info: 0 para ninguna restricción\r
field_login: Identifiant\r
field_mail_notification: Notifications par mail\r
field_admin: Administrateur\r
-field_locked: Verrouillé\r
field_last_login_on: Dernière connexion\r
field_language: Langue\r
field_effective_date: Date\r
button_activate: Activer\r
button_sort: Trier\r
\r
+status_active: actif\r
+status_registered: enregistré\r
+status_locked: vérouillé\r
+\r
text_select_mail_notifications: Sélectionner les actions pour lesquelles la notification par mail doit être activée.\r
text_regexp_info: ex. ^[A-Z0-9]+$\r
text_min_max_length_info: 0 pour aucune restriction\r
field_login: Login\r
field_mail_notification: Notifiche via e-mail\r
field_admin: Amministratore\r
-field_locked: Bloccato\r
field_last_login_on: Ultima connessione\r
field_language: Lingua\r
field_effective_date: Data\r
button_activate: Attiva\r
button_sort: Ordina\r
\r
+status_active: active\r
+status_registered: registered\r
+status_locked: bloccato\r
+\r
text_select_mail_notifications: Select actions for which mail notifications should be sent.\r
text_regexp_info: eg. ^[A-Z0-9]+$\r
text_min_max_length_info: 0 means no restriction\r
field_login: ログイン\r
field_mail_notification: メール通知\r
field_admin: 管理者\r
-field_locked: ロック済\r
field_last_login_on: 最終接続日\r
field_language: 言語\r
field_effective_date: 日付\r
button_activate: 有効にする\r
button_sort: ソート\r
\r
+status_active: active\r
+status_registered: registered\r
+status_locked: ロック済\r
+\r
text_select_mail_notifications: どのメール通知を送信するか、アクションを選択してください。\r
text_regexp_info: 例) ^[A-Z0-9]+$\r
text_min_max_length_info: 0だと無制限になります\r