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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7af9a20be3af0e933b341a952db9e557c9382732a0cc661aa3d833498f514b6e
4
- data.tar.gz: 5e1c786005a5dbab7ac8995357447f7626e16dd6acecf409558159e5dae74886
3
+ metadata.gz: 70b0a5cacb61c9115af5239e231dac69cba22f00b857a89ce4436cb7be09433d
4
+ data.tar.gz: 9fc0aacb7ee7496d2b5de86cc06cc0a4a54a55ace95fff433f2602628cc983d0
5
5
  SHA512:
6
- metadata.gz: 0d6abf6b869ab8ba23f0f147c4a8d1e2f9482f0a8011ac0a9a37f3b201203d30517e910243d70fd0b3da42e37a63880ae30098066e8605152ffa53495243b410
7
- data.tar.gz: '0739fa43160add59be481732b3776aba8e1e6c0167c4a016de381c88676919635feb0617ee73a80f6f12e67a095ca54242fc897f1a0d6a035bfbb1d296f4693d'
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.6)
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.1)
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 [controller_name, "show"].join("/") }
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
- raise "resources method not implemented"
139
+ @resources
141
140
  end
142
141
 
143
142
  def filter_and_paginate_resources!
144
- raise "filter_and_paginate_resources! method not implemented"
143
+ @resources = filtered_resources.paginate(page: page, per_page: per_page)
145
144
  end
146
145
 
147
146
  def resource
148
- raise "resource method not implemented"
147
+ @resource
149
148
  end
150
149
 
151
150
  def show_attributes
152
- raise "show_attributes method not implemented"
151
+ resource_class.attribute_names
153
152
  end
154
153
 
155
154
  def index_attributes
156
- raise "index_attributes method not implemented"
155
+ resource_class.attribute_names
157
156
  end
158
157
 
159
158
  def new_attributes
160
- raise "new_attributes method not implemented"
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
- raise "edit_attributes method not implemented"
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,4 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.text_field(attr,
4
+ options.fetch(:html) { {} }.merge(class: "form-control"))
@@ -0,0 +1,4 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.text_field(attr,
4
+ options.fetch(:html) { {} }.merge(class: "form-control"))
@@ -0,0 +1,4 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.text_field(attr,
4
+ options.fetch(:html) { {} }.merge(class: "form-control"))
@@ -0,0 +1,4 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.text_field(attr,
4
+ options.fetch(:html) { {} }.merge(class: "form-control"))
@@ -0,0 +1,4 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.number_field(attr,
4
+ options.fetch(:html) { {} }.merge(class: "form-control"))
@@ -0,0 +1,4 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.text_field(attr,
4
+ options.fetch(:html) { {} }.merge(class: "form-control"))
@@ -0,0 +1,4 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.text_field(attr,
4
+ options.fetch(:html) { {} }.merge(class: "form-control"))
@@ -0,0 +1,6 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.text_area(attr,
4
+ options.fetch(:html) { {} }.merge(rows: 5,
5
+ cols: nil,
6
+ class: "form-control"))
@@ -0,0 +1,4 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.text_field(attr,
4
+ options.fetch(:html) { {} }.merge(class: "form-control"))
@@ -0,0 +1,4 @@
1
+ .form-group
2
+ = form.label(attr)
3
+ = form.text_field(attr,
4
+ options.fetch(:html) { {} }.merge(class: "form-control"))
@@ -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
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Zadok
4
4
  VERSION_MAJOR = 0
5
- VERSION_MINOR = 4
6
- VERSION_TINY = 6
5
+ VERSION_MINOR = 5
6
+ VERSION_TINY = 0
7
7
  VERSION_PRE = nil
8
8
 
9
9
  VERSION = [
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.6
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-02-28 00:00:00.000000000 Z
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