<commit_before><script>
  window.app.setCurrentAnalyticsProduct(<%= ProductAnalyticsSerializer.new(@product, scope: (current_user || {})).to_json.html_safe %>);
</script>

<%= render 'shared/navbar' %>

<div class="page">
  <div class="container">

    <div class="row">

      <div class="col-md-2 fixed-enabler">

        <a href="#" class="btn btn-success btn-sm btn-block" style="margin-bottom: 24px;" data-toggle="modal" data-target="#launch-modal">
          Ready to launch?
        </a>

        <div class="modal fade" id="launch-modal">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" ><i class="icon-close" style="top: 7px;"></i></span><span class="sr-only">Close</span></button>
                <h3 class="modal-title">Are you ready to launch?</h3>
              </div>
              <div class="modal-body">
                <p class="lead omega text-center">Whilst in stealth, you can really take your time to flesh it out before the community at-large sees it. Aim to leave a lasting impression so the communitycan start contributing.</p>
                <hr>

                <div class="row">
                  <div class="col-md-10 col-md-offset-1">
                    <p class="text-center"><strong>We recommend tackling the following before launching:</strong></p>

                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Complete the business plan so it answers any questions potential contributors may have.
                      </div>
                    </div>
                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Write an introductory journal entry to introduce <%= @product.name %> and yourself to the community.
                      </div>
                    </div>
                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Create bounties that contributors can immediately work on.
                      </div>
                    </div>
                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Create your first Project to provide focus for contributors.
                      </div>
                    </div>
                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Get feedback from friends. Share the URL and have them chime in.
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Not yet</button>
                <button type="button" class="btn btn-success">Launch <%= @product.name %></button>
              </div>
            </div><!-- /.modal-content -->
          </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->

        <% if @product.poster? %>
          <% if current_user && @product.core_team?(current_user) %>
            <%= form_for :asset, url: product_logos_path(@product), html: {id: 'product-logo-form'} do |f| %>
              <%= f.hidden_field :attachment_id %>
              <%= f.hidden_field :name %>
            <% end %>
            <div class="js-dropzone"
                data-target-form="#product-logo-form"
                data-react-class="DragAndDrop"
                data-react-props="<%= {
                  url: @product.poster_image.url,
                  alt: @product.name
                }.to_json %>">
            </div>
          <% else %>
            <span class="img-shadow" style="margin-bottom: 36px;">
              <%= image_tag @product.poster_image.url, class: 'img-rounded', width: '100%', alt: @product.name %>
            </span>
          <% end %>
        <% end %>

        <ul class="nav nav-stacked nav-sidebar">
          <li class="<%= nav_active_class(:about) %>">
            <a href="<%= product_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-eyeglasses dropdown-glyph"></i>
              Plan
            </a>
          </li>

          <li class="<%= nav_active_class(:chat) %>">
            <a href="<%= product_chat_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-bubbles dropdown-glyph"></i>
              Chat
            </a>
          </li>

          <% if can?(:update, @product) || @product.posts.any? %>
            <li class="<%= nav_active_class(:blog) %>">
              <a href="<%= product_posts_path(@product) %>">
                <div class="pull-right" style="white-space:nowrap">
                  <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                  <span class="sr-only">More info</span>
                </div>

                <i class="icon-notebook dropdown-glyph"></i>
                Journal
              </a>
            </li>
          <% end %>
        </ul>

        <h6 style="padding-left:10px">Work</h6>

        <ul class="nav nav-stacked nav-sidebar">

          <li class="<%= nav_active_class(:projects) %>">
            <a href="<%= product_milestones_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-folder dropdown-glyph"></i>
              Projects
            </a>
          </li>

          <li class="<%= nav_active_class(:bounties) %>">
            <a href="<%= product_wips_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-trophy dropdown-glyph"></i>
              Bounties
            </a>
          </li>

          <li class="<%= nav_active_class(:discussions) %>">
            <a href="<%= product_discussions_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-book-open dropdown-glyph"></i>
              Discussions
            </a>
          </li>

          <li class="<%= nav_active_class(:assets) %>">
            <a href="<%= product_assets_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-layers dropdown-glyph"></i>
              Assets
            </a>
          </li>
        </ul>

        <h6 style="padding-left:10px">People</h6>

        <ul class="nav nav-stacked nav-sidebar">

          <li class="<%= nav_active_class(:core_team) %>">
            <a href="<%= product_core_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <span class="icon-user-following dropdown-glyph"></span>
              Core Team
            </a>
          </li>

          <li class="<%= nav_active_class(:people) %>">
            <a href="<%= product_people_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <span class="icon icon-users dropdown-glyph"></span>
              Teams
            </a>

          </li>

          <li class="<%= nav_active_class(:ownership) %>">
            <a href="<%= product_partners_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-pie-chart dropdown-glyph"></i>
              Ownership
            </a>
          </li>
        </ul>

        <% if @product.revenue? %>
          <h6 style="padding-left:10px">Financials</h6>

          <ul class="nav nav-stacked nav-sidebar">

            <li class="<%= nav_active_class(:financials) %>">
              <a href="<%= product_financials_path(@product) %>">
                <i class="icon-wallet dropdown-glyph"></i>
                Money
              </a>
            </li>

            <!-- <li class="<%= nav_active_class(:contracts) %>">
              <a href="<%= product_contracts_path(@product) %>">
                <i class="icon-docs dropdown-glyph"></i>
                Contracts
              </a>
            </li> -->
          </ul>
        <% end %>

      </div>

      <div class="col-md-10">

        <ul class="list list-inline pull-right">
          <li>
            <a href="#" class="btn btn-primary btn-sm" style="vertical-align: bottom;">
              <i class="icon icon-share-alt" style="margin-right: 2px;"></i>
              Share
            </a>
          </li>
          <li>
            <div class="toggler toggler-sm">
              <% if signed_in? && @product.watching?(current_user) %>
                <a class="toggler-btn btn btn-default inactive" href="<%= unsubscribe_product_path(@product) %>" data-method="post">
                  <i class="icon icon-eye" style="margin-right: 2px;"></i>
                  Unwatch
                </a>
              <% else %>
                <a class="toggler-btn btn btn-primary" href="<%= subscribe_product_path(@product) %>" data-method="post">
                  <i class="icon icon-eye" style="margin-right: 2px;"></i>
                  Watch
                </a>
              <% end %>
                <a class="toggler-badge" href="<%= product_watchers_path(@product) %>">
                  <%= @product.watchers.count %>
                </a>
            </div>
          </li>
          <li style="padding-right: 0;">
            <div class="toggler toggler-sm">
              <div
                   data-react-class="JoinTeam"
                   data-react-props="<%= {
                     count: @product.team_memberships.active.count,
                     join_path: product_people_path(@product),
                     leave_path: (current_user && product_person_path(@product, current_user)),
                     is_member: @product.member?(current_user),<commit_msg>First pass at share button/popover<commit_after><script>
  window.app.setCurrentAnalyticsProduct(<%= ProductAnalyticsSerializer.new(@product, scope: (current_user || {})).to_json.html_safe %>);
</script>

<%= render 'shared/navbar' %>

<div class="page">
  <div class="container">

    <div class="row">

      <div class="col-md-2 fixed-enabler">

        <a href="#" class="btn btn-success btn-sm btn-block" style="margin-bottom: 24px;" data-toggle="modal" data-target="#launch-modal">
          Ready to launch?
        </a>

        <div class="modal fade" id="launch-modal">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" ><i class="icon-close" style="top: 7px;"></i></span><span class="sr-only">Close</span></button>
                <h3 class="modal-title">Are you ready to launch?</h3>
              </div>
              <div class="modal-body">
                <p class="lead omega text-center">Whilst in stealth, you can really take your time to flesh it out before the community at-large sees it. Aim to leave a lasting impression so the communitycan start contributing.</p>
                <hr>

                <div class="row">
                  <div class="col-md-10 col-md-offset-1">
                    <p class="text-center"><strong>We recommend tackling the following before launching:</strong></p>

                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Complete the business plan so it answers any questions potential contributors may have.
                      </div>
                    </div>
                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Write an introductory journal entry to introduce <%= @product.name %> and yourself to the community.
                      </div>
                    </div>
                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Create bounties that contributors can immediately work on.
                      </div>
                    </div>
                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Create your first Project to provide focus for contributors.
                      </div>
                    </div>
                    <div class="row" style="margin-bottom: 6px;">
                      <div class="col-md-1">
                        <i class="icon-check text-success"></i>
                      </div>
                      <div class="col-md-11 text-muted">
                        Get feedback from friends. Share the URL and have them chime in.
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Not yet</button>
                <button type="button" class="btn btn-success">Launch <%= @product.name %></button>
              </div>
            </div><!-- /.modal-content -->
          </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->

        <% if @product.poster? %>
          <% if current_user && @product.core_team?(current_user) %>
            <%= form_for :asset, url: product_logos_path(@product), html: {id: 'product-logo-form'} do |f| %>
              <%= f.hidden_field :attachment_id %>
              <%= f.hidden_field :name %>
            <% end %>
            <div class="js-dropzone"
                data-target-form="#product-logo-form"
                data-react-class="DragAndDrop"
                data-react-props="<%= {
                  url: @product.poster_image.url,
                  alt: @product.name
                }.to_json %>">
            </div>
          <% else %>
            <span class="img-shadow" style="margin-bottom: 36px;">
              <%= image_tag @product.poster_image.url, class: 'img-rounded', width: '100%', alt: @product.name %>
            </span>
          <% end %>
        <% end %>

        <ul class="nav nav-stacked nav-sidebar">
          <li class="<%= nav_active_class(:about) %>">
            <a href="<%= product_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-eyeglasses dropdown-glyph"></i>
              Plan
            </a>
          </li>

          <li class="<%= nav_active_class(:chat) %>">
            <a href="<%= product_chat_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-bubbles dropdown-glyph"></i>
              Chat
            </a>
          </li>

          <% if can?(:update, @product) || @product.posts.any? %>
            <li class="<%= nav_active_class(:blog) %>">
              <a href="<%= product_posts_path(@product) %>">
                <div class="pull-right" style="white-space:nowrap">
                  <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                  <span class="sr-only">More info</span>
                </div>

                <i class="icon-notebook dropdown-glyph"></i>
                Journal
              </a>
            </li>
          <% end %>
        </ul>

        <h6 style="padding-left:10px">Work</h6>

        <ul class="nav nav-stacked nav-sidebar">

          <li class="<%= nav_active_class(:projects) %>">
            <a href="<%= product_milestones_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-folder dropdown-glyph"></i>
              Projects
            </a>
          </li>

          <li class="<%= nav_active_class(:bounties) %>">
            <a href="<%= product_wips_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-trophy dropdown-glyph"></i>
              Bounties
            </a>
          </li>

          <li class="<%= nav_active_class(:discussions) %>">
            <a href="<%= product_discussions_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-book-open dropdown-glyph"></i>
              Discussions
            </a>
          </li>

          <li class="<%= nav_active_class(:assets) %>">
            <a href="<%= product_assets_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-layers dropdown-glyph"></i>
              Assets
            </a>
          </li>
        </ul>

        <h6 style="padding-left:10px">People</h6>

        <ul class="nav nav-stacked nav-sidebar">

          <li class="<%= nav_active_class(:core_team) %>">
            <a href="<%= product_core_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <span class="icon-user-following dropdown-glyph"></span>
              Core Team
            </a>
          </li>

          <li class="<%= nav_active_class(:people) %>">
            <a href="<%= product_people_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <span class="icon icon-users dropdown-glyph"></span>
              Teams
            </a>

          </li>

          <li class="<%= nav_active_class(:ownership) %>">
            <a href="<%= product_partners_path(@product) %>">
              <div class="pull-right" style="white-space:nowrap">
                <span class="icon icon-info text-light link-hover-primary" data-container="body" data-toggle="popover" data-placement="right" data-trigger="hover" data-content="From elevator pitch to monetization strategies, the Plan should answer questions about your business."></span>
                <span class="sr-only">More info</span>
              </div>

              <i class="icon-pie-chart dropdown-glyph"></i>
              Ownership
            </a>
          </li>
        </ul>

        <% if @product.revenue? %>
          <h6 style="padding-left:10px">Financials</h6>

          <ul class="nav nav-stacked nav-sidebar">

            <li class="<%= nav_active_class(:financials) %>">
              <a href="<%= product_financials_path(@product) %>">
                <i class="icon-wallet dropdown-glyph"></i>
                Money
              </a>
            </li>

            <!-- <li class="<%= nav_active_class(:contracts) %>">
              <a href="<%= product_contracts_path(@product) %>">
                <i class="icon-docs dropdown-glyph"></i>
                Contracts
              </a>
            </li> -->
          </ul>
        <% end %>

      </div>

      <div class="col-md-10">

        <ul class="list list-inline pull-right">
          <li>
            <a
              href="#"
              class="btn btn-primary btn-sm"
              style="vertical-align: bottom;"
              data-toggle="popover"
              data-placement="bottom"
              data-html="true"
              data-content="
                <div class='form-group' style='margin-bottom: 4px'>
                  <label for='share-url'><%= @product.name %> is currently in stealth. See what your friends think and invite them to help out:</label>
                  <div class='input-group'>
                    <input type='text' class='form-control' id='share-url' value='http://assembly.com/d84k3gz'>
                    <span class='input-group-btn'>
                      <button class='btn btn-default' type='button'>Copy</button>
                    </span>
                  </div>
                </div>"
              >
              <i class="icon icon-share-alt" style="margin-right: 2px;"></i>
              Share
            </a>
          </li>
          <li>
            <div class="toggler toggler-sm">
              <% if signed_in? && @product.watching?(current_user) %>
                <a class="toggler-btn btn btn-default inactive" href="<%= unsubscribe_product_path(@product) %>" data-method="post">
                  <i class="icon icon-eye" style="margin-right: 2px;"></i>
                  Unwatch
                </a>
              <% else %>
                <a class="toggler-btn btn btn-primary" href="<%= subscribe_product_path(@product) %>" data-method="post">
                  <i class="icon icon-eye" style="margin-right: 2px;"></i>
                  Watch
                </a>
              <% end %>
                <a class="toggler-badge" href="<%= product_watchers_path(@product) %>">
                  <%= @product.watchers.count %>
                </a>
            </div>
          </li>
          <li style="padding-right: 0;">
            <div class="toggler toggler-sm">
              <div
                   data-react-class="JoinTeam"
                   data-react-props="<%= {
                     count: @product.team_memberships.active.count,
                     join_path: product_people_path(@product),
                     leave_path: (current_user && product_person_path(@product, current_user)),
                     is_member: @product.member?(current_user),
{'fraction_non_alphanumeric': 0.14991835623894406, 'fraction_numerical': 0.003673969247516669, 'mean_word_length': 1.7670368975903614, 'pattern_counts': {'":': 0, '<': 647, '<?xml version=': 0, '>': 643, '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': '4208637', 'n_tokens_mistral': 8386, 'n_tokens_neox': 7712, 'n_words': 1797}