wakuwaku_module 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: a837cca7d4537619f500f4aa05920baa1c804dc7
4
- data.tar.gz: 418e1b98196447ccc5433c460958e191eb8dd79e
3
+ metadata.gz: 4d6e22b62ec8eee9020960a18cdb069903411111
4
+ data.tar.gz: 6c2fc6dd6c3f677af07e80e386403cf02a8957bb
5
5
  SHA512:
6
- metadata.gz: 3d2ea8ccd651e8e423033bb0f7dd4969aec488ae265c8f274cb4249fb0222750c9e15f2406bf937d5449ff48970eae26d23b8263c0f87edd50a3a59c59d2336e
7
- data.tar.gz: 01d59d7fcec04ac119a325f23a9d54ce2ea28a5515c84fd2b6146823f15dbc0f7d1c842e532319fcd91cba7dd62b42986c2a4bf53fb5b327b0712e5134125544
6
+ metadata.gz: 14f2e73e82f66b7eaf4716d0d8d545a7213093dd737847caf3658250203c1b40b817f9123b8b02f97e5c61ff842681606bb8a91b0ce6b206e8c3266c53ad708f
7
+ data.tar.gz: e2a5ca697aff3c10dafb8d0652c719f2e66c04b61f16cbc548b8c89c85843e773f2997145324e44a1396413cc02b25e588d70be54d0b743014b0e9a60550e171
@@ -0,0 +1,3 @@
1
+ module PathNotifiacation
2
+
3
+ end
@@ -0,0 +1,48 @@
1
+ module PostStatus
2
+ def list_status(str)
3
+ case str
4
+ when 'approved' then { text: generate_status(str), klass: 'tag tag-green' }
5
+ when 'repost' then { text: generate_status(str), klass: 'tag tag-blue' }
6
+ when 'newpost' then { text: generate_status(str), klass: 'tag tag-blue' }
7
+ when 'rejected' then { text: generate_status(str), klass: 'tag tag-red' }
8
+ when 'published' then { text: generate_status(str), klass: 'tag tag-green' }
9
+ when 'reviewing' then { text: generate_status(str), klass: 'tag tag-yellow' }
10
+ when 'draft' then { text: generate_status(str), klass: 'tag tag-gray' }
11
+ when 'need_review' then { text: generate_status(str), klass: 'tag tag-yellow' }
12
+ when 'unvailable' then { text: generate_status(str), klass: 'tag tag-gray' }
13
+ when 'waiting' then { text: generate_status(str), klass: 'tag tag-red' }
14
+ end
15
+ end
16
+
17
+ def status_view_editor(post)
18
+ status = post.status
19
+ status = 'newpost' if status == 'reviewing' && post.count_submit <= 1
20
+ status = 'repost' if status == 'reviewing' && post.count_submit > 1
21
+ status = 'unvailable' if status.nil?
22
+ generate_span_status(status)
23
+ end
24
+
25
+ def status_view_translator(status)
26
+ status = 'waiting' if status.nil?
27
+ generate_span_status(status)
28
+ end
29
+
30
+ def status_view_writer(post)
31
+ status = post.status
32
+ status = 'approved' if status == 'need_review'
33
+ generate_span_status(status)
34
+ end
35
+
36
+ private
37
+
38
+ def generate_span_status(status)
39
+ text = list_status(status).fetch(:text)
40
+ klass = list_status(status).fetch(:klass)
41
+
42
+ content_tag(:span, text, class: klass)
43
+ end
44
+
45
+ def generate_status(str)
46
+ I18n.t(".post_status.status.#{str}")
47
+ end
48
+ end
@@ -1,3 +1,3 @@
1
1
  module WakuwakuModule
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -2,5 +2,7 @@ require "wakuwaku_module/version"
2
2
 
3
3
  module WakuwakuModule
4
4
  class Error < StandardError; end
5
- # Your code goes here...
5
+
6
+ class Engine < ::Rails::Engine
7
+ end
6
8
  end
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wakuwaku_module
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - nguyenthanhcong101096
@@ -54,7 +54,11 @@ files:
54
54
  - bin/console
55
55
  - bin/setup
56
56
  - lib/wakuwaku_module.rb
57
+ - lib/wakuwaku_module/path_notification.rb
58
+ - lib/wakuwaku_module/post_status.rb
57
59
  - lib/wakuwaku_module/version.rb
60
+ - wakuwaku_module-0.1.0.gem
61
+ - wakuwaku_module-0.1.1.gem
58
62
  - wakuwaku_module.gemspec
59
63
  homepage: https://github.com/google/google-auth-library-ruby
60
64
  licenses: