Skip to content

Commit

Permalink
Merge branch 'master' into ordered-multiselect-append-new
Browse files Browse the repository at this point in the history
  • Loading branch information
dwbutler committed Jan 16, 2015
2 parents e361092 + c0d9d93 commit 2fe2d50
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 176 deletions.
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ rvm:
- 1.9.3
- 2.0.0
- 2.1
- 2.2
- rbx-2
- ruby-head

Expand All @@ -32,17 +33,17 @@ sudo: false

matrix:
include:
- rvm: 2.1
- rvm: 2.2
env: RAILS_VERSION=4.2 CI_ORM=active_record CI_DB_ADAPTER=sqlite3
- rvm: 2.1
- rvm: 2.2
env: RAILS_VERSION=4.2 CI_ORM=mongoid
- rvm: 2.1
- rvm: 2.2
env: CI_ORM=active_record CI_DB_ADAPTER=mysql2
- rvm: 2.1
- rvm: 2.2
env: CI_ORM=active_record CI_DB_ADAPTER=postgresql CI_DB_USERNAME=postgres
- rvm: 2.1
- rvm: 2.2
env: RAILS_VERSION=4.0 CI_ORM=active_record CI_DB_ADAPTER=sqlite3
- rvm: 2.1
- rvm: 2.2
env: RAILS_VERSION=4.0 CI_ORM=mongoid
- rvm: jruby-19mode
env: CI_ORM=mongoid
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ when '4.2'
gem 'sass-rails', '~> 5.0.0.beta1'
gem 'devise', github: 'plataformatec/devise', branch: 'lm-rails-4-2'
when '4.0'
gem 'rails', '~> 4.0.0'
gem 'rails', '< 4.1'
gem 'devise', '>= 3.2'
gem 'test-unit'
else
gem 'rails', '~> 4.1.0'
gem 'devise', '>= 3.2'
Expand Down Expand Up @@ -57,7 +58,7 @@ group :test do
gem 'capybara', '>= 2.1'
gem 'carrierwave', '>= 0.8'
gem 'coveralls'
gem 'database_cleaner', '>= 1.2'
gem 'database_cleaner', ['>= 1.2', '!= 1.4.0']
gem 'dragonfly', '~> 1.0'
gem 'factory_girl', '>= 4.2'
gem 'generator_spec', '>= 0.8'
Expand Down
284 changes: 142 additions & 142 deletions app/assets/stylesheets/rails_admin/base/font-awesome-4-compability.scss

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions app/assets/stylesheets/rails_admin/base/theming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ body.rails_admin {
top: 50px;
bottom: 0;
background: #eaf0f1;
z-index: 100;
}

/* fat labels in forms */
Expand Down Expand Up @@ -181,7 +182,7 @@ body.rails_admin {
// }

/* nested nav */
.nav.nav-list {
.nav {
.nav-level-1 {
padding-left:30px;
}
Expand Down Expand Up @@ -269,7 +270,7 @@ body.rails_admin {
/* icons */
td.links {
max-width: none;
.inline {
.list-inline {
margin:0px;
li { display:inline-block; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.ui-datepicker {
/* fix glitches */
border-width:0px;
z-index: 3!important;
z-index: 1051!important;
table{
margin:0px;
}
Expand Down
30 changes: 16 additions & 14 deletions app/views/rails_admin/main/_submit_buttons.html.haml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
%input{type: :hidden, name: 'return_to', value: (params[:return_to].presence || request.referer)}
%br
.form-actions
%button.btn.btn-primary{type: "submit", name: "_save", :'data-disable-with' => t("admin.form.save")}
%i.icon-white.icon-ok
= t("admin.form.save")
%span.extra_buttons
- if authorized? :new, @abstract_model
%button.btn.btn-info{type: "submit", name: "_add_another", :'data-disable-with' => t("admin.form.save_and_add_another")}
= t("admin.form.save_and_add_another")
- if authorized? :edit, @abstract_model
%button.btn.btn-info{type: "submit", name: "_add_edit", :'data-disable-with' => t("admin.form.save_and_edit")}
= t("admin.form.save_and_edit")
%button.btn{type: "submit", name: "_continue", :'data-disable-with' => t("admin.form.cancel")}
%i.icon-remove
= t("admin.form.cancel")

.form-group
.col-sm-offset-2.col-sm-10
%button.btn.btn-primary{type: "submit", name: "_save", :'data-disable-with' => t("admin.form.save")}
%i.icon-white.icon-ok
= t("admin.form.save")
%span.extra_buttons
- if authorized? :new, @abstract_model
%button.btn.btn-info{type: "submit", name: "_add_another", :'data-disable-with' => t("admin.form.save_and_add_another")}
= t("admin.form.save_and_add_another")
- if authorized? :edit, @abstract_model
%button.btn.btn-info{type: "submit", name: "_add_edit", :'data-disable-with' => t("admin.form.save_and_edit")}
= t("admin.form.save_and_edit")
%button.btn{type: "submit", name: "_continue", :'data-disable-with' => t("admin.form.cancel")}
%i.icon-remove
= t("admin.form.cancel")
2 changes: 1 addition & 1 deletion app/views/rails_admin/main/dashboard.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
.progress-bar.animate-width-to{:class => "progress-bar-#{get_indicator(percent)}", :'data-animate-length' => ([1.0, percent].max.to_i * 20), :'data-animate-width-to' => "#{[2.0, percent].max.to_i}%", style: "width:2%"}
= @count[abstract_model.pretty_name]
%td.links
%ul.inline= menu_for :collection, abstract_model, nil, true
%ul.inline.list-inline= menu_for :collection, abstract_model, nil, true
- if @auditing_adapter && authorized?(:history)
#block-tables.block
.content
Expand Down
10 changes: 6 additions & 4 deletions app/views/rails_admin/main/history.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

= form_tag("", method: "get", class: "search pjax-form form-inline") do
.well
%input{name: "query", type: "search", value: query, placeholder: "#{t("admin.misc.filter")}", class: 'input-small'}
%button.btn.btn-primary{type: "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
%i.icon-white.icon-refresh
= t("admin.misc.refresh")
.input-group
%input.form-control.input-small{name: "query", type: "search", value: query, placeholder: "#{t("admin.misc.filter")}", class: 'input-small'}
%span.input-group-btn
%button.btn.btn-primary{type: "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
%i.icon-white.icon-refresh
= t("admin.misc.refresh")
%table#history.table.table-striped.table-condensed
%thead
%tr
Expand Down
2 changes: 1 addition & 1 deletion app/views/rails_admin/main/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
- if @other_right_link ||= other_right && index_path(params.merge(set: (params[:set].to_i + 1)))
%td.other.right= link_to "...", @other_right_link, class: 'pjax'
%td.last.links
%ul.inline= menu_for :member, @abstract_model, object, true
%ul.inline.list-inline= menu_for :member, @abstract_model, object, true
- if @objects.respond_to?(:total_count)
- total_count = @objects.total_count.to_i
.row
Expand Down
1 change: 1 addition & 0 deletions lib/rails_admin/config/fields/types/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Types
class Json < RailsAdmin::Config::Fields::Types::Text
# Register field type for the type loader
RailsAdmin::Config::Fields::Types.register(self)
RailsAdmin::Config::Fields::Types.register(:jsonb, self)

register_instance_option :formatted_value do
value.present? ? JSON.pretty_generate(value) : nil
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/config/edit/rails_admin_config_edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,10 @@ class HelpTest < Tableless
fill_in 'field_test_nested_field_tests_attributes_0_title', with: 'nested field test title 1 edited', visible: false
find('#field_test_nested_field_tests_attributes_1__destroy', visible: false).set('true')

click_button 'Save' # first(:button, "Save").click
click_button 'Save'
is_expected.to have_content('Field test successfully updated')

@record.reload

expect(@record.comment.content.strip).to eq('nested comment content')
expect(@record.nested_field_tests.length).to eq(1)
expect(@record.nested_field_tests[0].title).to eq('nested field test title 1 edited')
Expand Down
17 changes: 16 additions & 1 deletion spec/rails_admin/config/fields/types/json_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require 'spec_helper'

describe RailsAdmin::Config::Fields::Types::Json do
let(:field) { RailsAdmin.config(FieldTest).fields.detect { |f| f.name == :json_field } }

describe '#parse_input' do
let(:field) { RailsAdmin.config(FieldTest).fields.detect { |f| f.name == :json_field } }
before :each do
RailsAdmin.config do |config|
config.model FieldTest do
Expand All @@ -20,4 +21,18 @@
expect { field.parse_input(json_field: '{{') }.to raise_error(JSON::ParserError)
end
end

describe 'aliasing' do
before :each do
RailsAdmin.config do |config|
config.model FieldTest do
field :json_field, :jsonb
end
end
end

it 'allows use of :jsonb fieldtype' do
expect(field.class).to eq RailsAdmin::Config::Fields::Types::Json
end
end
end

0 comments on commit 2fe2d50

Please sign in to comment.