remotes/origin/1203
pavel 11 years ago
parent 9c46d43a6b
commit 55453393b1
  1. 32
      templates/client/includes/place/place_object.html
  2. 32
      templates/client/static_client/css/main.css
  3. 2
      templates/client/static_client/css_min/main.min.css
  4. 26
      templates/client/static_client/js/_modules/page.place.object.js
  5. 2
      templates/client/static_client/js_min/_modules/page.place.object.min.js

@ -5,7 +5,7 @@
{% block page_body %}
<div class="m-article">
<div class="item-wrap place clearfix">
<div class="item-wrap expo-place-page clearfix">
<aside>
<div class="i-pict">
{% include 'client/includes/show_logo.html' with obj=place %}
@ -19,7 +19,7 @@
{{ place.name|safe }}
</div>
<div class="i-descr annotation-part">
{{ place.description|safe|linebreaks }}
{{ place.description.strip|safe|linebreaks }}
</div>
<a class="i-descr-readmore" href="javascript:void(0);">{% trans 'Далее...' %}</a>
<div class="i-descr full-part hidden" >
@ -33,7 +33,9 @@
</div>
<div class="show-map"><a class="toggle-map" href="#">Раскрыть карту</a></div>
</header>
<div class="i-map">
<!--todo: открыть-->
<div class="i-map ">
<div class="close-map"><a class="toggle-map" href="#">Скрыть карту</a></div>
<!-- позиция для карты задается в атрибуте data-coords -->
<div class="map-canvas" id="map-canvas" data-coords="{{ place.address.lat|stringformat:'f' }},{{ place.address.lng|stringformat:'f' }}" ></div>
@ -161,16 +163,25 @@
</div>
</div>
<div class="eni-holds">
{{ place.total_year_action }}
<div class="eni-areas stat clearfix">
<div class="eni-title">
{% trans 'Ежегодно проводится' %}
</div>
<div class="enis-col">
<b>{{ place.total_year_action }}</b>
{% trans 'событий' %}
</div>
</div>
{% if place.foundation_year %}
<div class="eni-areas">
<div class="eni-holds">
{% if place.foundation_year %}
<div class="eni-founded">{% trans 'Основано в' %} <b>{{ place.foundation_year }}</b> {% trans 'году' %}</div>
{% endif %}
</div>
</div>
{% endif %}
</div>
{% if place.get_scheme %}
@ -341,7 +352,8 @@
{% endblock %}
{% block scripts %}
<script src="{% static 'client/js' %}{% if debug %}/{% else %}_min/{% endif %}_modules/page.place.object{% if debug %}{% else %}.min{% endif %}.js"></script>
<script src="{% static 'client/js/_modules/page.place.object.js' %}"></script>
<!--<script src="{% static 'client/js' %}{% if debug %}/{% else %}_min/{% endif %}_modules/page.place.object{% if debug %}{% else %}.min{% endif %}.js"></script>-->
<script>
EXPO.place.object.init({
article:{

@ -13485,3 +13485,35 @@ hr + .rq-note {
.advertise-window header {
padding-bottom: 0;
}
/*****************\
# Страница места проведения (/places/...)
\*****************/
.expo-place-page .i-info .i-descr{
height: auto;
}
.expo-place-page .i-descr-readmore{
margin-bottom: 1em;
display: block;
}
.eni-areas.stat .enis-col{
text-align: center;
display: inline-block;
width: auto;
padding-right: 32px;
}
.eni-areas.stat .eni-title{
float: left;
margin-left: -130px;
display: block;
width: 110px;
margin-right: 16px;
font-size: 20px;
line-height: 21px;
text-align: right;
-webkit-transition: color .3s;
-o-transition: color .3s;
transition: color .3s;
color:#ff6600;
/*margin-top: 28px;*/
}

File diff suppressed because one or more lines are too long

@ -19,10 +19,11 @@ if (EXPO.place.object){
Article.prototype = {
init: function () {
var self = this,
anText = this.$annotation.html().slice(0,self.cutLength);
this.fullText = this.$annotation.html();
this.$annotation.html(anText+'...');
this.$fullPart.html(this.fullText);
anText = this.$annotation.text().slice(0,self.cutLength);
this.fullText = this.$annotation.html().trim();
this._setMoreLess(this.fullText,self.cutLength, 10)
//this.$annotation.html($.trim(anText));
//this.$fullPart.html($.trim(this.fullText));
@ -34,6 +35,23 @@ if (EXPO.place.object){
},
_cutAnnotation: function () {
},
_setMoreLess: function (fullHtml, thrLength, tolerance) {
var alltext = fullHtml;
if (alltext.length + tolerance < thrLength) {
return;
}
else {
var firstHalf = alltext.substring(0, thrLength);
var firstHalfSpan = '<span class="firstHalf">' + firstHalf + '</span>';
this.$annotation.html(firstHalfSpan);
this.$annotation.find("p:last").append("...");
this.$fullPart.html(alltext);
}
}
};
that.opt = {}; //свойства по умолчанию

@ -1 +1 @@
var EXPO=EXPO||{};EXPO.place=EXPO.place||{},EXPO.place.object?console.warn("WARNING: EXPO.place.object is already defined!"):EXPO.place.object=function(){var t={},i=function(t,i){this.$annotation=$("."+t.annotationClass,i),this.$fullPart=$("."+t.fullPartClass,i),this.$readMore=$("."+t.readMoreClass,i),this.cutLength=t.cutLength,this.fullText,this.init()};return i.prototype={init:function(){var t=this,i=this.$annotation.html().slice(0,t.cutLength);this.fullText=this.$annotation.html(),this.$annotation.html(i+"..."),this.$fullPart.html(this.fullText)},showMore:function(){this.$readMore.hide(),this.$annotation.hide(),this.$fullPart.removeClass("hidden")},_cutAnnotation:function(){}},t.opt={},$(function(){}),t.init=function(t){$.extend(this.opt,t);var n=this;this.articles=[],$("."+n.opt.article.class).each(function(){var t=new i(n.opt.article,this);t.$readMore.on("click",function(){t.showMore()}),n.articles.push(t)})},t}();
var EXPO=EXPO||{};EXPO.place=EXPO.place||{},EXPO.place.object?console.warn("WARNING: EXPO.place.object is already defined!"):EXPO.place.object=function(){var t={},n=function(t,n){this.$annotation=$("."+t.annotationClass,n),this.$fullPart=$("."+t.fullPartClass,n),this.$readMore=$("."+t.readMoreClass,n),this.cutLength=t.cutLength,this.fullText,this.init()};return n.prototype={init:function(){{var t=this;this.$annotation.text().slice(0,t.cutLength)}this.fullText=this.$annotation.html().trim(),this._setMoreLess(this.fullText,t.cutLength,10)},showMore:function(){this.$readMore.hide(),this.$annotation.hide(),this.$fullPart.removeClass("hidden")},_cutAnnotation:function(){},_setMoreLess:function(t,n,i){var a=t;if(!(a.length+i<n)){var e=a.substring(0,n),s='<span class="firstHalf">'+e+"</span>";this.$annotation.html(s),this.$annotation.find("p:last").append("..."),this.$fullPart.html(a)}}},t.opt={},$(function(){}),t.init=function(t){$.extend(this.opt,t);var i=this;this.articles=[],$("."+i.opt.article.class).each(function(){var t=new n(i.opt.article,this);t.$readMore.on("click",function(){t.showMore()}),i.articles.push(t)})},t}();
Loading…
Cancel
Save