remotes/origin/1203
Nazar Kotyuk 11 years ago
commit f335ce32ba
  1. 165
      templates/client/includes/accounts/current_user.html
  2. 2
      templates/client/popups/create_company.html
  3. 74
      templates/client/static_client/js/_modules/page.profile.js
  4. 2
      templates/client/static_client/js_min/_modules/page.profile.min.js

@ -46,7 +46,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="i-rating" title="Рейтинг: 551">551</div>
<div class="reason_block">
<p>Заполните свой<br>профиль, чтобы<br>повысить рейтинг</p>
<p>Чем выше<br>рейтинг —<br>тем больше<br>преимуществ!</p>
</div>
</aside> </aside>
{# END avatar #} {# END avatar #}
<div class="i-info"> <div class="i-info">
@ -294,36 +298,42 @@
</div> </div>
{# contacts #} {# contacts #}
<div class="ic-links dd_width_5"> <div class="ic-links dd_width_5">
<div class="ic-tel p-editable"> <div class="phone_form-wrap">
{% if phone_form.phone.value %} <div class="p-editable add_link_text add_link_text_medium">
<a class="e-btn" href="#" title="">{% trans 'Добавить' %}</a>
<div class="add_link_text_text">{% trans 'номер телефона' %} <b>+15</b></div>
</div>
<div class="ic-tel p-editable hidden">
{% if phone_form.phone.value %}
<span id="static-phone-value">{{ phone_form.phone.value|phone }}</span> <span id="static-phone-value">{{ phone_form.phone.value|phone }}</span>
{% endif %} {% endif %}
<div class="edit-wrap"> <div class="edit-wrap">
<a class="e-btn" href="#">{% trans 'редактировать' %}</a> <a class="e-btn" href="#">{% trans 'редактировать' %}</a>
<div class="e-form"> <div class="e-form">
<form class="clearfix update-profile-form" id="phone_form" action="/profile/update/phone/" method="post">{% csrf_token %} <form class="clearfix update-profile-form" id="phone_form" action="/profile/update/phone/" method="post">{% csrf_token %}
<div class="ef-body"> <div class="ef-body">
<div class="epfl"> <div class="epfl">
<label>{{ phone_form.phone.label }}</label> <label>{{ phone_form.phone.label }}</label>
<div class="epf-field"> <div class="epf-field">
{{ phone_form.phone }} {{ phone_form.phone }}
</div> </div>
</div> </div>
</div> </div>
<div class="ef-buttons"> <div class="ef-buttons">
<button type="submit" class="lnk icon-save">{% trans 'Сохранить' %}</button> <button type="submit" class="lnk icon-save">{% trans 'Сохранить' %}</button>
</div> </div>
</form> </form>
<a class="ef-close" href="#">{% trans 'закрыть' %}</a> <a class="ef-close" href="#">{% trans 'закрыть' %}</a>
</div> </div>
</div> </div>
</div>
</div> </div>
<!-- {% comment %}
<div class="ic-mail p-editable"> <div class="ic-mail p-editable">
{% if email_form.email.value %} {% if email_form.email.value %}
<a class="icon-mail" href="mailto:{{ email_form.email.value }}">{{ email_form.email.value }}</a> <a class="icon-mail" href="mailto:{{ email_form.email.value }}">{{ email_form.email.value }}</a>
@ -353,39 +363,44 @@
</div> </div>
</div> </div>
</div> </div>
--> {% endcomment %}
<div class="web_page_form-wrap">
<div class="ic-site p-editable"> <div class="ic-site p-editable add_link_text add_link_text_medium">
{% if web_page_form.web_page.value %} <a class="e-btn" href="#" title="">{% trans 'Добавить' %}</a>
<a class="icon-ext-link" id="static-web-page-value" href="{% if web_page_form.web_page.value %}{{ web_page_form.web_page.value }}{% else %}#{% endif %}" target="_blank"> <div class="add_link_text_text">{% trans 'сайт' %} <b>+5</b></div>
{% if web_page_form.web_page.value %} </div>
{{ web_page_form.web_page.value }} <div class="ic-site p-editable hidden">
{% endif %} {% if web_page_form.web_page.value %}
</a> <a class="icon-ext-link" id="static-web-page-value" href="{% if web_page_form.web_page.value %}{{ web_page_form.web_page.value }}{% else %}#{% endif %}" target="_blank">
{% endif %} {% if web_page_form.web_page.value %}
{{ web_page_form.web_page.value }}
{% endif %}
</a>
{% endif %}
<div class="edit-wrap"> <div class="edit-wrap">
<a class="e-btn" href="#">{% trans 'редактировать' %}</a> <a class="e-btn" href="#">{% trans 'редактировать' %}</a>
<div class="e-form"> <div class="e-form">
<form class="clearfix update-profile-form" id="web_page_form" action="/profile/update/web-page/" method="post">{% csrf_token %} <form class="clearfix update-profile-form" id="web_page_form" action="/profile/update/web-page/" method="post">{% csrf_token %}
<div class="ef-body"> <div class="ef-body">
<div class="epfl"> <div class="epfl">
<label>{{ web_page_form.web_page.label }}</label> <label>{{ web_page_form.web_page.label }}</label>
<div class="epf-field"> <div class="epf-field">
{{ web_page_form.web_page }} {{ web_page_form.web_page }}
</div>
</div> </div>
</div>
</div> </div>
<div class="ef-buttons"> <div class="ef-buttons">
<button type="submit" class="lnk icon-save">{% trans 'Сохранить' %}</button> <button type="submit" class="lnk icon-save">{% trans 'Сохранить' %}</button>
</div> </div>
</form> </form>
<a class="ef-close" href="#">{% trans 'закрыть' %}</a> <a class="ef-close" href="#">{% trans 'закрыть' %}</a>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -398,32 +413,37 @@
{# about #} {# about #}
<div class="i-additional"> <div class="i-additional">
<div class="ia-title">{% trans 'О себе:' %}</div> <div class="ia-title">{% trans 'О себе:' %}</div>
<div class="about_form-wrap">
<div class="p-editable add_link_text">
<a class="e-btn" href="#" title="">{% trans 'Добавить' %}</a>
<div class="add_link_text_text">{% trans 'информацию о себе' %} <b>+10</b></div>
</div>
<div class="p-editable hidden">
<p id="static-about-value">{{ about_form.about.value }}</p>
<div class="p-editable"> <div class="edit-wrap">
<p id="static-about-value">{{ about_form.about.value }}</p> <a class="e-btn" href="#">{% trans 'редактировать' %}</a>
<div class="e-form">
<div class="edit-wrap"> <form class="clearfix update-profile-form" id="about_form" action="/profile/update/about/" method="post">{% csrf_token %}
<a class="e-btn" href="#">{% trans 'редактировать' %}</a>
<div class="e-form">
<form class="clearfix update-profile-form" id="about_form" action="/profile/update/about/" method="post">{% csrf_token %}
<div class="ef-body"> <div class="ef-body">
<div class="epfl"> <div class="epfl">
<label>{{ about_form.about.label }}</label> <label>{{ about_form.about.label }}</label>
<div class="epf-field"> <div class="epf-field">
{{ about_form.about }} {{ about_form.about }}
</div>
</div> </div>
</div>
</div> </div>
<div class="ef-buttons"> <div class="ef-buttons">
<button type="submit" class="lnk icon-save">{% trans 'Сохранить' %}</button> <button type="submit" class="lnk icon-save">{% trans 'Сохранить' %}</button>
</div> </div>
</form> </form>
<a class="ef-close" href="#">{% trans 'закрыть' %}</a> <a class="ef-close" href="#">{% trans 'закрыть' %}</a>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -451,7 +471,7 @@
</div> </div>
<div class="add-company-block"> <div class="add-company-block">
<a class="button icon-add" href="#">{% trans 'Добавить компанию' %}</a> <a class="button icon-add" href="#" id="add-new-company">{% trans 'Добавить компанию' %}</a>
</div> </div>
{# END companies #} {# END companies #}
@ -479,6 +499,7 @@
// text part that is added to form id to designate its wrapper container // text part that is added to form id to designate its wrapper container
formContainerPostfix:'-wrap', formContainerPostfix:'-wrap',
// text and paths for dynamically rendered selectboxes // text and paths for dynamically rendered selectboxes
addCompanyButtonId:'add-new-company',
selectBox:[ selectBox:[
{id:'id_country'}, {id:'id_country'},
{id:'id_theme', {id:'id_theme',
@ -499,6 +520,10 @@
// some helper text in current language // some helper text in current language
lang:{ lang:{
workIn:'в'// there must be 'at' in English workIn:'в'// there must be 'at' in English
},
addCompany:{
modalId:'pw-company',
formId:'create_company_form'
} }
}); });

@ -6,7 +6,7 @@
<div class="pw-title">{% trans 'Создание компании' %}</div> <div class="pw-title">{% trans 'Создание компании' %}</div>
</header> </header>
<div class="pw-body clearfix"> <div class="pw-body clearfix">
<form id="create_company_form" method="post" class="pw-form" action="{{ form.action }}">{% csrf_token %} <form id="create_company_form" method="post" class="pw-form update-profile-form" action="{{ form.action }}">{% csrf_token %}
<div class="pwf-line"> <div class="pwf-line">
<div class="pwf-field"> <div class="pwf-field">
{{ form.name }} {{ form.name }}

@ -15,8 +15,9 @@ if (EXPO.profile){
//language object //language object
that.lang ={}; that.lang ={};
//dependences //dependences
var com = EXPO.common;
//private //private
// factory for on page form objects // factory for on page form objects
function Forms(){}; function Forms(){};
// methods to perform ajax responses to send and receive data from the server // methods to perform ajax responses to send and receive data from the server
@ -116,6 +117,10 @@ if (EXPO.profile){
Forms.home_form = function (path) { Forms.home_form = function (path) {
var self = this; var self = this;
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
var country = $('#s2id_id_country').find('.select2-chosen').text(), var country = $('#s2id_id_country').find('.select2-chosen').text(),
@ -130,6 +135,10 @@ if (EXPO.profile){
}; };
Forms.name_form = function (path) { Forms.name_form = function (path) {
var self = this; var self = this;
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
$('#static-name-value').text($('#id_last_name').val()+' '+$('#id_first_name').val()); $('#static-name-value').text($('#id_last_name').val()+' '+$('#id_first_name').val());
@ -141,6 +150,10 @@ if (EXPO.profile){
}; };
Forms.work_form = function (path) { Forms.work_form = function (path) {
var self = this; var self = this;
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
$('#static-work-value').text($('#id_position').val()); $('#static-work-value').text($('#id_position').val());
@ -152,6 +165,10 @@ if (EXPO.profile){
}; };
Forms.about_company_form = function (path) { Forms.about_company_form = function (path) {
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
window.location.reload(); window.location.reload();
@ -162,6 +179,10 @@ if (EXPO.profile){
}; };
Forms.phone_form = function (path) { Forms.phone_form = function (path) {
var self = this; var self = this;
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
$('#static-phone-value').text($('#id_phone')[0].value); $('#static-phone-value').text($('#id_phone')[0].value);
@ -175,6 +196,10 @@ if (EXPO.profile){
}; };
Forms.web_page_form = function (path) { Forms.web_page_form = function (path) {
var self = this; var self = this;
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
var userLink = $('#id_web_page').val(); var userLink = $('#id_web_page').val();
@ -188,6 +213,10 @@ if (EXPO.profile){
}; };
Forms.about_form = function (path) { Forms.about_form = function (path) {
var self = this; var self = this;
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
$('#static-about-value').text($('#id_about').val()); $('#static-about-value').text($('#id_about').val());
@ -207,6 +236,10 @@ if (EXPO.profile){
Forms.social_form = function (path) { Forms.social_form = function (path) {
var self = this, var self = this,
$img, imgSrc, $input, inputValue; $img, imgSrc, $input, inputValue;
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
@ -261,6 +294,10 @@ if (EXPO.profile){
$pickBlock = $('#pick-block'), $pickBlock = $('#pick-block'),
$form, $form,
$avatar = $('img',$pickBlock); $avatar = $('img',$pickBlock);
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
@ -286,6 +323,26 @@ if (EXPO.profile){
this.ajaxPath = path; this.ajaxPath = path;
}; };
/**
* add new company form init
* @param path
*/
Forms.create_company_form = function (path) {
var self = this;
/**
* callback after successful request to the server
* @param data -data object recieved from server
*/
this.pullHandler = function (data) {
if (data.success){
}
};
this.ajaxPath = path;
};
// methods // methods
@ -326,9 +383,9 @@ if (EXPO.profile){
}; };
this.forms = {}; this.forms = {};
$(function () { $(function () {
//start of document.ready /**
* <selectbox> styling with 3-rd party libs
// <selectbox> styling with 3-rd party libs */
$('#'+self.opt.selectBox[0].id).select2({ $('#'+self.opt.selectBox[0].id).select2({
width: 'element' width: 'element'
}); });
@ -468,6 +525,15 @@ if (EXPO.profile){
return false; return false;
}); });
/**
* add new company modal window trigger
*/
$('#'+self.opt.addCompanyButtonId).on('click', function (event) {
event.preventDefault();
$.fancybox.open('#'+ self.opt.addCompany.modalId);
return false;
});
}); });

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save