コード例 #1
0
ファイル: views.py プロジェクト: fwenzel/firefox-flicks
def home(request):
    """Landing page for Flicks. Displays only the promo videos."""
    # Redirect logged in users to the recent videos page.
    if request.user.is_active:
        return redirect('flicks.videos.recent')

    d = dict(promo_dance=promo_video_shortlink('dance'),
             promo_noir=promo_video_shortlink('noir'),
             promo_twilight=promo_video_shortlink('twilight'),
             page_type='home')

    return render(request, 'home.html', d)
コード例 #2
0
ファイル: views.py プロジェクト: Acidburn0zzz/firefox-flicks
def promo_video_twilight(request):
    """Twilight parody promo video."""
    desc = _('A teenage girl learns the truth about the fox. Get inspired for '
             'your Firefox Flicks entry by checking out our video.')
    d = dict(video_title=_('Twilight'),
             video_description=desc,
             tweet_text=desc,
             page_type='videos',
             video_embed=vidly_embed_code(promo_video_shortlink('twilight'),
                                          width='100%'))
    return render(request, 'videos/2012/promo.html', d)
コード例 #3
0
def promo_video_twilight(request):
    """Twilight parody promo video."""
    desc = _('A teenage girl learns the truth about the fox. Get inspired for '
             'your Firefox Flicks entry by checking out our video.')
    d = dict(video_title=_('Twilight'),
             video_description=desc,
             tweet_text=desc,
             page_type='videos',
             video_embed=vidly_embed_code(promo_video_shortlink('twilight'),
                                          width='100%'))
    return render(request, 'videos/2012/promo.html', d)
コード例 #4
0
ファイル: views.py プロジェクト: pmclanahan/firefox-flicks
def promo_video_twilight(request):
    """Twilight parody promo video."""
    desc = _lazy('A teenage girl learns the truth about the fox. Get inspired '
                 'for your Firefox Flicks entry by checking out our video.')
    d = dict(video_title=_lazy('Twilight'),
             video_description=desc,
             tweet_text=desc,
             page_type='videos',
             video_embed=Markup(embedCode(promo_video_shortlink('twilight'),
                                          width=600, height=337)))
    return render(request, 'videos/promo.html', d)
コード例 #5
0
ファイル: views.py プロジェクト: fwenzel/firefox-flicks
def promo_video_dance(request):
    """Dancing promo video."""
    d = dict(video_title=_lazy('Dance'),
             video_description=_lazy("He's got the moves, he's got ambition. "
                                     "How far can this fox's feet take him? "
                                     "Get inspired for your Firefox Flicks "
                                     "entry by checking out our video."),
             page_type='videos',
             video_embed=Markup(embedCode(promo_video_shortlink('dance'),
                                          width=600, height=337)))
    return render(request, 'videos/promo.html', d)
コード例 #6
0
ファイル: views.py プロジェクト: fwenzel/firefox-flicks
def promo_video_noir(request):
    """Film Noir promo video."""
    d = dict(video_title=_lazy('Noir'),
             video_description=_lazy('The fox meets a damsel in distress, but '
                                     'can he help her? Get inspired for your '
                                     'Firefox Flicks entry by checking out '
                                     'our video.'),
             page_type='videos',
             video_embed=Markup(embedCode(promo_video_shortlink('noir'),
                                          width=600, height=337)))
    return render(request, 'videos/promo.html', d)
コード例 #7
0
ファイル: views.py プロジェクト: Acidburn0zzz/firefox-flicks
def promo_video_noir(request):
    """Film Noir promo video."""
    d = dict(video_title=_('Noir'),
             video_description=_('The fox meets a damsel in distress, but can '
                                 'he help her? Get inspired for your Firefox '
                                 'Flicks entry by checking out our video.'),
             tweet_text=_('The fox meets a damsel in distress, but can he help '
                          'her?'),
             page_type='videos',
             video_embed=vidly_embed_code(promo_video_shortlink('noir'),
                                          width='100%'))
    return render(request, 'videos/2012/promo.html', d)
コード例 #8
0
ファイル: views.py プロジェクト: Osmose/firefox-flicks
def promo_video_noir(request):
    """Film Noir promo video."""
    d = dict(video_title=_('Noir'),
             video_description=_('The fox meets a damsel in distress, but can '
                                 'he help her? Get inspired for your Firefox '
                                 'Flicks entry by checking out our video.'),
             tweet_text=_('The fox meets a damsel in distress, but can he help '
                          'her?'),
             page_type='videos',
             video_embed=vidly_embed_code(promo_video_shortlink('noir'),
                                          width='100%'))
    return render(request, 'videos/2012/promo.html', d)
コード例 #9
0
ファイル: views.py プロジェクト: Acidburn0zzz/firefox-flicks
def promo_video_dance(request):
    """Dancing promo video."""
    d = dict(video_title=_('Dance'),
             video_description=_("He's got the moves, he's got ambition. How "
                                 "far can this fox's feet take him? Get "
                                 "inspired for your Firefox Flicks entry by "
                                 "checking out our video."),
             tweet_text=_("He's got the moves. He's got ambition. How far can "
                          "this fox's feet take him?"),
             page_type='videos',
             video_embed=vidly_embed_code(promo_video_shortlink('dance'),
                                          width='100%'))
    return render(request, 'videos/2012/promo.html', d)
コード例 #10
0
def promo_video_dance(request):
    """Dancing promo video."""
    d = dict(video_title=_('Dance'),
             video_description=_("He's got the moves, he's got ambition. How "
                                 "far can this fox's feet take him? Get "
                                 "inspired for your Firefox Flicks entry by "
                                 "checking out our video."),
             tweet_text=_("He's got the moves. He's got ambition. How far can "
                          "this fox's feet take him?"),
             page_type='videos',
             video_embed=vidly_embed_code(promo_video_shortlink('dance'),
                                          width='100%'))
    return render(request, 'videos/2012/promo.html', d)
コード例 #11
0
ファイル: test_util.py プロジェクト: mozilla/firefox-flicks
 def test_success(self):
     """If a video for the current locale exists, return it's shortlink."""
     with self.activate('fr'):
         eq_(promo_video_shortlink('noir'), 'french')
コード例 #12
0
ファイル: test_util.py プロジェクト: mozilla/firefox-flicks
 def test_no_en_us(self):
     """If there is no video matching the current locale or en-US,
     return None.
     """
     with self.activate('es'):
         eq_(promo_video_shortlink('no-en-us'), None)
コード例 #13
0
ファイル: test_util.py プロジェクト: mozilla/firefox-flicks
 def test_no_locale(self):
     """If there is no video matching the current locale, default to
     en-US.
     """
     with self.activate('es'):
         eq_(promo_video_shortlink('noir'), 'english')
コード例 #14
0
ファイル: test_util.py プロジェクト: mozilla/firefox-flicks
 def test_invalid_promo(self):
     """If an invalid promo name is given, return None."""
     eq_(promo_video_shortlink('invalid'), None)