zadok 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/app/views/zadok/edit.html.slim +19 -8
- data/app/views/zadok/form/fields/_array.html.slim +5 -1
- data/app/views/zadok/form/fields/_boolean.html.slim +5 -2
- data/app/views/zadok/form/fields/_email_field.html.slim +3 -2
- data/app/views/zadok/form/fields/_file_field.html.slim +4 -3
- data/app/views/zadok/form/fields/_hex_field.html.slim +2 -1
- data/app/views/zadok/form/fields/_number_field.html.slim +3 -2
- data/app/views/zadok/form/fields/_select.html.slim +6 -2
- data/app/views/zadok/form/fields/_text_area.html.slim +5 -2
- data/app/views/zadok/form/fields/_text_field.html.slim +3 -2
- data/app/views/zadok/form/fields/_url_field.html.slim +3 -2
- data/app/views/zadok/index.html.slim +12 -8
- data/app/views/zadok/new.html.slim +10 -4
- data/lib/zadok/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: 1bcd5163593d2bac96ca058c59802ef3977286bef98bb99377556c98f0bdfd74
|
4
|
+
data.tar.gz: e088d089e2743deb6c69c1828f1ac7b27d5e33690f64860aa12978593e1a6aa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a936ad999525e0a183f3a5129be5b5c3a811a9aef90979d7dbffea52ebf0a400d49d59de3e9ef2ed07722c885db91da341c902dc7f43a49fe3ab20f22bcda4df
|
7
|
+
data.tar.gz: e825e56041831128185f0cd6e0ed867c323991505851c7f224ba2efb387efc38739e936107876e7c39ca41f13059f65d2e6f11123d565b594ea03af4bbf2d6dd
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
zadok (0.3.
|
4
|
+
zadok (0.3.6)
|
5
5
|
bootstrap (~> 4.0)
|
6
6
|
bundler-audit (~> 0.6)
|
7
7
|
cancancan (~> 2.1)
|
@@ -89,8 +89,8 @@ GEM
|
|
89
89
|
railties (>= 4.1.0, < 5.2)
|
90
90
|
responders
|
91
91
|
warden (~> 1.2.3)
|
92
|
-
devise-i18n (1.
|
93
|
-
devise (>=
|
92
|
+
devise-i18n (1.6.0)
|
93
|
+
devise (>= 4.4)
|
94
94
|
devise_invitable (1.7.3)
|
95
95
|
actionmailer (>= 4.1.0)
|
96
96
|
devise (>= 4.0.0)
|
@@ -3,17 +3,28 @@
|
|
3
3
|
.card-body
|
4
4
|
h2.card-title
|
5
5
|
= t("#{resource_name.pluralize}.edit")
|
6
|
-
= link_to
|
6
|
+
= link_to(t("activerecord.models.#{resource_name}.other"),
|
7
|
+
resource_url_for(:index),
|
8
|
+
class: "btn btn-primary text-white float-right")
|
7
9
|
|
8
|
-
= form_for(resource,
|
10
|
+
= form_for(resource,
|
11
|
+
url: resource_url_for(:update),
|
12
|
+
as: resource_name,
|
13
|
+
html: { autocomplete: "off" }) do |form|
|
9
14
|
- edit_attributes.each do |attr, options|
|
10
|
-
= render
|
15
|
+
= render("zadok/form/fields/#{options[:type]}",
|
16
|
+
resource: resource,
|
17
|
+
form: form,
|
18
|
+
attr: attr,
|
19
|
+
options: options)
|
11
20
|
|
12
21
|
.form-group
|
13
|
-
= form.submit
|
22
|
+
= form.submit(class: "btn btn-primary text-white")
|
23
|
+
|
14
24
|
- if can?(:destroy, resource)
|
15
25
|
.card-footer
|
16
|
-
= link_to(t("#{resource_name.pluralize}.destroy"),
|
17
|
-
|
18
|
-
|
19
|
-
|
26
|
+
= link_to(t("#{resource_name.pluralize}.destroy"),
|
27
|
+
resource_url_for(:destroy),
|
28
|
+
data: { confirm: t("#{resource_name.pluralize}.destroy_confirm") },
|
29
|
+
method: :delete,
|
30
|
+
class: "btn btn-danger pull-right")
|
@@ -1,2 +1,6 @@
|
|
1
1
|
- options[:field_count].times do
|
2
|
-
= render
|
2
|
+
= render("zadok/form/fields/#{options[:field_type]}",
|
3
|
+
resource: resource,
|
4
|
+
form: form,
|
5
|
+
attr: attr,
|
6
|
+
options: options.deep_merge(html: { multiple: true }))
|
@@ -3,5 +3,8 @@
|
|
3
3
|
br
|
4
4
|
- [true, false].each do |option|
|
5
5
|
.form-check.form-check-inline
|
6
|
-
= form.radio_button
|
7
|
-
= form.label
|
6
|
+
= form.radio_button(attr, option, class: "form-check-input")
|
7
|
+
= form.label(attr,
|
8
|
+
t("zadok.options").fetch(option.to_s.to_sym),
|
9
|
+
value: option,
|
10
|
+
class: "form-check-label")
|
@@ -1,7 +1,8 @@
|
|
1
1
|
.form-group
|
2
2
|
.custom-file
|
3
|
-
= form.file_field
|
4
|
-
|
3
|
+
= form.file_field(attr,
|
4
|
+
options.fetch(:html) { {} }.merge(class: "custom-file-input"))
|
5
|
+
= form.label(attr, class: "custom-file-label")
|
5
6
|
|
6
7
|
- if options[:preview]
|
7
|
-
= image_tag
|
8
|
+
= image_tag(resource.send(attr).url, class: "logo img-fluid")
|
@@ -1,4 +1,8 @@
|
|
1
1
|
.form-group
|
2
|
-
= form.label
|
2
|
+
= form.label(attr)
|
3
3
|
br
|
4
|
-
= form.select
|
4
|
+
= form.select(attr,
|
5
|
+
options_for_select(options[:choices],
|
6
|
+
resource.send(attr)),
|
7
|
+
options.fetch(:options) { {} },
|
8
|
+
options.fetch(:html) { {} }.merge(class: "custom-select"))
|
@@ -1,3 +1,6 @@
|
|
1
1
|
.form-group
|
2
|
-
= form.label
|
3
|
-
= form.text_area
|
2
|
+
= form.label(attr)
|
3
|
+
= form.text_area(attr,
|
4
|
+
options.fetch(:html) { {} }.merge(rows: options[:rows],
|
5
|
+
cols: options[:cols],
|
6
|
+
class: "form-control"))
|
@@ -4,7 +4,9 @@
|
|
4
4
|
h2.card-title
|
5
5
|
= t("activerecord.models.#{resource_name}.other")
|
6
6
|
- if can?(:create, resource_name.classify.constantize)
|
7
|
-
= link_to
|
7
|
+
= link_to(t("#{resource_name.pluralize}.new"),
|
8
|
+
resource_url_for(:new),
|
9
|
+
class: "btn btn-primary text-white float-right")
|
8
10
|
|
9
11
|
= render "zadok/filters/edit"
|
10
12
|
|
@@ -16,12 +18,14 @@
|
|
16
18
|
tfoot
|
17
19
|
tr
|
18
20
|
td.text-right[colspan=index_attributes.count]
|
19
|
-
= page_entries_info
|
21
|
+
= page_entries_info(resources)
|
20
22
|
tbody
|
21
|
-
= render
|
23
|
+
= render(partial: "#{resource_name.pluralize}/index_row",
|
24
|
+
collection: resources,
|
25
|
+
as: :resource)
|
22
26
|
|
23
|
-
= will_paginate
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
= will_paginate(resources,
|
28
|
+
inner_window: 1,
|
29
|
+
outer_window: 0,
|
30
|
+
renderer: Zadok::LinkRenderer,
|
31
|
+
class: "pagination justify-content-center")
|
@@ -3,11 +3,17 @@
|
|
3
3
|
.card-body
|
4
4
|
h2.card-title
|
5
5
|
= t("#{resource_name.pluralize}.new")
|
6
|
-
= link_to
|
6
|
+
= link_to(t("activerecord.models.#{resource_name}.other"),
|
7
|
+
resource_url_for(:index),
|
8
|
+
class: "btn btn-primary text-white float-right")
|
7
9
|
|
8
|
-
= form_for(resource, html: { autocomplete: "off"
|
10
|
+
= form_for(resource, html: { autocomplete: "off" }) do |form|
|
9
11
|
- new_attributes.each do |attr, options|
|
10
|
-
= render
|
12
|
+
= render("zadok/form/fields/#{options[:type]}",
|
13
|
+
resource: resource,
|
14
|
+
form: form,
|
15
|
+
attr: attr,
|
16
|
+
options: options)
|
11
17
|
|
12
18
|
.form-group
|
13
|
-
= form.submit
|
19
|
+
= form.submit(class: "btn btn-primary text-white")
|
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.3.
|
4
|
+
version: 0.3.6
|
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-
|
11
|
+
date: 2018-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap
|