{% include 'header.twig' %}
<!-- Main variables *content* -->
			 <main  id="content" >
				 <div class="container-fluid">
                <div class="row">
            <div class="col-md-6">
               
                           
                <div class="card card_v2 mb-3">
                    <div class="card-body">
                            <div id="def_side_title">
                                <div class="icon">
                                    <i class="fal fa-user-circle"></i>
                                </div>
                                <div class="name">
                                User Infos
                                </div>
                            </div>
                         <div class="mb-3">

                                     
                                     {% if error %}
        <div class="alert alert-dismissible alert-danger">
          <button type="button" class="close" data-dismiss="alert">×</button>
          {{ errorText }}
        </div>
      {% endif %}
      {% if success %}
        <div class="alert alert-dismissible alert-success">
          <button type="button" class="close" data-dismiss="alert">×</button>
          {{ successText }}
        </div>
      {% endif %}
					      
                                  
												<label>Username</label>
												<input type="text" class="form-control" id="username" value="{{ user['username'] }}" readonly>
											</div>

											

											<div class="mb-3">
												<label>E-mail</label>
												<input type="text" class="form-control" id="email" value="{{ user['email'] }}" readonly>
											</div>
<div class="mb-3">
												<label>Last Login</label>
												<input type="text" class="form-control" id="name" value="{{ user['login_ip'] }}" readonly>
                        </div>
                    </div>
                </div>					
							
                <div class="card card_v2 mb-3">
                    <div class="card-body">

                            <div id="def_side_title">
                                <div class="icon">
                                    <i class="far fa-lock"></i>
                                </div>
                                <div class="name">
                                Account Password Manager
                                </div>
                            </div>
                               <form action="" method="post">
                                            
                                <div class="mb-3">
                                            <label for="current" class="control-label">Current password</label>
                                            <input type="password" class="form-control" value="" name="current_password">
                                        </div>
                                  
                                    
                                        <div class="mb-3">
                                            <label for="new" class="control-label">New password</label>
                                            <input type="password" class="form-control" value="" name="password">
                                        </div>
                              
                                   
                                        <div class="mb-3">
                                            <label for="confirm" class="control-label">Confirm new password</label>
                                            <input type="password" class="form-control" value="" name="confirm_password">
                                        </div>
                              
                                    
                                   
                                        <button type="submit" class="btn btn-primary w-100">Change password</button>
                            </form>
                            
                    </div>
                </div>

            </div>
            <div class="col-md-6">
                <div class="card card_v2 mb-3">
                    <div class="card-body">
                            <div id="def_side_title">
                                <div class="icon">
                                    <i class="fad fa-key"></i>
                                </div>
                                <div class="name">
                                 API Key Generator
                                </div>
                            </div>
                             <form  action="/account/newapikey" method="post">

                                <div class="form-group">
                                  <label for="key" class="control-label">API key</label>
                                  <input type="text" class="form-control" id="api_key"
                                                value="{{ masked_api_key }}" readonly>
                                                                  </div>
                      
                                <button type="submit" class="btn btn-primary d-block w-100">Generate new</button>
                              </form>
                        <br>
                        <div class="alert alert-danger">
                            When you click on "Generate new" it will Generate new key. This key is very sensitive informations of your account please avoid share this key. Thank you.
                        </div>
                    </div>
                  </div>
                  {% if site['languages']|length > 1 %}
                  
                                  <div class="card card_v2 mb-3">
                    <div class="card-body">
                            <div id="def_side_title">
                                <div class="icon">
                                    <i class="far fa-language"></i>
                                </div>
                                <div class="name">
                                 Language
                                </div>
                            </div>
                            <form method="post" action="account/change_lang">
                                <div class="form-group">
                                  <label for="language" class="control-label">{{ lang['account.changelang.title'] }}</label>
                                 <select class="form-control" name="lang">
															{% for language in site['languages'] %}
																<option {% if language["code"] == user["lang"] %} selected {% endif %} value="{{ language["code"] }}">{{ language["name"] }}</option>
															{% endfor %}
														</select>
                                </div>
                                <button type="submit" class="btn btn-primary d-block w-100">{{ lang['account.changelang.button'] }}</button>
                              </form>
                    </div>
                  </div>
                  {% endif %}

                <div class="card card_v2 mb-3">
                    <div class="card-body">
                            <div id="def_side_title">
                                <div class="icon">
                                    <i class="far fa-clock"></i>
                                </div>
                                <div class="name">
                                    Timezone
                                </div>
                            </div>
                            <form method="post" action="account/timezone">
                                <div class="form-group">
                                  <label for="timezone" class="control-label">{{ lang['account.timezone.title'] }}</label>>
										<select name="timezone" id="timezone" class="form-control">
																{% for timezone in timezones %}
																	<option {% if timezone["timezone"] == user['timezone'] %} selected {% endif %} value="{{ timezone["timezone"] }}">{{ timezone["label"] }}</option>
																{% endfor %}
															</select>
									           </div>

									   <button type="submit" class="btn btn-primary">{{ lang['account.timezone.button'] }}</button>
		                                    </div>
                                </div>
                            </form>
                        </div>













{% include 'footer.twig' %}
