<commit_before>{% extends "base.html" %}
{% set active_page = "profile" %}
{% set active_link = "settings" %}
{% import "account/_helpers.html" as helper %}
{% from "applications/_helpers.html" import broken_image %}

{% block content %}
{% from "_formhelpers.html" import render_field %}
{% from "_formhelpers.html" import geotagx_render_field , geotagx_render_checkbox , geotagx_render_selectlist %}

<!-- TO-DO :: Handle Form errors properlu -->
<script src="{{url_for('static', filename='js/vendor/jquery.Jcrop.min.js')}}"></script>
<link rel="stylesheet" href="{{url_for('static', filename='css/jquery.Jcrop.min.css')}}" type="text/css" />

<div class="row">

<section class="tab wow fadeInLeft animated" data-wow-animation-name="none" style="visibility: visible; -webkit-animation-name: none;">
            <header class="panel-heading tab-bg-dark-navy-blue">
              <ul class="nav nav-tabs nav-justified ">
                <li class="active">
                  <a data-toggle="tab" href="#update_profile">
                    Update Profile
                  </a>
                </li>
               <li class="">
                  <a data-toggle="tab" href="#upload_profile_picture">
                    Update Profile Picture
                  </a>
                </li>                
                <li class="">
                  <a data-toggle="tab" href="#change_password">
                    Change Password
                  </a>
                </li>
                <li class="">
                  <a data-toggle="tab" href="#external_services">
                    External Services
                  </a>
                </li>
                <li class="">
                  <a data-toggle="tab" href="#api_key">
                    API Key
                  </a>
                </li>                
              </ul>
            </header>
            <div class="panel-body">
              <div class="tab-content tasi-tab">
                <div id="update_profile" class="tab-pane fade active in col-md-4 col-md-offset-4">
                    <form method="post" class="form-horizontal" action="{{ url_for('account.update_profile', name=current_user.name) }}">
                        <fieldset>
                            <center>
                            <h2 {% if form.errors %}name="profile" class="has-error" {%endif%}>Your profile</h2>
                            </center>
                            <center>
                            <i class="fa fa-user big-icon-11"></i>
                            </center>
                        {{ form.id }}
                        {{ form.hidden_tag() }}
                        {{ geotagx_render_field(form.fullname,"fullname", "", "text", current_user.fullname ) }}
                        {{ geotagx_render_field(form.name,"name",  current_user.name, "text" , current_user.name) }}
                        {{ geotagx_render_field(form.email_addr,"email_addr", "", "text", current_user.email_addr) }}

                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-md-6">
                                    <center><h4>{{ _('Privacy Mode')}}</h4></center>
                                </div>
                                <div class="col-md-6 class-md-offset-6">
                                    <center>
                                {% if current_user.privacy_mode %}
                                    {{ geotagx_render_checkbox(form.privacy_mode, "privacy_mode" , "checked", "y")  }}
                                {% else %}
                                    {{ geotagx_render_checkbox(form.privacy_mode, "privacy_mode" , "unchecked", "n")  }}                            
                                {% endif %}
                                    </center>
                                </div>
                            </div>
                        </div>

                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-md-6">
                                    <center><h4>{{ _('Get email Notifications')}}</h4></center>
                                </div>
                                <div class="col-md-6 class-md-offset-6">
                                    <center>
                                {% if current_user.subscribed %}
                                    {{ geotagx_render_checkbox(form.subscribed, "subscribed" , "checked", "y")  }}
                                {% else %}
                                    {{ geotagx_render_checkbox(form.subscribed, "subscribed" , "unchecked", "n")  }}                            
                                {% endif %}
                                    </center>
                                </div>
                            </div>
                        </div>

                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-md-6">
                                    <center><h4>{{ _('Locale')}}</h4></center>
                                </div>
                                <div class="col-md-6 class-md-offset-6">
                                    <center>
                                        {{ geotagx_render_selectlist(form.locale, "locale" ,current_user.locale)  }}    
                                    </center>
                                </div>
                            </div>
                        </div>                        

                        <div class="form-actions">

                            <div class="container-fluid">
                                <div class="row">
                                    <div class="col-md-6">
                                        <button type="submit" name='btn' value="Profile" class="btn btn-primary btn-large col-md-12 input-lg" />{{ _('Save the changes') }}</button>
                                    </div>
                                    <div class="col-md-6 class-md-offset-6">
                                        <center>
                                        <a href="{{url_for('account.update_profile', name=current_user.name)}}" class="btn btn-large btn-danger col-md-12 input-lg">{{ _('Cancel') }}</a>   
                                        </center>
                                    </div>
                                </div>
                            </div>                           
                        </div>
                        </fieldset>
                    </form>

                </div>
                <div id="upload_profile_picture" class="tab-pane fade col-md-4 col-md-offset-4">
                        <form method="post" class="form-horizontal" action="{{ url_for('account.update_profile', name=current_user.name) }}" enctype="multipart/form-data">
                            <fieldset>
                                <div class="span2 img-polaroid">
                                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                                {{ helper.render_user_thumbnail(current_user, upload_method)}}
                                </div>
                                <br/>
                                <input class="form-control input-lg" id="avatar" name="avatar" onchange="previewImage()" type="file">
                                <br/>
                                {{ upload_form.x1 }}
                                {{ upload_form.y1 }}
                                {{ upload_form.x2 }}
                                {{ upload_form.y2 }}<commit_msg>Center profile picture on update profile page<commit_after>{% extends "base.html" %}
{% set active_page = "profile" %}
{% set active_link = "settings" %}
{% import "account/_helpers.html" as helper %}
{% from "applications/_helpers.html" import broken_image %}

{% block content %}
{% from "_formhelpers.html" import render_field %}
{% from "_formhelpers.html" import geotagx_render_field , geotagx_render_checkbox , geotagx_render_selectlist %}

<!-- TO-DO :: Handle Form errors properlu -->
<script src="{{url_for('static', filename='js/vendor/jquery.Jcrop.min.js')}}"></script>
<link rel="stylesheet" href="{{url_for('static', filename='css/jquery.Jcrop.min.css')}}" type="text/css" />

<div class="row">

<section class="tab wow fadeInLeft animated" data-wow-animation-name="none" style="visibility: visible; -webkit-animation-name: none;">
            <header class="panel-heading tab-bg-dark-navy-blue">
              <ul class="nav nav-tabs nav-justified ">
                <li class="active">
                  <a data-toggle="tab" href="#update_profile">
                    Update Profile
                  </a>
                </li>
               <li class="">
                  <a data-toggle="tab" href="#upload_profile_picture">
                    Update Profile Picture
                  </a>
                </li>                
                <li class="">
                  <a data-toggle="tab" href="#change_password">
                    Change Password
                  </a>
                </li>
                <li class="">
                  <a data-toggle="tab" href="#external_services">
                    External Services
                  </a>
                </li>
                <li class="">
                  <a data-toggle="tab" href="#api_key">
                    API Key
                  </a>
                </li>                
              </ul>
            </header>
            <div class="panel-body">
              <div class="tab-content tasi-tab">
                <div id="update_profile" class="tab-pane fade active in col-md-4 col-md-offset-4">
                    <form method="post" class="form-horizontal" action="{{ url_for('account.update_profile', name=current_user.name) }}">
                        <fieldset>
                            <center>
                            <h2 {% if form.errors %}name="profile" class="has-error" {%endif%}>Your profile</h2>
                            </center>
                            <center>
                            <i class="fa fa-user big-icon-11"></i>
                            </center>
                        {{ form.id }}
                        {{ form.hidden_tag() }}
                        {{ geotagx_render_field(form.fullname,"fullname", "", "text", current_user.fullname ) }}
                        {{ geotagx_render_field(form.name,"name",  current_user.name, "text" , current_user.name) }}
                        {{ geotagx_render_field(form.email_addr,"email_addr", "", "text", current_user.email_addr) }}

                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-md-6">
                                    <center><h4>{{ _('Privacy Mode')}}</h4></center>
                                </div>
                                <div class="col-md-6 class-md-offset-6">
                                    <center>
                                {% if current_user.privacy_mode %}
                                    {{ geotagx_render_checkbox(form.privacy_mode, "privacy_mode" , "checked", "y")  }}
                                {% else %}
                                    {{ geotagx_render_checkbox(form.privacy_mode, "privacy_mode" , "unchecked", "n")  }}                            
                                {% endif %}
                                    </center>
                                </div>
                            </div>
                        </div>

                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-md-6">
                                    <center><h4>{{ _('Get email Notifications')}}</h4></center>
                                </div>
                                <div class="col-md-6 class-md-offset-6">
                                    <center>
                                {% if current_user.subscribed %}
                                    {{ geotagx_render_checkbox(form.subscribed, "subscribed" , "checked", "y")  }}
                                {% else %}
                                    {{ geotagx_render_checkbox(form.subscribed, "subscribed" , "unchecked", "n")  }}                            
                                {% endif %}
                                    </center>
                                </div>
                            </div>
                        </div>

                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-md-6">
                                    <center><h4>{{ _('Locale')}}</h4></center>
                                </div>
                                <div class="col-md-6 class-md-offset-6">
                                    <center>
                                        {{ geotagx_render_selectlist(form.locale, "locale" ,current_user.locale)  }}    
                                    </center>
                                </div>
                            </div>
                        </div>                        

                        <div class="form-actions">

                            <div class="container-fluid">
                                <div class="row">
                                    <div class="col-md-6">
                                        <button type="submit" name='btn' value="Profile" class="btn btn-primary btn-large col-md-12 input-lg" />{{ _('Save the changes') }}</button>
                                    </div>
                                    <div class="col-md-6 class-md-offset-6">
                                        <center>
                                        <a href="{{url_for('account.update_profile', name=current_user.name)}}" class="btn btn-large btn-danger col-md-12 input-lg">{{ _('Cancel') }}</a>   
                                        </center>
                                    </div>
                                </div>
                            </div>                           
                        </div>
                        </fieldset>
                    </form>

                </div>
                <div id="upload_profile_picture" class="tab-pane fade col-md-4 col-md-offset-4">
                        <form method="post" class="form-horizontal" action="{{ url_for('account.update_profile', name=current_user.name) }}" enctype="multipart/form-data">
                            <fieldset>
                                <div class="span2 img-polaroid">
                                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                                <center>
                                    {{ helper.render_user_thumbnail(current_user, upload_method)}}
                                </center>
                                </div>
                                <br/>
                                <input class="form-control input-lg" id="avatar" name="avatar" onchange="previewImage()" type="file">
                                <br/>
                                {{ upload_form.x1 }}
                                {{ upload_form.y1 }}
                                {{ upload_form.x2 }}
                                {{ upload_form.y2 }}
{'fraction_non_alphanumeric': 0.12672264598423177, 'fraction_numerical': 0.004486891865906032, 'mean_word_length': 0.9483016983016983, 'pattern_counts': {'":': 0, '<': 231, '<?xml version=': 0, '>': 231, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 74, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1438855', 'n_tokens_mistral': 3895, 'n_tokens_neox': 3582, 'n_words': 646}