Files
growstuff/app/views/admin/features/index.html.haml
T
Brenda Wallace 85b5ff9ecd Add feature flags, with job ideas as the first
Admins switch features on and off at /admin/features, kept in Flipper.
Job ideas (the page, the banners and the overlay) only show while its
flag is on. Features are off until switched on.

Closes #5050
2026-10-24 18:01:56 +13:00

32 lines
1000 B
Plaintext

- content_for :title, t('.title')
- content_for :breadcrumbs do
%li.breadcrumb-item= link_to 'Admin', admin_path
%li.breadcrumb-item.active= link_to t('.title'), admin_features_path
%p= t('.intro')
%table.table.table-striped
%thead
%tr
%th= t('.feature')
%th= t('.state')
%th
%tbody
- @features.each do |feature|
%tr{ id: "feature-#{feature.name}" }
%td
%strong= t("admin.features.names.#{feature.name}")
%br
%span.text-muted= t("admin.features.descriptions.#{feature.name}")
%td
- if feature.enabled?
%span.badge.bg-success= t('.on')
- else
%span.badge.bg-secondary= t('.off')
%td
- on = feature.enabled?
= button_to t(on ? '.switch_off' : '.switch_on'), admin_feature_path(feature),
method: :patch, params: { enabled: !on },
class: ['btn btn-sm', on ? 'btn-outline-secondary' : 'btn-primary']