Commit bf2671e7 authored by Simon Daron's avatar Simon Daron

News Roll reloaded

parent 320bedbd
......@@ -405,7 +405,7 @@ class Home(TemplateView):
context = super(Home, self).get_context_data(**kwargs)
context['sectionName'] = "Home"
context['focus'] = NewsItem.objects.select_related('category').filter(
focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('?')[:5]
focus=True).exclude(image__isnull=True).exclude(image__exact='').order_by('?')[:12]
context['emissions'] = Emission.objects.filter(archived=False,
creation_timestamp__gte=datetime(2013, 9, 13)).order_by('title')
......
......@@ -726,8 +726,35 @@ body{
/****************************************************/
/**** News ****/
/****************************************************/
.newsRoll .title{
background:black;
color:white;
bottom:0px;
opacity:0.9;
width:100%;
text-align: left;
font-family: "RegloBold";
position: absolute;
left: 0;
}
.newsRoll .title div{
padding: 1em;
}
.newsRoll a, .newsRoll button img{
border:2px solid black;
}
.newsRoll .labels .item{
display:block;
background:#3333FF;
color:white;
margin:0.1em;
font-size:0.9em;
padding:0.3em;
}
/*
.newsRoll {
padding-top: 5px;
padding-bottom: 5px;
......@@ -831,6 +858,8 @@ body{
margin:0 0 0 0 !important;
padding:0 0 0 0 !important;
}
*/
/****************************************************/
.list.news li {
}
.news li.item a { -webkit-backface-visibility: hidden; }
......
{% load thumbnails %}{% load i18n %}
<div id="newsRoll">
<div class="newsRoll center wrapper">
<ul class="custom">
<div class="newsRoll center wrapper navigation cf">
<ul id="ticker" class="custom bigNews leftPart" style="height:360px;overflow:hidden;">
{% for content in news %}
<li class="{% if forloop.counter == 1 %}first{% endif %}">
<a class="block news relative" href="{% url 'newsitem-view' slug=content.slug %}">
{% if forloop.counter == 1 %}
<img class="logo" src="{{ content.image|thumbnail:'640x480' }}"/>
{% else %}
<img class="logo" src="{{ content.image|thumbnail:'320x480' }}"/>
{% endif %}
<li
id="newsRollId-{{ content.slug }}"
class="">
<a
style="max-width:100%;height:360px;background: no-repeat 50% 50% url('{{ content.image|thumbnail:'800x600' }}');"
class="block news relative"
href="{% url 'newsitem-view' slug=content.slug %}">
{% if content.category %}
<div class="labels absolute">
<div class="label labels absolute">
<span class="item inBlock">{{ content.category.title }}</span>
</div>
{% endif %}
<span class="title inBlock"><span>{{ content.title }}</span></span>
<div class="title"><div>{{ content.title }}</div></div>
</a>
</li>
{% endfor %}
</ul>
<ul class="custom inline rightPart" id="roller">
{% for content in news %}
<li class="num-{{ forloop.counter }}">
<button class="inBlock" data-about="#newsRollId-{{ content.slug }}">
<img src="{{ content.image|thumbnail:'80x60' }}" />
</button>
</li>
{% endfor %}
</ul>
<style>
</style>
<script>
$(function() {
$('#ticker li:not(:first)');
function tick(){
$('#ticker li:first').animate({'opacity':0}, 200, function () {
$(this).appendTo($('#ticker')).css('opacity', 1);
});
}
$("#roller button").on('click',function(e){
e.preventDefault();
$($(this).attr('data-about')).prependTo('#ticker');
return false;
});
setInterval(function(){tick(); }, 5000);/**/
});
</script>
</div>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment