unclesp1d3r/CipherSwarm

View on GitHub
app/views/projects/show.html.erb

Summary

Maintainability
Test Coverage
<%= render Railsboot::HeaderComponent.new do |header| %>
  <% header.with_heading do %>
    <%= title @project.name %>
  <% end %>
  <%= header.with_actions do %>
    <% if can? :edit, Attack %>
      <%= render Railsboot::Button::LinkComponent.new(href: edit_project_path(@project), size: "sm") do %>
        <%= icon("pencil") %>
      <% end %>
    <% end %>
  <% end %>
  <% header.with_breadcrumb.with_items([
       { text: "Dashboard", href: root_path },
       { text: "Admin", href: admin_index_path },
       { text: @project.name, href: @campaign, active: true }
     ]) %>
<% end %>

<%= show_for @project do |s| %>
  <%= s.attribute :description %>
  <%= s.association :users %>
  <%= s.association :agents %>
  <%= s.association :campaigns %>
  <%= s.association :hash_lists %>
<% end %>

<div class="btn-group" role="group">
  <%= link_to "Edit", edit_project_path(@project), class: "btn btn-warning" if can? :update, @project %>
  <%= link_to "Back", admin_index_path, class: "btn btn-outline-secondary" if can? :view, :admin_dashboard %>
</div>