Mercurial > public > sg101
changeset 358:768e3568addf
Fixing #172; add a forums jump box.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 04 Mar 2011 03:50:07 +0000 |
parents | 8e3f252e4fbb |
children | e877b9c05740 |
files | gpp/templates/forums/forum_index.html gpp/templates/forums/jump_box.html gpp/templates/forums/jump_box.js gpp/templates/forums/topic.html static/css/base.css |
diffstat | 5 files changed, 45 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/gpp/templates/forums/forum_index.html Fri Mar 04 02:41:49 2011 +0000 +++ b/gpp/templates/forums/forum_index.html Fri Mar 04 03:50:07 2011 +0000 @@ -2,9 +2,10 @@ {% load url from future %} {% load forum_tags %} {% block custom_head %} -{% if feed %} -<link rel="alternate" type="application/rss+xml" title="{{ feed.name }}" href="{{ feed.feed }}" /> -{% endif %} + {% if feed %} + <link rel="alternate" type="application/rss+xml" title="{{ feed.name }}" href="{{ feed.feed }}" /> + {% endif %} + {% include "forums/jump_box.js" %} {% endblock %} {% block title %}Forums: {{ forum.name }}{% endblock %} {% block content %} @@ -55,6 +56,7 @@ </tbody> </table> {{ page_nav }} +{% include 'forums/jump_box.html' %} {% if user.is_authenticated %} <a href="{% url 'forums-new_topic' slug=forum.slug %}">New Topic</a> • <form action="{% url 'forums-catchup' slug=forum.slug %}" method="post" style="display:inline">{% csrf_token %}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/templates/forums/jump_box.html Fri Mar 04 03:50:07 2011 +0000 @@ -0,0 +1,19 @@ +{% load url from future %} +<form action="." method="get" id="forum-jumpbox-form"> + <select id="forum-jumpbox-select"> + <option value="{% url 'forums-forum_index' slug='surfguitar101-website' %}">SurfGuitar101 Website</option> + <option value="{% url 'forums-forum_index' slug='suggestion-box' %}">Suggestion Box</option> + <option value="{% url 'forums-forum_index' slug='sg101-podcast' %}">SG101 Podcast</option> + <option value="{% url 'forums-forum_index' slug='surf-music' %}">Surf Music General Discussion</option> + <option value="{% url 'forums-forum_index' slug='gigs' %}">Show Announcements</option> + <option value="{% url 'forums-forum_index' slug='surf-musician' %}">Surf Musician</option> + <option value="{% url 'forums-forum_index' slug='gear' %}">Gear</option> + <option value="{% url 'forums-forum_index' slug='recording-corner' %}">Recording Corner</option> + <option value="{% url 'forums-forum_index' slug='surf-videos' %}">Surf Videos</option> + <option value="{% url 'forums-forum_index' slug='best-sg101' %}">Best-Of SG101</option> + <option value="{% url 'forums-forum_index' slug='for-sale-trade' %}">For Sale / Trade</option> + <option value="{% url 'forums-forum_index' slug='musicians-gigs-wanted' %}">Musicians & Gigs Wanted</option> + <option value="{% url 'forums-forum_index' slug='shallow-end' %}">The Shallow End</option> + </select> + <button type="button" id="forum-jumpbox-button">Go</button> +</form>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/templates/forums/jump_box.js Fri Mar 04 03:50:07 2011 +0000 @@ -0,0 +1,11 @@ +<script type="text/javascript"> +//<![CDATA[ +$(document).ready(function() { + var jumpSelect = $('#forum-jumpbox-select')[0]; + $('#forum-jumpbox-button').click(function() { + var dest = jumpSelect.options[jumpSelect.selectedIndex].value; + window.location = dest; + }); +}); +//]]> +</script>
--- a/gpp/templates/forums/topic.html Fri Mar 04 02:41:49 2011 +0000 +++ b/gpp/templates/forums/topic.html Fri Mar 04 03:50:07 2011 +0000 @@ -2,7 +2,10 @@ {% load url from future %} {% load forum_tags %} {% block title %}Forums: {{ topic.name }}{% endblock %} -{% block custom_js %}{{ form.media }}{% endblock %} +{% block custom_js %} + {{ form.media }} + {% include "forums/jump_box.js" %} +{% endblock %} {% block content %} {% forum_navigation topic %} @@ -30,6 +33,7 @@ {% endfor %} </table> {{ page_nav }} +{% include 'forums/jump_box.html' %} {% if can_moderate %} <div class="forum-mod-controls"> <form action="{% url 'forums-mod_topic_stick' topic.id %}" method="post">{% csrf_token %}
--- a/static/css/base.css Fri Mar 04 02:41:49 2011 +0000 +++ b/static/css/base.css Fri Mar 04 03:50:07 2011 +0000 @@ -358,6 +358,11 @@ #forum-query-form { text-align:right; } +#forum-jumpbox-form { + text-align:right; + margin-top:0.5em; + margin-bottom:0.5em; +} #forums-post-list dt { margin-top: 0.5em; padding: 3px 0 3px 0;