Class: Decidim::AuthorCell
Overview
This cell renders the author of a resource. It is intended to be used
below resource titles to indicate its authorship & such, and is intended
for resources that have a single author.
Constant Summary
collapse
- LAYOUTS =
[:default, :compact, :avatar].freeze
Instance Method Summary
collapse
#follow_button_for
#conversation_between, #conversation_between_multiple, #conversation_label_for, #conversation_name_for, #current_or_new_conversation_path_with, #current_or_new_conversation_path_with_multiple, #current_or_new_profile_conversation_path, #current_or_new_user_conversation_path, #link_to_current_or_new_conversation_with, #text_link_to_current_or_new_conversation_with, #username_list
#current_component, #flaggable?, #from_context, #index_action?, #show_action?, #user_flaggable?, #withdrawable?
Instance Method Details
#author_name ⇒ Object
22
23
24
|
# File 'app/cells/decidim/author_cell.rb', line 22
def author_name
options[:author_name_text] || model.name
end
|
#context_actions_options ⇒ Object
38
39
40
41
42
43
|
# File 'app/cells/decidim/author_cell.rb', line 38
def context_actions_options
return unless options.has_key?(:context_actions)
return [] if options[:context_actions].blank?
@context_actions_options ||= options[:context_actions].map(&:to_sym)
end
|
#display_name ⇒ Object
26
27
28
|
# File 'app/cells/decidim/author_cell.rb', line 26
def display_name
model.deleted? ? t("decidim.profile.deleted") : decidim_sanitize(author_name)
end
|
#flag_user ⇒ Object
30
31
32
|
# File 'app/cells/decidim/author_cell.rb', line 30
def flag_user
render unless current_user == model
end
|
#raw_model ⇒ Object
34
35
36
|
# File 'app/cells/decidim/author_cell.rb', line 34
def raw_model
model.try(:__getobj__) || model
end
|