|
1 | 1 | <%# locals: (form:) %> |
2 | 2 |
|
3 | | -<div class="field px-4 flex items-center"> |
| 3 | +<div class="field px-4 gap-2 flex items-center"> |
4 | 4 | <%= form.label :role, "Role" %> |
5 | 5 | <%= form.select :role, |
6 | 6 | OrganizerPositionInvite.roles.keys.map { |role| [role.titleize, role] }, |
7 | 7 | {}, |
8 | 8 | "x-model": "role" %> |
| 9 | + <div data-controller="menu" data-menu-placement-value="bottom-start"> |
| 10 | + <button |
| 11 | + type="button" |
| 12 | + class="pop menu__toggle menu__toggle--arrowless overflow-visible" |
| 13 | + data-menu-target="toggle" data-action="menu#toggle click@document->menu#close keydown@document->menu#keydown"> |
| 14 | + <%= inline_icon "question-mark", size: 14 %> |
| 15 | + </button> |
| 16 | + <div class="menu__content menu__content--2 menu__content--compact h5 p-0" data-menu-target="content"> |
| 17 | + <p class="muted mb1"><span class="bold info">Managers</span> can do everything |
| 18 | + in the organization.</p> |
| 19 | + <div class="muted mb1"> |
| 20 | + <p class="m0"><span class="bold info">Members</span> can:</p> |
| 21 | + <ul class="m0"> |
| 22 | + <li>Create & use cards (with a limit if spending controls are enabled) |
| 23 | + </li> |
| 24 | + <li>Not transfer money</li> |
| 25 | + <li>Not change the organization's settings</li> |
| 26 | + </ul> |
| 27 | + </div> |
| 28 | + <p class="muted mb1"><span class="bold info">Readers</span> have read-only access to the organization.</p> |
| 29 | + </div> |
| 30 | + </div> |
9 | 31 | </div> |
10 | 32 |
|
11 | | -<p class="muted mb1"><span class="bold info">Managers</span> can do everything |
12 | | - in the organization.</p> |
13 | | - |
14 | | -<div class="muted mb1"> |
15 | | - <p class="m0"><span class="bold info">Members</span> can:</p> |
16 | | - <ul class="m0"> |
17 | | - <li>Create & use cards (with a limit if spending controls are enabled) |
18 | | - </li> |
19 | | - <li>Not transfer money</li> |
20 | | - <li>Not change the organization's settings</li> |
21 | | - </ul> |
22 | | -</div> |
23 | | - |
24 | | -<p class="muted mb1"><span class="bold info">Readers</span> have read-only access to the organization.</p> |
25 | | - |
26 | | -<div x-show="role === 'member'" x-cloak x-transition.duration.500ms class="my-4"> |
27 | | - <%= form.label :enable_controls, class: "mb1 inline-flex flex-col" do %> |
28 | | - Enable spending controls? |
29 | | - <span class="muted h6">You can always enable & configure spending controls after, too.</span> |
30 | | - <% end %> |
31 | | - |
32 | | - <div class="field field--options"> |
33 | | - <%= form.radio_button :enable_controls, false, "x-model": "spendingControls" %> |
34 | | - <%= form.label :enable_controls, value: false do %> |
35 | | - <strong>No</strong> |
36 | | - <% end %> |
37 | | - |
38 | | - <%= form.radio_button :enable_controls, true, "x-model": "spendingControls" %> |
39 | | - <%= form.label :enable_controls, value: true do %> |
40 | | - <strong>Yes</strong> |
41 | | - <% end %> |
| 33 | +<div data-controller="accordion" class="border-t px-4 pb-2"> |
| 34 | + <div class="flex items-center gap-4 field field--checkbox"> |
| 35 | + <label class="flex flex-col"> |
| 36 | + <span>Spending controls</span> |
| 37 | + <span class="muted h6">Changes can be made later</span> |
| 38 | + </label> |
| 39 | + <div class="field--checkbox--switch ml-auto" style="flex-shrink:0"> |
| 40 | + <%= form.label :enable_controls do %> |
| 41 | + <%= form.check_box :enable_controls, { data: { action: "change->accordion#toggle", accordion_target: "checkbox" } }, true, false %> |
| 42 | + <span class="slider"></span> |
| 43 | + <% end %> |
| 44 | + </div> |
42 | 45 | </div> |
43 | 46 |
|
44 | | - <div x-show="spendingControls === 'true'" x-cloak x-transition.duration.500ms class="mb1"> |
| 47 | + <div data-accordion-target="content" class="flex items-center gap-4 justify-between"> |
45 | 48 | <%= form.label :initial_control_allowance_amount, value: "Initial allowance amount" %> |
46 | | - <%= form.number_field :initial_control_allowance_amount, placeholder: "500.00", step: 0.01, min: 0.00, data: { controller: "truncate-decimal", action: "truncate-decimal#truncate blur->truncate-decimal#pad" } %> |
| 49 | + <%= form.number_field :initial_control_allowance_amount, placeholder: "500.00", step: 0.01, min: 0.00, style: "max-width:100px!important;text-align:right", data: { controller: "truncate-decimal", action: "truncate-decimal#truncate blur->truncate-decimal#pad" } %> |
47 | 50 | </div> |
48 | 51 | </div> |
0 commit comments