File: add_group.erb

package info (click to toggle)
ruby-flipper 0.26.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,288 kB
  • sloc: ruby: 16,377; sh: 61; javascript: 24; makefile: 14
file content (29 lines) | stat: -rw-r--r-- 1,054 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<% if params.key?("error") %>
  <div class="alert alert-danger">
    <%= params["error"] %>
  </div>
<% end %>

<div class="card">
  <h4 class="card-header">Enable Group for <%= @feature.key %></h4>
  <div class="card-body">
    <% if @feature.disabled_groups.empty? %>
      <p>All groups are enabled for this feature which means there is nothing to add.</p>
    <% else %>
      <p>
        Turn on this feature for an entire group of actors.
      </p>
      <form action="<%= script_name %>/features/<%= @feature.key %>/groups" method="post" class="form-inline">
        <%== csrf_input_tag %>
        <input type="hidden" name="operation" value="enable">
        <select name="value" class="form-control mr-2">
          <option value="">Select a group...</option>
          <% @feature.disabled_groups.each do |group| %>
            <option value="<%= group.name %>"><%= group.name %></option>
          <% end %>
        </select>
        <input type="submit" value="Add Group" class="btn btn-primary">
      </form>
    <% end %>
  </div>
</div>