itsf_backend 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/itsf/backend/application/ui_autocomplete.js.coffee +16 -0
- data/app/assets/stylesheets/itsf/backend/application.css.less +3 -1
- data/app/assets/stylesheets/itsf/backend/application/tab-with-nav.css.less +7 -0
- data/app/assets/stylesheets/itsf/backend/application/ui-autocomplete.css.less +8 -0
- data/app/assets/stylesheets/itsf_backend.css +1 -0
- data/app/forms/concerns/form/ui_autocomplete.rb +13 -0
- data/app/views/itsf/backend/home/_dashboard_panel.html.haml +9 -6
- data/app/views/itsf/backend/resource/base/_form.html.haml +7 -1
- data/app/views/layouts/itsf/backend/_main_navigation_drop_down.html.haml +10 -9
- data/config/initializers/simple_form_extensions.rb +4 -0
- data/lib/itsf/backend/version.rb +1 -1
- data/lib/itsf_backend.rb +1 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dcf00b74666b710c157f92a724a63137d2f407e
|
4
|
+
data.tar.gz: a15219050c845c035cfaccdb021ebc60b61eeacc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16436d0ba231de75bdbe947320216a6ff03f4aa67ebb2b55dbdcdef4d2472682729fe05b96dfc53702ae9f6eba8f135760759a56aaf9ec9a3752363810bcb899
|
7
|
+
data.tar.gz: 68fbba8e9d36dc16709075da25760d74a6a524fa536fbfa714289336a63d5d084dabbfbef2447dc5858e7f2e620cab03880fa2edd1002903e466cd9da5c2957d
|
@@ -0,0 +1,16 @@
|
|
1
|
+
$ ->
|
2
|
+
$('.ui-autocomplete-input').each ->
|
3
|
+
element = $(this)
|
4
|
+
target = $(this).attr('data-source-url')
|
5
|
+
|
6
|
+
element.autocomplete
|
7
|
+
source: target
|
8
|
+
minLength: 2
|
9
|
+
html: true
|
10
|
+
open: (event, ui) ->
|
11
|
+
$('.ui-autocomplete').css 'z-index', 1000
|
12
|
+
return
|
13
|
+
create: ->
|
14
|
+
$(this).data('ui-autocomplete')._renderItem = (ul, item) ->
|
15
|
+
$("<li>").append("<span>" + item.title + "<br><small>" + item.subtitle + "</small></span>").appendTo ul
|
16
|
+
return
|
@@ -27,4 +27,6 @@
|
|
27
27
|
@import "application/panel-footer-pagination.css.less";
|
28
28
|
@import "application/panel-with-actions.css.less";
|
29
29
|
@import "application/table-actions.css.less";
|
30
|
-
@import "application/table-responsive.css.less";
|
30
|
+
@import "application/table-responsive.css.less";
|
31
|
+
@import "application/tab-with-nav.css.less";
|
32
|
+
@import "application/ui-autocomplete.css.less";
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Concerns
|
2
|
+
module Form
|
3
|
+
module UiAutocomplete
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
def autocomplete(attribute, options = {})
|
7
|
+
options.reverse_merge!(url: -> { url_for(action: attribute, format: :json) })
|
8
|
+
url = options.delete(:url)
|
9
|
+
input attribute, as: :string, input_html: { class: 'ui-autocomplete-input', :'data-source-url' => url.call }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -13,12 +13,15 @@
|
|
13
13
|
- else
|
14
14
|
= kontroller.resource_class.count
|
15
15
|
%td.text-right
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
- begin
|
17
|
+
= link_to({ controller: kontroller.name.underscore.gsub('_controller', ''), action: 'new' }, id: "link-to-#{kontroller.name.underscore.gsub('_controller', '').gsub(/[\/_]/, '-')}-new", class: 'btn btn-success btn-xs btn-responsive') do
|
18
|
+
%span.glyphicon.glyphicon-plus
|
19
|
+
%span.btn-text= t('.new')
|
20
|
+
|
21
|
+
= link_to({ controller: kontroller.name.underscore.gsub('_controller', '') }, id: "link-to-#{kontroller.name.underscore.gsub('_controller', '').gsub(/[\/_]/, '-')}-index" ,class: 'btn btn-primary btn-xs btn-responsive') do
|
22
|
+
%span.glyphicon.glyphicon-eye-open
|
23
|
+
%span.btn-text= t('.view')
|
24
|
+
- rescue ActionController::UrlGenerationError
|
22
25
|
|
23
26
|
|
24
27
|
.panel.panel-default
|
@@ -1,2 +1,8 @@
|
|
1
1
|
- resource_class.attribute_names.delete_if { |name| Itsf::Backend.hidden_attributes_for[:edit].include?(name.to_sym) }.each do |name|
|
2
|
-
|
2
|
+
- if form.object.class.columns_hash[name].type == :hstore
|
3
|
+
= simple_fields_for name do |hstore_form|
|
4
|
+
- if form.object.send(name).respond_to?(:each)
|
5
|
+
- form.object.send(name).each do |key, value|
|
6
|
+
= hstore_form.input key, input_html: { value: value }
|
7
|
+
- else
|
8
|
+
= form.input name
|
@@ -6,15 +6,16 @@
|
|
6
6
|
- controllers = engine.to_s.gsub('::Engine', '::Configuration').constantize.registered_controllers
|
7
7
|
- if controllers.respond_to?(:call)
|
8
8
|
- controllers = controllers.call
|
9
|
-
- controllers.each do |kontroller|
|
10
|
-
- Rails.logger.info kontroller.inspect
|
9
|
+
- controllers.each do |kontroller|
|
11
10
|
- resource_klass = kontroller.resource_class
|
12
11
|
- if !Itsf::Backend.features?(:pundit) || policy(resource_klass).index?
|
13
12
|
%li{ class: (kontroller == controller.class ? 'active' : nil) }
|
14
|
-
|
15
|
-
=
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
- begin
|
14
|
+
= link_to(send(engine.engine_name).url_for(controller: "/#{kontroller.controller_path}")) do
|
15
|
+
= resource_klass.model_name.human(count: :other)
|
16
|
+
%span.label.label-default
|
17
|
+
- if respond_to?(:current_user) && current_user.respond_to?(:last_sign_in_at) && resource_klass.respond_to?(:column_names) && resource_klass.column_names.include?('updated_at')
|
18
|
+
= "#{resource_klass.where("updated_at > ?", current_user.last_sign_in_at).count}/#{resource_klass.count}"
|
19
|
+
- else
|
20
|
+
= resource_klass.count
|
21
|
+
- rescue ActionController::UrlGenerationError
|
data/lib/itsf/backend/version.rb
CHANGED
data/lib/itsf_backend.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itsf_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -464,6 +464,7 @@ files:
|
|
464
464
|
- app/assets/javascripts/itsf/backend/application/itsf-logo.coffee
|
465
465
|
- app/assets/javascripts/itsf/backend/application/pagination-size.coffee
|
466
466
|
- app/assets/javascripts/itsf/backend/application/table-column-sorting.coffee
|
467
|
+
- app/assets/javascripts/itsf/backend/application/ui_autocomplete.js.coffee
|
467
468
|
- app/assets/javascripts/itsf/backend/vendor/jQueryRotate.js
|
468
469
|
- app/assets/javascripts/itsf/backend/vendor/jquery.dragtable.js
|
469
470
|
- app/assets/javascripts/itsf/backend/vendor/jquery.redirect.js
|
@@ -485,8 +486,10 @@ files:
|
|
485
486
|
- app/assets/stylesheets/itsf/backend/application/navigation-logo.css.less
|
486
487
|
- app/assets/stylesheets/itsf/backend/application/panel-footer-pagination.css.less
|
487
488
|
- app/assets/stylesheets/itsf/backend/application/panel-with-actions.css.less
|
489
|
+
- app/assets/stylesheets/itsf/backend/application/tab-with-nav.css.less
|
488
490
|
- app/assets/stylesheets/itsf/backend/application/table-actions.css.less
|
489
491
|
- app/assets/stylesheets/itsf/backend/application/table-responsive.css.less
|
492
|
+
- app/assets/stylesheets/itsf/backend/application/ui-autocomplete.css.less
|
490
493
|
- app/assets/stylesheets/itsf/backend/bootstrap_and_overrides.css.less
|
491
494
|
- app/assets/stylesheets/itsf/backend/vendor/jquery.dragtable.css
|
492
495
|
- app/assets/stylesheets/itsf/backend/vendor/timeline.min.css
|
@@ -517,6 +520,7 @@ files:
|
|
517
520
|
- app/extensions/concerns/resource_row/published_extensions.rb
|
518
521
|
- app/extensions/concerns/resource_row/timestamp_extensions.rb
|
519
522
|
- app/extensions/concerns/simple_form_form_builder_extensions.rb
|
523
|
+
- app/forms/concerns/form/ui_autocomplete.rb
|
520
524
|
- app/helpers/itsf/backend/application_helper.rb
|
521
525
|
- app/inputs/fake_checkbox_input.rb
|
522
526
|
- app/inputs/fake_text_input.rb
|
@@ -563,6 +567,7 @@ files:
|
|
563
567
|
- config/initializers/extend_object.rb
|
564
568
|
- config/initializers/extend_ransack_form_builder.rb
|
565
569
|
- config/initializers/extend_simple_form_form_builder.rb
|
570
|
+
- config/initializers/simple_form_extensions.rb
|
566
571
|
- config/locales/de.yml
|
567
572
|
- config/locales/en.yml
|
568
573
|
- config/rbac.yml
|