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: "label-info", embargo: "label-warning", lease: "label-warning", open: "label-success", restricted: "label-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.
14 15 16 |
# File 'app/presenters/hyrax/permission_badge.rb', line 14 def initialize(visibility) @visibility = visibility end |
Instance Method Details
#render ⇒ Object
Draws a span tag with styles for a bootstrap label
19 20 21 |
# File 'app/presenters/hyrax/permission_badge.rb', line 19 def render content_tag(:span, text, class: "label #{dom_label_class}") end |