Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New hgtv with channels and playlists.
- Loading branch information
Showing
31 changed files
with
266 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,7 @@ build/ | |
dist/ | ||
settings.py | ||
.webassets-cache | ||
.sass-cache | ||
nosetests.xml | ||
baseframe-packed.css | ||
baseframe-packed.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Require any additional compass plugins here. | ||
# Set this to the root of your project when deployed: | ||
http_path = "/" | ||
css_dir = "hgtv/static/css" | ||
sass_dir = "hgtv/static/sass" | ||
images_dir = "hgtv/static/img" | ||
javascripts_dir = "hgtv/static/js" | ||
line_comments = false | ||
# To enable relative paths to assets via compass helper functions. Uncomment: | ||
relative_assets = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from hgtv.forms.playlist import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from baseframe.forms import Form | ||
import flask.ext.wtf as wtf | ||
|
||
__all__ = ['PlaylistForm'] | ||
|
||
|
||
class PlaylistForm(Form): | ||
title = wtf.TextField('Title', validators=[wtf.Required()]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from hgtv.models import db, BaseNameMixin | ||
|
||
|
||
class Channel(db.Model, BaseNameMixin): | ||
__tablename__ = 'channel' | ||
userid = db.Column(db.Unicode(22), nullable=False, unique=True) | ||
featured = db.Column(db.Boolean, default=False, nullable=False) | ||
|
||
|
||
class Playlist(db.Model, BaseNameMixin): | ||
__tablename__ = 'playlist' | ||
channel_id = db.Column(db.Integer, db.ForeignKey('channel.id'), nullable=False) | ||
channel = db.relationship(Channel, primaryjoin=channel_id == Channel.id, | ||
backref=db.backref('playlists', cascade='all, delete-orphan')) | ||
featured = db.Column(db.Boolean, default=False, nullable=False) | ||
|
||
|
||
channels_videos = db.Table('channels_videos', | ||
db.Column('channel_id', db.Integer, db.ForeignKey('channel.id'), nullable=False), | ||
db.Column('video_id', db.Integer, db.ForeignKey('video.id'), nullable=False) | ||
) | ||
|
||
|
||
playlists_videos = db.Table('playlists_videos', | ||
db.Column('playlist_id', db.Integer, db.ForeignKey('playlist.id'), nullable=False), | ||
db.Column('video_id', db.Integer, db.ForeignKey('video.id'), nullable=False) | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: iso-8859-15 -*- | ||
|
||
from hgtv.models import db, BaseMixin | ||
from hgtv.models import db, BaseNameMixin | ||
from hgtv.models.tag import tags_videos | ||
from hgtv.models.channel import Channel, channels_videos, playlists_videos | ||
|
||
__all__ = ['Video'] | ||
|
||
class Video(db.Model, BaseMixin): | ||
|
||
class Video(db.Model, BaseNameMixin): | ||
__tablename__ = 'video' | ||
name = db.Column(db.Unicode(80), unique=True, nullable=False) | ||
title = db.Column(db.Unicode(80), unique=True, nullable=False) | ||
description = db.Column(db.Text(), nullable=False) | ||
url = db.Column(db.Unicode(80), unique=True, nullable=False) | ||
season_id = db.Column(db.Integer, db.ForeignKey('season.id'), nullable=False) | ||
channel_id = db.Column(db.Integer, db.ForeignKey('channel.id'), nullable=False) | ||
channel = db.relationship(Channel, primaryjoin=channel_id == Channel.id, | ||
backref=db.backref('videos', cascade='all, delete-orphan')) | ||
description = db.Column(db.UnicodeText, nullable=False, default=u'') | ||
url = db.Column(db.Unicode(250), nullable=False) | ||
slides = db.Column(db.Unicode(250), nullable=False, default=u'') | ||
|
||
tags = db.relationship('Tag', secondary=tags_videos, backref=db.backref('videos')) | ||
channels = db.relationship('Channel', secondary=channels_videos, backref=db.backref('tagged_videos')) | ||
playlists = db.relationship('Playlist', secondary=playlists_videos, backref=db.backref('videos')) | ||
|
||
def __repr__(self): | ||
return self.name | ||
return u'<Video %s>' % self.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#logo { | ||
text-indent: -119988px; | ||
overflow: hidden; | ||
text-align: left; | ||
background-image: url('../img/logo.png?1328964434'); | ||
background-repeat: no-repeat; | ||
background-position: 50% 50%; | ||
width: 137px; | ||
height: 75px; | ||
} | ||
|
||
@media only screen and (-webkit-min-device-pixel-ratio: 2) { | ||
#logo { | ||
background-image: url('../img/logo@2x.png?1328994417'); | ||
-webkit-background-size: 137px 75px; | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import "compass/typography/text/replacement" | ||
|
||
#logo | ||
@include replace-text-with-dimensions('logo.png') | ||
|
||
@media only screen and (-webkit-min-device-pixel-ratio: 2) | ||
#logo | ||
background-image: image-url('logo@2x.png') | ||
-webkit-background-size: image-width('logo.png') image-height('logo.png') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% extends "layout.html" %} | ||
{% block title %}{{ channel.title }}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% extends "layout.html" %} | ||
{% block title %}Playlist: {{ playlist.title }}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% extends "layout.html" %} | ||
{% block title %}Videos tagged with {{ channel.title }}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% extends "layout.html" %} | ||
{% block headline %} | ||
<h1><a href="/diogo">Diogo Ferreira on CyanogenMod</a> <small>« <a href="/droidcon">Droidcon</a> <a href="/droidcon/2011">2011</a></small></h1> | ||
<p>Recorded November 2011</p> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="row"> | ||
<div class="span6"> | ||
<div class="video169"> | ||
<iframe src="http://www.youtube.com/embed/rTcFk4L7ux0?wmode=transparent" frameborder="0" allowfullscreen></iframe> | ||
</div> | ||
</div> | ||
<div class="span6"> | ||
<div class="video169"> | ||
<iframe src="http://www.slideshare.net/slideshow/embed_code/9303960" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
from flask import send_from_directory | ||
from hgtv import app | ||
|
||
import hgtv.views.index | ||
import hgtv.views.login | ||
import hgtv.views.channel | ||
import hgtv.views.playlist | ||
import hgtv.views.video | ||
import hgtv.views.tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from flask import render_template | ||
from coaster.views import load_model | ||
|
||
from hgtv import app | ||
from hgtv.models import Channel | ||
|
||
|
||
@app.route('/<channel>/') | ||
@load_model(Channel, {'name': 'channel'}, 'channel') | ||
def channel_view(channel): | ||
return render_template('channel.html', channel=channel) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
from flask import g, send_from_directory, Response, get_flashed_messages, flash, render_template | ||
from flask import send_from_directory, render_template | ||
from hgtv import app | ||
|
||
|
||
@app.route('/') | ||
def index(): | ||
return render_template('index.html') | ||
resp = [] | ||
for category, msg in get_flashed_messages(with_categories=True): | ||
resp.append(u'-- %s: %s --' % (category, msg)) | ||
if g.user: | ||
resp.append(u'User: %s' % g.user) | ||
resp.append(u"HasGeek.tv. Come back later.") | ||
return Response(u'\n'.join(resp), mimetype="text/plain") | ||
|
||
|
||
@app.route('/favicon.ico') | ||
def favicon(): | ||
return send_from_directory(os.path.join(app.root_path, 'static', 'img'), | ||
'favicon.ico', mimetype='image/vnd.microsoft.icon') |
Oops, something went wrong.