ucb_rails_user 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,13 @@
1
1
  // the users table has width set to auto, but the pagination tries to stretch to full width - this
2
2
  // forces the pagination to match the table
3
3
  var resizePagination = function () {
4
- var paginationDiv = $('.dataTables_info').parents('.row').first()
5
- paginationDiv.width($('.dataTable').width())
4
+ //var paginationDiv = $('.dataTables_info').parents('.row').first()
5
+ //paginationDiv.width($('.dataTable').width())
6
6
  }
7
7
 
8
8
  var addDatatablesToSearchResults = function () {
9
9
  $('.add-user-search-results-table').dataTable({
10
- searching: false,
10
+ searching: true,
11
11
  order: [[ 2, "asc" ]],
12
12
  columnDefs: [ {
13
13
  targets: 3,
@@ -24,8 +24,10 @@ var addDatatablesToUsersTable = function () {
24
24
  columnDefs: [ {
25
25
  targets: [8, 9],
26
26
  orderable: false
27
- }]
27
+ }],
28
28
  })
29
+ var addNewHtml = '&nbsp;&nbsp;<a href="/admin/users/new" class="btn btn-primary">Add New</a>'
30
+ $('#DataTables_Table_0_filter').append(addNewHtml)
29
31
  }
30
32
 
31
33
  $( window ).on("load", function() {
@@ -34,6 +36,8 @@ $( window ).on("load", function() {
34
36
  window.setTimeout(addDatatablesToUsersTable, 100)
35
37
 
36
38
  $('.user-search-form').on('submit', function() {
39
+ $('.search-results').hide()
37
40
  $('.ucb-rails-user-loader').show()
38
41
  })
39
42
  })
43
+
@@ -4,10 +4,10 @@
4
4
  *
5
5
  * To rebuild or modify this file with the latest versions of the included
6
6
  * software please visit:
7
- * https://datatables.net/download/#bs/dt-1.10.16
7
+ * https://datatables.net/download/#bs4/dt-1.10.18/r-2.2.2
8
8
  *
9
9
  * Included libraries:
10
- * DataTables 1.10.16
10
+ * DataTables 1.10.18, Responsive 2.2.2
11
11
  */
12
12
 
13
13
  table.dataTable {
@@ -16,6 +16,7 @@ table.dataTable {
16
16
  margin-bottom: 6px !important;
17
17
  max-width: none !important;
18
18
  border-collapse: separate !important;
19
+ border-spacing: 0;
19
20
  }
20
21
  table.dataTable td,
21
22
  table.dataTable th {
@@ -37,7 +38,7 @@ div.dataTables_wrapper div.dataTables_length label {
37
38
  white-space: nowrap;
38
39
  }
39
40
  div.dataTables_wrapper div.dataTables_length select {
40
- width: 75px;
41
+ width: auto;
41
42
  display: inline-block;
42
43
  }
43
44
  div.dataTables_wrapper div.dataTables_filter {
@@ -54,7 +55,7 @@ div.dataTables_wrapper div.dataTables_filter input {
54
55
  width: auto;
55
56
  }
56
57
  div.dataTables_wrapper div.dataTables_info {
57
- padding-top: 8px;
58
+ padding-top: 0.85em;
58
59
  white-space: nowrap;
59
60
  }
60
61
  div.dataTables_wrapper div.dataTables_paginate {
@@ -65,6 +66,7 @@ div.dataTables_wrapper div.dataTables_paginate {
65
66
  div.dataTables_wrapper div.dataTables_paginate ul.pagination {
66
67
  margin: 2px 0;
67
68
  white-space: nowrap;
69
+ justify-content: flex-end;
68
70
  }
69
71
  div.dataTables_wrapper div.dataTables_processing {
70
72
  position: absolute;
@@ -95,52 +97,64 @@ table.dataTable thead .sorting_desc_disabled {
95
97
  cursor: pointer;
96
98
  position: relative;
97
99
  }
98
- table.dataTable thead .sorting:after,
100
+ table.dataTable thead .sorting:before, table.dataTable thead .sorting:after,
101
+ table.dataTable thead .sorting_asc:before,
99
102
  table.dataTable thead .sorting_asc:after,
103
+ table.dataTable thead .sorting_desc:before,
100
104
  table.dataTable thead .sorting_desc:after,
105
+ table.dataTable thead .sorting_asc_disabled:before,
101
106
  table.dataTable thead .sorting_asc_disabled:after,
107
+ table.dataTable thead .sorting_desc_disabled:before,
102
108
  table.dataTable thead .sorting_desc_disabled:after {
103
109
  position: absolute;
104
- bottom: 8px;
105
- right: 8px;
110
+ bottom: 0.9em;
106
111
  display: block;
107
- font-family: 'Glyphicons Halflings';
108
- opacity: 0.5;
112
+ opacity: 0.3;
109
113
  }
110
- table.dataTable thead .sorting:after {
111
- opacity: 0.2;
112
- content: "\e150";
113
- /* sort */
114
+ table.dataTable thead .sorting:before,
115
+ table.dataTable thead .sorting_asc:before,
116
+ table.dataTable thead .sorting_desc:before,
117
+ table.dataTable thead .sorting_asc_disabled:before,
118
+ table.dataTable thead .sorting_desc_disabled:before {
119
+ right: 1em;
120
+ content: "\2191";
114
121
  }
115
- table.dataTable thead .sorting_asc:after {
116
- content: "\e155";
117
- /* sort-by-attributes */
122
+ table.dataTable thead .sorting:after,
123
+ table.dataTable thead .sorting_asc:after,
124
+ table.dataTable thead .sorting_desc:after,
125
+ table.dataTable thead .sorting_asc_disabled:after,
126
+ table.dataTable thead .sorting_desc_disabled:after {
127
+ right: 0.5em;
128
+ content: "\2193";
118
129
  }
130
+ table.dataTable thead .sorting_asc:before,
119
131
  table.dataTable thead .sorting_desc:after {
120
- content: "\e156";
121
- /* sort-by-attributes-alt */
132
+ opacity: 1;
122
133
  }
123
- table.dataTable thead .sorting_asc_disabled:after,
134
+ table.dataTable thead .sorting_asc_disabled:before,
124
135
  table.dataTable thead .sorting_desc_disabled:after {
125
- color: #eee;
136
+ opacity: 0;
126
137
  }
127
138
 
128
139
  div.dataTables_scrollHead table.dataTable {
129
140
  margin-bottom: 0 !important;
130
141
  }
131
142
 
132
- div.dataTables_scrollBody > table {
143
+ div.dataTables_scrollBody table {
133
144
  border-top: none;
134
145
  margin-top: 0 !important;
135
146
  margin-bottom: 0 !important;
136
147
  }
137
- div.dataTables_scrollBody > table > thead .sorting:after,
138
- div.dataTables_scrollBody > table > thead .sorting_asc:after,
139
- div.dataTables_scrollBody > table > thead .sorting_desc:after {
148
+ div.dataTables_scrollBody table thead .sorting:before,
149
+ div.dataTables_scrollBody table thead .sorting_asc:before,
150
+ div.dataTables_scrollBody table thead .sorting_desc:before,
151
+ div.dataTables_scrollBody table thead .sorting:after,
152
+ div.dataTables_scrollBody table thead .sorting_asc:after,
153
+ div.dataTables_scrollBody table thead .sorting_desc:after {
140
154
  display: none;
141
155
  }
142
- div.dataTables_scrollBody > table > tbody > tr:first-child > th,
143
- div.dataTables_scrollBody > table > tbody > tr:first-child > td {
156
+ div.dataTables_scrollBody table tbody tr:first-child th,
157
+ div.dataTables_scrollBody table tbody tr:first-child td {
144
158
  border-top: none;
145
159
  }
146
160
 
@@ -160,14 +174,19 @@ div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
160
174
  text-align: center;
161
175
  }
162
176
  }
163
- table.dataTable.table-condensed > thead > tr > th {
177
+ table.dataTable.table-sm > thead > tr > th {
164
178
  padding-right: 20px;
165
179
  }
166
- table.dataTable.table-condensed .sorting:after,
167
- table.dataTable.table-condensed .sorting_asc:after,
168
- table.dataTable.table-condensed .sorting_desc:after {
169
- top: 6px;
170
- right: 6px;
180
+ table.dataTable.table-sm .sorting:before,
181
+ table.dataTable.table-sm .sorting_asc:before,
182
+ table.dataTable.table-sm .sorting_desc:before {
183
+ top: 5px;
184
+ right: 0.85em;
185
+ }
186
+ table.dataTable.table-sm .sorting:after,
187
+ table.dataTable.table-sm .sorting_asc:after,
188
+ table.dataTable.table-sm .sorting_desc:after {
189
+ top: 5px;
171
190
  }
172
191
 
173
192
  table.table-bordered.dataTable th,
@@ -199,3 +218,185 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:las
199
218
  }
200
219
 
201
220
 
221
+ table.dataTable.dtr-inline.collapsed > tbody > tr > td.child,
222
+ table.dataTable.dtr-inline.collapsed > tbody > tr > th.child,
223
+ table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty {
224
+ cursor: default !important;
225
+ }
226
+ table.dataTable.dtr-inline.collapsed > tbody > tr > td.child:before,
227
+ table.dataTable.dtr-inline.collapsed > tbody > tr > th.child:before,
228
+ table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty:before {
229
+ display: none !important;
230
+ }
231
+ table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > td:first-child,
232
+ table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child {
233
+ position: relative;
234
+ padding-left: 30px;
235
+ cursor: pointer;
236
+ }
237
+ table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > td:first-child:before,
238
+ table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child:before {
239
+ top: 12px;
240
+ left: 4px;
241
+ height: 14px;
242
+ width: 14px;
243
+ display: block;
244
+ position: absolute;
245
+ color: white;
246
+ border: 2px solid white;
247
+ border-radius: 14px;
248
+ box-shadow: 0 0 3px #444;
249
+ box-sizing: content-box;
250
+ text-align: center;
251
+ text-indent: 0 !important;
252
+ font-family: 'Courier New', Courier, monospace;
253
+ line-height: 14px;
254
+ content: '+';
255
+ background-color: #0275d8;
256
+ }
257
+ table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before,
258
+ table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before {
259
+ content: '-';
260
+ background-color: #d33333;
261
+ }
262
+ table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td:first-child,
263
+ table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th:first-child {
264
+ padding-left: 27px;
265
+ }
266
+ table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td:first-child:before,
267
+ table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th:first-child:before {
268
+ top: 5px;
269
+ left: 4px;
270
+ height: 14px;
271
+ width: 14px;
272
+ border-radius: 14px;
273
+ line-height: 14px;
274
+ text-indent: 3px;
275
+ }
276
+ table.dataTable.dtr-column > tbody > tr > td.control,
277
+ table.dataTable.dtr-column > tbody > tr > th.control {
278
+ position: relative;
279
+ cursor: pointer;
280
+ }
281
+ table.dataTable.dtr-column > tbody > tr > td.control:before,
282
+ table.dataTable.dtr-column > tbody > tr > th.control:before {
283
+ top: 50%;
284
+ left: 50%;
285
+ height: 16px;
286
+ width: 16px;
287
+ margin-top: -10px;
288
+ margin-left: -10px;
289
+ display: block;
290
+ position: absolute;
291
+ color: white;
292
+ border: 2px solid white;
293
+ border-radius: 14px;
294
+ box-shadow: 0 0 3px #444;
295
+ box-sizing: content-box;
296
+ text-align: center;
297
+ text-indent: 0 !important;
298
+ font-family: 'Courier New', Courier, monospace;
299
+ line-height: 14px;
300
+ content: '+';
301
+ background-color: #0275d8;
302
+ }
303
+ table.dataTable.dtr-column > tbody > tr.parent td.control:before,
304
+ table.dataTable.dtr-column > tbody > tr.parent th.control:before {
305
+ content: '-';
306
+ background-color: #d33333;
307
+ }
308
+ table.dataTable > tbody > tr.child {
309
+ padding: 0.5em 1em;
310
+ }
311
+ table.dataTable > tbody > tr.child:hover {
312
+ background: transparent !important;
313
+ }
314
+ table.dataTable > tbody > tr.child ul.dtr-details {
315
+ display: inline-block;
316
+ list-style-type: none;
317
+ margin: 0;
318
+ padding: 0;
319
+ }
320
+ table.dataTable > tbody > tr.child ul.dtr-details > li {
321
+ border-bottom: 1px solid #efefef;
322
+ padding: 0.5em 0;
323
+ }
324
+ table.dataTable > tbody > tr.child ul.dtr-details > li:first-child {
325
+ padding-top: 0;
326
+ }
327
+ table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
328
+ border-bottom: none;
329
+ }
330
+ table.dataTable > tbody > tr.child span.dtr-title {
331
+ display: inline-block;
332
+ min-width: 75px;
333
+ font-weight: bold;
334
+ }
335
+
336
+ div.dtr-modal {
337
+ position: fixed;
338
+ box-sizing: border-box;
339
+ top: 0;
340
+ left: 0;
341
+ height: 100%;
342
+ width: 100%;
343
+ z-index: 100;
344
+ padding: 10em 1em;
345
+ }
346
+ div.dtr-modal div.dtr-modal-display {
347
+ position: absolute;
348
+ top: 0;
349
+ left: 0;
350
+ bottom: 0;
351
+ right: 0;
352
+ width: 50%;
353
+ height: 50%;
354
+ overflow: auto;
355
+ margin: auto;
356
+ z-index: 102;
357
+ overflow: auto;
358
+ background-color: #f5f5f7;
359
+ border: 1px solid black;
360
+ border-radius: 0.5em;
361
+ box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
362
+ }
363
+ div.dtr-modal div.dtr-modal-content {
364
+ position: relative;
365
+ padding: 1em;
366
+ }
367
+ div.dtr-modal div.dtr-modal-close {
368
+ position: absolute;
369
+ top: 6px;
370
+ right: 6px;
371
+ width: 22px;
372
+ height: 22px;
373
+ border: 1px solid #eaeaea;
374
+ background-color: #f9f9f9;
375
+ text-align: center;
376
+ border-radius: 3px;
377
+ cursor: pointer;
378
+ z-index: 12;
379
+ }
380
+ div.dtr-modal div.dtr-modal-close:hover {
381
+ background-color: #eaeaea;
382
+ }
383
+ div.dtr-modal div.dtr-modal-background {
384
+ position: fixed;
385
+ top: 0;
386
+ left: 0;
387
+ right: 0;
388
+ bottom: 0;
389
+ z-index: 101;
390
+ background: rgba(0, 0, 0, 0.6);
391
+ }
392
+
393
+ @media screen and (max-width: 767px) {
394
+ div.dtr-modal div.dtr-modal-display {
395
+ width: 95%;
396
+ }
397
+ }
398
+ div.dtr-bs-modal table.table tr:first-child td {
399
+ border-top: none;
400
+ }
401
+
402
+
@@ -1,8 +1,6 @@
1
1
  .ucb-rails-users-table-header.clearfix
2
- %h2.pull-left
2
+ %h1
3
3
  Users
4
- .pull-right
5
- = link_to "Add new", new_admin_user_path(), class: "btn btn-primary"
6
4
 
7
5
  %table.table.table-striped.table-bordered.table-hover.ucb-rails-users-table
8
6
  %thead
@@ -1,4 +1,5 @@
1
1
  $('.ucb-rails-user-loader').hide()
2
2
  $('.search-results').html("#{ j render(partial: "search_results") }")
3
3
  addDatatablesToSearchResults()
4
+ $('.search-results').show()
4
5
 
@@ -1,3 +1,3 @@
1
1
  module UcbRailsUser
2
- VERSION = '0.9.0'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucb_rails_user
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Downey
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-08-08 00:00:00.000000000 Z
14
+ date: 2018-08-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -19,28 +19,28 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 5.1.1
22
+ version: '5.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 5.1.1
29
+ version: '5.1'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: sass-rails
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - "~>"
35
35
  - !ruby/object:Gem::Version
36
- version: 5.0.6
36
+ version: '5.0'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: 5.0.6
43
+ version: '5.0'
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: haml
46
46
  requirement: !ruby/object:Gem::Requirement
@@ -59,72 +59,72 @@ dependencies:
59
59
  name: haml-rails
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ">="
62
+ - - "~>"
63
63
  - !ruby/object:Gem::Version
64
- version: '0'
64
+ version: '1.0'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ">="
69
+ - - "~>"
70
70
  - !ruby/object:Gem::Version
71
- version: '0'
71
+ version: '1.0'
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: active_attr
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - ">="
76
+ - - "~>"
77
77
  - !ruby/object:Gem::Version
78
- version: '0'
78
+ version: '0.10'
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - ">="
83
+ - - "~>"
84
84
  - !ruby/object:Gem::Version
85
- version: '0'
85
+ version: '0.10'
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: simple_form
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - ">="
90
+ - - "~>"
91
91
  - !ruby/object:Gem::Version
92
- version: '0'
92
+ version: '4.0'
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ">="
97
+ - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: '0'
99
+ version: '4.0'
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: omniauth
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - ">="
104
+ - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: '0'
106
+ version: '1.8'
107
107
  type: :runtime
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ">="
111
+ - - "~>"
112
112
  - !ruby/object:Gem::Version
113
- version: '0'
113
+ version: '1.8'
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: omniauth-cas
116
116
  requirement: !ruby/object:Gem::Requirement
117
117
  requirements:
118
118
  - - "~>"
119
119
  - !ruby/object:Gem::Version
120
- version: 1.1.1
120
+ version: '1.1'
121
121
  type: :runtime
122
122
  prerelease: false
123
123
  version_requirements: !ruby/object:Gem::Requirement
124
124
  requirements:
125
125
  - - "~>"
126
126
  - !ruby/object:Gem::Version
127
- version: 1.1.1
127
+ version: '1.1'
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: ucb_ldap
130
130
  requirement: !ruby/object:Gem::Requirement
@@ -157,16 +157,16 @@ dependencies:
157
157
  name: sqlite3
158
158
  requirement: !ruby/object:Gem::Requirement
159
159
  requirements:
160
- - - ">="
160
+ - - "~>"
161
161
  - !ruby/object:Gem::Version
162
- version: '0'
162
+ version: '1.3'
163
163
  type: :development
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - ">="
167
+ - - "~>"
168
168
  - !ruby/object:Gem::Version
169
- version: '0'
169
+ version: '1.3'
170
170
  - !ruby/object:Gem::Dependency
171
171
  name: rspec-rails
172
172
  requirement: !ruby/object:Gem::Requirement
@@ -181,7 +181,7 @@ dependencies:
181
181
  - - "~>"
182
182
  - !ruby/object:Gem::Version
183
183
  version: '3.5'
184
- description:
184
+ description: Rails engine for managing user accounts within UC Berkeley's auth system
185
185
  email:
186
186
  - darinwilson@gmail.com
187
187
  executables: []
@@ -195,7 +195,6 @@ files:
195
195
  - app/assets/javascripts/ucb_rails_user/datatables.js
196
196
  - app/assets/javascripts/ucb_rails_user/scripts.js
197
197
  - app/assets/javascripts/ucb_rails_user/ucb_rails_user.js
198
- - app/assets/stylesheets/ucb_rails_user/components/_add_users_search_results_table.sass
199
198
  - app/assets/stylesheets/ucb_rails_user/components/_loader.sass
200
199
  - app/assets/stylesheets/ucb_rails_user/components/_users_table.sass
201
200
  - app/assets/stylesheets/ucb_rails_user/datatables.css
@@ -270,8 +269,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
269
  version: '0'
271
270
  requirements: []
272
271
  rubyforge_project:
273
- rubygems_version: 2.4.8
272
+ rubygems_version: 2.7.7
274
273
  signing_key:
275
274
  specification_version: 4
276
- summary: Rails engine for managing user accounts within UC Berkeley's auth system
275
+ summary: Rails engine for UCB user accounts
277
276
  test_files: []
@@ -1,2 +0,0 @@
1
- .add-user-search-results-table
2
- width: 50%