/
_group.html.eex
31 lines (30 loc) · 1.62 KB
/
_group.html.eex
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
30
31
<div id="group_<%= html_safe(@gate.for) %>" class="container fwf-I-hate-grids">
<div class="row no-gutters">
<div class="col-lg-8 col-md-7 col-sm-5 col-3 text-left">
<code><%= html_safe(@gate.for) %></code>
</div>
<div class="col-lg-2 col-md-2 col-sm-3 col-3 text-left">
<%= html_status_for @gate.enabled %>
</div>
<div class="col-lg-1 col-md-2 col-sm-2 col-3 text-right">
<form action="<%= path(@conn, "/flags/#{url_safe(@flag.name)}/groups/#{url_safe(@gate.for)}") %>" method="post" class="fwf-inline-toggle">
<input type="hidden" name="_method" value="PATCH">
<input type="hidden" name="_csrf_token" value="<%= @conn.assigns[:csrf_token] %>">
<%= if @gate.enabled do %>
<input type="hidden" name="enabled" value="false">
<button type="submit" class="btn btn-sm btn-outline-danger">Disable</button>
<% else %>
<input type="hidden" name="enabled" value="true">
<button type="submit" class="btn btn-sm btn-outline-success">Enable</button>
<% end %>
</form>
</div>
<div class="col-lg-1 col-md-1 col-sm-2 col-3 text-right">
<form action="<%= path(@conn, "/flags/#{url_safe(@flag.name)}/groups/#{url_safe(@gate.for)}") %>" method="post" class="fwf-inline-toggle">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_csrf_token" value="<%= @conn.assigns[:csrf_token] %>">
<button type="submit" class="btn btn-sm btn-secondary" data-confirm="Are you sure you want to clear group '<%= html_safe(@gate.for) %>'?">Clear</button>
</form>
</div>
</div>
</div>