wakuwaku_module 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d6e22b62ec8eee9020960a18cdb069903411111
|
4
|
+
data.tar.gz: 6c2fc6dd6c3f677af07e80e386403cf02a8957bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14f2e73e82f66b7eaf4716d0d8d545a7213093dd737847caf3658250203c1b40b817f9123b8b02f97e5c61ff842681606bb8a91b0ce6b206e8c3266c53ad708f
|
7
|
+
data.tar.gz: e2a5ca697aff3c10dafb8d0652c719f2e66c04b61f16cbc548b8c89c85843e773f2997145324e44a1396413cc02b25e588d70be54d0b743014b0e9a60550e171
|
@@ -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
|
data/lib/wakuwaku_module.rb
CHANGED
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.
|
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:
|