# HG changeset patch # User Brian Neal # Date 1449434910 21600 # Node ID 21c592cac71cb7da47f0642b0691a22678b19bc5 # Parent fd70e9d547ed7344626d572ffcd809be883c4019 ManifestStaticFilesStorage: stop using form Media. It's okay for the admin, but not for user facing stuff. diff -r fd70e9d547ed -r 21c592cac71c bio/forms.py --- a/bio/forms.py Sun Dec 06 13:22:09 2015 -0600 +++ b/bio/forms.py Sun Dec 06 14:48:30 2015 -0600 @@ -51,15 +51,6 @@ 'profile_text', 'hide_email', 'signature', 'time_zone', 'use_24_time', 'auto_favorite', 'auto_subscribe') - class Media: - css = { - 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + - settings.GPP_THIRD_PARTY_CSS['jquery-ui']) - } - js = (settings.GPP_THIRD_PARTY_JS['markitup'] + - settings.GPP_THIRD_PARTY_JS['jquery-ui'] + - ['js/bio.js', 'js/timezone.js']) - def clean_time_zone(self): """Ensure the timezone is valid and will work with pytz. @@ -145,12 +136,6 @@ """ username = forms.CharField(max_length=30, widget=AutoCompleteUserInput()) - class Media: - css = { - 'all': settings.GPP_THIRD_PARTY_CSS['jquery-ui'] - } - js = settings.GPP_THIRD_PARTY_JS['jquery-ui'] - def clean_username(self): username = self.cleaned_data['username'].strip() try: diff -r fd70e9d547ed -r 21c592cac71c comments/forms.py --- a/comments/forms.py Sun Dec 06 13:22:09 2015 -0600 +++ b/comments/forms.py Sun Dec 06 14:48:30 2015 -0600 @@ -79,12 +79,3 @@ raise forms.ValidationError(str(ex)) return comment - - class Media: - css = { - 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + - settings.GPP_THIRD_PARTY_CSS['jquery-ui']), - } - js = (settings.GPP_THIRD_PARTY_JS['markitup'] + - settings.GPP_THIRD_PARTY_JS['jquery-ui'] + - ['js/comments.js']) diff -r fd70e9d547ed -r 21c592cac71c downloads/forms.py --- a/downloads/forms.py Sun Dec 06 13:22:09 2015 -0600 +++ b/downloads/forms.py Sun Dec 06 14:48:30 2015 -0600 @@ -4,7 +4,6 @@ import os from django import forms -from django.conf import settings from downloads.models import PendingDownload from downloads.models import AllowedExtension @@ -28,11 +27,3 @@ class Meta: model = PendingDownload fields = ('title', 'category', 'description', 'file') - - class Media: - css = { - 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + - settings.GPP_THIRD_PARTY_CSS['jquery-ui']) - } - js = (settings.GPP_THIRD_PARTY_JS['markitup'] + - settings.GPP_THIRD_PARTY_JS['jquery-ui']) diff -r fd70e9d547ed -r 21c592cac71c forums/forms.py --- a/forums/forms.py Sun Dec 06 13:22:09 2015 -0600 +++ b/forums/forms.py Sun Dec 06 14:48:30 2015 -0600 @@ -5,7 +5,6 @@ from collections import OrderedDict from django import forms -from django.conf import settings from forums.models import Forum from forums.models import Topic @@ -18,17 +17,6 @@ from core.markup import site_markup -FORUMS_FORM_CSS = { - 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + - settings.GPP_THIRD_PARTY_CSS['jquery-ui']) -} -FORUMS_FORM_JS = ( - settings.GPP_THIRD_PARTY_JS['markitup'] + - settings.GPP_THIRD_PARTY_JS['jquery-ui'] + - ['js/jquery.form.min.js', 'js/forums.js'] -) - - class NewPostForm(forms.Form): """Form for creating a new post.""" body = forms.CharField(label='', @@ -37,10 +25,6 @@ topic_id = forms.IntegerField(widget=forms.HiddenInput) topic = None - class Media: - css = FORUMS_FORM_CSS - js = FORUMS_FORM_JS - def __init__(self, *args, **kwargs): super(NewPostForm, self).__init__(*args, **kwargs) attachments = args[0].getlist('attachment') if len(args) else [] @@ -95,10 +79,6 @@ forum = None has_mod_fields = False - class Media: - css = FORUMS_FORM_CSS - js = FORUMS_FORM_JS - def __init__(self, user, forum, *args, **kwargs): super(NewTopicForm, self).__init__(*args, **kwargs) self.user = user @@ -176,10 +156,6 @@ model = Post fields = ('body', ) - class Media: - css = FORUMS_FORM_CSS - js = FORUMS_FORM_JS - def __init__(self, *args, **kwargs): topic_name = kwargs.pop('topic_name', None) super(PostForm, self).__init__(*args, **kwargs) diff -r fd70e9d547ed -r 21c592cac71c gcalendar/forms.py --- a/gcalendar/forms.py Sun Dec 06 13:22:09 2015 -0600 +++ b/gcalendar/forms.py Sun Dec 06 14:48:30 2015 -0600 @@ -4,7 +4,6 @@ import datetime import pytz from django import forms -from django.conf import settings from gcalendar.models import Event @@ -82,16 +81,6 @@ fields = ('what', 'start_date', 'start_time', 'end_date', 'end_time', 'all_day', 'time_zone', 'where', 'description', 'create_forum_thread') - class Media: - css = { - 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + - settings.GPP_THIRD_PARTY_CSS['jquery-ui'] + - ['css/gcalendar.css']) - } - js = (settings.GPP_THIRD_PARTY_JS['markitup'] + - settings.GPP_THIRD_PARTY_JS['jquery-ui'] + - ['js/timezone.js', 'js/gcalendar.js']) - def __init__(self, *args, **kwargs): initial = kwargs.get('initial', {}) instance = kwargs.get('instance', None) diff -r fd70e9d547ed -r 21c592cac71c membermap/forms.py --- a/membermap/forms.py Sun Dec 06 13:22:09 2015 -0600 +++ b/membermap/forms.py Sun Dec 06 14:48:30 2015 -0600 @@ -2,7 +2,6 @@ Forms for the member map application. """ from django import forms -from django.conf import settings from membermap.models import MapEntry @@ -16,12 +15,3 @@ class Meta: model = MapEntry fields = ('location', 'message') - - class Media: - css = { - 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + - settings.GPP_THIRD_PARTY_CSS['jquery-ui']) - } - js = (settings.GPP_THIRD_PARTY_JS['markitup'] + - settings.GPP_THIRD_PARTY_JS['jquery-ui']) - diff -r fd70e9d547ed -r 21c592cac71c membermap/views.py --- a/membermap/views.py Sun Dec 06 13:22:09 2015 -0600 +++ b/membermap/views.py Sun Dec 06 14:48:30 2015 -0600 @@ -15,7 +15,6 @@ from membermap.models import MapEntry from membermap.forms import MapEntryForm -from bio.models import UserProfile CACHE_KEY = 'membermap_json' CACHE_TIMEOUT = 5 * 60 diff -r fd70e9d547ed -r 21c592cac71c messages/forms.py --- a/messages/forms.py Sun Dec 06 13:22:09 2015 -0600 +++ b/messages/forms.py Sun Dec 06 14:48:30 2015 -0600 @@ -108,14 +108,6 @@ if receiver_opts.notify_email: notify_receiver(new_msg) - class Media: - css = { - 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + - settings.GPP_THIRD_PARTY_CSS['jquery-ui']) - } - js = (settings.GPP_THIRD_PARTY_JS['markitup'] + - settings.GPP_THIRD_PARTY_JS['jquery-ui']) - class OptionsForm(forms.ModelForm): class Meta: diff -r fd70e9d547ed -r 21c592cac71c news/forms.py --- a/news/forms.py Sun Dec 06 13:22:09 2015 -0600 +++ b/news/forms.py Sun Dec 06 14:48:30 2015 -0600 @@ -3,7 +3,6 @@ """ from django import forms -from django.conf import settings from core.html import ImageCheckError from core.html import image_check @@ -28,17 +27,6 @@ model = PendingStory fields = ['title', 'category', 'short_markup'] - class Media: - css = { - 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + - settings.GPP_THIRD_PARTY_CSS['jquery-ui']) - } - js = ( - settings.GPP_THIRD_PARTY_JS['markitup'] + - settings.GPP_THIRD_PARTY_JS['jquery-ui'] + - ['js/jquery.form.min.js'] - ) - def clean_short_markup(self): md = self.cleaned_data['short_markup'] self.html = None diff -r fd70e9d547ed -r 21c592cac71c sg101/templates/bio/edit_profile.html --- a/sg101/templates/bio/edit_profile.html Sun Dec 06 13:22:09 2015 -0600 +++ b/sg101/templates/bio/edit_profile.html Sun Dec 06 14:48:30 2015 -0600 @@ -1,9 +1,13 @@ {% extends 'bio/base.html' %} {% load bio_tags %} {% load elsewhere_tags %} +{% load script_tags %} +{% load static from staticfiles %} {% block title %}Edit Profile{% endblock %} {% block custom_js %} - {{ profile_form.media }} +{% script_tags 'jquery-ui markitup' %} + + {% endblock %} {% block content %}
diff -r fd70e9d547ed -r 21c592cac71c sg101/templates/bio/member_search.html --- a/sg101/templates/bio/member_search.html Sun Dec 06 13:22:09 2015 -0600 +++ b/sg101/templates/bio/member_search.html Sun Dec 06 14:48:30 2015 -0600 @@ -1,7 +1,8 @@ {% extends "base.html" %} +{% load script_tags %} {% block title %}Member Search{% endblock %} {% block custom_js %} - {{ form.media }} +{% script_tags 'jquery-ui' %} {% endblock %} {% block content %}

Member Search

diff -r fd70e9d547ed -r 21c592cac71c sg101/templates/downloads/add.html --- a/sg101/templates/downloads/add.html Sun Dec 06 13:22:09 2015 -0600 +++ b/sg101/templates/downloads/add.html Sun Dec 06 14:48:30 2015 -0600 @@ -1,11 +1,14 @@ {% extends 'base.html' %} {% load downloads_tags %} {% load core_tags %} +{% load script_tags %} {% block title %}Add Download{% endblock %} {% block custom_css %} -{{ add_form.media }} {% endblock %} +{% block custom_js %} +{% script_tags 'jquery-ui markitup' %} +{% endblock %} {% block content %}

Downloads

{% include 'downloads/navigation.html' %} diff -r fd70e9d547ed -r 21c592cac71c sg101/templates/forums/edit_post.html --- a/sg101/templates/forums/edit_post.html Sun Dec 06 13:22:09 2015 -0600 +++ b/sg101/templates/forums/edit_post.html Sun Dec 06 14:48:30 2015 -0600 @@ -1,7 +1,13 @@ {% extends 'base.html' %} {% load forum_tags %} +{% load script_tags %} +{% load static from staticfiles %} {% block title %}Forums: Edit Post{% endblock %} -{% block custom_js %}{{ form.media }}{% endblock %} +{% block custom_js %} + {% script_tags 'jquery-ui markitup' %} + + +{% endblock %} {% block content %} {% forum_navigation topic "Edit Post" %} diff -r fd70e9d547ed -r 21c592cac71c sg101/templates/forums/new_post.html --- a/sg101/templates/forums/new_post.html Sun Dec 06 13:22:09 2015 -0600 +++ b/sg101/templates/forums/new_post.html Sun Dec 06 14:48:30 2015 -0600 @@ -1,7 +1,13 @@ {% extends 'base.html' %} {% load forum_tags %} +{% load script_tags %} +{% load static from staticfiles %} {% block title %}Forums: New Post{% endblock %} -{% block custom_js %}{{ form.media }}{% endblock %} +{% block custom_js %} + {% script_tags 'jquery-ui markitup' %} + + +{% endblock %} {% block content %} {% forum_navigation topic "New Post" %} diff -r fd70e9d547ed -r 21c592cac71c sg101/templates/forums/new_topic.html --- a/sg101/templates/forums/new_topic.html Sun Dec 06 13:22:09 2015 -0600 +++ b/sg101/templates/forums/new_topic.html Sun Dec 06 14:48:30 2015 -0600 @@ -1,7 +1,10 @@ {% extends 'base.html' %} {% load forum_tags %} +{% load script_tags %} {% block title %}Forums: New Topic{% endblock %} -{% block custom_js %}{{ form.media }}{% endblock %} +{% block custom_js %} + {% script_tags 'jquery-ui markitup' %} +{% endblock %} {% block content %} {% forum_navigation forum "New Topic" %} diff -r fd70e9d547ed -r 21c592cac71c sg101/templates/forums/topic.html --- a/sg101/templates/forums/topic.html Sun Dec 06 13:22:09 2015 -0600 +++ b/sg101/templates/forums/topic.html Sun Dec 06 14:48:30 2015 -0600 @@ -3,13 +3,15 @@ {% load forum_tags %} {% load core_tags %} {% load script_tags %} +{% load static from staticfiles %} {% block title %}Forums: {{ topic.name }}{% endblock %} {% block custom_meta %} {% open_graph_meta_tags topic %} {% endblock %} {% block custom_js %} - {% script_tags 'imagesloaded' %} - {{ form.media }} + {% script_tags 'jquery-ui markitup imagesloaded' %} + + {% include "forums/jump_box.js" %} + {% endblock %} {% block content %} diff -r fd70e9d547ed -r 21c592cac71c sg101/templates/membermap/index.html --- a/sg101/templates/membermap/index.html Sun Dec 06 13:22:09 2015 -0600 +++ b/sg101/templates/membermap/index.html Sun Dec 06 14:48:30 2015 -0600 @@ -1,11 +1,14 @@ {% extends 'base.html' %} {% load core_tags %} +{% load script_tags %} {% block title %}Member Map{% endblock %} +{% block custom_css %} + +{% endblock %} {% block custom_js %} -{{ form.media }} - +{% script_tags 'jquery-ui markitup' %} {% endblock %} {% endif %} {% block submit-class %}class="active"{% endblock %}