schneidmaster/gitreports.com

View on GitHub
app/views/repositories/_repository.html.erb

Summary

Maintainability
Test Coverage
<tr>
  <td>
    <%= link_to repo.name, repository_path(repo) %>
  </td>
  <td>
    <%= link_to "Edit", edit_repository_path(repo) %>
  </td>
  <td>
    <% if repo.is_active %>
      Active
    <% else %>
      Inactive
    <% end %>
  </td>
  <td>
    <% if repo.is_active %>
      <%= link_to "Deactivate", repository_path(repo, repository: { is_active: false }), method: :patch, data: { confirm: "Are you sure you want to deactivate repository '" + repo.name + "'?" } %>
    <% else %>
      <%= link_to "Activate", repository_path(repo, repository: { is_active: true }), method: :patch, data: { confirm: "Are you sure you want to activate repository '" + repo.name + "'?" } %>
    <% end %>
  </td>
  <td>
    <% if repo.is_active %>
      <%= link_to "View", repository_public_path(@current_user.username, repo.name) %>
    <% else %>
      -
    <% end %>
  </td>
</tr>