18F/micropurchase

View on GitHub
app/views/insights/index.html.erb

Summary

Maintainability
Test Coverage
<% content_for :data_tags do %>
  <meta name="twitter:label1" value="Active Auctions">
  <meta name="twitter:data1" value="<%= @view_model.active_count %>">
  <meta name="twitter:label2" value="Coming Auctions">
  <meta name="twitter:data2" value="<%= @view_model.upcoming_count %>">
<% end %>

<section class="slab-intro usa-grid">
  <h1>Insights</h1>
  <div class="hero-metrics-wrapper">
    <% @view_model.hero_metrics.each do |metric| %>
      <%= render partial: 'hero_metric',
        locals: {
        href: "##{metric.href}",
        statistic: metric.statistic,
        label: metric.label,
        label_statistic: metric.label_statistic
      } %>
    <% end %>
  </div>
</section>

<section class="usa-grid">
  <div>
    <h1>Projects</h1>
    <h2 class="h4">Where can you get involved?</h2>
    <div class="usa-width-one-half skills">
      <table class="striped-table">
        <thead>
          <tr>
            <th>Skill</th>
            <th>Total Auctions</th>
            <th>Total Successful</th>
          </tr>
        </thead>
        <tbody>
          <% @view_model.sorted_skills_count.each do |skill| %>
            <tr>
              <td><%= skill.name %></td>
              <td><%= skill.evaluated_auction_count %></td>
              <td><%= skill.accepted_auction_count %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
    </div>
    <div class="usa-width-one-half" id="donut-by-repo"></div>
  </div>
</section>
<section class="usa-grid" id="chart-donuts">
  <div>
  <p>All micro-purchase auctions are for open source code contributions to
  public code repositories (repos) hosted on GitHub. Auction winners submit
  code to a repository for review, and if the code passes the acceptance
  criteria, the owner of the repository will accept the code into the
  repository. On the left, you can see a breakdown of the various repos that
  have incorporated code from micro-purchase auction winners. On the right,
  you can see what programming languages have been used in micro-purchase
  solutions. Move your mouse over a section to see the name of that
  category.</p>
</section>

<section class="usa-grid slab-intro" id="chart-winning-bid">
  <h1>Winning bid by date of auction</h1>
  <h2 class="h4">What bids are winning these days?</h2>
  <p class="winners-chart-directions">Only auctions with at least one bid are represented.</p>
  <div id="chart2"></div>
  <p>All micro-purchase reverse auctions start at $3,500 or less and vendors bid
  down the price they accept for completing the tasks presented. The graph
  above shows how the winning price for auctions have changed over time.
  Place your mouse over an auction to see exact bid numbers. Winning bids
  have ranged across the spectrum from $1 to near the $3,500 cap.</p>
</section>

<section class="usa-grid" id="chart-community">
  <h1>Community</h1>
  <h2 class="h4">The Micro-purchase platform is growing.</h2>
  <p class="winners-chart-directions">Use the subchart below to navigate past community figures</p>
  <div id="chart4"></div>
  <p>The micro-purchase platform has tapped into an interested community of
  both government product owners and open source contributors. As the 18F
  team ramps up capacity to host more auctions for more projects, we’re also
  seeing an increase in bidders. This is all positive evidence that there is
  an untapped marketplace for small, open source contributions to government
  projects. Drag and adjust the black box on the bottom bar to see a more
  detailed view of each date.</p>
</section>

<section class="slab-intro usa-grid" id="chart-bids-by-auction">
  <h1>Bids by auction</h1>
  <h2 class="h4">Are number of bids and winning bid related?</h2>
  <div id="chart5"></div>
  <p>Mouse over each circle to see how many bids that auction received and
  the price of the winning bid. As we explore this market, we’re excited to
  analyze trends in bidding volume, winning price, and auction type.</p>
</section>

<%= javascript_include_tag "insights-bundle" %>