Skip to content

Commit

Permalink
Merge branch 'master' into activo
Browse files Browse the repository at this point in the history
Conflicts:
	app/views/rails_admin/main/edit.html.erb
	app/views/rails_admin/main/list.html.erb
	app/views/rails_admin/main/new.html.erb
	rails_admin.gemspec
	spec/dummy_app/Gemfile
  • Loading branch information
gunn committed May 19, 2011
2 parents 5399c7a + 9016134 commit 890893b
Show file tree
Hide file tree
Showing 34 changed files with 761 additions and 209 deletions.
8 changes: 8 additions & 0 deletions Gemfile
Expand Up @@ -35,6 +35,14 @@ group :development, :test do
gem 'cancan' if ENV['AUTHORIZATION_ADAPTER'] == 'cancan'
gem 'factory_girl', '2.0.0.beta2'
gem 'generator_spec'

platform :mri_18 do
gem 'ruby-debug'
end

platform :mri_19 do
gem 'ruby-debug19'
end
end

gemspec
32 changes: 32 additions & 0 deletions README.md
Expand Up @@ -544,6 +544,7 @@ column, you can:

### Create and update views

* Form rendering
* Field groupings
* Visibility
* Labels
Expand All @@ -557,6 +558,37 @@ column, you can:
* Overriding field help texts
* CKEditor integration

**Form rendering**

RailsAdmin renders these views with Rails' form builder (form_for). If you want to use a different
form builder then provide an override for the edit view or independingly for the
create and update views. The argument is a symbol or string that is sent to the view
to process the form. This is handy for integrating things like the nested form builder (https://github.com/ryanb/nested_form) if you need to override a field's edit template.

RailsAdmin.config do |config|
config.model Team do
edit do
form_builder :nested_form_for
field :name
end
end
end

or independently

RailsAdmin.config do |config|
config.model Team do
create do
form_builder :create_form_for
field :name
end
update do
form_builder :update_form_for
field :name
end
end
end

**Field groupings**

By default RailsAdmin groups fields in the edit views (create and update views)
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
@@ -1,3 +1,5 @@
#!/usr/bin/env rake

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/rails_admin/application_controller.rb
Expand Up @@ -2,6 +2,8 @@

module RailsAdmin
class ApplicationController < ::ApplicationController
newrelic_ignore if defined?(NewRelic)

before_filter :_authenticate!
before_filter :_authorize!
before_filter :set_plugin_name
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/rails_admin/main_controller.rb
Expand Up @@ -333,8 +333,7 @@ def list_entries(other = {})
options.merge!(:include => associations) unless associations.empty?

if params[:all]
options.merge!(:limit => per_page * 2)
@objects = @abstract_model.all(options, scope).reverse
@objects = @abstract_model.all(options, scope)
else
@current_page = (params[:page] || 1).to_i
options.merge!(:page => @current_page, :per_page => per_page)
Expand Down
6 changes: 3 additions & 3 deletions app/views/rails_admin/main/_form_fieldset.html.erb
@@ -1,8 +1,8 @@
<% if (fields = fieldset.visible_fields).length > 0 %>
<% if (fields = fieldset.fields.map{ |f| f.with(:form => form, :object => object, :view => self) }.select(&:visible)).length > 0 %>
<fieldset>
<legend><%= fieldset.label %></legend>
<% fields.map{|field| field.with(:form => form, :object => object, :view => self)}.each do |field| %>
<% fields.each do |field| %>
<%= field.render -%>
<% end %>
</fieldset>
<% end %>
<% end %>
Expand Up @@ -16,7 +16,7 @@
<div class="field <%= field.dom_id %>">
<%= form.label field.method_name, field.label %>
<input type="hidden" name="<%= field.dom_name %>" value=""/>
<%= form.select field.method_name, collection, { :selected => selected_ids }, field.html_attributes %>
<%= form.select field.method_name, collection, { :selected => selected_ids, :object => @object }, field.html_attributes %>
<% if field.has_errors? %>
<span class="errorMessage"><%= "#{field.label} #{field.errors.first}" %></span>
<% end %>
Expand Down
Expand Up @@ -34,7 +34,7 @@
} else {
$.ajax({
url: urls[$(this).val()],
data: { compact: true },
data: { compact: true, all: true },
beforeSend: function(xhr) {
xhr.setRequestHeader("Accept", "application/json");
},
Expand Down
39 changes: 39 additions & 0 deletions config/locales/devise.mn.yml
@@ -0,0 +1,39 @@
mn:
errors:
messages:
not_found: "олдсонгүй"
already_confirmed: "аль хэдийн шалгагдсан"
not_locked: "түгжигдээгүй"

devise:
failure:
unauthenticated: 'Та эхлээд нэвтрэх юмуу бүртгүүлсэн байх ёстой.'
unconfirmed: 'Таны бүртгэл шалгагдаагүй байна.'
locked: 'Таны бүртгэл түгжигдсэн байна.'
invalid: 'Э-мэйл эсвэл Нууц код буруу байна.'
invalid_token: 'Шалгах тэмдэг тохирсонгүй.'
timeout: 'Your session expired, please sign in again to continue.'
inactive: 'Your account was not activated yet.'
sessions:
signed_in: 'Signed in successfully.'
signed_out: 'Signed out successfully.'
passwords:
send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
updated: 'Your password was changed successfully. You are now signed in.'
confirmations:
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
confirmed: 'Your account was successfully confirmed. You are now signed in.'
registrations:
signed_up: 'You have signed up successfully. If enabled, a confirmation was sent to your e-mail.'
updated: 'You updated your account successfully.'
destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
unlocks:
send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
unlocked: 'Your account was successfully unlocked. You are now signed in.'
mailer:
confirmation_instructions:
subject: 'Confirmation instructions'
reset_password_instructions:
subject: 'Reset password instructions'
unlock_instructions:
subject: 'Unlock Instructions'
39 changes: 39 additions & 0 deletions config/locales/devise.zh_cn.yml
@@ -0,0 +1,39 @@
zh_cn:
errors:
messages:
not_found: "没找到"
already_confirmed: "已经确认"
not_locked: "没有锁定"

devise:
failure:
unauthenticated: '你需要登录或注册后才能继续'
unconfirmed: '你需要验证账户后才能继续'
locked: '你的账户已经被锁定'
invalid: '邮箱或地址无效'
invalid_token: '身份验证令牌无效'
timeout: '你的会话已过期,请重新登陆后继续'
inactive: '你的账户还没有激活'
sessions:
signed_in: '登陆成功'
signed_out: '登出成功'
passwords:
send_instructions: '几分钟后你会收到一份关于如何重置密码说明的邮件'
updated: '你的密码已成功更新。现在你已经登陆'
confirmations:
send_instructions: '几分钟后你会收到一份关于如何验证账户说明的邮件'
confirmed: '你的账户已成功验证。现在你已经登陆'
registrations:
signed_up: '你已经成功注册。不出意外的话,一份验证邮件已发往你的邮箱'
updated: '你已成功更新你的账户'
destroyed: '再见!你的账户已被成功取消。我们希望再次看到你'
unlocks:
send_instructions: '几分钟后你会收到一份关于如何解锁账户说明的邮件'
unlocked: '你的账户已被成功解锁。现在你已经登陆'
mailer:
confirmation_instructions:
subject: '确认账户'
reset_password_instructions:
subject: '重置密码'
unlock_instructions:
subject: '解锁账户'
2 changes: 2 additions & 0 deletions config/locales/rails_admin.bg.yml
Expand Up @@ -38,6 +38,8 @@ bg:
select_choice: "Избери и кликни"
chose_all: "Избери всички"
clear_all: "Изчисти всички"
up: "Up"
down: "Down"
save: "Запамети"
save_and_add_another: "Запамети и добави друг"
save_and_edit: "Запамети и редактирай"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.da.yml
Expand Up @@ -35,6 +35,8 @@ da:
select_choice: "Vælg og klik"
chose_all: "Vælg alle"
clear_all: "Fravælg alle"
up: "Up"
down: "Down"
save: "Gem"
save_and_add_another: "Gem og tilføj ny"
save_and_edit: "Gem og rediger"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.de.yml
Expand Up @@ -40,6 +40,8 @@ de:
select_choice: "Treffen Sie Ihre Auswahl und klicken Sie"
chose_all: "Alle auswählen"
clear_all: "Alle zurücksetzen"
up: "Up"
down: "Down"
save: "Speichern"
save_and_add_another: "Speichern und einen weiteren hinzufügen"
save_and_edit: "Speichern und bearbeiten"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.es.yml
Expand Up @@ -35,6 +35,8 @@ es:
select_choice: "Seleccione su(s) elección(es) y haga clic"
chose_all: "Elegir todos"
clear_all: "Limpiar todos"
up: "Up"
down: "Down"
save: "Guardar"
save_and_add_another: "Guardar y agregar otro"
save_and_edit: "Guardar y editar"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.fi.yml
Expand Up @@ -38,6 +38,8 @@ fi:
select_choice: "Tee valinnat ja klikkaa"
chose_all: "Valitse kaikki"
clear_all: "Tyhjennä"
up: "Up"
down: "Down"
save: "Tallenna"
save_and_add_another: "Tallenna ja lisää uusi"
save_and_edit: "Tallenna ja muokkaa"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.lt.yml
Expand Up @@ -39,6 +39,8 @@ lt:
select_choice: "Pasirinkti reikalingus ir patvirtinti"
chose_all: "Pasirinkti visus"
clear_all: "Išvalyti"
up: "Up"
down: "Down"
save: "Išsaugoti"
save_and_add_another: "Išsaugoti ir pridėti naują"
save_and_edit: "Išsaugoti ir tęsti redagavimą"
Expand Down
6 changes: 5 additions & 1 deletion config/locales/rails_admin.lv.yml
Expand Up @@ -21,8 +21,10 @@ lv:
list:
edit_action: "Labot"
delete_action: "Dzēst"
select_action: "Izvēlies"
delete_selected: "Dzēst izvēlētos"
add_new: "Pievienot jaunu"
search: "MEKLĒT"
search: "Meklēt"
select: "Izvēlieties %{name}, lai labotu"
show_all: "Parādīt visu"
new:
Expand All @@ -35,6 +37,8 @@ lv:
select_choice: "Izvēlieties nepieciešamo un spiediet"
chose_all: "Izvēlēties visus"
clear_all: "Notīrīt"
up: "Up"
down: "Down"
save: "Saglabāt"
save_and_add_another: "Saglabāt un pievienot jaunu"
save_and_edit: "Saglabāt un labot"
Expand Down
62 changes: 62 additions & 0 deletions config/locales/rails_admin.mn.yml
@@ -0,0 +1,62 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.

mn:
home:
name: "нүүр"
admin:
dashboard:
pagename: "Сайтын удирдлага"
name: "Хянах хэсэг"
model_name: "Моделийн нэр"
last_used: "Сүүлд ашигласан"
records: "Бичлэгүүд"
modify: "Засах"
add_new: "Шинээр нэмэх"
show: "Харах"
ago: "ago"
history:
name: "Түүх"
page_name: "%{name}-н түүх"
no_activity: "No Activity"
credentials:
log_out: "Гарах"
list:
edit_action: "Засах"
delete_action: "Устгах"
select_action: "Сонгох"
delete_selected: "Сонгосны устгах"
add_new: "Шинээр нэмэх"
search_btn: "ХАЙХ"
select: "%{name}-г сонгож засах"
show_all: "Бүгдийг харуул"
new:
basic_info: "Үндсэн мэдээлэл"
required: "Шаардлагатай"
optional: "Шаардлагатай бус"
one_char: "тэмдэг."
many_chars: " тэмдэгтүүд."
chosen: "Chosen %{name}"
select_choice: "Сонголтоо сонгоно уу"
chose_all: "Бүгдийг сонгох"
clear_all: "Бүгдийг цэвэрлэ"
up: "Up"
down: "Down"
save: "Хадгал"
save_and_add_another: "Хадгалаад шинээр"
save_and_edit: "Хадгалаад засах"
cancel: "Болих"
delete:
flash_confirmation: "%{name} -г устгалаа"
confirmation: "Итгэлтэй байна уу"
flash:
successful: "%{name} was successfully %{action}"
error: "%{name} failed to be %{action}"
noaction: "No actions were taken"
actions:
create: "үүсгэх"
created: "үүссэн"
update: "шинэчлэх"
updated: "шинэчилсэн"
delete: "устгах"
deleted: "устгасан"
2 changes: 2 additions & 0 deletions config/locales/rails_admin.pl.yml
Expand Up @@ -38,6 +38,8 @@ pl:
select_choice: "Wybierz kilka i kliknij"
chose_all: "Wybierz wszystkie"
clear_all: "Wyczyść"
up: "Up"
down: "Down"
save: "Zapisz"
save_and_add_another: "Zapisz i dodaj kolejny"
save_and_edit: "Zapisz i wróć do edycji"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.pt-BR.yml
Expand Up @@ -40,6 +40,8 @@ pt-BR:
select_choice: "Selecione sua(s) escolha(s) e clique"
chose_all: "Escolher todos"
clear_all: "Limpar todos"
up: "Up"
down: "Down"
save: "Gravar"
save_and_add_another: "Gravar e adicionar outro"
save_and_edit: "Gravar e alterar"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.pt-PT.yml
Expand Up @@ -37,6 +37,8 @@ pt-PT:
select_choice: "Selecione as sua(s) escolha(s) e clique"
chose_all: "Escolher todos"
clear_all: "Limpar todos"
up: "Up"
down: "Down"
save: "Guardar"
save_and_add_another: "Guardar e adicionar outro"
save_and_edit: "Guardar e editar"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.ru.yml
Expand Up @@ -39,6 +39,8 @@ ru:
select_choice: "Выберите нужное и кликните"
chose_all: "Выбрать все"
clear_all: "Очистить"
up: "Up"
down: "Down"
save: "Сохранить"
save_and_add_another: "Сохранить и добавить новый"
save_and_edit: "Сохранить и продолжить редактирование"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.sv.yml
Expand Up @@ -40,6 +40,8 @@ sv:
select_choice: "Välj dina val och klicka"
chose_all: "Välja alla"
clear_all: "Rensa alla"
up: "Up"
down: "Down"
save: "Spara"
save_and_add_another: "Spara och lägg till ny"
save_and_edit: "Spara och redigera"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.tr.yml
Expand Up @@ -38,6 +38,8 @@ tr:
select_choice: "Şık veya şıkları seçin ve tıklayın"
chose_all: "Hepsini seç"
clear_all: "Hepsini temizle"
up: "Up"
down: "Down"
save: "Kaydet"
save_and_add_another: "Kaydet ve başka ekle"
save_and_edit: "Kaydet ve düzenle"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/rails_admin.uk.yml
Expand Up @@ -35,6 +35,8 @@ uk:
select_choice: "Оберіть один чи декілька і натисніть"
chose_all: "Обрати все"
clear_all: "Очистити все"
up: "Up"
down: "Down"
save: "Зберегти"
save_and_add_another: "Зберегти і добавити ще"
save_and_edit: "Зберегти і поредагувати"
Expand Down

0 comments on commit 890893b

Please sign in to comment.