tramway-admin 1.33 → 1.33.0.1
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/README.md +58 -1
- data/lib/tramway/admin/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a2170c93de0fe4f501e76ad2b66b3cf07e622974d1db732dccd3f0fa751ebcb
|
4
|
+
data.tar.gz: 432f1bf0bc5c5eedc821023e5a9156c32e9428842629ad763bef407239eb4195
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdc0d555ddc0d23d2a526cb918234dd6380f226db163db773b2fd5ac310a698080ef0c245a178cae63aab89f567efd2245a2da67651f1d0975d9d3cab4169211
|
7
|
+
data.tar.gz: 621ee6dae256c59292cfbd788af17a2051ee2d43b636fee44452e31cbff25818e4dd5a0f9a08303a8026da465635e7058b4e88c9305504ea595decdecc43e09c
|
data/README.md
CHANGED
@@ -239,7 +239,6 @@ class YourModel < Tramway::Core::ApplicationRecord
|
|
239
239
|
#### 12. Run server `rails s`
|
240
240
|
#### 13. Launch `localhost:3000/admin`
|
241
241
|
|
242
|
-
|
243
242
|
### CRUDs for models
|
244
243
|
|
245
244
|
By default users with role `admin` have access to all models used as arguments in method `::Tramway::Admin.set_available_models`. If you want specify models by roles, use them as keys
|
@@ -393,6 +392,64 @@ window.current_locale = window.i18n_locale 'en'
|
|
393
392
|
```
|
394
393
|
to the `app/assets/javascripts/admin/application.js.coffee` file
|
395
394
|
|
395
|
+
### Decorator Helper methods
|
396
|
+
|
397
|
+
#### date_view
|
398
|
+
Returns a date in the format depending on localization
|
399
|
+
|
400
|
+
*app/decorators/\*_decorator.rb*
|
401
|
+
```ruby
|
402
|
+
def created_at
|
403
|
+
date_view object.created_at
|
404
|
+
end
|
405
|
+
```
|
406
|
+
#### datetime_view
|
407
|
+
Returns a date and time in the format depending on localization
|
408
|
+
|
409
|
+
*app/decorators/*_decorator.rb*
|
410
|
+
```ruby
|
411
|
+
def created_at
|
412
|
+
datetime_view object.created_at
|
413
|
+
end
|
414
|
+
```
|
415
|
+
#### state_machine_view
|
416
|
+
Returns the state of an object according to a state machine
|
417
|
+
|
418
|
+
*app/decorators/*_decorator.rb*
|
419
|
+
```ruby
|
420
|
+
def state
|
421
|
+
state_machine_view object, :state
|
422
|
+
end
|
423
|
+
```
|
424
|
+
#### image_view
|
425
|
+
Returns an image in a particular format depending on the parameters of the original image file
|
426
|
+
|
427
|
+
*app/decorators/\*_decorator.rb*
|
428
|
+
```ruby
|
429
|
+
def avatar
|
430
|
+
image_view object.avatar
|
431
|
+
end
|
432
|
+
```
|
433
|
+
#### enumerize_view
|
434
|
+
Returns object enumerations as text
|
435
|
+
|
436
|
+
*app/decorators/\*_decorator.rb*
|
437
|
+
```ruby
|
438
|
+
def field_type
|
439
|
+
enumerize_view object.field_type
|
440
|
+
end
|
441
|
+
```
|
442
|
+
|
443
|
+
#### file_view
|
444
|
+
Returns file name and button to download it
|
445
|
+
|
446
|
+
*app/decorators/\*_decorator.rb*
|
447
|
+
```ruby
|
448
|
+
def file_download
|
449
|
+
file_view object.file
|
450
|
+
end
|
451
|
+
```
|
452
|
+
|
396
453
|
## Notifications
|
397
454
|
|
398
455
|
You can add notification to your admin panel to the navbar.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.33.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tramway-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.18.
|
19
|
+
version: 1.18.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.18.
|
26
|
+
version: 1.18.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tramway-auth
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|