para 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/para/admin/filters-form.coffee +11 -0
  3. data/app/assets/javascripts/para/admin/tabs.coffee +21 -0
  4. data/app/assets/stylesheets/para/admin/theme/_base.sass +4 -1
  5. data/app/assets/stylesheets/para/overrides/theme.sass +5 -2
  6. data/app/controllers/para/admin/crud_resources_controller.rb +3 -2
  7. data/app/decorators/para/component/base_decorator.rb +7 -1
  8. data/app/decorators/para/component/crud_decorator.rb +14 -1
  9. data/app/decorators/para/component/singleton_resource_decorator.rb +20 -3
  10. data/app/helpers/para/admin/page_helper.rb +1 -1
  11. data/app/helpers/para/model_helper.rb +6 -2
  12. data/app/helpers/para/search_helper.rb +4 -0
  13. data/app/models/para/component/singleton_resource.rb +10 -0
  14. data/app/views/para/admin/resources/_filters.html.haml +1 -1
  15. data/app/views/para/form/_tabs.html.haml +1 -1
  16. data/db/migrate/20160613172154_create_unaccent_extension.rb +5 -0
  17. data/lib/generators/para/filters/templates/_filters.html.haml +1 -1
  18. data/lib/generators/para/orderable/orderable_generator.rb +4 -12
  19. data/lib/generators/para/orderable/templates/orderable_migration.rb +1 -1
  20. data/lib/generators/para/table/table_generator.rb +3 -20
  21. data/lib/para/attribute_field/datetime.rb +1 -1
  22. data/lib/para/config.rb +4 -2
  23. data/lib/para/ext/paperclip.rb +14 -1
  24. data/lib/para/form_builder/tabs.rb +14 -9
  25. data/lib/para/generators/field_helpers.rb +1 -1
  26. data/lib/para/generators/name_helpers.rb +8 -0
  27. data/lib/para/model_field_parsers/paperclip.rb +2 -1
  28. data/lib/para/search/distinct.rb +111 -0
  29. data/lib/para/search.rb +6 -0
  30. data/lib/para/version.rb +1 -1
  31. data/lib/para.rb +1 -0
  32. metadata +15 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 855b5d4493847325b66af2955504dcb8524f9e2d
4
- data.tar.gz: 32e9da832c3641f4993cdd3c65096782ef4ba14b
3
+ metadata.gz: 19583a8f81d13b5d13e77b3ad1da83c9d9d8eae0
4
+ data.tar.gz: e45edc3103747e6d25ca80921f93f72552b21b2b
5
5
  SHA512:
6
- metadata.gz: b5f34e153a1bc38d5e07e37c96b7a9f181e0be8957d1c1d685d3606649fcfefd88a426e8fd201302289f81d99ba076919e98295c8ae8c720cf3aed61698846db
7
- data.tar.gz: 790dffa7b7fa6d327548b23e3a1dec0aeabf115bea3ceb6aa4fd31588f4c5f0318f1b23ca4daf3da6167e2bbde207bdcd1cdc4a5358443d23fcdc686bba1d86c
6
+ metadata.gz: a7ddf6fe3c253d66a3bc6804e27ca1b849e1bb1dcb7d54d40e892d6d95b35ce806a3a24740d2d590acfde5bcd538bde20baaf2efef3bcdc52254c27c4f20117e
7
+ data.tar.gz: da666593dfbcc85b37e87d8fc25345486ae0875b8e144dbd7da7a5e719a86b2a64cde7f535ec445c7c48668375f9bf5c33c2767c15bc0e00d28f4e9802c93392
@@ -0,0 +1,11 @@
1
+ class FiltersForm
2
+ constructor: (options = {}) ->
3
+ @$el = options.$el
4
+ @$el.on('change', 'input, select', @onChange)
5
+
6
+ onChange: =>
7
+ @$el.submit()
8
+
9
+ $(document).on 'page:change', ->
10
+ $('[data-filters-form]').each (i, el) ->
11
+ new FiltersForm($el: $(el))
@@ -0,0 +1,21 @@
1
+ # Tabs hash management adapted from SO answer :
2
+ # http://stackoverflow.com/a/21443271/685925
3
+ #
4
+ class Para.Tabs
5
+ constructor: (options = {}) ->
6
+ @$el = $(options.el)
7
+ @showActiveTab()
8
+ @$('a[data-toggle="tab"]').on('shown.bs.tab', @onTabShown)
9
+
10
+ showActiveTab: ->
11
+ @$('a[href="' + location.hash + '"]').tab('show') if location.hash isnt ''
12
+
13
+ onTabShown: (e) =>
14
+ tabHash = $(e.target).attr('href').substr(1)
15
+ history.pushState(null, null, "##{ tabHash }")
16
+
17
+ $: (args...) ->
18
+ $.fn.find.apply(@$el, args)
19
+
20
+ $(document).on 'page:change', ->
21
+ $('[data-form-tabs]').each (i, el) -> new Para.Tabs(el: el)
@@ -8,7 +8,6 @@ html *
8
8
  body, html
9
9
  min-height: 100%
10
10
  position: relative
11
- overflow-x: hidden
12
11
  -webkit-font-smoothing: antialiased
13
12
  -moz-osx-font-smoothing: grayscale
14
13
 
@@ -31,6 +30,10 @@ body, html
31
30
  padding-left: 10px
32
31
  padding-right: 10px
33
32
 
33
+ .alert
34
+ position: relative
35
+ z-index: 4
36
+
34
37
  // Main container
35
38
  // -------------------------
36
39
 
@@ -132,8 +132,11 @@ button
132
132
  height: 50px
133
133
 
134
134
  .pull-right.btn-group
135
- min-width: 97px
136
-
135
+ min-width: 145px
136
+ text-align: right
137
+ > .btn
138
+ float: none
139
+
137
140
  // Form
138
141
  .input-group-btn
139
142
  .btn,
@@ -4,6 +4,7 @@ module Para
4
4
  module Admin
5
5
  class CrudResourcesController < Para::Admin::ResourcesController
6
6
  include Para::Admin::ResourceControllerConcerns
7
+ include Para::SearchHelper
7
8
 
8
9
  before_filter :load_and_authorize_crud_resource
9
10
  before_filter :add_breadcrumbs, only: [:show, :index, :edit, :new]
@@ -13,7 +14,7 @@ module Para
13
14
 
14
15
  def index
15
16
  @q = @component.resources.search(params[:q])
16
- @resources = @q.result.uniq.page(params[:page])
17
+ @resources = distinct_search_results(@q).page(params[:page])
17
18
 
18
19
  # Sort collection for orderable and trees
19
20
  @resources = if @resources.respond_to?(:ordered)
@@ -79,7 +80,7 @@ module Para
79
80
 
80
81
  def resource_model
81
82
  @resource_model ||=
82
- if @component.subclassable_with?(params[:type])
83
+ if params[:type] && @component.subclassable_with?(params[:type])
83
84
  params[:type].constantize
84
85
  else
85
86
  super
@@ -9,7 +9,13 @@ module Para
9
9
  end
10
10
 
11
11
  def relation_path(controller_or_resource, options = {})
12
- find_path([:admin, self, controller_or_resource], options)
12
+ if Hash === controller_or_resource
13
+ options = controller_or_resource
14
+ controller_or_resource = nil
15
+ end
16
+
17
+ components = [:admin, self, controller_or_resource].compact
18
+ find_path(components, options)
13
19
  end
14
20
 
15
21
  private
@@ -9,10 +9,13 @@ module Para
9
9
  end
10
10
 
11
11
  def relation_path(controller_or_resource, *nested_resources, **options)
12
- id_key = nested_resources.empty? ? :id : :resource_id
12
+ nested = nested_resources.any?
13
+ id_key = nested ? :resource_id : :id
13
14
 
14
15
  if (id = extract_id_from(controller_or_resource))
15
16
  options[id_key] = id
17
+ elsif Hash === controller_or_resource
18
+ options = controller_or_resource
16
19
  end
17
20
 
18
21
  route_key = route_key_for(options[id_key], options)
@@ -20,6 +23,8 @@ module Para
20
23
 
21
24
  data = [:admin, self, route_key].compact + nested_resources
22
25
 
26
+ options[:action] = action_option_for(options, nested: nested)
27
+
23
28
  polymorphic_path(data, options)
24
29
  end
25
30
 
@@ -40,6 +45,14 @@ module Para
40
45
  def model_singular_route_key
41
46
  @model_singular_route_key ||= model.model_name.singular_route_key
42
47
  end
48
+
49
+ def action_option_for(options, nested: false)
50
+ if !nested && options[:action].try(:to_sym) == :show
51
+ :edit
52
+ else
53
+ options[:action]
54
+ end
55
+ end
43
56
  end
44
57
  end
45
58
  end
@@ -4,11 +4,28 @@ module Para
4
4
  include Para::Component::BaseDecorator
5
5
 
6
6
  def path(options = {})
7
- find_path([:admin, self], options)
7
+ find_path([:admin, self, :resource], options)
8
8
  end
9
9
 
10
- def relation_path(controller_or_resource, options = {})
11
- path
10
+ def relation_path(controller_or_resource, *nested_resources, **options)
11
+ nested = nested_resources.any?
12
+ nested_resources << :resource unless nested
13
+
14
+ if Hash === controller_or_resource
15
+ options = controller_or_resource
16
+ end
17
+
18
+ options[:action] = action_option_for(options, nested: nested)
19
+ data = [:admin, self, *nested_resources]
20
+ polymorphic_path(data, options)
21
+ end
22
+
23
+ def action_option_for(options, nested: false)
24
+ if !nested && options[:action].try(:to_sym) == :show
25
+ nil
26
+ else
27
+ options[:action]
28
+ end
12
29
  end
13
30
  end
14
31
  end
@@ -25,7 +25,7 @@ module Para
25
25
  def actions_for(type)
26
26
  Para.config.page_actions_for(type).map do |action|
27
27
  instance_eval(&action)
28
- end
28
+ end.compact
29
29
  end
30
30
  end
31
31
  end
@@ -17,9 +17,13 @@ module Para
17
17
  component.class.reflect_on_association(relation).klass
18
18
  end
19
19
 
20
- def field_value_for(object, field_name, type = nil)
20
+ def value_for(object, field_name, type = nil)
21
21
  field = model_field_mappings(object.class).field_for(field_name, type)
22
- value = field.value_for(object)
22
+ field.value_for(object)
23
+ end
24
+
25
+ def field_value_for(object, field_name, type = nil)
26
+ value = value_for(object, field_name, type)
23
27
  excerpt_value_for(value)
24
28
  end
25
29
 
@@ -18,5 +18,9 @@ module Para
18
18
  attribute.attribute_column_path.join('_')
19
19
  end.join('_or_')
20
20
  end
21
+
22
+ def distinct_search_results(search)
23
+ Para::Search::Distinct.new(search).result
24
+ end
21
25
  end
22
26
  end
@@ -20,6 +20,16 @@ module Para
20
20
  def default_form_actions
21
21
  [:submit]
22
22
  end
23
+
24
+ def model_name
25
+ ModelName.new(self)
26
+ end
27
+
28
+ class ModelName < ActiveModel::Name
29
+ def singular_route_key
30
+ 'singleton'
31
+ end
32
+ end
23
33
  end
24
34
  end
25
35
  end
@@ -1,4 +1,4 @@
1
- = search_form_for @q, builder: SimpleForm::FormBuilder, url: @component.path do |form|
1
+ = search_form_for @q, builder: SimpleForm::FormBuilder, url: @component.path, html: { data: { :'filters-form' => true } } do |form|
2
2
  .input-group
3
3
  %span.input-group-addon
4
4
  %i.fa.fa-search
@@ -1,4 +1,4 @@
1
- .form-tabs
1
+ .form-tabs{ data: { 'form-tabs': true } }
2
2
  %nav.navbar.navbar-inverse
3
3
  %ul.nav.navbar-nav{ role: 'tablist' }
4
4
  - tabs.each_with_index do |tab, index|
@@ -0,0 +1,5 @@
1
+ class CreateUnaccentExtension < ActiveRecord::Migration
2
+ def change
3
+ ActiveRecord::Base.connection.execute('CREATE EXTENSION IF NOT EXISTS unaccent')
4
+ end
5
+ end
@@ -1,4 +1,4 @@
1
- = search_form_for @q, builder: SimpleForm::FormBuilder, url: @component.path do |form|
1
+ = search_form_for @q, builder: SimpleForm::FormBuilder, url: @component.path, html: { data: { :'filters-form' => true } } do |form|
2
2
  .input-group
3
3
  %span.input-group-addon
4
4
  %i.fa.fa-search
@@ -1,5 +1,5 @@
1
1
  module Para
2
- class OrderableGenerator < Rails::Generators::NamedBase
2
+ class OrderableGenerator < Para::Generators::NamedBase
3
3
  include Rails::Generators::Migration
4
4
 
5
5
  source_root File.expand_path('../templates', __FILE__)
@@ -15,14 +15,14 @@ module Para
15
15
  def add_field_to_model
16
16
  migration_template(
17
17
  'orderable_migration.rb',
18
- "db/migrate/add_orderable_position_to_#{ plural_file_name }.rb"
18
+ "db/migrate/add_orderable_position_to_#{ table_name }.rb"
19
19
  )
20
20
  end
21
21
 
22
22
  def add_orderable_to_model
23
23
  class_definition = "class #{ class_name } < ActiveRecord::Base\n"
24
24
 
25
- inject_into_file "app/models/#{ file_name }.rb", after: class_definition do
25
+ inject_into_file "app/models/#{ singular_namespaced_path }.rb", after: class_definition do
26
26
  " acts_as_orderable\n"
27
27
  end
28
28
  end
@@ -33,15 +33,7 @@ module Para
33
33
 
34
34
  def fianl_message
35
35
  message = "The #{ class_name } model is now orderable.\n"
36
- message << "* Please migrate to update your model's table\n" unless options[:migrate]
37
- message << <<-MESSAGE
38
- * Please add to your model resource's routes the ordering path.
39
- e.g.: resources :#{ plural_file_name } do
40
- collection do
41
- patch 'order'
42
- end
43
- end
44
- MESSAGE
36
+ message << "Please migrate to update your model's table\n" unless options[:migrate]
45
37
 
46
38
  say(message)
47
39
  end
@@ -1,4 +1,4 @@
1
- class AddOrderablePositionTo<%= class_name.pluralize %> < ActiveRecord::Migration
1
+ class AddOrderablePositionTo<%= table_name.camelize %> < ActiveRecord::Migration
2
2
  def change
3
3
  add_column :<%= table_name %>, :position, :integer, default: 0
4
4
  add_index :<%= table_name %>, :position
@@ -1,5 +1,8 @@
1
1
  module Para
2
2
  class TableGenerator < Para::Generators::NamedBase
3
+ include Para::Admin::BaseHelper
4
+ include Para::Generators::FieldHelpers
5
+
3
6
  source_root File.expand_path('../templates', __FILE__)
4
7
 
5
8
  desc 'Para resources table generator'
@@ -10,25 +13,5 @@ module Para
10
13
  "app/views/admin/#{ plural_namespaced_path }/_table.haml"
11
14
  )
12
15
  end
13
-
14
- private
15
-
16
- def attributes
17
- @attributes ||= begin
18
- model =
19
- begin
20
- Para.const_get(class_name)
21
- rescue
22
- class_name.classify.constantize
23
- end
24
- AttributeFieldMappings.new(model).fields
25
- end
26
- end
27
-
28
- def attributes_list
29
- @attributes_list ||= attributes.map do |field|
30
- field.name.to_sym.inspect
31
- end.join(', ')
32
- end
33
16
  end
34
17
  end
@@ -6,7 +6,7 @@ module Para
6
6
  field_option :wrapper, :wrapper_name
7
7
 
8
8
  def value_for(instance)
9
- (value = instance.send(name)) && I18n.l(value)
9
+ (value = instance.send(name)) && ::I18n.l(value)
10
10
  end
11
11
 
12
12
  def wrapper_name
data/lib/para/config.rb CHANGED
@@ -57,8 +57,10 @@ module Para
57
57
  page_actions[type] ||= []
58
58
  end
59
59
 
60
- def self.add_actions_for(type, &block)
61
- page_actions_for(type) << block
60
+ def self.add_actions_for(*types, &block)
61
+ types.each do |type|
62
+ page_actions_for(type) << block
63
+ end
62
64
  end
63
65
  end
64
66
  end
@@ -28,7 +28,8 @@ module Para
28
28
 
29
29
  # Notify ActiveRecord that the model has changed so nested models
30
30
  # get to run validation hooks and attachments are cleared
31
- send(:"#{ attachment_name }_file_name_will_change!")
31
+ column_name = attribute_container_column_for(attachment_name)
32
+ send(:"#{ column_name }_will_change!")
32
33
  end
33
34
  end
34
35
 
@@ -60,6 +61,18 @@ module Para
60
61
 
61
62
  @klass.send(:before_validation, :clear_removed_attachments)
62
63
  end
64
+
65
+ @klass.send(:define_method, :attribute_container_column_for) do |attachment_name|
66
+ attribute_name = "#{ attachment_name }_file_name"
67
+
68
+ if self.class.columns.any? { |column| column.name == attribute_name }
69
+ return attribute_name
70
+ end
71
+
72
+ stored_attribute = self.class.stored_attributes.each do |key, fields|
73
+ return key if fields.include?(attribute_name.to_sym)
74
+ end
75
+ end
63
76
  end
64
77
  end
65
78
  end
@@ -2,22 +2,23 @@ module Para
2
2
  module FormBuilder
3
3
  module Tabs
4
4
  def tabs(&block)
5
- tabs_manager = TabsManager.new(template, object)
6
- block.call(tabs_manager)
5
+ manager = TabsManager.new(template, object, self)
6
+ block.call(manager)
7
7
 
8
- template.render partial: 'para/form/tabs', locals: { tabs: tabs_manager.tabs }
8
+ template.render partial: 'para/form/tabs', locals: { tabs: manager.tabs }
9
9
  end
10
10
 
11
11
  class TabsManager
12
- attr_reader :template, :object
12
+ attr_reader :template, :object, :builder
13
13
 
14
- def initialize(template, object)
14
+ def initialize(template, object, builder)
15
15
  @template = template
16
16
  @object = object
17
+ @builder = builder
17
18
  end
18
19
 
19
20
  def tab(identifier, options = {}, &block)
20
- tabs << Tab.new(template, object, identifier, options, &block)
21
+ tabs << Tab.new(template, object, builder, identifier, options, &block)
21
22
  nil
22
23
  end
23
24
 
@@ -27,13 +28,14 @@ module Para
27
28
  end
28
29
 
29
30
  class Tab
30
- attr_reader :template, :object, :identifier, :icon, :content
31
+ attr_reader :template, :object, :builder, :identifier, :icon, :content
31
32
 
32
33
  delegate :capture, to: :template
33
34
 
34
- def initialize(template, object, identifier, options, &content_block)
35
+ def initialize(template, object, builder, identifier, options, &content_block)
35
36
  @template = template
36
37
  @object = object
38
+ @builder = builder
37
39
  @identifier = identifier
38
40
  @content = capture { content_block.call }
39
41
  @icon = options[:icon]
@@ -48,7 +50,10 @@ module Para
48
50
  end
49
51
 
50
52
  def dom_id
51
- @dom_id = identifier.to_s.parameterize
53
+ @dom_id = [
54
+ builder.nested_resource_dom_id.presence,
55
+ identifier.to_s.parameterize
56
+ ].compact.join('-')
52
57
  end
53
58
  end
54
59
  end
@@ -5,7 +5,7 @@ module Para
5
5
 
6
6
  def attributes
7
7
  @attributes ||= begin
8
- model = Para.const_get(class_name)
8
+ model = namespaced_class_name.constantize
9
9
  AttributeFieldMappings.new(model).fields
10
10
  end
11
11
  end
@@ -4,6 +4,14 @@ module Para
4
4
  def plural_namespaced_path
5
5
  @plural_namespaced_path ||= File.join(*class_path, plural_name)
6
6
  end
7
+
8
+ def singular_namespaced_path
9
+ @singular_namespaced_path ||= File.join(*class_path, singular_name)
10
+ end
11
+
12
+ def namespaced_class_name
13
+ @namespaced_class_name ||= [namespace, class_name].compact.join('::')
14
+ end
7
15
  end
8
16
  end
9
17
  end
@@ -43,7 +43,8 @@ module Para
43
43
  #
44
44
  def image?(options)
45
45
  if (styles = options[:styles]) && !styles.empty?
46
- styles.values.first.match(/^(\d|x)/i)
46
+ styles.values.first.is_a?(String) &&
47
+ styles.values.first.match(/^(\d|x)/i)
47
48
  end
48
49
  end
49
50
  end
@@ -0,0 +1,111 @@
1
+ # This class allows to unify search results and avoid duplicates, avoiding
2
+ # SQL DISTINCT errors by adding ORDER BY fields to the DISTINCT selection
3
+ # automatically
4
+ #
5
+ # This fixes a previous issue when trying to order search results with
6
+ # Ransack sorting feature, when implying associated models
7
+ #
8
+ module Para
9
+ module Search
10
+ class Distinct
11
+ attr_reader :search
12
+
13
+ def initialize(search)
14
+ @search = search
15
+ @sort_index ||= 0
16
+ end
17
+
18
+ def result
19
+ selects = build_selects
20
+ search.result.select(selects).uniq
21
+ end
22
+
23
+ private
24
+
25
+ def build_selects
26
+ ([table_wildcard_select] + sort_selects).join(', ')
27
+ end
28
+
29
+ def table_wildcard_select
30
+ [search.klass.table_name, '*'].join('.')
31
+ end
32
+
33
+ def sort_selects
34
+ return [] unless search
35
+
36
+ search.sorts.map do |sort|
37
+ case sort.attr
38
+ when Arel::Attributes::Attribute then process_attribute(sort)
39
+ when Arel::Nodes::SqlLiteral then process_sql_literal(sort)
40
+ #
41
+ # Explicitly raise here to avoid the system to swallow sorting errors,
42
+ # since any unsupported class must have been explicitly used by the
43
+ # developer, and debugging it would be hard without an exception
44
+ #
45
+ else raise "Unsupported sort attribute class : #{ sort.attr.class.name }"
46
+ end
47
+ end
48
+ end
49
+
50
+ def process_attribute(sort)
51
+ sort_index = next_sort_index
52
+ sql = [sort.attr.relation.name, sort.attr.name].join('.')
53
+
54
+ replace_sort(sort, sort_index)
55
+ build_alias(sql, sort_index)
56
+ end
57
+
58
+ # When given an SQL literal, we store the sql expression in a named SELECT
59
+ # variable, and replace the expression by its variable name inside of the
60
+ # ransack sort instance
61
+ #
62
+ def process_sql_literal(sort)
63
+ sort_index = next_sort_index
64
+ sql = sort.attr.to_s
65
+
66
+ replace_sort(sort, sort_index)
67
+ build_alias(sql, sort_index)
68
+ end
69
+
70
+ def next_sort_index
71
+ ['sort', @sort_index += 1].join('_')
72
+ end
73
+
74
+ def replace_sort(sort, sort_index)
75
+ sort.instance_variable_set(:@attr, Arel::Nodes::SqlLiteral.new(sort_index))
76
+ end
77
+
78
+ def build_alias(sql, index)
79
+ Arel::Nodes::InfixOperation.new(
80
+ 'AS',
81
+ format_string(sql),
82
+ Arel::Nodes::SqlLiteral.new(index)
83
+ ).to_sql
84
+ end
85
+
86
+ def format_string(sql)
87
+ sql_lower(sql_unaccent(sql_stringify(sql)))
88
+ end
89
+
90
+ def sql_lower(sql)
91
+ Arel::Nodes::NamedFunction.new('LOWER', [sql])
92
+ end
93
+
94
+ def sql_unaccent(sql)
95
+ Arel::Nodes::NamedFunction.new('UNACCENT', [sql])
96
+ end
97
+
98
+ def sql_stringify(sql)
99
+ Arel::Nodes::NamedFunction.new(
100
+ 'CAST', [
101
+ Arel::Nodes::InfixOperation.new(
102
+ 'AS',
103
+ Arel::Nodes::SqlLiteral.new(sql),
104
+ Arel::Nodes::SqlLiteral.new('text')
105
+ )
106
+ ]
107
+ )
108
+ end
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,6 @@
1
+ module Para
2
+ module Search
3
+ end
4
+ end
5
+
6
+ require 'para/search/distinct'
data/lib/para/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Para
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
data/lib/para.rb CHANGED
@@ -35,6 +35,7 @@ require 'para/exporter'
35
35
  require 'para/importer'
36
36
  require 'para/sti'
37
37
  require 'para/page'
38
+ require 'para/search'
38
39
 
39
40
  module Para
40
41
  extend ActiveSupport::Autoload
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: para
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentin Ballestrino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-11 00:00:00.000000000 Z
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: devise
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.0'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '5.0'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: '3.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '5.0'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: simple_form
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -346,7 +352,9 @@ files:
346
352
  - app/assets/images/para/admin/loading-spinner.gif
347
353
  - app/assets/javascripts/admin/app.coffee
348
354
  - app/assets/javascripts/para/admin.coffee
355
+ - app/assets/javascripts/para/admin/filters-form.coffee
349
356
  - app/assets/javascripts/para/admin/table.coffee
357
+ - app/assets/javascripts/para/admin/tabs.coffee
350
358
  - app/assets/javascripts/para/admin/theme_actions.coffee
351
359
  - app/assets/javascripts/para/admin/tree.coffee
352
360
  - app/assets/javascripts/para/application.js
@@ -467,6 +475,7 @@ files:
467
475
  - db/migrate/20150203173219_add_identifier_to_para_components.rb
468
476
  - db/migrate/20160304113055_add_json_equality_operator_patch_to_postgres.rb
469
477
  - db/migrate/20160419145254_create_para_page_sections.rb
478
+ - db/migrate/20160613172154_create_unaccent_extension.rb
470
479
  - lib/generators/para/admin_user/admin_user_generator.rb
471
480
  - lib/generators/para/component/component_generator.rb
472
481
  - lib/generators/para/component/crud/crud_generator.rb
@@ -573,6 +582,8 @@ files:
573
582
  - lib/para/plugins.rb
574
583
  - lib/para/plugins/routes.rb
575
584
  - lib/para/routes.rb
585
+ - lib/para/search.rb
586
+ - lib/para/search/distinct.rb
576
587
  - lib/para/sti.rb
577
588
  - lib/para/sti/root_model.rb
578
589
  - lib/para/version.rb