Mercurial > public > sg101
changeset 1144:c31008989a16
Convert home page to V3 design.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Mon, 14 Nov 2016 19:29:34 -0600 |
parents | 14334b2f2323 |
children | a469445d8be3 |
files | news/templatetags/news_tags.py sg101/static/js/v3/sg101.js sg101/templates/bulletins/bulletins.html sg101/templates/forums/new_posts_tag.html sg101/templates/home.html sg101/templates/news/current_news.html sg101/urls.py sg101/views.py |
diffstat | 8 files changed, 110 insertions(+), 59 deletions(-) [+] |
line wrap: on
line diff
--- a/news/templatetags/news_tags.py Wed Nov 09 20:02:14 2016 -0600 +++ b/news/templatetags/news_tags.py Mon Nov 14 19:29:34 2016 -0600 @@ -26,4 +26,5 @@ return { 'stories': stories, 'on_home': True, + 'V3_DESIGN': True, }
--- a/sg101/static/js/v3/sg101.js Wed Nov 09 20:02:14 2016 -0600 +++ b/sg101/static/js/v3/sg101.js Mon Nov 14 19:29:34 2016 -0600 @@ -24,4 +24,18 @@ } } }); + $('iframe').each(function(index) { + $this = $(this); + var src = $this.attr('src'); + var srcYouTube = src.includes('youtube'); + var srcVimeo = src.includes('vimeo'); + if (srcYouTube || srcVimeo) { + var wrapper = $this.closest('div.flex-video'); + if (wrapper.length == 0) { + var html = srcVimeo ? '<div class="flex-video vimeo"></div>' + : '<div class="flex-video"></div>'; + $this.wrap(html); + } + } + }); });
--- a/sg101/templates/bulletins/bulletins.html Wed Nov 09 20:02:14 2016 -0600 +++ b/sg101/templates/bulletins/bulletins.html Mon Nov 14 19:29:34 2016 -0600 @@ -1,11 +1,17 @@ {% load humanize %} {% for bulletin in bulletins %} -<div class="bulletin" id="bulletin-{{ bulletin.id }}"> - <h3>{{ bulletin.title }}</h3> - <div class="bulletin-text"> - {{ bulletin.text|safe }} +<div class="row"> + <div class="columns"> + <div class="callout"> + <h3><i class="fi-megaphone"></i> {{ bulletin.title }}</h3> + <div class="bulletin-text"> + {{ bulletin.text|safe }} + </div> + <p class="byline"> + Posted: {{ bulletin.start_date|naturalday|capfirst }} + {{ bulletin.start_date|date:"H:i" }}. + </p> + </div> </div> - <p class="bulletin-meta">Posted: {{ bulletin.start_date|naturalday|capfirst }} - {{ bulletin.start_date|date:"H:i" }}.</p> </div> {% endfor %}
--- a/sg101/templates/forums/new_posts_tag.html Wed Nov 09 20:02:14 2016 -0600 +++ b/sg101/templates/forums/new_posts_tag.html Mon Nov 14 19:29:34 2016 -0600 @@ -1,14 +1,19 @@ {% load core_tags %} -<div> -<h2>Latest Forum Posts</h2> -<p>Join us in our <a href="{% url 'forums-index' %}">forums</a> for some lively discussions. Here are the forum topics with new posts.</p> -{% if topics %} - <ul> - {% for topic in topics %} - <li><a href="{{ topic.url }}">{{ topic.title }}</a> by {{ topic.author }} {{ topic.date|elapsed }}</li> - {% endfor %} - </ul> -{% else %} - <p>No forum topics at this time.</p> -{% endif %} +<div class="row"> + <div class="columns"> + <h2>Latest Forum Posts</h2> + <p> + Join us in our <a href="{% url 'forums-index' %}">forums</a> for some + lively discussions. Here are the forum topics with new posts. + </p> + {% if topics %} + <ul> + {% for topic in topics %} + <li><a href="{{ topic.url }}">{{ topic.title }}</a> by {{ topic.author }} {{ topic.date|elapsed }}</li> + {% endfor %} + </ul> + {% else %} + <p>No forum topics at this time.</p> + {% endif %} + </div> </div>
--- a/sg101/templates/home.html Wed Nov 09 20:02:14 2016 -0600 +++ b/sg101/templates/home.html Mon Nov 14 19:29:34 2016 -0600 @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% load bulletin_tags %} {% load core_tags %} {% load news_tags %} @@ -15,9 +15,55 @@ <link rel="alternate" type="application/rss+xml" title="SurfGuitar101 News" href="{% url 'feeds-news' %}" /> {% endblock %} {% block custom_css %} -<link rel="stylesheet" href="{% static "css/news.css" %}" /> +<style type="text/css"> +#home-slideshow img { display: none } +</style> {% endblock %} +{% block content %} +<h2 id="news-top">Welcome to SurfGuitar101!</h2> +<div class="row"> + <div class="small-5 show-for-medium columns"> + <div id="home-slideshow"> + {% cache 600 home_slideshow %} + {% slideshow_images %} + {% endcache %} + </div> + </div> + <div class="columns"> + <p> + Since February 26, 2006, SurfGuitar101.com has been the premier home on the + web for friends and fans of the world-wide phenomenon known as surf music! + Created in Southern California in the early 1960's, surf music is very much + alive today and has spread around the globe. Join us in our forums to + discuss surf music, past and present. Meet new friends and discover new + bands. Want to play surf music? We have lots of forums devoted to playing, + performing, and writing surf music. We have lots of discussions on gear: + guitars, amps, and drums. Check out our podcasts and hear some really great + tunes! Finally, we feature news and articles on the surf scene, and you'll + always know where you can catch some live surf music! + </p> + </div> +</div> +{# cache 3600 home_bulletins #} + {% current_bulletins %} +{# endcache #} +{% new_posts %} +{# cache 3600 home_news #} + {% current_news %} +{# endcache #} +{# cache 3600 home_new_stuff #} +{% latest_poll %} +<div class="span-9 append-1"> + {% latest_weblinks %} +</div> +<div class="span-9 last"> + {% latest_downloads %} +</div> +{# endcache #} +{% endblock %} + {% block custom_js %} +<script src="{% static "js/jquery.cycle.all3.0.3.js" %}"></script> <script> $(document).ready(function() { $('#home-slideshow img:first').fadeIn(1000, function() { @@ -30,41 +76,4 @@ }); }); </script> -<style type="text/css"> -#home-slideshow img { display: none } -</style> {% endblock %} -{% block content %} -<h2>Welcome to SurfGuitar101!</h2> -<div class="span-9"> - <div id="home-slideshow"> - {% cache 600 home_slideshow %} - {% slideshow_images %} - {% endcache %} - </div> -</div> -<div class="span-10 last"> -<p> -<strong>Welcome to the all new SurfGuitar101.com!</strong> We've rewritten the site software and have a new design! We hope you like the new site and features; please leave feedback in our forums. -</p> -<p>Since February 26, 2006, SurfGuitar101.com has been the premier home on the web for friends and fans of the world-wide phenomenon known as surf music! Created in Southern California in the early 1960's, surf music is very much alive today and has spread around the globe. Join us in our forums to discuss surf music, past and present. Meet new friends and discover new bands. Want to play surf music? We have lots of forums devoted to playing, performing, and writing surf music. We have lots of discussions on gear: guitars, amps, and drums. Check out our podcasts and hear some really great tunes! Finally, we feature news and articles on the surf scene, and you'll always know where you can catch some live surf music! -</p> -</div> -<br class="clear" /> -{% cache 3600 home_bulletins %} - {% current_bulletins %} -{% endcache %} -{% new_posts %} -{% cache 3600 home_news %} - {% current_news %} -{% endcache %} -{% cache 3600 home_new_stuff %} -{% latest_poll %} -<div class="span-9 append-1"> - {% latest_weblinks %} -</div> -<div class="span-9 last"> - {% latest_downloads %} -</div> -{% endcache %} -{% endblock %}
--- a/sg101/templates/news/current_news.html Wed Nov 09 20:02:14 2016 -0600 +++ b/sg101/templates/news/current_news.html Mon Nov 14 19:29:34 2016 -0600 @@ -4,5 +4,11 @@ {% include 'news/story_summary.html' %} {% endfor %} <hr /> -<p>For more news stories, check out our <a href="{% url 'news-index_page' %}">news archive</a>.</p> +<div class="row"> + <div class="columns"> + <p> + For more news stories, check out our <a href="{% url 'news-index_page' %}">news archive</a>. + </p> + </div> +</div> {% endif %}
--- a/sg101/urls.py Wed Nov 09 20:02:14 2016 -0600 +++ b/sg101/urls.py Mon Nov 14 19:29:34 2016 -0600 @@ -14,12 +14,13 @@ from custom_search.forms import CustomModelSearchForm from custom_search.views import UserSearchView from core.views import FixedView +from sg101.views import HomePageView from sg101.views import StoreView urlpatterns = [ url(r'^$', - TemplateView.as_view(template_name='home.html'), + HomePageView.as_view(), name='home'), url(r'^about/$', FixedView.as_view(title='About', content_template='fixed/about.html'),
--- a/sg101/views.py Wed Nov 09 20:02:14 2016 -0600 +++ b/sg101/views.py Mon Nov 14 19:29:34 2016 -0600 @@ -3,6 +3,15 @@ from django.views.generic import TemplateView +class HomePageView(TemplateView): + template_name = 'home.html' + + def get_context_data(self, **kwargs): + context = super(HomePageView, self).get_context_data(**kwargs) + context['V3_DESIGN'] = True + return context + + class StoreView(TemplateView): template_name = 'store/base.html'