administrate 0.15.0 → 0.16.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: bb407c439ba3795c3161109f57d64a8e20db553d80f583c6d2a66bfe0f713cd7
4
- data.tar.gz: 1691010813773e6ecc19b067adb4a610c6624f2ec2d8a03bb6414a683d5d83b0
3
+ metadata.gz: b4919291c5352f8cfb68e629292b4cd85f89d1e8912bf75e6702ecee682383f7
4
+ data.tar.gz: 48212e43cd940b32a40f1d86c93f181cb808fbcfaa839459292ec258460c8b97
5
5
  SHA512:
6
- metadata.gz: 0fc7042ed3389b1cf87a4ba41681e310dc3678e790a5af0d3c3e3d64c213f50b5bf66409069159a18e784c9cdaf5e6d60e2d2614f4647b5ab0d8e0b4e2f6b70e
7
- data.tar.gz: 1c8b66a38eca96f2002ccd8b253b4fc7abd082e7376111e2e1be399b870755ce29511982828760fd6a229f5571eb1ace83a9121fae2253db2653218ffbd237ce
6
+ metadata.gz: 839bab4d2832921f6a6f7fcc06cbc8f8a5e18017e9de81d7d0c5d22360567ba9b9a427a68223c5b6fe600cb07dbb176404476a51fecb56f07f559a1461da0c4c
7
+ data.tar.gz: 7b356066b5c0dbe9d82bdc65eefe6563111e30592b827b94fdd03196f01a29e167fb5d22cee9ec907c7e57c29913f12ba75a922aef7f8172a0130b964527c2d8
@@ -47,5 +47,8 @@ input[type="submit"],
47
47
  border: $base-border;
48
48
  border-color: $blue;
49
49
  color: $blue;
50
+ }
51
+
52
+ .button--nav {
50
53
  margin-bottom: $base-spacing;
51
54
  }
@@ -8,7 +8,7 @@ as defined by the routes in the `admin/` namespace
8
8
  %>
9
9
 
10
10
  <nav class="navigation" role="navigation">
11
- <%= link_to(t("administrate.navigation.back_to_app"), root_url, class: "button button--alt") if defined?(root_url) %>
11
+ <%= link_to(t("administrate.navigation.back_to_app"), root_url, class: "button button--alt button--nav") if defined?(root_url) %>
12
12
 
13
13
  <% Administrate::Namespace.new(namespace).resources_with_index_route.each do |resource| %>
14
14
  <%= link_to(
@@ -46,7 +46,7 @@ It renders the `_table` partial to display details about the resources.
46
46
  "administrate.actions.new_resource",
47
47
  name: display_resource_name(page.resource_name, singular: true).downcase
48
48
  ),
49
- [:new, namespace, page.resource_path],
49
+ [:new, namespace, page.resource_path.to_sym],
50
50
  class: "button",
51
51
  ) if valid_action?(:new) && show_action?(:new, new_resource) %>
52
52
  </div>
@@ -1,7 +1,7 @@
1
1
  <%#
2
2
  # Url Index Partial
3
3
 
4
- This partial renders an email address,
4
+ This partial renders a URL address,
5
5
  to be displayed on a resource's index page.
6
6
 
7
7
  By default, the value is rendered as an `a` element.
@@ -1,7 +1,7 @@
1
1
  <%#
2
2
  # Url Show Partial
3
3
 
4
- This partial renders an email address,
4
+ This partial renders a URL address,
5
5
  to be displayed on a resource's show page.
6
6
 
7
7
  By default, the value is rendered as an `a` element.
@@ -2,8 +2,6 @@
2
2
  title: Adding Controllers without a related Model
3
3
  ---
4
4
 
5
- # Adding Controllers without a related Model
6
-
7
5
  Sometimes you may want to add a custom controller that has no resource
8
6
  related to it (for example for a statistics page).
9
7
 
@@ -65,6 +65,7 @@ specify, including:
65
65
  - `Field::Select`
66
66
  - `Field::String`
67
67
  - `Field::Text`
68
+ - `Field::Url`
68
69
  - `Field::Password`
69
70
 
70
71
  ## Customizing Fields
@@ -238,6 +239,14 @@ Default is `false`.
238
239
  `:truncate` - Set the number of characters to display in the index view.
239
240
  Defaults to `50`.
240
241
 
242
+ **Field::Url**
243
+
244
+ `:searchable` - Specify if the attribute should be considered when searching.
245
+ Default is `true`.
246
+
247
+ `:truncate` - Set the number of characters to display in the index view.
248
+ Defaults to `50`.
249
+
241
250
  **Field::Password**
242
251
 
243
252
  `:searchable` - Specify if the attribute should be considered when searching.
@@ -1,7 +1,7 @@
1
1
  module Administrate
2
2
  class Namespace
3
3
  def initialize(namespace)
4
- @namespace = namespace
4
+ @namespace = namespace.to_sym
5
5
  end
6
6
 
7
7
  def resources
@@ -9,7 +9,7 @@ module Administrate
9
9
  end
10
10
 
11
11
  def namespace
12
- controller_path.split("/").first
12
+ controller_path.split("/").first.to_sym
13
13
  end
14
14
 
15
15
  def resource_class
@@ -1,3 +1,3 @@
1
1
  module Administrate
2
- VERSION = "0.15.0".freeze
2
+ VERSION = "0.16.0".freeze
3
3
  end
@@ -5,7 +5,7 @@ require "administrate/namespace"
5
5
  module Administrate
6
6
  class ViewGenerator < Rails::Generators::Base
7
7
  include Administrate::GeneratorHelpers
8
- class_option :namespace, type: :string, default: "admin"
8
+ class_option :namespace, type: :string, default: :admin
9
9
 
10
10
  def self.template_source_path
11
11
  File.expand_path(
@@ -27,7 +27,7 @@ module Administrate
27
27
  COLLECTION_ATTRIBUTE_LIMIT = 4
28
28
  READ_ONLY_ATTRIBUTES = %w[id created_at updated_at]
29
29
 
30
- class_option :namespace, type: :string, default: "admin"
30
+ class_option :namespace, type: :string, default: :admin
31
31
 
32
32
  source_root File.expand_path("../templates", __FILE__)
33
33
 
@@ -1,5 +1,5 @@
1
- module <%= namespace.classify %>
2
- class <%= class_name.pluralize %>Controller < <%= namespace.classify %>::ApplicationController
1
+ module <%= namespace.to_s.classify %>
2
+ class <%= class_name.pluralize %>Controller < <%= namespace.to_s.classify %>::ApplicationController
3
3
  # Overwrite any of the RESTful controller actions to implement custom behavior
4
4
  # For example, you may want to send an email after a foo is updated.
5
5
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Charlton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-02-26 00:00:00.000000000 Z
12
+ date: 2021-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack