Permalink
Browse files

Fixes per review.

  • Loading branch information...
1 parent 10f9a67 commit 0d751239a55b61ecd2757a9ca4a154a16658c3a7 @Osmose Osmose committed May 15, 2012
@@ -2,7 +2,7 @@
<li id="slide-{{ idx }}">
<a href="{{ video.details_href }}" class="title" title="{{ video.title }}">
{% if video.is_winner %}
- <img class="winner-mark" src="{{ MEDIA_URL }}img/winner-trophy-sm.png">
+ <img class="winner-mark" src="{{ MEDIA_URL }}img/winner-trophy-sm.png" alt="{{ _('Award') }}">
{% endif %}
<img src="{{ video.poster_href }}" height="141">
</a>
@@ -96,13 +96,13 @@
{% for f in ['category', 'region'] %}
<li>
<h3>{{ form[f].label }}</h3>
- {{ form[f]|safe }}
+ {{ form[f] }}
</li>
{% endfor %}
<li>
<h3>{{ _('Search') }}</h3>
<div class="search-wrapper">
- {{ form.search|safe }}
+ {{ form.search }}
<button type="submit" class="search">{{ _('Search') }}</button>
</div>
</li>
@@ -136,23 +136,26 @@
<h1>{{ region_name }}</h1>
<section class="grandprize">
- {{ large_award(awards['grand_winner__%s'|format(region_key)]) }}
+ {% set key = 'grand_winner__%s'|format(region_key) %}
+ {{ large_award(awards[key]) }}
</section>
<section class="category">
<h2>{{ _('Category Winners') }}</h2>
<ul>
{% for category_key, category_name in category_choices %}
- {{ small_award(category_name, awards['category_winner__%s__%s'|format(region_key, category_key)]) }}
+ {% set key = 'category_winner__%s__%s'|format(region_key, category_key) %}
+ {{ small_award(category_name, awards[key]) }}
{% endfor %}
</ul>
</section>
<section class="runnerups">
- <h2>Runner Ups</h2>
+ <h2>{{ _('Runner Ups') }}</h2>
<ul>
{% for category_key, category_name in category_choices %}
- {{ small_award(category_name, awards['runner_up__%s__%s'|format(region_key, category_key)]) }}
+ {% set key = 'runner_up__%s__%s'|format(region_key, category_key) %}
+ {{ small_award(category_name, awards[key]) }}
{% endfor %}
</ul>
</section>
View
@@ -4,6 +4,9 @@
from django.contrib.admin import autodiscover
from django.shortcuts import render
+from funfactory.monkeypatches import patch
+patch()
+
# Autodiscover admin.py files in each app
autodiscover()
@@ -41,6 +41,7 @@
('asia_africa_australia', _lazy('Asia, Africa & Australia'))
)
+# Untranslated as they're only seen in the admin interface.
AWARD_TYPE_CHOICES = (
('grand_winner', 'Grand Prize Winner'),
('category_winner', 'Category Winner'),
@@ -29,7 +29,7 @@
<div class="video-wrapper">
{{ video.embed_html }}
{% if video.is_winner %}
- <img class="winner-mark" src="{{ MEDIA_URL }}img/winner-trophy-sm.png">
+ <img class="winner-mark" src="{{ MEDIA_URL }}img/winner-trophy-sm.png" alt="{{ _('Award') }}">
{% endif %}
</div>
<div id="judge_mark">
@@ -18,7 +18,7 @@
<p class="intro-description">
{% trans %}
Our illustrious judges have watched the flicks, laughed
- their laughs, shed their tears and theyve made their
+ their laughs, shed their tears and they've made their
decisions. It wasn’t easy thanks to all the amazing entries,
but here they are, ladies and gentlemen, the winners of
Firefox Flicks 2012.
@@ -263,7 +263,3 @@ def test_nonstaff_no_mark(self):
eq_(Video.objects.get(pk=video.pk).judge_mark, False)
self._post(video, admin_mark='asdf')
eq_(Video.objects.get(pk=video.pk).judge_mark, False)
-
-
-class RecentTests(TestCase):
-
@@ -10,7 +10,7 @@
name='flicks.videos.details'),
url(r'^add_view/?$', views.ajax_add_view,
name='flicks.videos.add_view'),
- url(r'^video/noir/$', views.promo_video_noir,
+ url(r'^video/noir/$', views.promo_video_noir,
name='flicks.videos.promo_video_noir'),
url(r'^video/dance/$', views.promo_video_dance,
name='flicks.videos.promo_video_dance'),
View
@@ -182,7 +182,7 @@ ol.videos li {
width: 252px;
}
-ol.videos li:nth-child(3n+1) {
+.videos li:nth-child(3n+1) {
clear: left;
}
View
@@ -1,35 +1,48 @@
(function ($) {
- var $window = $(window);
- var $content = $(".content-wrapper");
- var $nav = $("#nav-sections");
- var navTop = $nav.offset();
- var navHeight = $nav.height() + 24;
- var fixed = false;
+ var $window = $(window);
+ var $content = $('.content-wrapper');
+ var $nav = $('#nav-sections');
+ var navTop = $nav.offset();
+ var navHeight = $nav.height() + 24;
+ var fixed = false;
+ var didScroll = false;
$window.scroll(function() {
- var scrollTop = $window.scrollTop();
+ didScroll = true;
+ });
- if(scrollTop >= navTop.top) {
- if(!fixed) {
- fixed = true;
- $nav.addClass("fixed");
- $content.css({ paddingTop: navHeight+24 });
- }
- } else {
- if(fixed) {
- fixed = false;
- $nav.removeClass("fixed");
- $content.css({ paddingTop: "0" });
+ function adjustScrollbar() {
+ if (didScroll) {
+ didScroll = false;
+ var scrollTop = $window.scrollTop();
+
+ if(scrollTop >= navTop.top) {
+ if(!fixed) {
+ fixed = true;
+ $nav.addClass("fixed");
+ $content.css({ paddingTop: navHeight+24 });
+ }
+ } else {
+ if(fixed) {
+ fixed = false;
+ $nav.removeClass("fixed");
+ $content.css({ paddingTop: "0" });
+ }
}
}
- });
+ };
+
+ // Check for an adjusted scrollbar every 300ms.
+ setInterval(adjustScrollbar, 300);
+
+ // Bind scrolling to linked element.
+ $window.on('click', '#nav-sections a', function(e){
+ e.preventDefault();
- $("#nav-sections a").click(function(){
- /* extract the target element's ID from the link's href */
- var target = $(this).attr("href").replace( /.*?#(.*)/g, "$1" );
+ // Extract the target element's ID from the link's href.
+ var target = $(this).attr("href").replace( /.*?(#.*)/g, "$1" );
$('html, body').animate({
- scrollTop: $("#"+target).offset().top-navHeight
+ scrollTop: $(target).offset().top-navHeight
}, 1000);
- return false;
});
})(jQuery);

0 comments on commit 0d75123

Please sign in to comment.