phccodesnipperpro 4.4.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +28 -0
- data/Rakefile +4 -18
- data/app/assets/config/phccodesnipperpro_manifest.js +2 -2
- data/app/controllers/phccodesnipperpro/application_controller.rb +14 -15
- data/app/controllers/phccodesnipperpro/script/snippets_controller.rb +1 -1
- data/app/controllers/phccodesnipperpro/script/urls_controller.rb +1 -1
- data/app/models/phccodesnipperpro/script/snippet.rb +0 -3
- data/app/views/layouts/phccodesnipperpro/application.html.erb +73 -79
- data/app/views/layouts/phccodesnipperpro/components/backend/footer/_footer.html.erb +14 -8
- data/app/views/layouts/phccodesnipperpro/components/backend/navigation/_top_menu.html.erb +41 -37
- data/app/views/layouts/phccodesnipperpro/components/backend/sidebars/_side_menu.html.erb +921 -189
- data/app/views/phccodesnipperpro/script/snippets/_form.html.erb +15 -15
- data/app/views/phccodesnipperpro/script/snippets/edit.html.erb +21 -21
- data/app/views/phccodesnipperpro/script/snippets/index.html.erb +57 -57
- data/app/views/phccodesnipperpro/script/snippets/new.html.erb +19 -21
- data/app/views/phccodesnipperpro/script/snippets/show.html.erb +63 -58
- data/app/views/phccodesnipperpro/script/urls/_form.html.erb +12 -12
- data/app/views/phccodesnipperpro/script/urls/edit.html.erb +16 -16
- data/app/views/phccodesnipperpro/script/urls/index.html.erb +55 -55
- data/app/views/phccodesnipperpro/script/urls/new.html.erb +21 -21
- data/app/views/phccodesnipperpro/script/urls/show.html.erb +61 -57
- data/config/routes.rb +6 -9
- data/db/migrate/20190504104048_create_phccodesnipperpro_script_urls.rb +19 -0
- data/db/migrate/20190504104101_create_phccodesnipperpro_script_snippets.rb +19 -0
- data/lib/phccodesnipperpro/engine.rb +30 -56
- data/lib/phccodesnipperpro/version.rb +1 -1
- data/lib/phccodesnipperpro.rb +2 -0
- metadata +62 -390
- data/app/assets/javascripts/phccodesnipperpro/application.js +0 -2
- data/app/assets/stylesheets/phccodesnipperpro/application.scss +0 -2
- data/config/initializers/friendly_id.rb +0 -107
@@ -1,107 +0,0 @@
|
|
1
|
-
# FriendlyId Global Configuration
|
2
|
-
#
|
3
|
-
# Use this to set up shared configuration options for your entire application.
|
4
|
-
# Any of the configuration options shown here can also be applied to single
|
5
|
-
# models by passing arguments to the `friendly_id` class method or defining
|
6
|
-
# methods in your model.
|
7
|
-
#
|
8
|
-
# To learn more, check out the guide:
|
9
|
-
#
|
10
|
-
# http://norman.github.io/friendly_id/file.Guide.html
|
11
|
-
|
12
|
-
FriendlyId.defaults do |config|
|
13
|
-
# ## Reserved Words
|
14
|
-
#
|
15
|
-
# Some words could conflict with Rails's routes when used as slugs, or are
|
16
|
-
# undesirable to allow as slugs. Edit this list as needed for your app.
|
17
|
-
config.use :reserved
|
18
|
-
|
19
|
-
config.reserved_words = %w(new edit index session login logout users admin
|
20
|
-
stylesheets assets javascripts images)
|
21
|
-
|
22
|
-
# This adds an option to treat reserved words as conflicts rather than exceptions.
|
23
|
-
# When there is no good candidate, a UUID will be appended, matching the existing
|
24
|
-
# conflict behavior.
|
25
|
-
|
26
|
-
# config.treat_reserved_as_conflict = true
|
27
|
-
|
28
|
-
# ## Friendly Finders
|
29
|
-
#
|
30
|
-
# Uncomment this to use friendly finders in all models. By default, if
|
31
|
-
# you wish to find a record by its friendly id, you must do:
|
32
|
-
#
|
33
|
-
# MyModel.friendly.find('foo')
|
34
|
-
#
|
35
|
-
# If you uncomment this, you can do:
|
36
|
-
#
|
37
|
-
# MyModel.find('foo')
|
38
|
-
#
|
39
|
-
# This is significantly more convenient but may not be appropriate for
|
40
|
-
# all applications, so you must explicity opt-in to this behavior. You can
|
41
|
-
# always also configure it on a per-model basis if you prefer.
|
42
|
-
#
|
43
|
-
# Something else to consider is that using the :finders addon boosts
|
44
|
-
# performance because it will avoid Rails-internal code that makes runtime
|
45
|
-
# calls to `Module.extend`.
|
46
|
-
#
|
47
|
-
# config.use :finders
|
48
|
-
#
|
49
|
-
# ## Slugs
|
50
|
-
#
|
51
|
-
# Most applications will use the :slugged module everywhere. If you wish
|
52
|
-
# to do so, uncomment the following line.
|
53
|
-
#
|
54
|
-
# config.use :slugged
|
55
|
-
#
|
56
|
-
# By default, FriendlyId's :slugged addon expects the slug column to be named
|
57
|
-
# 'slug', but you can change it if you wish.
|
58
|
-
#
|
59
|
-
# config.slug_column = 'slug'
|
60
|
-
#
|
61
|
-
# By default, slug has no size limit, but you can change it if you wish.
|
62
|
-
#
|
63
|
-
# config.slug_limit = 255
|
64
|
-
#
|
65
|
-
# When FriendlyId can not generate a unique ID from your base method, it appends
|
66
|
-
# a UUID, separated by a single dash. You can configure the character used as the
|
67
|
-
# separator. If you're upgrading from FriendlyId 4, you may wish to replace this
|
68
|
-
# with two dashes.
|
69
|
-
#
|
70
|
-
# config.sequence_separator = '-'
|
71
|
-
#
|
72
|
-
# Note that you must use the :slugged addon **prior** to the line which
|
73
|
-
# configures the sequence separator, or else FriendlyId will raise an undefined
|
74
|
-
# method error.
|
75
|
-
#
|
76
|
-
# ## Tips and Tricks
|
77
|
-
#
|
78
|
-
# ### Controlling when slugs are generated
|
79
|
-
#
|
80
|
-
# As of FriendlyId 5.0, new slugs are generated only when the slug field is
|
81
|
-
# nil, but if you're using a column as your base method can change this
|
82
|
-
# behavior by overriding the `should_generate_new_friendly_id?` method that
|
83
|
-
# FriendlyId adds to your model. The change below makes FriendlyId 5.0 behave
|
84
|
-
# more like 4.0.
|
85
|
-
# Note: Use(include) Slugged module in the config if using the anonymous module.
|
86
|
-
# If you have `friendly_id :name, use: slugged` in the model, Slugged module
|
87
|
-
# is included after the anonymous module defined in the initializer, so it
|
88
|
-
# overrides the `should_generate_new_friendly_id?` method from the anonymous module.
|
89
|
-
#
|
90
|
-
# config.use :slugged
|
91
|
-
# config.use Module.new {
|
92
|
-
# def should_generate_new_friendly_id?
|
93
|
-
# slug.blank? || <your_column_name_here>_changed?
|
94
|
-
# end
|
95
|
-
# }
|
96
|
-
#
|
97
|
-
# FriendlyId uses Rails's `parameterize` method to generate slugs, but for
|
98
|
-
# languages that don't use the Roman alphabet, that's not usually sufficient.
|
99
|
-
# Here we use the Babosa library to transliterate Russian Cyrillic slugs to
|
100
|
-
# ASCII. If you use this, don't forget to add "babosa" to your Gemfile.
|
101
|
-
#
|
102
|
-
# config.use Module.new {
|
103
|
-
# def normalize_friendly_id(text)
|
104
|
-
# text.to_slug.normalize! :transliterations => [:russian, :latin]
|
105
|
-
# end
|
106
|
-
# }
|
107
|
-
end
|