administrate 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of administrate might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/administrate/application_controller.rb +2 -0
- data/app/views/fields/select/_form.html.erb +31 -0
- data/app/views/fields/select/_index.html.erb +16 -0
- data/app/views/fields/select/_show.html.erb +16 -0
- data/lib/administrate/base_dashboard.rb +1 -0
- data/lib/administrate/field/select.rb +21 -0
- data/lib/administrate/version.rb +1 -1
- data/lib/generators/administrate/field/templates/_form.html.erb +6 -2
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc3433138207bed6d4a596ef48f6bfac9429e4ee
|
4
|
+
data.tar.gz: 1b6e823bb2465556926e562e0e4e21a5bbfc1e61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 416d6157029a929e125139cd53897d93187cf798106fe8e43a5232c7a4ab193d1975f496af6e23e4f03036bfae478f9153597229dbfa308a595802b8b6d01b8e
|
7
|
+
data.tar.gz: 27967f0496a392f5dfee4914a35728d8e6f743a27d2d9e15c16f289995fdb40e7d9b18feabf273025e0646ff93ee7be1733216d7dabe6d930c34c971ccf9ab20
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<%#
|
2
|
+
# Select Index Partial
|
3
|
+
|
4
|
+
This partial renders a selectable text attribute,
|
5
|
+
to be displayed on a resource's edit form page.
|
6
|
+
|
7
|
+
## Local variables:
|
8
|
+
|
9
|
+
- `f`:
|
10
|
+
A Rails form generator, used to help create the appropriate input fields.
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::Select][1].
|
13
|
+
A wrapper around the attribute pulled from the database.
|
14
|
+
|
15
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Select
|
16
|
+
%>
|
17
|
+
|
18
|
+
<div class="field-unit__label">
|
19
|
+
<%= f.label field.attribute %>
|
20
|
+
</div>
|
21
|
+
<div class="field-unit__field">
|
22
|
+
<%= f.select(
|
23
|
+
field.attribute,
|
24
|
+
options_from_collection_for_select(
|
25
|
+
field.selectable_options,
|
26
|
+
:to_s,
|
27
|
+
:to_s,
|
28
|
+
field.data.presence,
|
29
|
+
)
|
30
|
+
) %>
|
31
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%#
|
2
|
+
# Select Index Partial
|
3
|
+
|
4
|
+
This partial renders a selectable text attribute,
|
5
|
+
to be displayed on a resource's index page.
|
6
|
+
|
7
|
+
## Local variables:
|
8
|
+
|
9
|
+
- `field`:
|
10
|
+
An instance of [Administrate::Field::Select][1].
|
11
|
+
A wrapper around the attribute pulled from the database.
|
12
|
+
|
13
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Select
|
14
|
+
%>
|
15
|
+
|
16
|
+
<%= field.data %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%#
|
2
|
+
# Select Show Partial
|
3
|
+
|
4
|
+
This partial renders a selectable text attribute,
|
5
|
+
to be displayed on a resource's show page.
|
6
|
+
|
7
|
+
## Local variables:
|
8
|
+
|
9
|
+
- `field`:
|
10
|
+
An instance of [Administrate::Field::Select][1].
|
11
|
+
A wrapper around the attribute pulled from the database.
|
12
|
+
|
13
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Select
|
14
|
+
%>
|
15
|
+
|
16
|
+
<%= field.data %>
|
@@ -7,6 +7,7 @@ require "administrate/field/has_one"
|
|
7
7
|
require "administrate/field/image"
|
8
8
|
require "administrate/field/number"
|
9
9
|
require "administrate/field/polymorphic"
|
10
|
+
require "administrate/field/select"
|
10
11
|
require "administrate/field/string"
|
11
12
|
require "administrate/field/text"
|
12
13
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative "base"
|
2
|
+
|
3
|
+
module Administrate
|
4
|
+
module Field
|
5
|
+
class Select < Field::Base
|
6
|
+
def self.searchable?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
10
|
+
def selectable_options
|
11
|
+
collection
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
@collection ||= options.fetch(:collection, [])
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/administrate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grayson Wright
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: autoprefixer-rails
|
@@ -239,6 +239,9 @@ files:
|
|
239
239
|
- app/views/fields/polymorphic/_form.html.erb
|
240
240
|
- app/views/fields/polymorphic/_index.html.erb
|
241
241
|
- app/views/fields/polymorphic/_show.html.erb
|
242
|
+
- app/views/fields/select/_form.html.erb
|
243
|
+
- app/views/fields/select/_index.html.erb
|
244
|
+
- app/views/fields/select/_show.html.erb
|
242
245
|
- app/views/fields/string/_form.html.erb
|
243
246
|
- app/views/fields/string/_index.html.erb
|
244
247
|
- app/views/fields/string/_show.html.erb
|
@@ -280,6 +283,7 @@ files:
|
|
280
283
|
- lib/administrate/field/image.rb
|
281
284
|
- lib/administrate/field/number.rb
|
282
285
|
- lib/administrate/field/polymorphic.rb
|
286
|
+
- lib/administrate/field/select.rb
|
283
287
|
- lib/administrate/field/string.rb
|
284
288
|
- lib/administrate/field/text.rb
|
285
289
|
- lib/administrate/generator_helpers.rb
|
@@ -341,8 +345,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
341
345
|
version: '0'
|
342
346
|
requirements: []
|
343
347
|
rubyforge_project:
|
344
|
-
rubygems_version: 2.
|
348
|
+
rubygems_version: 2.6.2
|
345
349
|
signing_key:
|
346
350
|
specification_version: 4
|
347
351
|
summary: A Rails engine for creating super-flexible admin dashboards
|
348
352
|
test_files: []
|
353
|
+
has_rdoc:
|