<commit_before><% content_for :toolbar do %>
  <%= render 'toolbar' %>
<% end %>

<h2><%= @group.display_name %> (<%= @group.privacy %>)</h2>
<p class='lead'><%= @group.tagline %></p>
<p><%= @group.about %></p>

<% if @group.member?(current_user) %>
  <%= link_to(t('.leave'), @membership, method: :delete, class: 'btn btn-danger', title: "#{t('.tooltip.leave', display_name: current_user.display_name, group_name: @group.display_name)}", data: { confirm: "#{t('.confirm')}" }) %>
<% else %>
  <%= simple_form_for(current_user.memberships.build(group_id: @group.id)) do |f| %>
    <%= f.input :group_id,  as: :hidden %>
    <%= f.button :submit, t('.join'), class: 'btn btn-primary' %>
  <% end %>
<% end %>

<h2>Members</h2>
<div class='row'>
  <% @group.memberships.each do |membership| %>
    <!-- TODO: The owner should be able to remove members -->
    <%= render partial: 'socializer/people/mini_card', object: membership.member, as: :person %>
  <% end %>
</div>

<% if @group.privacy.private? %>
  <h2>Invite members</h2><commit_msg>added an edit button for the group<commit_after><% content_for :toolbar do %>
  <%= render 'toolbar' %>
<% end %>

<h2>
  <div class="pull-right">
    <%= link_to(t('.edit'), edit_group_path(@group), class: 'btn btn-primary') if current_user?(@group.author) %>
  </div>
  <%= @group.display_name %> (<%= @group.privacy %>)
</h2>
<p class='lead'><%= @group.tagline %></p>
<p><%= @group.about %></p>
<hr>

<% if @group.member?(current_user) %>
  <%= link_to(t('.leave'), @membership, method: :delete, class: 'btn btn-danger', title: "#{t('.tooltip.leave', display_name: current_user.display_name, group_name: @group.display_name)}", data: { confirm: "#{t('.confirm')}" }) %>
<% else %>
  <%= simple_form_for(current_user.memberships.build(group_id: @group.id)) do |f| %>
    <%= f.input :group_id,  as: :hidden %>
    <%= f.button :submit, t('.join'), class: 'btn btn-primary' %>
  <% end %>
<% end %>

<h2>Members</h2>
<div class='row'>
  <% @group.memberships.each do |membership| %>
    <!-- TODO: The owner should be able to remove members -->
    <%= render partial: 'socializer/people/mini_card', object: membership.member, as: :person %>
  <% end %>
</div>

<% if @group.privacy.private? %>
  <h2>Invite members</h2>
{'fraction_non_alphanumeric': 0.23916887709991158, 'fraction_numerical': 0.005305039787798408, 'mean_word_length': 4.533007334963325, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '920149', 'n_tokens_mistral': 902, 'n_tokens_neox': 822, 'n_words': 178}