|
38 | 38 | </div> |
39 | 39 | </section> |
40 | 40 |
|
| 41 | +<section class="content"> |
| 42 | + <div class="container-fluid"> |
| 43 | + <div class="row"> |
| 44 | + <div class="col-12"> |
| 45 | + <!-- Default box --> |
| 46 | + <div class="card card-primary card-outline"> |
| 47 | + <div class="card-header"> |
| 48 | + <h2 class="card-title mr-2">Items requestable by this partner group</h2> |
| 49 | + <%= modal_button_to("#addItemModal", {text: "Add Item to group", size: "xs"}) if can_administrate? %> |
| 50 | + </div> |
| 51 | + <div class="card-body p-0"> |
| 52 | + <div class="tab-content" id="custom-tabs-three-tabContent"> |
| 53 | + <table class="table"> |
| 54 | + <thead> |
| 55 | + <tr> |
| 56 | + <th>Item name</th> |
| 57 | + <th>Base item name</th> |
| 58 | + <th></th> |
| 59 | + </thead> |
| 60 | + <tbody> |
| 61 | + <% @partner_group.partner_group_items.each do |partner_group_item| %> |
| 62 | + <% item = partner_group_item.item %> |
| 63 | + <tr> |
| 64 | + <td><%= item.name %></td> |
| 65 | + <td><%= item.base_item.name %></td> |
| 66 | + <td><%= delete_button_to( |
| 67 | + partner_group_item_path(partner_group_id: @partner_group.id, id: partner_group_item.id), |
| 68 | + {confirm: confirm_delete_msg("#{item.name} from this group")} |
| 69 | + ) %> |
| 70 | + </td> |
| 71 | + </tr> |
| 72 | + <% end %> |
| 73 | + </table> |
| 74 | + </div><!-- /.box-body.table-responsive --> |
| 75 | + </div> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + </div> |
| 80 | + <div id="addItemModal" class="modal fade"> |
| 81 | + <div class="modal-dialog"> |
| 82 | + <!-- Modal content--> |
| 83 | + <div class="modal-content"> |
| 84 | + <div class="modal-header"> |
| 85 | + <h4 class="modal-title">Add an item to <%= @partner_group.name %></h4> |
| 86 | + </div><!-- modal-header --> |
| 87 | + <div class="modal-body"> |
| 88 | + <div class="box-body"> |
| 89 | + <p> |
| 90 | + This item can be requested by members of this group. |
| 91 | + </p> |
| 92 | + <br/> |
| 93 | + <%= form_tag partner_group_items_path(@partner_group.id) do %> |
| 94 | + |
| 95 | + <%= label_tag 'Item: ' %> |
| 96 | + <%= select_tag :item_id, |
| 97 | + options_from_collection_for_select(@items_not_in_group, :id, :name) |
| 98 | + %> |
| 99 | + <br> |
| 100 | + <%= submit_button({text: "Add Item", icon: "plus"}) %> |
| 101 | + <% end # form %> |
| 102 | + </div><!-- box-body --> |
| 103 | + </div><!-- modal-body --> |
| 104 | + </div><!-- modal-content --> |
| 105 | + </div><!-- modal-dialog --> |
| 106 | + </div><!-- addItemModal--> |
| 107 | +</section> |
| 108 | +
|
41 | 109 | <section class="content"> |
42 | 110 | <div class="container-fluid"> |
43 | 111 | <div class="row"> |
|
0 commit comments