tolaria 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/app/assets/fonts/admin/fontawesome.eot +0 -0
- data/app/assets/fonts/admin/fontawesome.svg +90 -15
- data/app/assets/fonts/admin/fontawesome.ttf +0 -0
- data/app/assets/fonts/admin/fontawesome.woff +0 -0
- data/app/assets/fonts/admin/fontawesome.woff2 +0 -0
- data/app/assets/javascripts/admin/lib/no.js +2 -4
- data/app/assets/stylesheets/admin/components/_resource_form.scss +4 -0
- data/app/assets/stylesheets/admin/components/forms/_attachment_field.scss +1 -2
- data/app/assets/stylesheets/admin/settings/_icons.scss +798 -1
- data/lib/tolaria/default_config.rb +1 -1
- data/lib/tolaria/managed_class.rb +2 -2
- data/lib/tolaria/version.rb +1 -1
- data/test/demo/app/views/admin/blog_posts/_form.html.erb +1 -1
- data/test/integration/router_test.rb +30 -1
- metadata +3 -3
@@ -36,7 +36,7 @@ module Tolaria
|
|
36
36
|
|
37
37
|
# A factory method that registers a new model in Tolaria and configures
|
38
38
|
# its menu and param settings. Developers should use `ActiveRecord::Base.manage_with_tolaria`
|
39
|
-
def self.create(klass, icon:"file-o", permit_params:[], priority:10, category:"Settings", default_order:"id DESC", paginated:true, allowed_actions
|
39
|
+
def self.create(klass, icon:"file-o", permit_params:[], priority:10, category:"Settings", default_order:"id DESC", paginated:true, allowed_actions:%i[index show new create edit update destroy])
|
40
40
|
|
41
41
|
managed_class = self.new
|
42
42
|
managed_class.klass = klass
|
@@ -51,7 +51,7 @@ module Tolaria
|
|
51
51
|
managed_class.allowed_actions = allowed_actions.freeze
|
52
52
|
|
53
53
|
# Set auto-generated attributes
|
54
|
-
managed_class.controller_name = "#{managed_class.model_name.
|
54
|
+
managed_class.controller_name = "#{managed_class.model_name.collection.camelize}Controller".freeze
|
55
55
|
managed_class.param_key = managed_class.model_name.singular.to_sym
|
56
56
|
|
57
57
|
return managed_class
|
data/lib/tolaria/version.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<%= f.hint "The title of this post. The title is featured prominently across the site and used to construct the page URL. A good title is both summarizing and enticing, much like a newspaper headline." %>
|
4
4
|
|
5
5
|
<%= f.label :published_at, "Publishing Date" %>
|
6
|
-
<%= f.timestamp_field :published_at %>
|
6
|
+
<%= f.timestamp_field :published_at, class:"short" %>
|
7
7
|
<%= f.hint %{
|
8
8
|
The date this post should be published.
|
9
9
|
Published posts with a date set in the future will be scheduled to appear on that date.
|
@@ -46,7 +46,7 @@ class RouterTest < ActionDispatch::IntegrationTest
|
|
46
46
|
test "correctly draws uncountable routes" do
|
47
47
|
|
48
48
|
ActiveSupport::Inflector.inflections do |inflect|
|
49
|
-
inflect.uncountable
|
49
|
+
inflect.uncountable "pokemon"
|
50
50
|
end
|
51
51
|
|
52
52
|
class ::Pokemon < ActiveRecord::Base
|
@@ -63,6 +63,7 @@ class RouterTest < ActionDispatch::IntegrationTest
|
|
63
63
|
assert_equal "/admin/pokemon", admin_pokemon_index_path
|
64
64
|
assert_equal "/admin/pokemon/1", admin_pokemon_path(1)
|
65
65
|
assert_equal "/admin/pokemon/1/edit", edit_admin_pokemon_path(1)
|
66
|
+
assert Admin::PokemonController
|
66
67
|
|
67
68
|
# Unseat the class so that it doesn't leak out of this test
|
68
69
|
assert Tolaria.discard_managed_class(Pokemon), "should discard class"
|
@@ -70,4 +71,32 @@ class RouterTest < ActionDispatch::IntegrationTest
|
|
70
71
|
|
71
72
|
end
|
72
73
|
|
74
|
+
test "correctly draws uncommon collective routes" do
|
75
|
+
|
76
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
77
|
+
inflect.plural "hero", "heroes"
|
78
|
+
end
|
79
|
+
|
80
|
+
class ::BraveHero < ActiveRecord::Base
|
81
|
+
manage_with_tolaria using:{
|
82
|
+
icon: "key",
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
# Re-draw the routes
|
87
|
+
Rails.application.routes.draw do
|
88
|
+
Tolaria.draw_routes(self)
|
89
|
+
end
|
90
|
+
|
91
|
+
assert_equal "/admin/brave_heroes", admin_brave_heroes_path
|
92
|
+
assert_equal "/admin/brave_heroes/1", admin_brave_hero_path(1)
|
93
|
+
assert_equal "/admin/brave_heroes/1/edit", edit_admin_brave_hero_path(1)
|
94
|
+
assert Admin::BraveHeroesController
|
95
|
+
|
96
|
+
# Unseat the class so that it doesn't leak out of this test
|
97
|
+
assert Tolaria.discard_managed_class(BraveHero), "should discard class"
|
98
|
+
Object.send(:remove_const, :BraveHero)
|
99
|
+
|
100
|
+
end
|
101
|
+
|
73
102
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tolaria
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Csuhta
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bcrypt
|
@@ -427,7 +427,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
427
427
|
version: '0'
|
428
428
|
requirements: []
|
429
429
|
rubyforge_project:
|
430
|
-
rubygems_version: 2.5.1
|
430
|
+
rubygems_version: 2.4.5.1
|
431
431
|
signing_key:
|
432
432
|
specification_version: 4
|
433
433
|
summary: A Rails CMS framework for making people happy.
|