Class: Editor::Users::UserComponent
- Inherits:
-
CommonComponent
- Object
- CommonComponent
- Editor::Users::UserComponent
- Defined in:
- app/components/editor/users/user_component.rb
Instance Method Summary collapse
- #active_tag ⇒ Object
- #confirmed_tag ⇒ Object
-
#initialize(user:) ⇒ UserComponent
constructor
A new instance of UserComponent.
- #member_tag ⇒ Object
Constructor Details
#initialize(user:) ⇒ UserComponent
Returns a new instance of UserComponent.
4 5 6 7 |
# File 'app/components/editor/users/user_component.rb', line 4 def initialize(user:) super @user = user end |
Instance Method Details
#active_tag ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/components/editor/users/user_component.rb', line 17 def active_tag if @user.locked_at? tag.div icon_text("fas fa-lock", t(".lock")), class: "tag is-danger" else tag.div icon_text("fas fa-unlock", t(".unlock")), class: "tag is-success" end end |
#confirmed_tag ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/components/editor/users/user_component.rb', line 9 def confirmed_tag if @user.confirmed_at? tag.div icon_text("fas fa-user", t(".confirmed")), class: "tag is-success" else tag.div icon_text("fas fa-user", t(".unconfirmed")), class: "tag is-warning" end end |
#member_tag ⇒ Object
25 26 27 |
# File 'app/components/editor/users/user_component.rb', line 25 def member_tag tag.div icon_text("fas fa-users", "Member"), class: "tag is-success" if @user.member? end |