Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed width, centered layout

  • Loading branch information...
commit fc1f794e39a0a5343d0453f4fcee306964dfac44 1 parent d702239
@stefankoegl stefankoegl authored
View
2  htdocs/media/screen.css
@@ -20,7 +20,6 @@ hr
h1
{
- padding-bottom: .5em;
}
h2
@@ -194,7 +193,6 @@ div#podcastlogo
.short
{
- display: inline-block;
height: 1.3em;
overflow: hidden;
text-overflow: ellipsis;
View
1  mygpo/constants.py
@@ -18,6 +18,7 @@
PODCAST_LOGO_SIZE = 32
+PODCAST_LOGO_MEDIUM_SIZE=64
PODCAST_LOGO_BIG_SIZE = 128
DEFAULT_LOGIN_REDIRECT = '/'
View
9 mygpo/core/models.py
@@ -635,10 +635,11 @@ def get_episode_before(self, episode):
prevs = self.get_episodes(until=episode.released, descending=True,
limit=1)
+
try:
- prev = prevs.next()
+ return next(prevs)
except StopIteration:
- prev = None
+ return None
def get_episode_after(self, episode):
@@ -648,9 +649,9 @@ def get_episode_after(self, episode):
nexts = self.get_episodes(since=episode.released, limit=1)
try:
- next = nexts.next()
+ return next(nexts)
except StopIteration:
- next = None
+ return None
def get_episode_for_slug(self, slug):
View
27 mygpo/directory/templates/search.html
@@ -11,14 +11,18 @@
{% block title %}{% trans "Search" %}{% endblock %}
{% block content %}
-<h2>{% trans "Search" %}</h2>
+<h1>{% trans "Search" %}</h1>
-<form class="form-inline" method="get" action="{% url search %}" class="search">
- <div class="input-prepend">
- <span class="add-on"><i class="icon-search"></i></span><input class="input-xlarge" type="text" name="q" {% if q %}value="{{ q }}"{% endif %} >
- </div>
- <input class="btn btn-primary" type="submit" value="Search">
-</form>
+
+ <div class="row-fluid">
+ <div class="span8">
+
+ <form class="form-inline" method="get" action="{% url search %}" class="search">
+ <div class="input-prepend">
+ <span class="add-on"><i class="icon-search"></i></span><input class="input-xxlarge" type="text" name="q" {% if q %}value="{{ q }}"{% endif %} >
+ </div>
+ <input class="btn btn-primary" type="submit" value="Search">
+ </form>
{% if q %}
{% if results %}
@@ -72,5 +76,14 @@
{% endif %}
{% endif %}
+
+ </div>
+
+
+ <div class="span4">
+ <div class="well">
+ <h3>{% trans "Search API" %}</h3>
+ </div>
+ </div>
{% endblock %}
View
3  mygpo/share/templates/list.html
@@ -70,7 +70,8 @@
<form action="{% url list-rate owner.username podcastlist.slug %}?rate=1" method="post">
{% csrf_token %}
- <button class="btn icon-thumbs-up" type="submit">
+ <button class="btn" type="submit">
+ <li class="icon-thumbs-up"></li>
{% trans "Vote" %}
</button>
</form>
View
10 mygpo/web/templates/base.html
@@ -50,7 +50,7 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
- <div class="container-fluid">
+ <div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
@@ -95,7 +95,7 @@
</div>
</div>
- <div class="container-fluid">
+ <div class="container">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
@@ -106,12 +106,6 @@
</div><!--/.well -->
</div><!--/span-->
<div class="span10">
-<!-- <div class="hero-unit">
- <h1>Hello, world!</h1>
- <p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
- <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
- </div>-->
- <div class="row-fluid">
{% if messages %}
{% for message in messages %}
View
122 mygpo/web/templates/dashboard.html
@@ -14,12 +14,76 @@
{% block content %}
- <div class="row-liquid">
+ <div class="row-fluid">
+ <div class="span12">
+ <h1>{% trans "Hi, " %}{{ user.username }}</h1>
+ </div>
+ </div>
+
+ <div class="row-fluid">
+
+ <div class="span8">
+
+ {% cache 3600 newest_episodes user.username %}
+ {% if newest_episodes %}
+ <h2>{% trans "Newest Episodes" %}</h2>
+ <table class="list">
+ {% for episode in newest_episodes %}
+ <tr>
+ <td class="logo">{{ episode.podcast|podcast_logo }}</td>
+ <td>
+ {% episode_link episode episode.podcast %}<br/>
+ <span class="from_podcast">{% podcast_group_link episode.podcast %}</span>
+ </td>
+ <td>{{ episode.released|naturalday }}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ {% endif %}
+ {% endcache %}
- <div class="span7">
- <h1>{% trans "Hi, " %}{{ user.username }}</h1>
+ </div>
+
+ <div class="span4">
+
+ {% if sponsored_podcast %}
+ <div class="row-fluid">
+ <div class="well">
+ <h3>{{ sponsored_podcast.title }} <small>(Supporting Podcast)</small></h3>
+ <div>{{ sponsored_podcast.podcast|podcast_logo }}</div>
+ <div style="margin-left: 40px">{{ sponsored_podcast.text|truncatewords:"20"}}</div>
+ <br style="clear: left;"/>
+ <small><a href="{% url advertise %}">advertise here</a></small>
+ </div>
+ </div>
+ {% endif %}
+
+
+
+ {% if random_podcast %}
+ <div class="row-fluid">
+ <div class="well">
+
+ <a href="{% podcast_link_target random_podcast %}">
+ <div id="podcastlogo">{{ random_podcast|podcast_logo_medium }}</div>
+ </a>
+
+ <h3>{{ random_podcast.title }}</h3>
+
+ <p class="description">
+ {{ random_podcast.description|default:""|truncatewords:"50" }}
+ </p>
+
+ <p>
+ <a href="{% podcast_link_target random_podcast %}">{% trans "more..." %}</a>
+ </p>
+ </div>
+ </div>
+ {% endif %}
- <p><strong>{% blocktrans %}Explore {{ site }}{% endblocktrans %}</strong>
+ <div class="row-fluid">
+ <div class="well">
+ <h3>{% blocktrans %}Explore {{ site }}{% endblocktrans %}</h3>
<ul>
<li>
<i class="icon-check{% if not "devices" in checklist %}-empty{% endif %}"></i>
@@ -66,58 +130,8 @@
</ul>
</p>
-
- {% if sponsored_podcast %}
- <div class="sponsoring-podcast">
- <h3>{{ sponsored_podcast.title }} <small>(Supporting Podcast)</small></h3>
- <div>{{ sponsored_podcast.podcast|podcast_logo }}</div>
- <div style="margin-left: 40px">{{ sponsored_podcast.text|truncatewords:"20"}}</div>
- <br style="clear: left;"/>
- <small><a href="{% url advertise %}">advertise here</a></small>
- </div>
- {% endif %}
-
- </div>
-
- {% if random_podcast %}
- <div class="span5 well">
-
- <a href="{% podcast_link_target random_podcast %}">
- <div id="podcastlogo">{{ random_podcast|podcast_logo_big }}</div>
- </a>
-
- <h3>{{ random_podcast.title }}</h3>
-
- <p class="description">
- {{ random_podcast.description|default:""|truncatewords:"50" }}
- </p>
-
- <p>
- <a href="{% podcast_link_target random_podcast %}">{% trans "more..." %}</a>
- </p>
</div>
- {% endif %}
</div>
-
- <div class="row-liquid">
- {% cache 3600 newest_episodes user.username %}
- <div class="span12">
- {% if newest_episodes %}
- <h2>{% trans "Newest Episodes" %}</h2>
- <table class="list">
- {% for episode in newest_episodes %}
- <tr>
- <td class="logo">{{ episode.podcast|podcast_logo }}</td>
- <td>
- {% episode_link episode episode.podcast %}<br/>
- <span class="from_podcast">{% podcast_group_link episode.podcast %}</span>
- </td>
- <td>{{ episode.released|naturalday }}</td>
- </tr>
- {% endfor %}
- </table>
- {% endif %}
- {% endcache %}
</div>
{% endblock %}
View
13 mygpo/web/templates/devicelist.html
@@ -7,10 +7,10 @@
{% block mainmenu %}{{ "/devices/"|main_menu }}{% endblock %}
{% block sectionmenu %}{{ "/devices/"|section_menu }}{% endblock %}
-{% block title %}{% trans "My Devices" %}{% endblock %}
+{% block title %}{% trans "Managed Devices" %}{% endblock %}
{% block content %}
- <h1>{% trans "My Devices" %}</h1>
+ <h1>{% trans "Managed Devices" %}</h1>
<table class="list">
<tr>
@@ -34,11 +34,10 @@
<td>{{ device|device_type }}</td>
<td>{{ device.uid|striptags }}</td>
<td>
- <div class="btn icon-edit">
- <a href="{% url device-edit device.uid %}">
- {% trans "Configure" %}
- </a>
- </div>
+ <a class="btn" href="{% url device-edit device.uid %}">
+ <li class="icon-edit"></li>
+ {% trans "Configure" %}
+ </a>
</td>
</tr>
{% endfor %}
View
45 mygpo/web/templates/episode.html
@@ -71,7 +71,7 @@
</small>
{% if episode.description %}
- <p class="description">{{ episode.description|remove_html_tags|linebreaksbr }}</p>
+ <p class="description">{{ episode.description|remove_html_tags }}</p>
{% endif %}
</div>
@@ -88,11 +88,6 @@
{% endif %}
- <div class="share">
- {% google_plus_one_button %}
- {% fb_like_episode episode podcast %}
- </div>
-
{% if episode.url|is_flickr_photo %}
{{ episode|embed_flickr_photo }}
{% endif %}
@@ -124,20 +119,22 @@
{% endif %}
- <div class="navigation">
- <div class="prev">
+ <div class="pagination">
+ <ul>
{% if prev %}
- {% trans "Previous Episode:" %} {% episode_link prev podcast %}
+ <li>
+ {% episode_link prev podcast %}
+ </li>
{% endif %}
- </div>
- <div class="list">
- <a href="{% podcast_link_target podcast %}#episodes">{% trans "Episode-List" %}</a>
- </div>
- <div class="next">
+ <li>
+ <a href="{% podcast_link_target podcast %}#episodes">{% trans "Episode-List" %}</a>
+ </li>
{% if next %}
- {% trans "Next Episode:" %} {% episode_link next podcast %}
+ <li>
+ {% episode_link next podcast %}
+ </li>
{% endif %}
- </div>
+ </ul>
</div>
</div>
@@ -145,16 +142,24 @@
<div class="span4">
+ <div class="row-fluid">
+ <div class="well">
+
+ <h3>Share</h3>
+
+ {% google_plus_one_button %}
+ {% fb_like_episode episode podcast %}
+ </div>
+ </div>
+
+
+
{% if user.is_authenticated or chapters %}
<div class="row-fluid">
<div class="well">
<h3>{% trans "Chapters" %}</h3>
- <div class="info">
- {% blocktrans %}Your chapters are shown in bold.{% endblocktrans %}
- </div>
-
<table class="list">
<tr>
<th></th>
View
3  mygpo/web/templates/favorites.html
@@ -48,8 +48,9 @@
<tr>
<td class="logo">{% if episode.podcast %}{{ episode.podcast|podcast_logo }}{% endif %}</td>
- <td>{% episode_link episode episode.podcast %}<br/>
+ <td>
{% if episode.podcast %}
+ {% episode_link episode episode.podcast %}<br/>
<span class="from_podcast">{% podcast_group_link episode.podcast %}</span>
{% endif %}
</td>
View
3  mygpo/web/templates/podcast.html
@@ -68,7 +68,6 @@
{% endif %}
</div>
- </div>
@@ -81,7 +80,7 @@
<h2>{{ episode.title }} <small>{{ episode.released|naturalday }}</small></h2>
<div class="description">
- {{ episode.description|default:""|striptags }}
+ {{ episode.description|default:""|striptags|truncatewords:"100" }}
</div>
<a href="{% episode_link_target episode podcast %}">more...</a>
View
4 mygpo/web/templates/suggestions.html
@@ -55,12 +55,14 @@
<button class="btn btn-danger icon-thumbs-down" type="submit"> {% trans "No" %}</button>
</form>
</div>
- {% endif %}
<a class="btn" href="{% url suggestions-opml 15 "opml" %}">
<img src="/media/24x24/opml-icon.png">
{% trans "Download OPML" %}
</a>
+
+ {% endif %}
+
{% endblock %}
View
42 mygpo/web/templatetags/menu.py
@@ -16,7 +16,7 @@
_ = lambda x: x
MENU_STRUCTURE = (
- ('gpodder.net', (
+ ('', (
('/', _('Home')),
('/login/', _('Login')),
('/register/', _('Register')),
@@ -24,7 +24,17 @@
('/developer/', _('Development')),
('/online-help', _('Help')),
)),
- (_('My Podcasts'), (
+ ('Podcasts', (
+ ('/directory/', _('Directory')),
+ ('/podcast/', _('Podcast')),
+ ('/search/', _('Search')),
+ ('/lists/', _('Podcast Lists')),
+ ('/user/subscriptions/', _('User subscriptions')),
+ ('', _('Toplists')),
+ ('/toplist/', _('Podcasts')),
+ ('/toplist/episodes', _('Episodes')),
+ )),
+ (_('Subscriptions'), (
('/subscriptions/', _('Subscriptions')),
('/favorites/', _('Favorite Episodes')),
('/tags/', _('My Tags')),
@@ -33,21 +43,11 @@
('/history/', _('History')),
('/suggestions/', _('Suggestions')),
)),
- (_('Share'), (
+ (_('Community'), (
('/share/', _('Subscriptions')),
('/share/favorites', _('Favorites')),
('/share/lists/', _('Podcast Lists')),
- )),
- (_('Podcast Directory'), (
- ('/directory/', _('Directory')),
- ('/toplist/', _('Toplist')),
- ('/search/', _('Search')),
- ('/toplist/episodes', _('Episodes')),
- ('/lists/', _('Podcast Lists')),
- ('/podcast/', _('Podcast')),
- ('/user/subscriptions/', _('User subscriptions')),
- )),
- (_('Settings'), (
+ ('', _('Settings')),
('/account/', _('Account')),
('/account/privacy', _('Privacy')),
)),
@@ -63,7 +63,7 @@
def main_menu(selected):
found_section = False
links = []
- for label, items in MENU_STRUCTURE:
+ for label, items in MENU_STRUCTURE[1:]:
uris = [uri for uri, caption in items]
if selected in uris:
found_section = True
@@ -106,11 +106,19 @@ def section_menu(selected, title=None):
caption = title
if uri in HIDDEN_URIS:
items.append('<li class="active">%s</li>' % ugettext(caption))
+ elif uri == '':
+ items.append('<li class="nav-header">%s</li>' % ugettext(caption))
else:
items.append('<li class="active"><a href="%s">%s</a></li>' % \
(uri, ugettext(caption)))
- elif uri not in HIDDEN_URIS:
- items.append('<li><a href="%s">%s</a></li>' % (uri, ugettext(caption)))
+ else:
+ if uri in HIDDEN_URIS:
+ continue
+
+ if not uri:
+ items.append('<li class="nav-header">%s</li>' % ugettext(caption))
+ else:
+ items.append('<li><a href="%s">%s</a></li>' % (uri, ugettext(caption)))
s = '\n'.join(items)
return mark_safe(s)
View
8 mygpo/web/templatetags/podcasts.py
@@ -5,7 +5,8 @@
from django.utils.translation import ugettext as _
from django.utils.html import strip_tags
-from mygpo.constants import PODCAST_LOGO_SIZE, PODCAST_LOGO_BIG_SIZE
+from mygpo.constants import PODCAST_LOGO_SIZE, PODCAST_LOGO_BIG_SIZE, \
+ PODCAST_LOGO_MEDIUM_SIZE
from mygpo.web.utils import get_podcast_link_target, \
get_podcast_group_link_target
@@ -25,6 +26,11 @@ def podcast_logo_big(podcast):
return create_podcast_logo(podcast, PODCAST_LOGO_BIG_SIZE)
@register.filter
+def podcast_logo_medium(podcast):
+ return create_podcast_logo(podcast, PODCAST_LOGO_MEDIUM_SIZE)
+
+
+@register.filter
def podcast_status_icon(action):
if action.action == 'subscribe':
s = '<img src="/media/subscribe.png" />'
Please sign in to comment.
Something went wrong with that request. Please try again.