interage-helper 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +4 -0
- data/.rubocop.yml +22 -0
- data/.travis.yml +7 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +80 -0
- data/README.md +40 -0
- data/Rakefile +8 -0
- data/bin/brakeman +29 -0
- data/bin/bundle +105 -0
- data/bin/ci +12 -0
- data/bin/console +14 -0
- data/bin/rspec +29 -0
- data/bin/rubocop +29 -0
- data/bin/setup +8 -0
- data/interage-helper.gemspec +43 -0
- data/lib/generators/interage/helper/install/USAGE +8 -0
- data/lib/generators/interage/helper/install/install_generator.rb +26 -0
- data/lib/generators/interage/helper/install/templates/application_helper.rb +5 -0
- data/lib/generators/interage/helper/install/templates/application_helper.yml +95 -0
- data/lib/interage/application_helper.rb +55 -0
- data/lib/interage/application_icon_helper.rb +31 -0
- data/lib/interage/bootstrap_helper.rb +53 -0
- data/lib/interage/cep_helper.rb +11 -0
- data/lib/interage/cocoon_helper.rb +31 -0
- data/lib/interage/controller_active_helper.rb +17 -0
- data/lib/interage/cpf_cnpj_helper.rb +23 -0
- data/lib/interage/date_time_helper.rb +27 -0
- data/lib/interage/favicon_helper.rb +31 -0
- data/lib/interage/flash_message_helper.rb +21 -0
- data/lib/interage/font_awesome_helper.rb +30 -0
- data/lib/interage/gravatar_helper.rb +13 -0
- data/lib/interage/helper/version.rb +7 -0
- data/lib/interage/helper.rb +32 -0
- data/lib/interage/link_to_helper.rb +60 -0
- data/lib/interage/material_design_icons_helper.rb +25 -0
- data/lib/interage/number_helper.rb +9 -0
- data/lib/interage/pagination_helper.rb +11 -0
- data/lib/interage/phone_helper.rb +13 -0
- data/lib/interage/text_helper.rb +13 -0
- data/lib/interage/translation_helper.rb +127 -0
- data/lib/interage/version_helper.rb +21 -0
- metadata +131 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 593dbd3c407d8c8da4ebcc925193f901dd0dd69137d6a2d3874fbceca3e801a3
|
4
|
+
data.tar.gz: 21f4c9ebca28b1dad4cc753bbd5f9a9de979aec3923b490d379b69c7a84f7d9d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7891f4fb05d2622fcb8b2698828a501c2bab56da289e3aec66c8265d30cebd0e85c9f3e5ea25c8c96cc46404d62901e39d36b73011033cd89542b88511b04249
|
7
|
+
data.tar.gz: 86907b95cd65c9a349110751b61c8fa747232b4ee3fba42e8195b01114949d0ddd9ad492a1056ec800d58098df3ceceb496a1e4168cd79779d8528c3604ba554
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-performance
|
4
|
+
|
5
|
+
Documentation:
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
Style/EmptyMethod:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Style/SymbolArray:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
Style/WordArray:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
AllCops:
|
18
|
+
TargetRubyVersion: 2.6
|
19
|
+
Exclude:
|
20
|
+
- bin/**/*
|
21
|
+
- vendor/**/*
|
22
|
+
- lib/generators/interage/helper/*/templates/**/*.rb
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
gemspec
|
6
|
+
|
7
|
+
group :development, :test do
|
8
|
+
# https://github.com/rubocop-hq/rubocop#quickstart
|
9
|
+
gem 'rubocop', '~> 0.67.2'
|
10
|
+
# https://github.com/backus/rubocop-rspec
|
11
|
+
gem 'rubocop-rspec', '~> 1.32'
|
12
|
+
# https://github.com/rubocop-hq/rubocop-performance/#usage
|
13
|
+
gem 'rubocop-performance', '~> 1.1'
|
14
|
+
# https://github.com/rspec/rspec#install
|
15
|
+
gem 'rspec', '~> 3.8'
|
16
|
+
# https://github.com/pry/pry#installation
|
17
|
+
gem 'pry', '~> 0.12.2'
|
18
|
+
# https://github.com/presidentbeef/brakeman
|
19
|
+
gem 'brakeman', '~> 4.3', '>= 4.3.1', require: false
|
20
|
+
# https://github.com/rails/rails/tree/master/activesupport#download-and-installation
|
21
|
+
gem 'activesupport', '~> 5.2', '>= 5.2.3'
|
22
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
interage-helper (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (5.2.3)
|
10
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
11
|
+
i18n (>= 0.7, < 2)
|
12
|
+
minitest (~> 5.1)
|
13
|
+
tzinfo (~> 1.1)
|
14
|
+
ast (2.4.0)
|
15
|
+
brakeman (4.5.0)
|
16
|
+
coderay (1.1.2)
|
17
|
+
concurrent-ruby (1.1.5)
|
18
|
+
diff-lcs (1.3)
|
19
|
+
i18n (1.6.0)
|
20
|
+
concurrent-ruby (~> 1.0)
|
21
|
+
jaro_winkler (1.5.2)
|
22
|
+
method_source (0.9.2)
|
23
|
+
minitest (5.11.3)
|
24
|
+
parallel (1.17.0)
|
25
|
+
parser (2.6.2.1)
|
26
|
+
ast (~> 2.4.0)
|
27
|
+
pry (0.12.2)
|
28
|
+
coderay (~> 1.1.0)
|
29
|
+
method_source (~> 0.9.0)
|
30
|
+
psych (3.1.0)
|
31
|
+
rainbow (3.0.0)
|
32
|
+
rake (10.5.0)
|
33
|
+
rspec (3.8.0)
|
34
|
+
rspec-core (~> 3.8.0)
|
35
|
+
rspec-expectations (~> 3.8.0)
|
36
|
+
rspec-mocks (~> 3.8.0)
|
37
|
+
rspec-core (3.8.0)
|
38
|
+
rspec-support (~> 3.8.0)
|
39
|
+
rspec-expectations (3.8.2)
|
40
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
+
rspec-support (~> 3.8.0)
|
42
|
+
rspec-mocks (3.8.0)
|
43
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
+
rspec-support (~> 3.8.0)
|
45
|
+
rspec-support (3.8.0)
|
46
|
+
rubocop (0.67.2)
|
47
|
+
jaro_winkler (~> 1.5.1)
|
48
|
+
parallel (~> 1.10)
|
49
|
+
parser (>= 2.5, != 2.5.1.1)
|
50
|
+
psych (>= 3.1.0)
|
51
|
+
rainbow (>= 2.2.2, < 4.0)
|
52
|
+
ruby-progressbar (~> 1.7)
|
53
|
+
unicode-display_width (>= 1.4.0, < 1.6)
|
54
|
+
rubocop-performance (1.1.0)
|
55
|
+
rubocop (>= 0.67.0)
|
56
|
+
rubocop-rspec (1.32.0)
|
57
|
+
rubocop (>= 0.60.0)
|
58
|
+
ruby-progressbar (1.10.0)
|
59
|
+
thread_safe (0.3.6)
|
60
|
+
tzinfo (1.2.5)
|
61
|
+
thread_safe (~> 0.1)
|
62
|
+
unicode-display_width (1.5.0)
|
63
|
+
|
64
|
+
PLATFORMS
|
65
|
+
ruby
|
66
|
+
|
67
|
+
DEPENDENCIES
|
68
|
+
activesupport (~> 5.2, >= 5.2.3)
|
69
|
+
brakeman (~> 4.3, >= 4.3.1)
|
70
|
+
bundler (~> 2.0)
|
71
|
+
interage-helper!
|
72
|
+
pry (~> 0.12.2)
|
73
|
+
rake (~> 10.0)
|
74
|
+
rspec (~> 3.8)
|
75
|
+
rubocop (~> 0.67.2)
|
76
|
+
rubocop-performance (~> 1.1)
|
77
|
+
rubocop-rspec (~> 1.32)
|
78
|
+
|
79
|
+
BUNDLED WITH
|
80
|
+
2.1.4
|
data/README.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Interage::Helper
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'interage-helper', '~> 0.1'
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
```bash
|
14
|
+
bundle install
|
15
|
+
```
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
```bash
|
20
|
+
gem install interage-helper
|
21
|
+
```
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
You can use a Rails generator to create `ApplicationHelper`:
|
26
|
+
|
27
|
+
```bash
|
28
|
+
rails g interage:helper:install
|
29
|
+
```
|
30
|
+
|
31
|
+
And you can use a Rails generator to create helper classes:
|
32
|
+
|
33
|
+
|
34
|
+
```bash
|
35
|
+
rails g interage:helper:create UsersByEmail User
|
36
|
+
```
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
Bug reports and merge requests are welcome on GitLab at https://gitlab.com/[USERNAME]/interage-helper.
|
data/Rakefile
ADDED
data/bin/brakeman
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'brakeman' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("brakeman", "brakeman")
|
data/bin/bundle
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'bundle' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "rubygems"
|
12
|
+
|
13
|
+
m = Module.new do
|
14
|
+
module_function
|
15
|
+
|
16
|
+
def invoked_as_script?
|
17
|
+
File.expand_path($0) == File.expand_path(__FILE__)
|
18
|
+
end
|
19
|
+
|
20
|
+
def env_var_version
|
21
|
+
ENV["BUNDLER_VERSION"]
|
22
|
+
end
|
23
|
+
|
24
|
+
def cli_arg_version
|
25
|
+
return unless invoked_as_script? # don't want to hijack other binstubs
|
26
|
+
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
|
27
|
+
bundler_version = nil
|
28
|
+
update_index = nil
|
29
|
+
ARGV.each_with_index do |a, i|
|
30
|
+
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
|
31
|
+
bundler_version = a
|
32
|
+
end
|
33
|
+
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
34
|
+
bundler_version = $1 || ">= 0.a"
|
35
|
+
update_index = i
|
36
|
+
end
|
37
|
+
bundler_version
|
38
|
+
end
|
39
|
+
|
40
|
+
def gemfile
|
41
|
+
gemfile = ENV["BUNDLE_GEMFILE"]
|
42
|
+
return gemfile if gemfile && !gemfile.empty?
|
43
|
+
|
44
|
+
File.expand_path("../../Gemfile", __FILE__)
|
45
|
+
end
|
46
|
+
|
47
|
+
def lockfile
|
48
|
+
lockfile =
|
49
|
+
case File.basename(gemfile)
|
50
|
+
when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
|
51
|
+
else "#{gemfile}.lock"
|
52
|
+
end
|
53
|
+
File.expand_path(lockfile)
|
54
|
+
end
|
55
|
+
|
56
|
+
def lockfile_version
|
57
|
+
return unless File.file?(lockfile)
|
58
|
+
lockfile_contents = File.read(lockfile)
|
59
|
+
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
|
60
|
+
Regexp.last_match(1)
|
61
|
+
end
|
62
|
+
|
63
|
+
def bundler_version
|
64
|
+
@bundler_version ||= begin
|
65
|
+
env_var_version || cli_arg_version ||
|
66
|
+
lockfile_version || "#{Gem::Requirement.default}.a"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def load_bundler!
|
71
|
+
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
72
|
+
|
73
|
+
# must dup string for RG < 1.8 compatibility
|
74
|
+
activate_bundler(bundler_version.dup)
|
75
|
+
end
|
76
|
+
|
77
|
+
def activate_bundler(bundler_version)
|
78
|
+
if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
|
79
|
+
bundler_version = "< 2"
|
80
|
+
end
|
81
|
+
gem_error = activation_error_handling do
|
82
|
+
gem "bundler", bundler_version
|
83
|
+
end
|
84
|
+
return if gem_error.nil?
|
85
|
+
require_error = activation_error_handling do
|
86
|
+
require "bundler/version"
|
87
|
+
end
|
88
|
+
return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
89
|
+
warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
|
90
|
+
exit 42
|
91
|
+
end
|
92
|
+
|
93
|
+
def activation_error_handling
|
94
|
+
yield
|
95
|
+
nil
|
96
|
+
rescue StandardError, LoadError => e
|
97
|
+
e
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
m.load_bundler!
|
102
|
+
|
103
|
+
if m.invoked_as_script?
|
104
|
+
load Gem.bin_path("bundler", "bundle")
|
105
|
+
end
|
data/bin/ci
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "interage/helper"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/rubocop
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/bin/setup
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'interage/helper/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
CODE_URL = 'https://gitlab.com/interage/patterns/helper'
|
9
|
+
|
10
|
+
spec.name = 'interage-helper'
|
11
|
+
spec.version = Interage::Helper::VERSION
|
12
|
+
spec.authors = ['Walmir Neto']
|
13
|
+
spec.email = ['owalmirneto@gmail.com']
|
14
|
+
|
15
|
+
spec.summary = 'Application Helper for Interage'
|
16
|
+
spec.description = 'Classes to encapsulate helpers'
|
17
|
+
spec.homepage = CODE_URL
|
18
|
+
spec.licenses = ['MIT']
|
19
|
+
|
20
|
+
if spec.respond_to?(:metadata)
|
21
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
22
|
+
|
23
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
24
|
+
spec.metadata['source_code_uri'] = CODE_URL
|
25
|
+
spec.metadata['changelog_uri'] = CODE_URL
|
26
|
+
else
|
27
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
28
|
+
'public gem pushes.'
|
29
|
+
end
|
30
|
+
|
31
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
32
|
+
`git ls-files -z`.split("\x0").reject do |file|
|
33
|
+
file.match(%r{^(test|spec|features)/})
|
34
|
+
end
|
35
|
+
end
|
36
|
+
spec.bindir = 'exe'
|
37
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
38
|
+
spec.require_paths = ['lib']
|
39
|
+
|
40
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
41
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
42
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
43
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Interage
|
4
|
+
module Helper
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
source_root File.expand_path('templates', __dir__)
|
7
|
+
|
8
|
+
desc 'Generates a application helper.'
|
9
|
+
|
10
|
+
def create_application_helper
|
11
|
+
copy_file 'application_helper.rb', application_helper_path
|
12
|
+
copy_file 'application_helper.yml', application_locales_path
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def application_helper_path
|
18
|
+
Rails.root.join('app/helpers/application_helper.rb')
|
19
|
+
end
|
20
|
+
|
21
|
+
def application_locales_path
|
22
|
+
Rails.root.join('config/locales/pt-BR/application_helper.yml')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
pt-BR:
|
2
|
+
boolean:
|
3
|
+
truly: 'Sim'
|
4
|
+
falsely: 'Não'
|
5
|
+
|
6
|
+
menu:
|
7
|
+
default:
|
8
|
+
index: Listar
|
9
|
+
create: Criar
|
10
|
+
update: Editar
|
11
|
+
show: Mostrar
|
12
|
+
destroy: Apagar
|
13
|
+
|
14
|
+
links:
|
15
|
+
new: Adicionar %{model}
|
16
|
+
show: Ver
|
17
|
+
edit: Editar
|
18
|
+
destroy: Apagar
|
19
|
+
cancel: Cancelar
|
20
|
+
duplicate: Duplicar
|
21
|
+
back: Voltar
|
22
|
+
|
23
|
+
icons:
|
24
|
+
new: plus
|
25
|
+
show: eye
|
26
|
+
edit: pencil
|
27
|
+
destroy: trash
|
28
|
+
cancel: ban
|
29
|
+
duplicate: files-o
|
30
|
+
back: arrow-left
|
31
|
+
|
32
|
+
buttons:
|
33
|
+
cocoon:
|
34
|
+
add:
|
35
|
+
icon: plus
|
36
|
+
text: adicionar
|
37
|
+
remove:
|
38
|
+
icon: times
|
39
|
+
text: excluir
|
40
|
+
|
41
|
+
icons_alias:
|
42
|
+
arrow-down: arrow_downward
|
43
|
+
arrow-left: arrow_back
|
44
|
+
arrow-right: arrow_forward
|
45
|
+
arrow-up: arrow_upward
|
46
|
+
arrows-h: compare_arrows
|
47
|
+
ban: cancel
|
48
|
+
bars: menu
|
49
|
+
bell: notifications
|
50
|
+
calendar: today
|
51
|
+
calendar-o: today
|
52
|
+
calendar-check-o: event_available
|
53
|
+
calendar-times-o: event_busy
|
54
|
+
calendar-minus-o: date_range
|
55
|
+
camera: camera_enhance
|
56
|
+
check: done
|
57
|
+
check-square: check_box
|
58
|
+
minus-square: indeterminate_check_box
|
59
|
+
chevron-down: expand_more
|
60
|
+
chevron-right: chevron_right
|
61
|
+
chevron-up: expand_less
|
62
|
+
chevron-left: chevron_left
|
63
|
+
cog: settings
|
64
|
+
cogs: settings
|
65
|
+
comment: mode_comment
|
66
|
+
comments: question_answer
|
67
|
+
dollar: attach_money
|
68
|
+
envelope: email
|
69
|
+
eye: visibility
|
70
|
+
hdd-o: save_alt
|
71
|
+
paperclip: attachment
|
72
|
+
files-o: file_copy
|
73
|
+
file-pdf-o: picture_as_pdf
|
74
|
+
list-alt: reorder
|
75
|
+
money: local_atm
|
76
|
+
pencil: edit
|
77
|
+
pencil-square: rate_review
|
78
|
+
pencil-square-o: edit_location
|
79
|
+
picture-o: insert_photo
|
80
|
+
plus: add
|
81
|
+
plus-circle: add_circle
|
82
|
+
plus-square: add_circle_outline
|
83
|
+
key: vpn_key
|
84
|
+
search: search
|
85
|
+
sign-in: exit_to_app
|
86
|
+
sign-out: power_settings_new
|
87
|
+
square-o: crop_square
|
88
|
+
ticket: local_activity
|
89
|
+
times: clear
|
90
|
+
trash: delete_sweep
|
91
|
+
trash-o: delete_sweep
|
92
|
+
upload: cloud_upload
|
93
|
+
user: person
|
94
|
+
user-plus: person_add
|
95
|
+
users: people
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Interage
|
4
|
+
module ApplicationHelper
|
5
|
+
include ::Interage::ApplicationIconHelper
|
6
|
+
include ::Interage::BootstrapHelper
|
7
|
+
include ::Interage::CEPHelper
|
8
|
+
include ::Interage::CocoonHelper
|
9
|
+
include ::Interage::ControllerActiveHelper
|
10
|
+
include ::Interage::CPFCNPJHelper
|
11
|
+
include ::Interage::DateTimeHelper
|
12
|
+
include ::Interage::FaviconHelper
|
13
|
+
include ::Interage::FlashMessageHelper
|
14
|
+
include ::Interage::FontAwesomeHelper
|
15
|
+
include ::Interage::GravatarHelper
|
16
|
+
include ::Interage::LinkToHelper
|
17
|
+
include ::Interage::MaterialDesignIconsHelper
|
18
|
+
include ::Interage::NumberHelper
|
19
|
+
include ::Interage::PaginationHelper
|
20
|
+
include ::Interage::PhoneHelper
|
21
|
+
include ::Interage::TextHelper
|
22
|
+
include ::Interage::TranslationHelper
|
23
|
+
include ::Interage::VersionHelper
|
24
|
+
|
25
|
+
def format_seconds(seconds)
|
26
|
+
t('time.seconds.short', count: seconds)
|
27
|
+
end
|
28
|
+
|
29
|
+
def app_page_title(area = '')
|
30
|
+
"#{env_name_upcase}#{page_title}#{area}#{app_name}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def admin_page_title
|
34
|
+
app_page_title('Administração :: ')
|
35
|
+
end
|
36
|
+
|
37
|
+
def devise_page_title
|
38
|
+
app_page_title('Autenticação :: ')
|
39
|
+
end
|
40
|
+
|
41
|
+
def page_title
|
42
|
+
content_for?(:page_title) ? "#{content_for(:page_title)} » " : ''
|
43
|
+
end
|
44
|
+
|
45
|
+
def app_name
|
46
|
+
ENV.fetch('APP_NAME', Rails.application.class.module_parent_name)
|
47
|
+
end
|
48
|
+
|
49
|
+
def env_name_upcase
|
50
|
+
return if ENV['ENV_NAME'].blank?
|
51
|
+
|
52
|
+
"[#{ENV['ENV_NAME'].upcase}] "
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|