zadok 0.4.6 → 0.5.0
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/Gemfile.lock +2 -2
- data/app/controllers/zadok_controller.rb +16 -9
- data/app/views/zadok/form/fields/_date.html.slim +4 -0
- data/app/views/zadok/form/fields/_decimal.html.slim +4 -0
- data/app/views/zadok/form/fields/_float.html.slim +4 -0
- data/app/views/zadok/form/fields/_inet.html.slim +4 -0
- data/app/views/zadok/form/fields/_integer.html.slim +4 -0
- data/app/views/zadok/form/fields/_serialized.html.slim +4 -0
- data/app/views/zadok/form/fields/_string.html.slim +4 -0
- data/app/views/zadok/form/fields/_text.html.slim +6 -0
- data/app/views/zadok/form/fields/_time_zone_converter.html.slim +4 -0
- data/app/views/zadok/form/fields/_uuid.html.slim +4 -0
- data/app/views/zadok/show.html.slim +14 -0
- data/lib/zadok/version.rb +2 -2
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70b0a5cacb61c9115af5239e231dac69cba22f00b857a89ce4436cb7be09433d
|
4
|
+
data.tar.gz: 9fc0aacb7ee7496d2b5de86cc06cc0a4a54a55ace95fff433f2602628cc983d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '095b1e1a5ced61787817e55e5f77caa07a91f0627f871a220fc6c208321e77083d63e8d8abd31bb1925b5f69efe42a915f5e16bcdc9fc2d6d3b8b9b5a0ed7a27'
|
7
|
+
data.tar.gz: 55f97e086e904f82d7f580a1af31b630ebb1dae183a92513e9151291a1d6576f8c7c4464e409f87fd5445d713130b10c359ec10829d6b001973c584ad32f4c5c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
zadok (0.
|
4
|
+
zadok (0.5.0)
|
5
5
|
bootstrap (~> 4.0)
|
6
6
|
bundler-audit (~> 0.6)
|
7
7
|
cancancan (~> 2.1)
|
@@ -192,7 +192,7 @@ GEM
|
|
192
192
|
ruby-progressbar (~> 1.7)
|
193
193
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
194
194
|
ruby-progressbar (1.9.0)
|
195
|
-
rumination (0.17.
|
195
|
+
rumination (0.17.2)
|
196
196
|
activemodel
|
197
197
|
activesupport
|
198
198
|
dotenv
|
@@ -25,11 +25,10 @@ class ZadokController < ApplicationController
|
|
25
25
|
|
26
26
|
def show
|
27
27
|
respond_to do |format|
|
28
|
-
format.html { render
|
28
|
+
format.html { render "zadok/show" }
|
29
29
|
format.json { render json: resource, root: false }
|
30
30
|
format.xml { render xml: resource.attributes, root: controller_name.singularize }
|
31
31
|
end
|
32
|
-
|
33
32
|
end
|
34
33
|
|
35
34
|
def new
|
@@ -137,31 +136,39 @@ class ZadokController < ApplicationController
|
|
137
136
|
end
|
138
137
|
|
139
138
|
def resources
|
140
|
-
|
139
|
+
@resources
|
141
140
|
end
|
142
141
|
|
143
142
|
def filter_and_paginate_resources!
|
144
|
-
|
143
|
+
@resources = filtered_resources.paginate(page: page, per_page: per_page)
|
145
144
|
end
|
146
145
|
|
147
146
|
def resource
|
148
|
-
|
147
|
+
@resource
|
149
148
|
end
|
150
149
|
|
151
150
|
def show_attributes
|
152
|
-
|
151
|
+
resource_class.attribute_names
|
153
152
|
end
|
154
153
|
|
155
154
|
def index_attributes
|
156
|
-
|
155
|
+
resource_class.attribute_names
|
157
156
|
end
|
158
157
|
|
159
158
|
def new_attributes
|
160
|
-
|
159
|
+
Hash[
|
160
|
+
resource_class.attribute_types.map do |attr, type|
|
161
|
+
[attr, type.class.name.demodulize.downcase]
|
162
|
+
end
|
163
|
+
]
|
161
164
|
end
|
162
165
|
|
163
166
|
def edit_attributes
|
164
|
-
|
167
|
+
Hash[
|
168
|
+
resource_class.attribute_types.map do |attr, type|
|
169
|
+
[attr, type.class.name.demodulize.downcase]
|
170
|
+
end
|
171
|
+
]
|
165
172
|
end
|
166
173
|
|
167
174
|
def generate_csv
|
@@ -0,0 +1,14 @@
|
|
1
|
+
.container.resource-show[id="#{controller_name}-show"]
|
2
|
+
.card
|
3
|
+
.card-body
|
4
|
+
h2.card-title
|
5
|
+
= resource.name
|
6
|
+
- if can?(:edit, resource_class)
|
7
|
+
= link_to(t("#{controller_name}.edit"),
|
8
|
+
resource_url_for(:edit),
|
9
|
+
class: "btn btn-primary text-white float-right")
|
10
|
+
|
11
|
+
- show_attributes.each do |attr|
|
12
|
+
.row
|
13
|
+
.col = attr
|
14
|
+
.col = resource.send(attr)
|
data/lib/zadok/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zadok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leon Hooijer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap
|
@@ -380,16 +380,27 @@ files:
|
|
380
380
|
- app/views/zadok/filters/_typeable_multiselect.html.slim
|
381
381
|
- app/views/zadok/form/fields/_array.html.slim
|
382
382
|
- app/views/zadok/form/fields/_boolean.html.slim
|
383
|
+
- app/views/zadok/form/fields/_date.html.slim
|
384
|
+
- app/views/zadok/form/fields/_decimal.html.slim
|
383
385
|
- app/views/zadok/form/fields/_email_field.html.slim
|
384
386
|
- app/views/zadok/form/fields/_file_field.html.slim
|
387
|
+
- app/views/zadok/form/fields/_float.html.slim
|
385
388
|
- app/views/zadok/form/fields/_hex_field.html.slim
|
389
|
+
- app/views/zadok/form/fields/_inet.html.slim
|
390
|
+
- app/views/zadok/form/fields/_integer.html.slim
|
386
391
|
- app/views/zadok/form/fields/_number_field.html.slim
|
387
392
|
- app/views/zadok/form/fields/_select.html.slim
|
393
|
+
- app/views/zadok/form/fields/_serialized.html.slim
|
394
|
+
- app/views/zadok/form/fields/_string.html.slim
|
395
|
+
- app/views/zadok/form/fields/_text.html.slim
|
388
396
|
- app/views/zadok/form/fields/_text_area.html.slim
|
389
397
|
- app/views/zadok/form/fields/_text_field.html.slim
|
398
|
+
- app/views/zadok/form/fields/_time_zone_converter.html.slim
|
390
399
|
- app/views/zadok/form/fields/_url_field.html.slim
|
400
|
+
- app/views/zadok/form/fields/_uuid.html.slim
|
391
401
|
- app/views/zadok/index.html.slim
|
392
402
|
- app/views/zadok/new.html.slim
|
403
|
+
- app/views/zadok/show.html.slim
|
393
404
|
- lib/zadok.rb
|
394
405
|
- lib/zadok/engine.rb
|
395
406
|
- lib/zadok/filter_collection.rb
|