EXPO-122 ready

remotes/origin/1203
pavel 11 years ago
parent 2be914ac58
commit 8ea0541801
  1. 32
      templates/client/article/blog_list.html
  2. 27
      templates/client/article/news_list.html
  3. 4
      templates/client/includes/company/company_edit.html
  4. 11
      templates/client/static_client/css/main.css
  5. 2
      templates/client/static_client/css_min/main.min.css
  6. 109
      templates/client/static_client/js/_modules/block.newsFilter.js
  7. 3
      templates/client/static_client/js/_modules/page.company.js
  8. 1
      templates/client/static_client/js_min/_modules/block.newsFilter.min.js
  9. 2
      templates/client/static_client/js_min/_modules/page.company.min.js
  10. 2
      templates/client/static_client/js_min/_modules/page.profile.calendar.min.js

@ -1,4 +1,5 @@
{% extends 'base_catalog.html' %}
{% load static %}
{% load thumbnail %}
{% load i18n %}
{% load template_filters %}
@ -17,18 +18,25 @@
{% endblock %}
{% block content_list %}
<div class="set-sect p-form adm-form">
<div class="set-sect p-form adm-form news-filter-block">
<form action="#">
<div class="adm-form-body">
<div class="mf-line mf-line1 s-subj-tag">
<div class="mf-field">
<label>{{ article_filter_form.theme.label }}</label>
{{ article_filter_form.theme }}
</div>
<div class="custom-select theme">
{{ article_filter_form.theme }}
</div>
</div>
<div class="mf-field">
<label>{{ article_filter_form.tag.label }}</label>
{{ article_filter_form.tag.label }}
<div class="custom-select tags">
{{ article_filter_form.tag }}
</div>
</div>
</div>
@ -52,6 +60,22 @@
</div>
</div>
</div>
<!--todo: вернуть минифицированную версию-->
<script src="{% static 'client/js/_modules/block.newsFilter.js' %}"></script>
<script>
//js module initialization
EXPO.newsFilter.init({
theme:{
placeholder:"{% trans 'Укажите тематику' %}"
},
tags:{
placeholder:"{% trans 'Выберите ключевые теги' %}",
url:'http://{{ request.get_host }}/theme/get-tag/'
}
});
</script>
{% endblock %}
{% block paginator %}

@ -1,4 +1,5 @@
{% extends 'base_catalog.html' %}
{% load static %}
{% load i18n %}
{% load template_filters %}
@ -16,7 +17,7 @@
{% endblock %}
{% block content_list %}
<div class="set-sect p-form adm-form">
<div class="set-sect p-form adm-form news-filter-block">
<form action="#">
<div class="adm-form-body">
@ -24,12 +25,18 @@
<div class="mf-line mf-line1 s-subj-tag">
<div class="mf-field">
<label>{{ article_filter_form.theme.label }}</label>
{{ article_filter_form.theme }}
<div class="custom-select theme">
{{ article_filter_form.theme }}
</div>
</div>
<div class="mf-field">
<label>{{ article_filter_form.tag.label }}</label>
{{ article_filter_form.tag.label }}
<div class="custom-select tags">
{{ article_filter_form.tag }}
</div>
</div>
</div>
@ -52,6 +59,20 @@
{% endfor %}
</div>
</div>
<!--todo: вернуть минифицированную версию-->
<script src="{% static 'client/js/_modules/block.newsFilter.js' %}"></script>
<script>
//js module initialization
EXPO.newsFilter.init({
theme:{
placeholder:"{% trans 'Укажите тематику' %}"
},
tags:{
placeholder:"{% trans 'Выберите ключевые теги' %}",
url:'http://{{ request.get_host }}/theme/get-tag/'
}
});
</script>
{% endblock %}
{% block paginator %}

@ -660,11 +660,11 @@
path:'http://{{ request.get_host }}/city/get-city/'
},
{id:'id_tag',
placeholder:'Выберите ключевые теги',
placeholder:"{% trans 'Выберите ключевые теги' %}",
path:'http://{{ request.get_host }}/theme/get-tag/'
},
{id:'id_theme',
placeholder:'Укажите тематику',
placeholder:'Укажите тематику'
}
],

@ -13515,4 +13515,15 @@ hr + .rq-note {
transition: color .3s;
color:#ff6600;
/*margin-top: 28px;*/
}
/*****************\
# Страница блогов и новостей (/blogs/ /news)
\*****************/
.news-filter-block .mf-line.s-subj-tag .mf-field label{
margin-bottom: 1em;
}
.news-filter-block .select2-container-multi .select2-choices .select2-search-field:first-child input{
line-height: 36px ;
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,109 @@
var EXPO = EXPO || {}; //isolated namespace
if (EXPO.newsFilter) {
console.warn('WARNING: EXPO.newsFilter is already defined!');
} else {
EXPO.newsFilter = (function () {
/**
* private (visible inside this module only) variables
*/
/**
* @type {Object} - module API interafce realization
*/
var that = {};
/**
* @type {Object} default setting
*/
that.opt = {};
/**
* dependencies.Place where you can switch on dependencies for module
* @type {EXPO.common|*} - mostly used in project functions and data (block.common.js)
*/
var com = EXPO.common;
/**
* current module general initialization
* @param {Object} options - options recieved from web page view
*/
that.init = function (options) {
// settings extending
$.extend(this.opt, options);
// begin of initialization
var self = this;
$(function () {
var $page = $(".news-filter-block"),
$theme = $('.custom-select.theme select', $page),
$tags = $(".custom-select.tags input", $page),
$form = $page.children("form");
$theme.attr("multiple","multiple");
$theme.select2({
placeholder: self.opt.theme.placeholder,
width: '368px',
maximumSelectionSize: 3
});
$tags.val('0');
$tags.select2({
placeholder: self.opt.tags.placeholder,
width: '368px',
multiple: true,
maximumSelectionSize: 5,
ajax: {
url: self.opt.tags.url,
dataType: "json",
quietMillis: 200,
data: function(term, page){
var themes = $theme.val();
if(!themes){
themes = [];
}
return {term: term,
page: page,
themes: themes};
},
results: function (data) {
var results = [];
$.each(data, function(index, item){
results.push({
id: item.id,
text: item.label
});
});
return {results: results};
}
},
initSelection : function(element, callback) {
var data = [],
dataObjArr;
element.val('');
if($.trim(element.attr('data-predifined')) != '' && $.trim(element.attr('data-predifined')) != '[]'){
dataObjArr = JSON.parse(element.attr('data-predifined'));
callback(dataObjArr);
}else{
$(" .custom-select.tags .select2-input").width(336).addClass('select2-default').val(self.opt.tags.placeholder);
}
}
});
$tags.on('change', function (e) {
$form.submit();
});
$theme.on('change', function (e) {
$form.submit();
});
});
};
return that;
}());
}

@ -509,7 +509,6 @@ if (EXPO.company){
// methods
//инициализация общих свойств
that.init = function(options) {
// todo: убрать одновременное открытие форм
$.extend(this.lang, options.lang);
options.lang = null;
@ -578,7 +577,6 @@ if (EXPO.company){
/**
* enable city <select/> when country is chosen
*/
//todo:чтобы работал надо ждать пока Назар сделает нулевой option
$country.on('change', function () {
if($(this).val() != 0 || $(this).val() != ''){
@ -668,7 +666,6 @@ if (EXPO.company){
}
},
initSelection : function(element, callback) {
console.log(element);
var data = [],
dataObjArr;
element.val('');

@ -0,0 +1 @@
var EXPO=EXPO||{};EXPO.newsFilter?console.warn("WARNING: EXPO.newsFilter is already defined!"):EXPO.newsFilter=function(){var t={};t.opt={};EXPO.common;return t.init=function(t){$.extend(this.opt,t);var e=this;$(function(){var t=$(".news-filter-block"),i=$(".custom-select.theme select",t),a=$(".custom-select.tags input",t),l=t.children("form");i.attr("multiple","multiple"),i.select2({placeholder:e.opt.theme.placeholder,width:"368px",maximumSelectionSize:3}),a.val("0"),a.select2({placeholder:e.opt.tags.placeholder,width:"368px",multiple:!0,maximumSelectionSize:5,ajax:{url:e.opt.tags.url,dataType:"json",quietMillis:200,data:function(t,e){var a=i.val();return a||(a=[]),{term:t,page:e,themes:a}},results:function(t){var e=[];return $.each(t,function(t,i){e.push({id:i.id,text:i.label})}),{results:e}}},initSelection:function(t,i){var a;t.val(""),""!=$.trim(t.attr("data-predifined"))&&"[]"!=$.trim(t.attr("data-predifined"))?(a=JSON.parse(t.attr("data-predifined")),i(a)):$(" .custom-select.tags .select2-input").width(336).addClass("select2-default").val(e.opt.tags.placeholder)}}),a.on("change",function(){l.submit()}),i.on("change",function(){l.submit()})})},t}();

File diff suppressed because one or more lines are too long

@ -1 +1 @@
var EXPO=EXPO||{};EXPO.profile=EXPO.profile||{},EXPO.profile.calendar?console.warn("WARNING: EXPO.profile.calendar is already defined!"):EXPO.profile.calendar=function(){var t=(EXPO.common,{});return t.opt={},$(function(){}),t.init=function(t){$.extend(this.opt,t);var e=this,s=$("#"+this.opt.scrollBoxId),n=$("#"+this.opt.calenadrId),a=(n.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,$("#"+this.opt.scrollLeftId)),o=$("#"+this.opt.scrollRightId),r=$("."+this.opt.noEventsClass),l=$("."+this.opt.calendarToggleClass),i=this.opt.cellWidth*this.opt.cellsToScroll,c=0,d=function(){var t,s,n=0,a=0,o=e.opt.cellWidth,r=$("#"+e.opt.calenadrId),l=r.find("td."+e.opt.currentDayClass).index(),i=e.opt.cellsToScroll,c=r.find("."+e.opt.daysClass+" td").length;return e.stepWidth=i*o,e.calendarWidth=o*c,l>0?(l++,t=c/i,s=c/l,a=t-s,e.currentDay=l,a?(a=Math.floor(a-1),n=i*a*o):n=0):(e.currentDay=0,n=0),n};this.currentOffset=d(),this.$messages=[],$(function(){r.each(function(){$(this).attr("colspan")&&1!=$(this).attr("colspan")?$(this).width()>e.stepWidth&&e.$messages.push($(".message",$(this)).width(e.stepWidth).css({marginLeft:e.currentOffset+"px"})):$(this).find("."+e.opt.eventWrapClass).addClass("small")}),$("."+e.opt.eventsClass).each(function(){c++,3==c&&$(this).addClass("grey"),4==c&&($(this).addClass("grey"),c=0)})}),$(window).load(function(){s.mCustomScrollbar({axis:"y",horizontalScroll:!0,setLeft:"-"+EXPO.profile.calendar.currentOffset+"px",mouseWheel:{enable:!1},scrollButtons:{enable:!1},contentTouchScroll:!1,scrollInertia:1e3,timeout:0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1},keyboard:{enable:!1}})}),a.on("click",function(){if(e.currentOffset>=e.stepWidth){e.currentOffset-=i,s.mCustomScrollbar("scrollTo","+="+i);for(var t=0;t<e.$messages.length;t++){var n=parseInt(e.$messages[t].inlineStyle("margin-left"));n>0&&e.$messages[t].css({marginLeft:e.currentOffset+"px"})}}}),o.on("click",function(){if(e.currentOffset+e.stepWidth<e.calendarWidth){e.currentOffset+=i,s.mCustomScrollbar("scrollTo","-="+i);for(var t=0;t<e.$messages.length;t++){var n=parseInt(e.$messages[t].inlineStyle("margin-left"));n+e.$messages[t].width()<e.calendarWidth&&e.$messages[t].css({marginLeft:e.currentOffset+"px"})}}}),l.on("click",function(){var t=$(this),e=t.closest(".ep-sect"),s=e.children("div.ep-sect-body");return e.hasClass("eps-opened")?(o.hide(),a.hide(),s.stop().animate({opacity:0},300,function(){e.removeClass("eps-opened")})):(o.show(),a.show(),s.stop().animate({opacity:1},300,function(){e.addClass("eps-opened")})),!1})},t}();
var EXPO=EXPO||{};EXPO.profile=EXPO.profile||{},EXPO.profile.calendar?console.warn("WARNING: EXPO.profile.calendar is already defined!"):EXPO.profile.calendar=function(){var e=(EXPO.common,{});return e.opt={},$(function(){$("#btn_delete").on("click",function(e){e.preventDefault();var t=$("input[name=expo]:checkbox:checked").map(function(){return $(this).val()}).get(),s=$("input[name=conf]:checkbox:checked").map(function(){return $(this).val()}).get(),n=$("input[name=seminar]:checkbox:checked").map(function(){return $(this).val()}).get(),a=$("input[name=webinar]:checkbox:checked").map(function(){return $(this).val()}).get(),i={expo:JSON.stringify(t),conf:JSON.stringify(s),seminar:JSON.stringify(n),webinar:JSON.stringify(a)};$.get("/profile/calendar/remove/",i,function(e){e.success&&location.reload()})})}),e.init=function(e){$.extend(this.opt,e);var t=this,s=$("#"+this.opt.scrollBoxId),n=$("#"+this.opt.calenadrId),a=(n.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,$("#"+this.opt.scrollLeftId)),i=$("#"+this.opt.scrollRightId),o=$("."+this.opt.noEventsClass),r=$("."+this.opt.calendarToggleClass),c=this.opt.cellWidth*this.opt.cellsToScroll,l=0,d=function(){var e,s,n=0,a=0,i=t.opt.cellWidth,o=$("#"+t.opt.calenadrId),r=o.find("td."+t.opt.currentDayClass).index(),c=t.opt.cellsToScroll,l=o.find("."+t.opt.daysClass+" td").length;return t.stepWidth=c*i,t.calendarWidth=i*l,r>0?(r++,e=l/c,s=l/r,a=e-s,t.currentDay=r,a?(a=Math.floor(a-1),n=c*a*i):n=0):(t.currentDay=0,n=0),n};this.currentOffset=d(),this.$messages=[],$(function(){o.each(function(){$(this).attr("colspan")&&1!=$(this).attr("colspan")?$(this).width()>t.stepWidth&&t.$messages.push($(".message",$(this)).width(t.stepWidth).css({marginLeft:t.currentOffset+"px"})):$(this).find("."+t.opt.eventWrapClass).addClass("small")}),$("."+t.opt.eventsClass).each(function(){l++,3==l&&$(this).addClass("grey"),4==l&&($(this).addClass("grey"),l=0)})}),$(window).load(function(){s.mCustomScrollbar({axis:"y",horizontalScroll:!0,setLeft:"-"+EXPO.profile.calendar.currentOffset+"px",mouseWheel:{enable:!1},scrollButtons:{enable:!1},contentTouchScroll:!1,scrollInertia:1e3,timeout:0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1},keyboard:{enable:!1}})}),a.on("click",function(){if(t.currentOffset>=t.stepWidth){t.currentOffset-=c,s.mCustomScrollbar("scrollTo","+="+c);for(var e=0;e<t.$messages.length;e++){var n=parseInt(t.$messages[e].inlineStyle("margin-left"));n>0&&t.$messages[e].css({marginLeft:t.currentOffset+"px"})}}}),i.on("click",function(){if(t.currentOffset+t.stepWidth<t.calendarWidth){t.currentOffset+=c,s.mCustomScrollbar("scrollTo","-="+c);for(var e=0;e<t.$messages.length;e++){var n=parseInt(t.$messages[e].inlineStyle("margin-left"));n+t.$messages[e].width()<t.calendarWidth&&t.$messages[e].css({marginLeft:t.currentOffset+"px"})}}}),r.on("click",function(){var e=$(this),t=e.closest(".ep-sect"),s=t.children("div.ep-sect-body");return t.hasClass("eps-opened")?(i.hide(),a.hide(),s.stop().animate({opacity:0},300,function(){t.removeClass("eps-opened")})):(i.show(),a.show(),s.stop().animate({opacity:1},300,function(){t.addClass("eps-opened")})),!1})},e}();
Loading…
Cancel
Save