<commit_before>{% extends "base.html" %}

{# set jinja page variables #}
{# ----------------------------------------------------------------------- #}

{% set page_title = profile.given_name ~ " " ~ profile.surname %}

{% if g.user.id == profile.id %}
   {% set edit_status = "can-edit" %}
{% else %}
   {% set edit_status = "can-not-edit" %}
{% endif %}

{% block content %}


{% if g.user.id == profile.id %}
   <script type="text/javascript">
      var MILLISECONDS_IN_ONE_DAY = 1000 * 60 * 60 * 24
      // dates in database are stored in UTC with no timezone information
      // append "+0" so parsed in utc
      var date_created =  new Date("{{ g.user.created }}+0")  // so parsed in utc
      var date_last_viewed_profile =  new Date("{{ g.user.last_viewed_profile }}+0")

      var days_since_created = (new Date() - date_created)/MILLISECONDS_IN_ONE_DAY
      var days_since_last_viewed = (new Date() - date_last_viewed_profile)/MILLISECONDS_IN_ONE_DAY

      analytics.track('Loaded own profile', {
         "days_since_created": days_since_created,
         "days_since_last_viewed": days_since_last_viewed
         })
   </script>
{% endif %}


<div class="profile-header">
   <div class="wrapper">
      <div class="my-picture">
         <a href="http://www.gravatar.com" >
            <img class="gravatar" src="http://www.gravatar.com/avatar/{{ email_hash }}?s=110&d=mm" data-toggle="tooltip" class="gravatar" rel="tooltip" title="Modify your icon at Gravatar.com" />
         </a>
      </div>
      <div class="my-vitals">
         <h2 class='page-title editable-name'>
            <span class="given-name editable" data-name="given_name">{{ profile.given_name }}</span>
            <span class="surname editable" data-name="surname">{{ profile.surname }}</span>
            <span class="instr">&nbsp;<span>click name to edit</span></span>
         </h2>

         <div id="num-items" class="control-group working">
            <span class="working"><img src="{{ url_for('static', filename='img/ajax-loader.gif') }}" /><span class="text">Loading...</span></span>
            <span class="ready"><span class="value"></span> products <a href="#">expand all</a></span>
            <span class="error"><span class="value"></span> products <span class="error-message">(though failed to load all metrics)</span><a href="#">expand all</a></span>
         </div>



      </div>
      <div class="my-metrics"></div>
   </div>
   <div class="clearfloat"></div>
</div>



<div class="main" id="report" xmlns="http://www.w3.org/1999/html"
     xmlns="http://www.w3.org/1999/html">

   {% include 'snippets/ie-fail.html' %}

   <!-- START report-meta -->
   <div class="wrapper">
      <div id="report-meta">
         <!-- remove "tweet this" code for now because platform.twitter loading very slowly -->
         <div id="share">
            <!-- from https://twitter.com/about/resources/buttons#tweet -->
            <!-- based on code here: https://dev.twitter.com/docs/tweet-button -->
                             <span class="tweet-this">
                        <a href="https://twitter.com/share" class="twitter-share-button"
                           data-via="ImpactStory"
                           data-url="{{ request.url }}"
                           url="{{ request.url }}"
                           data-text="Check out the impact story of my research: {{ request.url }}"
                           data-count="horizontal"></a>
                             </span>
         </div>

         <button class="btn btn-small btn-primary" id="import-products-button" name="{{ report_id }}" href="#"><i class="icon-upload-alt"></i>add products</button>
         <div id="report-button">
            <div class="btn-group update">
               <button class="btn btn-small" id="update-report-button" name="{{ report_id }}" href="#"><i class="icon-refresh"></i>refresh metrics</button>
               <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
                  <i class="icon-download-alt"></i>
                  download
                  <span class="caret"></span>
               </a>
               <ul class="dropdown-menu">
                  <li><a class="" id="json-report-button" href="{{ g.roots.api_pretty }}/v1/{{ api_query }}?key=samplekey">json</a></li>
                  <li><a class="" id="csv-report-button" href="{{ g.roots.api_pretty }}/v1/{{ api_query }}.csv?key=samplekey">csv</a></li><commit_msg>Remove 'www.' in Tweet This url if it exists.<commit_after>{% extends "base.html" %}

{# set jinja page variables #}
{# ----------------------------------------------------------------------- #}

{% set page_title = profile.given_name ~ " " ~ profile.surname %}

{% if g.user.id == profile.id %}
   {% set edit_status = "can-edit" %}
{% else %}
   {% set edit_status = "can-not-edit" %}
{% endif %}

{% block content %}


{% if g.user.id == profile.id %}
   <script type="text/javascript">
      var MILLISECONDS_IN_ONE_DAY = 1000 * 60 * 60 * 24
      // dates in database are stored in UTC with no timezone information
      // append "+0" so parsed in utc
      var date_created =  new Date("{{ g.user.created }}+0")  // so parsed in utc
      var date_last_viewed_profile =  new Date("{{ g.user.last_viewed_profile }}+0")

      var days_since_created = (new Date() - date_created)/MILLISECONDS_IN_ONE_DAY
      var days_since_last_viewed = (new Date() - date_last_viewed_profile)/MILLISECONDS_IN_ONE_DAY

      analytics.track('Loaded own profile', {
         "days_since_created": days_since_created,
         "days_since_last_viewed": days_since_last_viewed
         })
   </script>
{% endif %}


<div class="profile-header">
   <div class="wrapper">
      <div class="my-picture">
         <a href="http://www.gravatar.com" >
            <img class="gravatar" src="http://www.gravatar.com/avatar/{{ email_hash }}?s=110&d=mm" data-toggle="tooltip" class="gravatar" rel="tooltip" title="Modify your icon at Gravatar.com" />
         </a>
      </div>
      <div class="my-vitals">
         <h2 class='page-title editable-name'>
            <span class="given-name editable" data-name="given_name">{{ profile.given_name }}</span>
            <span class="surname editable" data-name="surname">{{ profile.surname }}</span>
            <span class="instr">&nbsp;<span>click name to edit</span></span>
         </h2>

         <div id="num-items" class="control-group working">
            <span class="working"><img src="{{ url_for('static', filename='img/ajax-loader.gif') }}" /><span class="text">Loading...</span></span>
            <span class="ready"><span class="value"></span> products <a href="#">expand all</a></span>
            <span class="error"><span class="value"></span> products <span class="error-message">(though failed to load all metrics)</span><a href="#">expand all</a></span>
         </div>



      </div>
      <div class="my-metrics"></div>
   </div>
   <div class="clearfloat"></div>
</div>



<div class="main" id="report" xmlns="http://www.w3.org/1999/html"
     xmlns="http://www.w3.org/1999/html">

   {% include 'snippets/ie-fail.html' %}

   <!-- START report-meta -->
   <div class="wrapper">
      <div id="report-meta">
         <!-- remove "tweet this" code for now because platform.twitter loading very slowly -->
         <div id="share">
            <!-- based on code here: https://dev.twitter.com/docs/tweet-button -->
                             <span class="tweet-this">
                        {% set link_to_tweet = request.url|replace('www.','') %}
                        <a href="https://twitter.com/share" class="twitter-share-button"
                           data-via="ImpactStory"
                           data-url="{{ link_to_tweet }}"
                           url="{{ link_to_tweet }}"
                           data-text="Check out the impact story of my research: {{ link_to_tweet }}"
                           data-count="horizontal"></a>
                             </span>
         </div>

         <button class="btn btn-small btn-primary" id="import-products-button" name="{{ report_id }}" href="#"><i class="icon-upload-alt"></i>add products</button>
         <div id="report-button">
            <div class="btn-group update">
               <button class="btn btn-small" id="update-report-button" name="{{ report_id }}" href="#"><i class="icon-refresh"></i>refresh metrics</button>
               <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
                  <i class="icon-download-alt"></i>
                  download
                  <span class="caret"></span>
               </a>
               <ul class="dropdown-menu">
                  <li><a class="" id="json-report-button" href="{{ g.roots.api_pretty }}/v1/{{ api_query }}?key=samplekey">json</a></li>
                  <li><a class="" id="csv-report-button" href="{{ g.roots.api_pretty }}/v1/{{ api_query }}.csv?key=samplekey">csv</a></li>
{'fraction_non_alphanumeric': 0.1927831607083194, 'fraction_numerical': 0.006682258603407952, 'mean_word_length': 2.274981765134938, 'pattern_counts': {'":': 4, '<': 174, '<?xml version=': 0, '>': 174, 'https://': 5, 'lorem ipsum': 0, 'www.': 10, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '405430', 'n_tokens_mistral': 2818, 'n_tokens_neox': 2650, 'n_words': 570}