expo-16 almost ready, needs back-end editing

remotes/origin/1203
pavel 11 years ago
parent bbc7611646
commit 711cd3a7c4
  1. 2
      proj/settings.py
  2. 76
      templates/client/accounts/new_profile.html
  3. 4
      templates/client/blank.html
  4. 163
      templates/client/includes/accounts/current_user.html
  5. 3
      templates/client/includes/accounts/simple_user.html
  6. 26
      templates/client/static_client/css/main.css
  7. 41
      templates/client/static_client/js/_modules/page.profile.js

@ -412,4 +412,4 @@ except ImportError, e:
"""
ADMIN_PAGINATION = 20
CLIENT_PAGINATION = 15
TEMPLATE_DEBUG = DEBUG
TEMPLATE_DEBUG = DEBUG

@ -444,6 +444,44 @@
</div>
</div>
{% block scripts %}
<!-- mask select scripts-->
<script src="{% static 'client/js/plugins/inputmask/jquery.inputmask.js' %}"></script>
<script src="{% static 'client/js/plugins/inputmask/jquery.bind-first-0.2.3.min.js' %}"></script>
<script src="{% static 'client/js/plugins/inputmask/jquery.inputmask-multi.js' %}"></script>
<!-- page module-->
<!--<script src="{% static 'client/js' %}{% if debug %}/{% else %}_min/{% endif %}_modules/page.profile{% if debug %}{% else %}.min{% endif %}.js"></script>-->
<script src="{% static 'client/js/_modules/page.profile.js' %}"></script>
<script>
//js module initialization
EXPO.profile.init({
// class selector to identify required forms on page
updateFormClass:'update-profile-form',
// text and paths for dynamically rendered selectboxes
selectBox:[
{id:'id_country'},
{id:'id_theme',
placeHolder:'Выберите тематику компании'
},
{id:'id_city',
placeholder:'Search city',
path:'http://{{ request.get_host }}/city/get-city/'
},
{id:'id_company',
placeholder:'Search company',
path:'http://{{ request.get_host }}/company/get-company/'
}
],
// we need this id to enable mapping library
phoneBox: 'id_phone',
// some helper text in current language
lang:{
workIn:'в'// there must be 'at' in English
}
});
</script>
{% endblock %}
</div>
{% endblock %}
{% block popup %}
@ -457,40 +495,4 @@
<script src="{% static 'client/js/plugins/select2_locale_ru.js' %}"></script>
{% endblock %}
{% block scripts %}
<!-- mask select scripts-->
<script src="{% static 'client/js/plugins/inputmask/jquery.inputmask.js' %}"></script>
<script src="{% static 'client/js/plugins/inputmask/jquery.bind-first-0.2.3.min.js' %}"></script>
<script src="{% static 'client/js/plugins/inputmask/jquery.inputmask-multi.js' %}"></script>
<!-- page module-->
<script src="{% static 'client/js' %}{% if debug %}/{% else %}_min/{% endif %}_modules/page.profile{% if debug %}{% else %}.min{% endif %}.js"></script>
<script>
//js module initialization
EXPO.profile.init({
// class selector to identify required forms on page
updateFormClass:'update-profile-form',
// text and paths for dynamically rendered selectboxes
selectBox:[
{id:'id_country'},
{id:'id_theme',
placeHolder:'Выберите тематику компании'
},
{id:'id_city',
placeholder:'Search city',
path:'http://{{ request.get_host }}/city/get-city/'
},
{id:'id_company',
placeholder:'Search company',
path:'http://{{ request.get_host }}/company/get-company/'
}
],
// we need this id to enable mapping library
phoneBox: 'id_phone',
// some helper text in current language
lang:{
workIn:'в'// there must be 'at' in English
}
});
</script>
{% endblock %}

@ -24,7 +24,9 @@ This template include basic anf main styles and js files,
<link rel="shortcut icon" href="{% static 'client/img/favicon.ico' %}" type="image/x-icon" />
<link rel="stylesheet" href="{% static 'client/css' %}{% if debug %}/{% else %}_min/{% endif %}vendor{% if debug %}{% else %}.min{% endif %}.css">
<link rel="stylesheet" href="{% static 'client/css' %}{% if debug %}/{% else %}_min/{% endif %}main{% if debug %}{% else %}.min{% endif %}.css">
<!--todo: вернуть минифицированную версию-->
<!--<link rel="stylesheet" href="{% static 'client/css' %}{% if debug %}/{% else %}_min/{% endif %}main{% if debug %}{% else %}.min{% endif %}.css">-->
<link rel="stylesheet" href="{% static 'client/css/main.css' %}">
<script src="{% static 'client/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js' %}"></script>
<script src="{% static 'client/js/vendor/jquery-1.10.1.min.js' %}"></script>

@ -1,16 +1,23 @@
{% load static %}
{% load i18n %}
{% load template_filters %}
{% load thumbnail %}
<div class="m-article">
<div class="m-article edit-profile">
<div class="item-wrap clearfix">
{# avatar #}
<aside>
<div class="i-pict p-editable">
{% if request.user.profile.avatar %}
<img src="{{ request.user.profile.avatar.url }}" alt="" />
<div id="pick-block" class="pic_block">
{% endif %}
{% thumbnail request.user.profile.avatar "100x100" crop="center" as im %}
<img clas="user-avatar" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
{% endthumbnail %}
{% if request.user.profile.avatar %}
</div>
{% endif %}
<div class="edit-wrap">
<a class="e-btn" href="#">{% trans 'редактировать' %}</a>
@ -51,7 +58,7 @@
{% else %}
<span style="display:none;">
{% endif %}
<a href="#">{{ home_form.instance.country }}</a>
<span id="static-home-country">{{ home_form.instance.country }}</span>
</span>
{% if home_form.instance.city %}
@ -59,7 +66,7 @@
{% else %}
<span style="display:none;">
{% endif %}
, <a href="#">{{ home_form.instance.city }}</a>
, <span id="static-home-city">{{ home_form.instance.city }}</span>
</span>
<div class="edit-wrap e-left">
@ -79,9 +86,7 @@
<div class="epfl">
<label>{% trans 'Город' %}</label>
<div class="epf-field">
<select name="city" style="width: 200px;">
</select>
{{ home_form.city }}
</div>
</div>
@ -99,7 +104,9 @@
{# name #}
<div class="i-title p-editable">
<span>{{ name_form.get_full_name }}</span>
<span id="static-name-value">
{{ name_form.get_full_name }}
</span>
<div class="edit-wrap">
<a class="e-btn" href="#">{% trans 'редактировать' %}</a>
<div class="e-form">
@ -137,7 +144,7 @@
{# position #}
<div class="i-position p-editable">
<p>
<p id="static-work-value">
{{ work_form.position.value }}
{% if work_form.work.value %}
{% trans 'в' %} {{ work_form.work.value }}
@ -177,62 +184,50 @@
</div>
</div>
{# END position #}
{# description #}
<div class="i-descr p-editable">
<p>{{ about_company_form.about_company.value }}</p>
<div class="edit-wrap">
<a class="e-btn" href="#">{% trans 'редактировать' %}</a>
<div class="e-form">
<form class="clearfix update-profile-form" id="about_company_form" action="/profile/update/about-company/" method="post">{% csrf_token %}
<div class="ef-body">
<div class="epfl">
<label>{{ about_company_form.about_company.label }}</label>
<div class="epf-field">
{{ about_company_form.about_company }}
</div>
</div>
</div>
<div class="ef-buttons">
<button type="submit" class="lnk icon-save">{% trans 'Сохранить' %}</button>
</div>
</form>
<a class="ef-close" href="#">{% trans 'закрыть' %}</a>
</div>
</div>
</div>
{# END description #}
<hr />
<div class="i-contacts clearfix">
<div class="ic-buttons">
<a class="button icon-edit icb-edit-profile" href="#">{% trans 'редактировать профиль' %}</a>
<a class="button orange icon-edit icb-exit-edit" href="#">{% trans 'завершить редактирование' %}</a>
<div class="p-editable">
<ul class="soc-media-buttons">
<li><a href="{% if social_form.facebook.value %} {{ social_form.facebook.value }} {%else %}#{% endif %}">
<img src="{% static 'client/img/soc-medias/sm-icon-fb.png' %}" title="Facebook" alt="Facebook" />
<ul class="soc-media-buttons soc-media-buttons1">
<li>
{% if social_form.facebook.value %}
<a href="{{ social_form.facebook.value }}" target="_blank">
<img id="img-facebook" src="{% static 'client/img/soc-medias/sm-icon-fb.png' %}" title="Facebook" alt="Facebook" />
</a>
{% else %}
<img id="img-facebook" src="{% static 'client/img/soc-medias/sm-icon-fb_hover.png' %}" title="Facebook" alt="Facebook" />
{% endif %}
</li>
<li><a href="{% if social_form.linkedin.value %} {{ social_form.linkedin.value }} {%else %}#{% endif %}">
<img src="{% static 'client/img/soc-medias/sm-icon-lin.png' %}" title="LinkedIn" alt="LinkedIn" />
<li>
{% if social_form.linkedin.value %}
<a href="{{ social_form.linkedin.value }}" target="_blank">
<img id="img-linkedin" src="{% static 'client/img/soc-medias/sm-icon-lin.png' %}" title="LinkedIn" alt="LinkedIn" />
</a>
</li>
<li><a href="{% if social_form.vk.value %} {{ social_form.vk.value }} {%else %}#{% endif %}">
<img src="{% static 'client/img/soc-medias/sm-icon-vk.png' %}" title="В контакте" alt="В контакте" />
{% else %}
<img id="img-linkedin" src="{% static 'client/img/soc-medias/sm-icon-lin_hover.png' %}" title="LinkedIn" alt="LinkedIn" />
{% endif %}
<li>
{% if social_form.vk.value %}
<a href="{{ social_form.vk.value }}" target="_blank">
<img id="img-vk" src="{% static 'client/img/soc-medias/sm-icon-vk.png' %}" title="В контакте" alt="В контакте" />
</a>
{% else %}
<img id="img-vk" src="{% static 'client/img/soc-medias/sm-icon-vk_hover.png' %}" title="В контакте" alt="В контакте" />
{% endif %}
</li>
<li><a href="{% if social_form.twitter.value %} {{ social_form.twitter.value }} {%else %}#{% endif %}">
<img src="{% static 'client/img/soc-medias/sm-icon-twit.png' %}" title="Twitter" alt="Twitter" />
<li>
{% if social_form.twitter.value %}
<a href="{{ social_form.twitter.value }}" target="_blank">
<img id="img-twitter" src="{% static 'client/img/soc-medias/sm-icon-twit.png' %}" title="Twitter" alt="Twitter" />
</a>
</li>
</ul>
{% else %}
<img id="img-twitter" src="{% static 'client/img/soc-medias/sm-icon-twit_hover.png' %}" title="Twitter" alt="Twitter" />
{% endif %}
</li></li>
</ul>
<div class="edit-wrap">
<a class="e-btn" href="#">{% trans 'редактировать' %}</a>
<div class="e-form">
@ -284,7 +279,7 @@
<div class="ic-links">
<div class="ic-tel p-editable">
{% if phone_form.phone.value %}
<span>{{ phone_form.phone.value|phone }}</span>
<span id="static-phone-value">{{ phone_form.phone.value|phone }}</span>
{% endif %}
<div class="edit-wrap">
<a class="e-btn" href="#">{% trans 'редактировать' %}</a>
@ -345,7 +340,7 @@
<div class="ic-site p-editable">
{% if web_page_form.web_page.value %}
<a class="icon-ext-link" href="{% if web_page_form.web_page.value %}{{ web_page_form.web_page.value }}{% else %}#{% endif %}" target="_blank">
<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">
{% if web_page_form.web_page.value %}
{{ web_page_form.web_page.value }}
{% endif %}
@ -388,7 +383,7 @@
<div class="ia-title">{% trans 'О себе:' %}</div>
<div class="p-editable">
<p>{{ about_form.about.value }}</p>
<p id="static-about-value">{{ about_form.about.value }}</p>
<div class="edit-wrap">
<a class="e-btn" href="#">{% trans 'редактировать' %}</a>
@ -423,27 +418,41 @@
</div>
{% block scripts %}
<!-- mask select scripts-->
<script src="{% static 'client/js/plugins/inputmask/jquery.inputmask.js' %}"></script>
<script src="{% static 'client/js/plugins/inputmask/jquery.bind-first-0.2.3.min.js' %}"></script>
<script src="{% static 'client/js/plugins/inputmask/jquery.inputmask-multi.js' %}"></script>
<!-- page module-->
<!--todo: вернуть минифицированную версию-->
<!--<script src="{% static 'client/js' %}{% if debug %}/{% else %}_min/{% endif %}_modules/page.profile{% if debug %}{% else %}.min{% endif %}.js"></script>-->
<script src="{% static 'client/js/_modules/page.profile.js' %}"></script>
<script>
//js module initialization
EXPO.profile.init({
// class seletor to identify required forms on page
updateFormClass:'update-profile-form',
// text and paths for dynamically rendered selectboxes
selectBox:[
{id:'id_country'},
{id:'id_theme',
placeHolder:'Выберите тематику компании'
},
{id:'id_city',
placeholder:'Search city',
path:'/city/get-city/'
},
{id:'id_company',
placeholder:'Search company',
path:'/company/get-company/'
}
]
});
//js module initialization
EXPO.profile.init({
// class selector to identify required forms on page
updateFormClass:'update-profile-form',
// text and paths for dynamically rendered selectboxes
selectBox:[
{id:'id_country'},
{id:'id_theme',
placeHolder:'Выберите тематику компании'
},
{id:'id_city',
placeholder:'Поиск города',
path:'http://{{ request.get_host }}/city/get-city/'
},
{id:'id_company',
placeholder:'Поиск компании',
path:'http://{{ request.get_host }}/company/get-company/'
}
],
// we need this id to enable mapping library
phoneBox: 'id_phone',
// some helper text in current language
lang:{
workIn:'в'// there must be 'at' in English
}
});
</script>
{% endblock %}

@ -8,7 +8,8 @@
<aside>
{% if member.profile.avatar %}
<div class="i-pict">
<img src="{{ member.profile.avatar.url }}" alt="" />
<img clas="user-avatar" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}">
</div>
{% endif %}
</aside>

@ -8045,6 +8045,7 @@ a.order-button:hover .ob-text,
margin: -1px 0 0 -6px;
}
.i-pict.p-editable .edit-wrap {
left: 100%;
top: 5px;
@ -8152,7 +8153,7 @@ a.order-button:hover .ob-text,
left: 28px;
top: 0;
width: 600px;
z-index: 1000;
z-index: 2;
font-family: 'dindisplay_pro', Arial, sans-serif;
font-size: 12px;
line-height: 15px;
@ -12615,3 +12616,26 @@ hr + .rq-note {
.calenadar-body{
overflow: hidden;
}
/************************\
# страница редактирования профиля
\***********************/
.edit-profile .edit-wrap{
display: block;
}
.edit-profile .pe-current .e-form{
display: block;
}
.edit-profile .p-editable{
padding-left: 22px;
}
.edit-profile .p-editable.i-place{
padding-left: 36px;
}
.edit-profile .i-pict.p-editable{
padding: 0;
}
.edit-profile .i-pict.p-editable img{
z-index: 0;
}

@ -54,7 +54,8 @@ if (EXPO.profile){
if(typeof handler == 'function'){
// if particular data change required
handler(data);
this.formData = handler(data, formName);
this.getajax(data);
$('#wait-ajax').show();
} else{
this.getajax(data);
@ -142,8 +143,7 @@ if (EXPO.profile){
var self = this;
this.pullHandler = function (data) {
if (data.success){
var company = $('#s2id_id_company').find('.select2-chosen').text();
$('#static-work-value').html($('#id_position').val()+' '+EXPO.profile.lang.workIn+' <a href="'+data.url+'">"'+ company+'"</a>');
$('#static-work-value').text($('#id_position').val());
$('.p-editable').removeClass('pe-current');
}
@ -159,15 +159,6 @@ if (EXPO.profile){
};
this.ajaxPath = path;
};
Forms.social_form = function (path) {
this.pullHandler = function (data) {
if (data.success){
window.location.reload();
}
};
this.ajaxPath = path;
};
Forms.phone_form = function (path) {
var self = this;
@ -250,6 +241,15 @@ if (EXPO.profile){
}
$('.p-editable').removeClass('pe-current');
}
};
this.pushHandler = function (data, formName){
var formData = $('#'+formName).serialize();
return JSON.parse('{"' + decodeURI(formData).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}');
};
this.ajaxPath = path;
@ -260,18 +260,13 @@ if (EXPO.profile){
$editPhoto = $('#pic-edit-photo'),
$pickBlock = $('#pick-block'),
$form,
$avatar = $('.pic_block img');
$avatar = $('img',$pickBlock);
this.pullHandler = function (data) {
if (data.success){
if($avatar.length){
$avatar.attr('src', data.url);
}else{
$pickBlock.removeClass('add_pic_block').addClass('pic_block');
$('.add-wrapper', $pickBlock).remove();
$('<img/>').attr('src', data.url).prependTo($pickBlock);
}
// $('#static-about-value').text($('#id_about').val());
$('.p-editable').removeClass('pe-current');
}
};
@ -288,16 +283,10 @@ if (EXPO.profile){
$input.on('change', function () {
$(this).parents('form').submit();
});
$editPhoto.on('click', function () {
$input.trigger('click');
});
// pick-block
this.ajaxPath = path;
}
$(function () {
this.ajaxPath = path;
};
});
// methods
//инициализация общих свойств

Loading…
Cancel
Save