<commit_before><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Projects - Open Gov Hack Night</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/font-awesome.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/custom.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="container">
      <div class='col-md-10 col-md-offset-1'>
        <div class="header">
          <ul class="nav nav-pills pull-right">
            <li><a href="index.html">Home</a></li>
            <li><a href="events.html">Events</a></li>
            <li class="active"><a href="projects.html">Projects</a></li>
            <li><a href="people.html">People</a></li>
          </ul>
          <h3 class="text-muted"><a href="index.html" >Open Gov Hack Night</a></h3>
        </div>

        <!-- Begin page content-->
        <h1>Share your civic tech project</h1>

        <div class='well'>

          <p>Add a project for us to track. We <a href='https://github.com/open-city/civic-json-worker'>automatically update</a> this list based on your <a href='https://github.com/'>Github</a> activity.</p>

          <form class="form-horizontal" role="form">
            <div class="form-group">
              <label for="github-url" class="col-lg-2 control-label">Github URL</label>
              <div class="col-lg-10">
                <input type="text" class="form-control" id="github-url" placeholder="https://github.com/my-name/my-project">
              </div>
            </div>
            <div class="form-group">
              <div class="col-lg-offset-2 col-lg-10">
                <button  id='submit-project' type="submit" class="btn btn-success">Submit</button>
              </div>
            </div>
          </form>
        </div>
        <br>
        <br>

        <div id='submit-message' class="alert" style="display: none;"></div>

        <h1>Projects <span id='project-count'></span></h1>
        <p>Open source civic tech projects from Chicago's open gov community. Most were built using <a href="http://data.cityofchicago.org">open data</a>.</p>
        <br>

        <table id='hack-night-projects' class='table'>
          <thead>
            <tr>
              <th>Project</th>
              <th>Description</th>
              <th>Stars</th>
              <th>Forks</th>
              <th>Issues</th>
            </tr>
          </thead>
          <tbody>
          </tbody>
        </table>

        <!-- End page content-->

        <div class="footer">
          <p class='pull-right'>&copy; Open City 2013 | <a href='https://github.com/open-city/open-gov-hack-night'><i class='icon-github'></i> Pull requests welcome!</a></p>
        </div>
      </div>
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/analytics_lib.js"></script>

    <script src="js/moment.min.js"></script>
    <script src="js/jquery.dataTables.min.js"></script>
    <script src="js/jquery.dataTables.sorting.js"></script>
    <script src="js/jquery.address.js"></script>
    <script src="js/mustache.js"></script>

    <script>

      // helper function for displaying messages when submitting projects
      function displayMessage(message, type) {
        $( "#submit-message" ).fadeOut(function() {
          $( "#submit-message" ).attr('class', 'alert alert-' + type);
          $( "#submit-message" ).html(message);
        });
        $( "#submit-message" ).fadeIn();
      }

      // AJAX form submission to civic-json-worker
      // https://github.com/open-city/civic-json-worker
      $('#submit-project').click(function(){

        $.post(
          'http://civic-json.e-vz.com/add-project/',
          data={'project_url': $('#github-url').val()},
          function(resp){
            displayMessage( "<strong>Your project has been submitted!</strong> It should display below within 5 minutes.", 'success' );
            $("#github-url").val("");
          }
        ).fail(function() {
          displayMessage( "<strong>Error submitting your project!</strong> Check that the URL is correct.", 'danger' );
        });

        return false;
      });

      // handle the case where someone hits the 'enter' key insted of the submit button
      $("#github-url").keydown(function(e){
      var key =  e.keyCode ? e.keyCode : e.which;
        if(key == 13) {
          $('#submit-project').click();
          return false;
        }
      });

      // this is a template used for mustache.js. Each one represents a table row.
      var template = "\
        <tr>\
          <td>\
            <h3><a href='{{html_url}}'>{{name}}</a></h3>\
            {{#homepage}}\
              <a href='{{homepage_formatted}}'>Website</a>\
            {{/homepage}}\
            <br /><strong>Created</strong>\
            {{created_at_formatted}}\
            {{#language}}\
              <br /><strong>Language</strong>\
              {{language}}\
            {{/language}}\
          </td>\
          <td>\
            <p>{{description}}</p>\
            <h4>Contributors</h4>\
            <p class='contributors'>\
              {{#owner}}\
                <a href='{{html_url}}' class='contributor-owner'><img class='img-thumbnail' src='{{avatar_url}}' alt='Owner: {{login}}'/></a>\
              {{/owner}}\
              {{#contributors}}\
                <a href='{{html_url}}'><img class='img-thumbnail' src='{{avatar_url}}' alt='{{login}}' /></a>\
              {{/contributors}}\
            </p>\
          </td>\
          <td>\
            <a class='btn btn-default' href='{{html_url}}/stargazers'>{{watchers_count}} <i class='icon-star'></i></a>\
          </td>\
          <td>\
            <a class='btn btn-default' href='{{html_url}}/network'>{{forks_count}} <i class='icon-code-fork'></i></a>\
          </td>\
          <td>\
            <a class='btn btn-default' href='{{html_url}}/issues'>{{open_issues}} <i class='icon-exclamation-sign'></i></a>\
          </td>\
        </tr>\
      ";

      $.when( $.getJSON( "https://s3.amazonaws.com/civic-json/project_details.json" ) ).then(function( json, textStatus, jqXHR ) {

        // update project count at the top of the page
        $('#project-count').html("(" + json.length + ")");

        // loop through our json data
        for (var i = 0; i < json.length; i++) {

          // to display text like 'x days ago' we use moment.js's awesome fromNow function
          // http://momentjs.com/docs/#/displaying/fromnow/
          json[i]['created_at_formatted'] = moment(json[i]['created_at']).fromNow();
          json[i]['updated_at_formatted'] = moment(json[i]['updated_at']).fromNow();

          // check to make sure all our URL's have http:// in front of them
          // otherwise they won't link properly
          var prefix_regex = /^https?:\/\/.*/;
          var homepage = json[i]['homepage'];
          if (homepage != null && !prefix_regex.test(homepage))
            json[i]['homepage_formatted'] = "http://" + homepage;
          else
            json[i]['homepage_formatted'] = homepage;

          // using the template above, add the project as a new row to our table
          $("#hack-night-projects tbody").append(Mustache.render(template, json[i]));
        }

        // initialize datatables for sorting and searching
        // http://datatables.net/
        var projects_table = $('#hack-night-projects').dataTable( {
            "aaSorting": [ [2,'desc'], [3, 'desc'] ],
            "aoColumns": [
                null,
                null,
                { "sType": "num-html" },
                { "sType": "num-html" },
                { "sType": "num-html" }
            ],
            "bInfo": false,
            "bPaginate": false
        } );

        // allows linking directly to searches
        if ($.address.parameter('search') != undefined) {
          projects_table.fnFilter( $.address.parameter('search') );
        }

        // when someone types a search value, it updates the URL
        $('#hack-night-projects_filter input').keyup(function(e){
          $.address.parameter('search', $('#hack-night-projects_filter input').val());
        });
      });
    </script>
  </body>
</html>
<commit_msg>Fixed mustache template to render owner style based upon a boolean passed in JSON<commit_after><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Projects - Open Gov Hack Night</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/font-awesome.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/custom.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="container">
      <div class='col-md-10 col-md-offset-1'>
        <div class="header">
          <ul class="nav nav-pills pull-right">
            <li><a href="index.html">Home</a></li>
            <li><a href="events.html">Events</a></li>
            <li class="active"><a href="projects.html">Projects</a></li>
            <li><a href="people.html">People</a></li>
          </ul>
          <h3 class="text-muted"><a href="index.html" >Open Gov Hack Night</a></h3>
        </div>

        <!-- Begin page content-->
        <h1>Share your civic tech project</h1>

        <div class='well'>

          <p>Add a project for us to track. We <a href='https://github.com/open-city/civic-json-worker'>automatically update</a> this list based on your <a href='https://github.com/'>Github</a> activity.</p>

          <form class="form-horizontal" role="form">
            <div class="form-group">
              <label for="github-url" class="col-lg-2 control-label">Github URL</label>
              <div class="col-lg-10">
                <input type="text" class="form-control" id="github-url" placeholder="https://github.com/my-name/my-project">
              </div>
            </div>
            <div class="form-group">
              <div class="col-lg-offset-2 col-lg-10">
                <button  id='submit-project' type="submit" class="btn btn-success">Submit</button>
              </div>
            </div>
          </form>
        </div>
        <br>
        <br>

        <div id='submit-message' class="alert" style="display: none;"></div>

        <h1>Projects <span id='project-count'></span></h1>
        <p>Open source civic tech projects from Chicago's open gov community. Most were built using <a href="http://data.cityofchicago.org">open data</a>.</p>
        <br>

        <table id='hack-night-projects' class='table'>
          <thead>
            <tr>
              <th>Project</th>
              <th>Description</th>
              <th>Stars</th>
              <th>Forks</th>
              <th>Issues</th>
            </tr>
          </thead>
          <tbody>
          </tbody>
        </table>

        <!-- End page content-->

        <div class="footer">
          <p class='pull-right'>&copy; Open City 2013 | <a href='https://github.com/open-city/open-gov-hack-night'><i class='icon-github'></i> Pull requests welcome!</a></p>
        </div>
      </div>
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/analytics_lib.js"></script>

    <script src="js/moment.min.js"></script>
    <script src="js/jquery.dataTables.min.js"></script>
    <script src="js/jquery.dataTables.sorting.js"></script>
    <script src="js/jquery.address.js"></script>
    <script src="js/mustache.js"></script>

    <script>

      // helper function for displaying messages when submitting projects
      function displayMessage(message, type) {
        $( "#submit-message" ).fadeOut(function() {
          $( "#submit-message" ).attr('class', 'alert alert-' + type);
          $( "#submit-message" ).html(message);
        });
        $( "#submit-message" ).fadeIn();
      }

      // AJAX form submission to civic-json-worker
      // https://github.com/open-city/civic-json-worker
      $('#submit-project').click(function(){

        $.post(
          'http://civic-json.e-vz.com/add-project/',
          data={'project_url': $('#github-url').val()},
          function(resp){
            displayMessage( "<strong>Your project has been submitted!</strong> It should display below within 5 minutes.", 'success' );
            $("#github-url").val("");
          }
        ).fail(function() {
          displayMessage( "<strong>Error submitting your project!</strong> Check that the URL is correct.", 'danger' );
        });

        return false;
      });

      // handle the case where someone hits the 'enter' key insted of the submit button
      $("#github-url").keydown(function(e){
      var key =  e.keyCode ? e.keyCode : e.which;
        if(key == 13) {
          $('#submit-project').click();
          return false;
        }
      });

      // this is a template used for mustache.js. Each one represents a table row.
      var template = "\
        <tr>\
          <td>\
            <h3><a href='{{html_url}}'>{{name}}</a></h3>\
            {{#homepage}}\
              <a href='{{homepage_formatted}}'>Website</a>\
            {{/homepage}}\
            <br /><strong>Created</strong>\
            {{created_at_formatted}}\
            {{#language}}\
              <br /><strong>Language</strong>\
              {{language}}\
            {{/language}}\
          </td>\
          <td>\
            <p>{{description}}</p>\
            <h4>Contributors</h4>\
            <p class='contributors'>\
              {{#owner}}\
                <a href='{{html_url}}' class='contributor-owner'><img class='img-thumbnail' src='{{avatar_url}}' alt='Owner: {{login}}'/></a>\
              {{/owner}}\
              {{#contributors}}\
                {{^owner}}\
                  <a href='{{html_url}}'><img class='img-thumbnail' src='{{avatar_url}}' alt='{{login}}' /></a>\
                {{/owner}}\
              {{/contributors}}\
            </p>\
          </td>\
          <td>\
            <a class='btn btn-default' href='{{html_url}}/stargazers'>{{watchers_count}} <i class='icon-star'></i></a>\
          </td>\
          <td>\
            <a class='btn btn-default' href='{{html_url}}/network'>{{forks_count}} <i class='icon-code-fork'></i></a>\
          </td>\
          <td>\
            <a class='btn btn-default' href='{{html_url}}/issues'>{{open_issues}} <i class='icon-exclamation-sign'></i></a>\
          </td>\
        </tr>\
      ";

      $.when( $.getJSON( "https://s3.amazonaws.com/civic-json/project_details.json" ) ).then(function( json, textStatus, jqXHR ) {

        // update project count at the top of the page
        $('#project-count').html("(" + json.length + ")");

        // loop through our json data
        for (var i = 0; i < json.length; i++) {

          // to display text like 'x days ago' we use moment.js's awesome fromNow function
          // http://momentjs.com/docs/#/displaying/fromnow/
          json[i]['created_at_formatted'] = moment(json[i]['created_at']).fromNow();
          json[i]['updated_at_formatted'] = moment(json[i]['updated_at']).fromNow();

          // check to make sure all our URL's have http:// in front of them
          // otherwise they won't link properly
          var prefix_regex = /^https?:\/\/.*/;
          var homepage = json[i]['homepage'];
          if (homepage != null && !prefix_regex.test(homepage))
            json[i]['homepage_formatted'] = "http://" + homepage;
          else
            json[i]['homepage_formatted'] = homepage;

          // using the template above, add the project as a new row to our table
          $("#hack-night-projects tbody").append(Mustache.render(template, json[i]));
        }

        // initialize datatables for sorting and searching
        // http://datatables.net/
        var projects_table = $('#hack-night-projects').dataTable( {
            "aaSorting": [ [2,'desc'], [3, 'desc'] ],
            "aoColumns": [
                null,
                null,
                { "sType": "num-html" },
                { "sType": "num-html" },
                { "sType": "num-html" }
            ],
            "bInfo": false,
            "bPaginate": false
        } );

        // allows linking directly to searches
        if ($.address.parameter('search') != undefined) {
          projects_table.fnFilter( $.address.parameter('search') );
        }

        // when someone types a search value, it updates the URL
        $('#hack-night-projects_filter input').keyup(function(e){
          $.address.parameter('search', $('#hack-night-projects_filter input').val());
        });
      });
    </script>
  </body>
</html>

{'fraction_non_alphanumeric': 0.1910174969352502, 'fraction_numerical': 0.004680708793045804, 'mean_word_length': 2.011746937405605, 'pattern_counts': {'":': 14, '<': 389, '<?xml version=': 0, '>': 387, 'https://': 14, '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': '3983673', 'n_tokens_mistral': 5471, 'n_tokens_neox': 5250, 'n_words': 1159}