Class: Decidim::Posts::PostHostCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::Posts::PostHostCell
show all
- Includes:
- ActiveModel::Conversion, Cell::ViewModel::Partial, PostCellsHelper
- Defined in:
- app/cells/decidim/posts/post_host_cell.rb
Instance Method Summary
collapse
#component_settings, #current_component, #current_settings, #participatory_space
#category_label, #category_label_singular, #posts_component_for_meeting
Instance Method Details
#official_post ⇒ Object
67
68
69
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 67
def official_post
participatory_space.admins.exists?(id: post.author.id)
end
|
#post ⇒ Object
16
17
18
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 16
def post
model
end
|
#post_body ⇒ Object
20
21
22
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 20
def post_body
translated_attribute model.body
end
|
#post_category ⇒ Object
24
25
26
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 24
def post_category
model.category
end
|
63
64
65
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 63
def
model.
end
|
#post_highlighted ⇒ Object
59
60
61
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 59
def post_highlighted
model.highlighted
end
|
#post_status ⇒ Object
post status / for host post 0 default 1 bearbeitung 2 erledigt
33
34
35
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 33
def post_status
model.status
end
|
#post_status_text ⇒ Object
50
51
52
53
54
55
56
57
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 50
def post_status_text
case post_status
when 1
I18n.t('decidim.posts.posts.host.status.processing')
when 2
I18n.t('decidim.posts.posts.host.status.done')
end
end
|
#show ⇒ Object
12
13
14
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 12
def show
render :show
end
|
#status_class ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'app/cells/decidim/posts/post_host_cell.rb', line 37
def status_class
case post_status
when 0
nil
when 1
'warning'
when 2
'success'
else
nil
end
end
|