gitcoinco/code_fund_ads

View on GitHub
app/views/organization_users/edit.html.erb

Summary

Maintainability
Test Coverage
<%= render(PageComponent.new(subject: @organization, tabs: TabsComponent.new(tabs: organization_tabs(@organization)))) do |component| %>
  <% component.with(:header) do %>
    <%= render(Page::HeaderComponent.new(title: "Edit Member", subtitle: "for #{@organization.name}", buttons: [
      layout_button(link: new_organization_user_path(@organization), icon: "fas fa-plus", title: "Add member", display: authorized_user.can_edit_organization_users?(@organization)),
      delete_button(link: organization_user_path(@organization, @organization_user), title: "Remove member", layout: true, display: authorized_user.can_edit_organization_users?(@organization))
    ])) %>
  <% end %>
  <% component.with(:body) do %>
    <%= render CardComponent.new do %>
      <%= render Card::HeaderComponent.new do %>
        <%= render(Card::TitleComponent.new) { @organization_user.user&.name } %>
        <%= render(Card::SubtitleComponent.new) { "Fill out the fields below" } %>
      <% end %>
      <%= render "/organization_users/forms/existing_user_form",
            organization: @organization,
            organization_user: @organization_user,
            url: organization_user_path(@organization, @organization_user) %>
    <% end %>
  <% end %>
<% end %>