chaltron 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04a26003fe77f074bc5338438162de022181977c
4
- data.tar.gz: 5cd76996bc7515911ae75c2eb4a2a0e18eacc365
3
+ metadata.gz: de230dc89777b90b7e81ef42da838180a72bd0ba
4
+ data.tar.gz: 8743eb92b1f9d903d4a7e5b40659f41647bea35e
5
5
  SHA512:
6
- metadata.gz: 3164668cb7f1a83b126fc4adc955b1818bb0cb6beefbe659eb20f004a1ff07e455522133306825aa37f4f8568e26d9d97eab59ad4d5582b71f2d87dcd45a618c
7
- data.tar.gz: 22b51a5420bc8f7c84d3875ce45e0f54ccc1fb584bac5bd3e59eb3e04f361efd745bcea933c07ff5398ee166400796485196392273e384b3864131d5adeb36f2
6
+ metadata.gz: 8d6f5040e582d1db6cae0ff8d4687ffb8975897a35b5f2cfacd39c118d5ab486a655479cda93ea24d86126537683ea058428a223e64eaef9d04c6986aaf14117
7
+ data.tar.gz: 4d6af95dddf706c9d68d3d148900bab57d4fb7b872bc2a5e56fc0c4cf91e5a0e44be8491ef38d46208464f8532be93e6ba631152a3f466369b2fed3508bf6c08
data/Rakefile CHANGED
@@ -16,12 +16,10 @@ end
16
16
 
17
17
  APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
18
18
  load 'rails/tasks/engine.rake'
19
+ load 'rails/tasks/statistics.rake'
19
20
 
20
21
  require 'rake/clean'
21
22
 
22
-
23
- load 'rails/tasks/statistics.rake'
24
-
25
23
  Bundler::GemHelper.install_tasks
26
24
 
27
25
  Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each { |f| load f }
@@ -4,6 +4,7 @@ body {
4
4
 
5
5
  div#content {
6
6
  margin-top: 40px;
7
+ margin-bottom: 40px;
7
8
  }
8
9
 
9
10
  /**
@@ -11,7 +11,7 @@ SimpleNavigation::Configuration.run do |navigation|
11
11
  admin.item :users,
12
12
  { icon: 'fa fa-fw fa-users',
13
13
  text: I18n.t('chaltron.menu.users')
14
- }, users_url, highlights_on: /\/(users|ldap)/ if can?(:manage, User)
14
+ }, users_url, highlights_on: /\/(users|ldap)(?!\/self_(show|edit|update))/ if can?(:manage, User)
15
15
  admin.item :logs,
16
16
  { icon: 'fa fa-fw fa-book',
17
17
  text: I18n.t('chaltron.menu.logs')
@@ -20,7 +20,7 @@ SimpleNavigation::Configuration.run do |navigation|
20
20
  primary.item :logged, current_user.display_name.html_safe, nil do |user|
21
21
  user.item :self_edit, { icon: 'fa fa-fw fa-user',
22
22
  text: I18n.t('chaltron.menu.self_show') }, self_show_users_url,
23
- highlights_on: /\/self_(show|edit)/
23
+ highlights_on: /\/self_(show|edit|update)/
24
24
 
25
25
  user.item :logout, { icon: 'fa fa-fw fa-sign-out', text: 'Logout' },
26
26
  destroy_user_session_url, method: :delete
@@ -1,3 +1,3 @@
1
1
  module Chaltron
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
@@ -38,6 +38,7 @@ RUBY
38
38
  # html
39
39
  remove_file 'app/views/layouts/application.html.erb'
40
40
  directory 'app/views/layouts'
41
+ directory 'app/assets/images'
41
42
  # javascript
42
43
  inject_into_file 'app/assets/javascripts/application.js',
43
44
  "//= require chaltron\n", before: '//= require_tree .'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chaltron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - vicvega
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
11
+ date: 2016-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -357,15 +357,8 @@ files:
357
357
  - MIT-LICENSE
358
358
  - README.md
359
359
  - Rakefile
360
- - app/assets/images/700x300.gif
361
- - app/assets/images/favicon.ico
362
- - app/assets/images/slide1.gif
363
- - app/assets/images/slide2.gif
364
- - app/assets/images/slide3.gif
365
360
  - app/assets/javascripts/chaltron.js
366
- - app/assets/javascripts/chaltron.js~
367
361
  - app/assets/javascripts/chaltron/datatables.js.coffee
368
- - app/assets/javascripts/chaltron/datatables.js.coffee~
369
362
  - app/assets/javascripts/chaltron/localization.js.coffee
370
363
  - app/assets/javascripts/chaltron/main.js.coffee
371
364
  - app/assets/javascripts/dataTables/dataTables.bootstrap.min.js
@@ -442,6 +435,11 @@ files:
442
435
  - lib/chaltron/ldap/user.rb
443
436
  - lib/chaltron/version.rb
444
437
  - lib/generators/chaltron/install_generator.rb
438
+ - lib/generators/chaltron/templates/app/assets/images/700x300.gif
439
+ - lib/generators/chaltron/templates/app/assets/images/favicon.ico
440
+ - lib/generators/chaltron/templates/app/assets/images/slide1.gif
441
+ - lib/generators/chaltron/templates/app/assets/images/slide2.gif
442
+ - lib/generators/chaltron/templates/app/assets/images/slide3.gif
445
443
  - lib/generators/chaltron/templates/app/assets/javascripts/home.js.coffee
446
444
  - lib/generators/chaltron/templates/app/assets/stylesheets/home.scss
447
445
  - lib/generators/chaltron/templates/app/controllers/home_controller.rb
@@ -462,7 +460,6 @@ files:
462
460
  - lib/templates/erb/scaffold/_form.html.erb
463
461
  - lib/templates/erb/scaffold/edit.html.erb
464
462
  - lib/templates/erb/scaffold/index.html.erb
465
- - lib/templates/erb/scaffold/index.html.erb~
466
463
  - lib/templates/erb/scaffold/new.html.erb
467
464
  - lib/templates/erb/scaffold/show.html.erb
468
465
  homepage: https://github.com/vicvega/chaltron
@@ -485,7 +482,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
485
482
  version: '0'
486
483
  requirements: []
487
484
  rubyforge_project:
488
- rubygems_version: 2.4.8
485
+ rubygems_version: 2.6.2
489
486
  signing_key:
490
487
  specification_version: 4
491
488
  summary: Move faster and break things - revisited for rails 4
@@ -1,13 +0,0 @@
1
- //= require bootstrap-sprockets
2
- //= require dataTables/jquery.dataTables
3
- //= require dataTables/dataTables.bootstrap
4
- //= require dataTables/extras/dataTables.responsive
5
- //= require dataTables/extras/dataTables.select
6
- //= require nprogress
7
- //= require nprogress-turbolinks
8
- //= require nprogress-ajax
9
- //= require moment
10
- //= require moment/it.js
11
- //= require datetime-moment
12
-
13
- //= require_tree ./chaltron
@@ -1,106 +0,0 @@
1
- class DataTableBuilder
2
- constructor: ->
3
- @defaultOptions = {
4
- destroy: true
5
- autoWidth: false
6
- responsive: true
7
- stateSave: true
8
- }
9
-
10
- go: ->
11
- # users
12
- div = $('table#users')
13
- @initTable(container: div)
14
- # ldap create
15
- div = $('table#ldap_create')
16
- @initTable(container: div, params: {
17
- paging: false
18
- # default sorting: username (2nd column) asc
19
- order: [[1,'asc']]
20
- columnDefs: [
21
- { orderable: false, className: 'select-checkbox', targets: 0 }
22
- ]
23
- dom: 'T<"clear">lfrtip'
24
- select: { style: 'multi', info: false }
25
- })
26
-
27
- # logs
28
- div = $('table#logs')
29
- @initTable(container: div, params: {
30
- processing: true
31
- serverSide: true
32
- ajax: div.data('source')
33
- # default sorting: date (2nd column) desc
34
- order: [[1,'desc']]
35
- columnDefs: [
36
- { orderSequence: ['desc', 'asc'], targets: [ 1 ] }
37
- ]
38
- })
39
-
40
- # datatable class
41
- div = $('table.datatable')
42
- @initTable(container: div)
43
-
44
- # datatable class (server side processing)
45
- div = $('table[remote=true].datatable')
46
- @initTable(container: div, params: {
47
- processing: true
48
- serverSide: true
49
- ajax: div.data('source')
50
- })
51
-
52
- initTable: ({container, params} = {}) ->
53
- if container.length > 0
54
- params ?= {}
55
- # add custom params if any
56
- settings = $.extend({}, @defaultOptions, params)
57
- # add language
58
- settings = $.extend({}, settings, {language: Chaltron.locales('datatable')})
59
-
60
- container.DataTable(settings)
61
-
62
- $(document).on 'page:change', ->
63
- table = new DataTableBuilder
64
- table.go()
65
-
66
- # specify date format (for sorting)
67
- $.fn.dataTable.moment('DD MMM HH:mm')
68
-
69
- $ ->
70
- $('form#ldap_create').on 'submit', (e) ->
71
-
72
- count = $('table#ldap_create').DataTable().rows( { selected: true } ).count()
73
-
74
-
75
- console.log("----------------------------------- " + count)
76
-
77
- if count == 0
78
- message = Chaltron.locales('error_message')
79
- label = Chaltron.locales('error_label')
80
-
81
- flash = $("div.alert-warning:contains('#{message}')")
82
- if flash.length == 0
83
- # display warning flash message
84
- flash = $("<div><strong>#{label}</strong>: #{message}</div>").addClass('alert alert-warning')
85
- $('.flash-container').append(flash)
86
- else
87
- flash.show()
88
- # closable
89
- flash.click -> $(@).fadeOut()
90
- # self disappearing
91
- setTimeout (-> flash.fadeOut()), 5000
92
-
93
- e.preventDefault()
94
-
95
- for i in [0..count-1]
96
-
97
- console.log("------CICLO FOR----------------------------- " + i)
98
- console.log("------CICLO FOR----------------------------- " + $('table#ldap_create').DataTable().rows( { selected: true } ).data()[i][1])
99
-
100
-
101
- $('<input/>', {
102
- name: 'uids[]',
103
- type: 'hidden',
104
- multiple: 'multiple',
105
- value: $('table#ldap_create').DataTable().rows( { selected: true } ).data()[i][1]
106
- }).appendTo(@)
@@ -1,28 +0,0 @@
1
- <div class='container-fluid'>
2
- <h3 class='page-header'><%= plural_table_name.titleize %></h3>
3
- <div class='row'>
4
- <div class='col-md-12'>
5
- <div class='panel panel-default'>
6
- <div class='panel-body'>
7
- <%%= content_tag 'table', class: 'table table-striped datatable' do %>
8
- <thead>
9
- <tr><% attributes.each do |attribute| %>
10
- <th><%= attribute.name.humanize %></th><% end %>
11
- </tr>
12
- </thead>
13
- <tbody>
14
- <%%= content_tag_for(:tr, @<%= plural_table_name %>) do |<%= singular_table_name %>| %><% attributes.each do |attribute| %>
15
- <td><%%= link_to <%= singular_table_name %>.<%= attribute.name %>, <%= singular_table_name %> %></td><% end %>
16
- <%% end -%>
17
- </tbody>
18
- <%% end %>
19
- </div>
20
- </div>
21
- </div>
22
- </div>
23
- <hr>
24
- <%%= link_to new_<%= singular_table_name %>_path, class: 'btn btn-primary btn-large' do %>
25
- <%%= icon('plus') %> New
26
- <%% end %>
27
-
28
- </div>