parent
e6ebfd7279
commit
96fcbca95e
@ -0,0 +1,16 @@ |
||||
module Components |
||||
## |
||||
# A language switch and text area for updating a localized text setting. |
||||
class OnOffStatusCell < ::RailsCell |
||||
options :on_text |
||||
options :on_description |
||||
options :off_text |
||||
options :off_description |
||||
|
||||
options :is_on |
||||
|
||||
def enabled? |
||||
!!model[:is_on] |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,19 @@ |
||||
<%# The javscript for this cell is included in `settings.js.erb`. %> |
||||
|
||||
<div class="on-off-status-cell"> |
||||
<% if enabled? %> |
||||
<span class="mobile-otp--2fa-status -enabled"> |
||||
<%= op_icon 'icon-yes' %> |
||||
<%= model[:on_text] %> |
||||
</span> |
||||
<p> |
||||
<%= model[:on_description] %> |
||||
</p> |
||||
<% else %> |
||||
<span class="mobile-otp--2fa-status -disabled"> |
||||
<%= op_icon 'icon-not-supported' %> |
||||
<%= model[:off_text] %> |
||||
</span> |
||||
<p><%= model[:off_description] %></p> |
||||
<% end %> |
||||
</div> |
Loading…
Reference in new issue