Class: Hyrax::PermissionBadge
- Inherits:
-
Object
- Object
- Hyrax::PermissionBadge
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- app/presenters/hyrax/permission_badge.rb
Constant Summary collapse
- VISIBILITY_LABEL_CLASS =
{ authenticated: "badge-info", embargo: "badge-warning", lease: "badge-warning", open: "badge-success", restricted: "badge-danger" }.freeze
Instance Method Summary collapse
-
#initialize(visibility) ⇒ PermissionBadge
constructor
A new instance of PermissionBadge.
-
#render ⇒ Object
Draws a span tag with styles for a bootstrap label.
Constructor Details
#initialize(visibility) ⇒ PermissionBadge
Returns a new instance of PermissionBadge.
15 16 17 |
# File 'app/presenters/hyrax/permission_badge.rb', line 15 def initialize(visibility) @visibility = visibility end |
Instance Method Details
#render ⇒ Object
Draws a span tag with styles for a bootstrap label
20 21 22 |
# File 'app/presenters/hyrax/permission_badge.rb', line 20 def render tag.span(text, class: "badge #{dom_label_class}") end |