<commit_before>{% set body_class = "" %}
        <!--pledgepage-->
{% extends "includes/base.html" %}
{% block head %}
  <!-- for facebook sharing -->
  <meta property="og:image" content="https://lessigforpresident.com/wp-content/uploads/2015/08/facebook-og-image.jpg"/>
  <meta property="og:title" content="{{team.title|escape}}'s pledge page"/>
  <meta property="og:type" content="website"/>
  <meta property="og:site_name" content="Lessig2016Teams"/>
  <meta property="og:description"
        content="Our government doesn't represent us because the system is rigged. Lets help Lessig fix it."/>

  <script>
    PLEDGE_URL = '{{pledge_root_url}}';
    function addCommas(nStr) {
      nStr += '';
      x = nStr.split('.');
      x1 = x[0];
      x2 = x.length > 1 ? '.' + x[1] : '';
      var rgx = /(\d+)(\d{3})/;
      while (rgx.test(x1)) {
        x1 = x1.replace(rgx, '$1' + ',' + '$2');
      }
      return x1 + x2;
    }
    
    function setTeamCookie() {
      var date = new Date();
      date.setTime(date.getTime()+(24*60*60*1000));
      document.cookie = ("last_team_key={{team.key()}};" +
                         "expires=" + date.toGMTString() +
                         ";domain=.lessigforpresident.com;path=/");
    }
    var ALREADY_BANKED = 0;
    var GOAL_DOLLARS = 1000000;
    $(function() {
      setTeamCookie();

      $('#pledgeButton').on('click', function() {
        setTeamCookie();
      });

      var reload = function() {
        $.getJSON("{{pledge_root_url}}/r/total",
                  {"team": "{{team.key()}}"})
        .done(function(data) {
          $("#team_total_dollars").text("$" + addCommas(
              Math.round(data["teamTotalCents"]/100)));
          $("#team_total_pledges").text("" + data["teamPledges"]);
          var total_dollars = Math.floor(data["totalCents"]/100);
          total_dollars = total_dollars - ALREADY_BANKED;
          var progress = Math.floor((total_dollars * 100) / GOAL_DOLLARS);
          $("#total_dollars").text("$" + addCommas(total_dollars));
          $("#goal_dollars").text("$" + addCommas(GOAL_DOLLARS));
          $("#progressbar-bar").width(progress + "%");
          $("#progressbar-bar").attr("aria-valuenow", "" + progress);
          $("#progressbar-text").text(progress + "% Complete");
        })
        .fail(function() {
          $("#team_total_dollars").text("-");
          $("#team_total_pledges").text("-");
          $("#total_dollars").text("ERROR LOADING");
          $("#goal_dollars").text("");
        });
      };
      reload();
      // this genrates too many requests for not much reason
      // setInterval(reload, 15000);
      
      var update_pledgers = function() {
        $.getJSON("https://pledge.lessigforpresident.com/r/pledgers",
                  {"team": "{{team.key()}}"})
        .done(function(data) {
          if (data["pledgers"].length == 0) {
            $("#pledger-list").hide();
            return;
          }
          $("#pledger-list").show();
          var html = "";
          $.each(data["pledgers"], function(_, name) {
            html += "<li>" + $('<div/>').text(name).html() + "</li>";
          });
          $("#pledger-list ul").html(html);
        });
      };

      $("#pledger-list").hide();
      {% if edit_url %}
        update_pledgers();
      {% endif %}      
    });
  </script>
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
  <script src="{{pledge_root_url}}/static/pledge.js"></script>
  <script src="https://checkout.stripe.com/checkout.js"></script>
{% endblock %}
{% block body %}
  <div class="pledgepage" >
    <div class="container">

      <div class="row">
        <div class="col-md-8" id="pledgecol-main">

          <h2>{{team.title}}’s pledge page</h2>

          {% if not team.youtube_id and not team.image_url %}
            <h3>A word from Lessig:</h3>

            <div class="video-container">
              <iframe src="//www.youtube.com/embed/CaqrQz71bMk" width="420"
                  height="236" frameborder="0" webkitallowfullscreen
                  mozallowfullscreen allowfullscreen></iframe>
            </div>

          {% elif team.youtube_id %}
            <div class="video-container">
              <iframe src="//www.youtube.com/embed/{{team.youtube_id}}"
                  frameborder="0" allowfullscreen width="420"></iframe>
            </div>
          {% elif team.image_url %}
            <div class="video-container">
              <img src="{{team.image_url}}" />
            </div>

          {% endif %}

          <h2>A word from {{team.title}}:</h2>

          {{description_rendered|safe}}

          <a href="{{pledge_root_url}}/pledge?team={{team.key()}}"
              class="pledge-link">
            <button class="btn">Pledge Now</button>
          </a>
        </div>

        <div class="col-md-4" id="pledgecol-sidebar">
          <!-- page stats !-->
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title uppercase">This page</h3>
            </div>
            <div class="panel-body">
              <h6>PEOPLE WHO JOINED</h6>
              <h5 class="amount" id="team_total_people_joined">{{team.total_people_joined}}</h5>

              <h6>AMOUNT RAISED</h6>
              <h5 class="amount" id="team_total_dollars"></h5>

              <h6>PLEDGES</h6>
              <h5 class="pledges" id="team_total_pledges"></h5>
              <commit_msg>change team page top layout, add share btns<commit_after>{% set body_class = "" %}
        <!--pledgepage-->
{% extends "includes/base.html" %}
{% block head %}
  <!-- for facebook sharing -->
  <meta property="og:image" content="https://lessigforpresident.com/wp-content/uploads/2015/08/facebook-og-image.jpg"/>
  <meta property="og:title" content="{{team.title|escape}}'s pledge page"/>
  <meta property="og:type" content="website"/>
  <meta property="og:site_name" content="Lessig2016Teams"/>
  <meta property="og:description"
        content="Our government doesn't represent us because the system is rigged. Lets help Lessig fix it."/>

  <script>
    PLEDGE_URL = '{{pledge_root_url}}';
    function addCommas(nStr) {
      nStr += '';
      x = nStr.split('.');
      x1 = x[0];
      x2 = x.length > 1 ? '.' + x[1] : '';
      var rgx = /(\d+)(\d{3})/;
      while (rgx.test(x1)) {
        x1 = x1.replace(rgx, '$1' + ',' + '$2');
      }
      return x1 + x2;
    }
    
    function setTeamCookie() {
      var date = new Date();
      date.setTime(date.getTime()+(24*60*60*1000));
      document.cookie = ("last_team_key={{team.key()}};" +
                         "expires=" + date.toGMTString() +
                         ";domain=.lessigforpresident.com;path=/");
    }
    var ALREADY_BANKED = 0;
    var GOAL_DOLLARS = 1000000;
    $(function() {
      setTeamCookie();

      $('#pledgeButton').on('click', function() {
        setTeamCookie();
      });

      var reload = function() {
        $.getJSON("{{pledge_root_url}}/r/total",
                  {"team": "{{team.key()}}"})
        .done(function(data) {
          $("#team_total_dollars").text("$" + addCommas(
              Math.round(data["teamTotalCents"]/100)));
          $("#team_total_pledges").text("" + data["teamPledges"]);
          var total_dollars = Math.floor(data["totalCents"]/100);
          total_dollars = total_dollars - ALREADY_BANKED;
          var progress = Math.floor((total_dollars * 100) / GOAL_DOLLARS);
          $("#total_dollars").text("$" + addCommas(total_dollars));
          $("#goal_dollars").text("$" + addCommas(GOAL_DOLLARS));
          $("#progressbar-bar").width(progress + "%");
          $("#progressbar-bar").attr("aria-valuenow", "" + progress);
          $("#progressbar-text").text(progress + "% Complete");
        })
        .fail(function() {
          $("#team_total_dollars").text("-");
          $("#team_total_pledges").text("-");
          $("#total_dollars").text("ERROR LOADING");
          $("#goal_dollars").text("");
        });
      };
      reload();
      // this genrates too many requests for not much reason
      // setInterval(reload, 15000);
      
      var update_pledgers = function() {
        $.getJSON("https://pledge.lessigforpresident.com/r/pledgers",
                  {"team": "{{team.key()}}"})
        .done(function(data) {
          if (data["pledgers"].length == 0) {
            $("#pledger-list").hide();
            return;
          }
          $("#pledger-list").show();
          var html = "";
          $.each(data["pledgers"], function(_, name) {
            html += "<li>" + $('<div/>').text(name).html() + "</li>";
          });
          $("#pledger-list ul").html(html);
        });
      };

      $("#pledger-list").hide();
      {% if edit_url %}
        update_pledgers();
      {% endif %}      
    });
  </script>
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
  <script src="{{pledge_root_url}}/static/pledge.js"></script>
  <script src="https://checkout.stripe.com/checkout.js"></script>
{% endblock %}
{% block body %}
  <div class="pledgepage" >
    <div class="container">
      <div class="row">
        <div id="pledgecol-main">
          <div class="col-md-12">
            <a class="share" href="#" onclick="$('.row.share').slideToggle();">Share</a>
            <h2>{{team.title}}’s Pledge Page</h2>
            <div class="row share" style="display: none">
              <div class="col-sm-4 share-btn">
	              <a href="https://www.facebook.com/sharer/sharer.php?u=https://lessigforpresident.com/" title="" target="_blank" style="background-color:#3b5998;">
	                <i class="fa fa-facebook-square"></i> Share
                </a>
              </div><!-- eo .share_btn -->
              <div class="col-sm-4 share-btn">
                <a href="https://twitter.com/home?status=%40lessig%20is%20running%20for%20referendum%20presidency%20to%20fix%20our%20democracy%20once%20and%20for%20all%20%23lessig2016" title="" target="_blank" style="background-color:#00aced;">
                  <i class="fa fa-twitter"></i> Tweet
                </a>
              </div><!-- eo .share_btn -->
              <div class="col-sm-4 share-btn">
                <a href="https://instagram.com/lessig2016/" title="" target="_blank" style="background-color:#517fa4;">
                  <i class="fa fa-envelope"></i> Email
                </a>
              </div><!-- eo .share_btn -->
            </div><!-- eo .share.row -->
            <div class="col-md-6">
              <div class="video-container">
                {% if not team.youtube_id and not team.image_url %}
                  <iframe src="//www.youtube.com/embed/CaqrQz71bMk" width="420"
                      height="236" frameborder="0" webkitallowfullscreen
                      mozallowfullscreen allowfullscreen></iframe>
                {% elif team.youtube_id %}
                  <iframe src="//www.youtube.com/embed/{{team.youtube_id}}"
                      frameborder="0" allowfullscreen width="420"></iframe>
                {% elif team.image_url %}
                  <img src="{{team.image_url}}" />
                {% endif %}
              </div><!-- eo .video-container -->
            </div><!-- eo .col-md-6 -->
            <div class="short-message">
            {{description_rendered|safe}}
            </div><!-- eo .short-message -->

          <a href="{{pledge_root_url}}/pledge?team={{team.key()}}"
              class="pledge-link">
            <button class="btn">Pledge Now</button>
          </a>
          </div>
        </div>

        <div class="col-md-4" id="pledgecol-sidebar">
          <!-- page stats !-->
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title uppercase">This page</h3>
            </div>
            <div class="panel-body">
              <h6>PEOPLE WHO JOINED</h6>
              <h5 class="amount" id="team_total_people_joined">{{team.total_people_joined}}</h5>

              <h6>AMOUNT RAISED</h6>
              <h5 class="amount" id="team_total_dollars"></h5>

              <h6>PLEDGES</h6>
              <h5 class="pledges" id="team_total_pledges"></h5>
              
{'fraction_non_alphanumeric': 0.19279557651650675, 'fraction_numerical': 0.019759310456984876, 'mean_word_length': 2.0778278278278277, 'pattern_counts': {'":': 4, '<': 158, '<?xml version=': 0, '>': 160, 'https://': 10, 'lorem ipsum': 0, 'www.': 5, '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': '5906785', 'n_tokens_mistral': 4117, 'n_tokens_neox': 3821, 'n_words': 619}