tramway-core 1.17.1 → 1.17.1.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 +33 -0
- data/app/assets/javascripts/tramway/core/application.js +1 -1
- data/lib/tramway/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4be07671b875ed3901b13904f9d54f3915ab5c4c42d637609a25bebee8b233a0
|
4
|
+
data.tar.gz: 77d1050db409315611f0fda8586c20cd15aa9b85e49d23f86ebc995556e420da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 875d00ccf2b6cdfa9bdb7fb64ab77b60b517be9f4ae24f856b5e79e2e90c068d97f074ea4df90b70f70457dbbbd955525d850f3f6a5939ba404eec020d144fc6
|
7
|
+
data.tar.gz: 3c0ffdef1b9dba8d41353908a82d2841879b9490d191e10ca017ed16d6b14bbabceeb5da27318dbf1939203820eed1d3227980e59f0410864e74785e48d85f68
|
data/README.md
CHANGED
@@ -106,6 +106,39 @@ Something like this:
|
|
106
106
|
copy_to_clipboard "some_id" # some_id is HTML id of element. Content of this element will be copied to the clipboard after pressing the button
|
107
107
|
```
|
108
108
|
|
109
|
+
## How to create model that will be an Application Model for the Tramway
|
110
|
+
|
111
|
+
#### 1. Generate model that you to use. We create Organization, for example
|
112
|
+
|
113
|
+
```shell
|
114
|
+
rails g model organization name:text public_name:text tagline:text address:text phone:text coordinates:point, state: text # remember! State field is required, if you use tramway-admin
|
115
|
+
rails db:migrate
|
116
|
+
```
|
117
|
+
|
118
|
+
#### 2. Add model_class to Initializer
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
Tramway::Core.initialize_application model_class: Organization
|
122
|
+
```
|
123
|
+
|
124
|
+
#### 3. Create 1 instance of Organization model
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
rails c
|
128
|
+
Organization.create! public_name: 'Tramway', name: :organization, tagline: 'Tramway is not buggy, LOL!'
|
129
|
+
```
|
130
|
+
|
131
|
+
#### 4. Add model to singleton to the `tramway-admin` admin panel to be able to change its data
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
Tramway::Admin.set_singleton_models Organization, project: :organization # now you should use organization.name here
|
135
|
+
```
|
136
|
+
|
137
|
+
#### 5. Then continue configuration of your model in admin panel with tramway-admin gem [instruction, starting from point 8](https://github.com/ulmic/tramway-dev/tree/develop/tramway-admin#8-configurate-navbar)
|
138
|
+
|
139
|
+
#### 6. Now you are able to change your application main info in admin panel
|
140
|
+
|
141
|
+
## In Russian
|
109
142
|
|
110
143
|
# Базовые классы
|
111
144
|
|
@@ -28,7 +28,7 @@ $(document).ready(function() {
|
|
28
28
|
console.log('You should set `window.current_locale` before all Javascript code');
|
29
29
|
}
|
30
30
|
|
31
|
-
if ($('.date_picker').length
|
31
|
+
if ($('.date_picker').length != 0) {
|
32
32
|
$('.date_picker').datepicker({
|
33
33
|
format: window.current_locale.date_format,
|
34
34
|
language: window.current_locale.locale
|
data/lib/tramway/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.17.1
|
4
|
+
version: 1.17.1.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-03-
|
11
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: audited
|