зеркало из https://github.com/mozilla/airmozilla.git
Switch to django-compressor
This commit is contained in:
Родитель
000b03adb2
Коммит
fe3335e288
|
@ -18,3 +18,4 @@ tmp/*
|
||||||
*~
|
*~
|
||||||
*.mo
|
*.mo
|
||||||
.virtualenv
|
.virtualenv
|
||||||
|
/static/
|
||||||
|
|
До Ширина: | Высота: | Размер: 10 KiB После Ширина: | Высота: | Размер: 10 KiB |
|
@ -1,19 +1,22 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html LANG="{{ LANG }}" dir="{{ DIR }}">
|
<html lang="{{ LANG }}" dir="{{ DIR }}">
|
||||||
<head>
|
<head>
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||||
<title>{% block page_title %}Air Mozilla{% endblock %}</title>
|
<title>{% block page_title %}Air Mozilla{% endblock %}</title>
|
||||||
|
|
||||||
{% block site_css %}
|
{% block site_css %}
|
||||||
{{ css('main_css') }}
|
{% compress css %}
|
||||||
|
<link href="{{ static('css/main.css')}}" rel="stylesheet" type="text/css">
|
||||||
|
{% endcompress %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
|
||||||
{% block site_js %}
|
{% block site_js %}
|
||||||
{{ js('main_js') }}
|
{% compress js %}
|
||||||
|
<script src="{{ static('js/libs/jquery-1.7.2.min.js') }}"></script>
|
||||||
|
{% endcompress %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,12 @@
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
{% if request.user.is_active %}
|
{% if request.user.is_active %}
|
||||||
|
|
||||||
<p>{{ _('You are logged in as {username}')|f(username=request.user) }}.
|
<p>{{ _('You are logged in as {username}')|f(username=request.user) }}.
|
||||||
<a href="{{ url('auth.logout') }}">{{ _('Log out') }}</a></p>
|
<a href="{{ url('auth.logout') }}">{{ _('Log out') }}</a></p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p><a id="browserid" href="#">{{ _('Log in with BrowserID') }}</a></p>
|
<p><a id="browserid" href="#">{{ _('Log in with BrowserID') }}</a></p>
|
||||||
<form method="POST" action="{{ url('auth.mozilla_browserid_verify') }}">
|
<form method="post" action="{{ url('auth.mozilla_browserid_verify') }}">
|
||||||
{{ csrf() }}
|
{{ csrf() }}
|
||||||
{{ browserid_form.as_p() }}
|
{{ browserid_form.as_p() }}
|
||||||
</form>
|
</form>
|
||||||
|
@ -18,7 +19,7 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block site_js %}
|
{% block site_js %}
|
||||||
{{ js('main_js') }}
|
{{ super() }}
|
||||||
{% if not request.user.is_active %}
|
{% if not request.user.is_active %}
|
||||||
{{ browserid_form.media }}
|
{{ browserid_form.media }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
[class^="icon-"] {background-image: url("/media/img/manage/glyphicons-halflings.png")}
|
[class^="icon-"] {
|
||||||
|
background-image: url("../img/glyphicons-halflings.png");
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
До Ширина: | Высота: | Размер: 8.6 KiB После Ширина: | Высота: | Размер: 8.6 KiB |
До Ширина: | Высота: | Размер: 14 KiB После Ширина: | Высота: | Размер: 14 KiB |
|
@ -1,4 +1,4 @@
|
||||||
{% extends "manage_base.html" %}
|
{% extends "manage/manage_base.html" %}
|
||||||
{% set page = "home" %}
|
{% set page = "home" %}
|
||||||
|
|
||||||
{% block manage_title %}
|
{% block manage_title %}
|
|
@ -25,14 +25,17 @@
|
||||||
<title>{% block page_title %}Air Mozilla Management{% endblock %}</title>
|
<title>{% block page_title %}Air Mozilla Management{% endblock %}</title>
|
||||||
|
|
||||||
{% block site_css %}
|
{% block site_css %}
|
||||||
{{ css('manage_css') }}
|
{% compress css %}
|
||||||
|
<link href="{{ static('manage/css/bootstrap.min.css') }}" rel="stylesheet" type="text/css">
|
||||||
|
<link href="{{ static('manage/css/manage.css') }}" rel="stylesheet" type="text/css">
|
||||||
|
{% endcompress %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span12" id="logo">
|
<div class="span12" id="logo">
|
||||||
<img id="logo-img" src="{{ MEDIA_URL }}img/logo-airmo-lg.png" alt="Air Mozilla">
|
<img id="logo-img" src="{{ static('img/logo-airmo-lg.png') }}" alt="Air Mozilla">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="menu" class="span3">
|
<div id="menu" class="span3">
|
||||||
<ul class="nav nav-list">
|
<ul class="nav nav-list">
|
||||||
|
@ -61,8 +64,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% block site_js %}
|
{% block site_js %}
|
||||||
{{ js('main_js') }}
|
{% compress js %}
|
||||||
|
<script src="{{ static('js/libs/jquery-1.7.2.min.js') }}"></script>
|
||||||
|
{% endcompress %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -12,7 +12,7 @@ staff_required = user_passes_test(lambda u: u.is_staff)
|
||||||
@staff_required
|
@staff_required
|
||||||
def home(request):
|
def home(request):
|
||||||
"""Management homepage / explanation page."""
|
"""Management homepage / explanation page."""
|
||||||
return render(request, 'home.html')
|
return render(request, 'manage/home.html')
|
||||||
|
|
||||||
|
|
||||||
@staff_required
|
@staff_required
|
||||||
|
@ -35,7 +35,7 @@ def users(request):
|
||||||
users_paged = paginator.page(1)
|
users_paged = paginator.page(1)
|
||||||
except EmptyPage:
|
except EmptyPage:
|
||||||
users_paged = paginator.page(paginator.num_pages)
|
users_paged = paginator.page(paginator.num_pages)
|
||||||
return render(request, 'users.html', {'users': users_paged, 'form': form})
|
return render(request, 'manage/users.html', {'users': users_paged, 'form': form})
|
||||||
|
|
||||||
|
|
||||||
@staff_required
|
@staff_required
|
||||||
|
@ -50,7 +50,7 @@ def user_edit(request, id):
|
||||||
return redirect('manage.users')
|
return redirect('manage.users')
|
||||||
else:
|
else:
|
||||||
form = UserEditForm(instance=user)
|
form = UserEditForm(instance=user)
|
||||||
return render(request, 'user_edit.html', {'form': form, 'u': user})
|
return render(request, 'manage/user_edit.html', {'form': form, 'u': user})
|
||||||
|
|
||||||
|
|
||||||
@staff_required
|
@staff_required
|
||||||
|
@ -58,7 +58,7 @@ def user_edit(request, id):
|
||||||
def groups(request):
|
def groups(request):
|
||||||
"""Group editor: view groups and change group permissions."""
|
"""Group editor: view groups and change group permissions."""
|
||||||
groups = Group.objects.all()
|
groups = Group.objects.all()
|
||||||
return render(request, 'groups.html', {'groups': groups})
|
return render(request, 'manage/groups.html', {'groups': groups})
|
||||||
|
|
||||||
|
|
||||||
@staff_required
|
@staff_required
|
||||||
|
@ -73,7 +73,7 @@ def group_edit(request, id):
|
||||||
return redirect('manage.groups')
|
return redirect('manage.groups')
|
||||||
else:
|
else:
|
||||||
form = GroupEditForm(instance=group)
|
form = GroupEditForm(instance=group)
|
||||||
return render(request, 'group_edit.html', {'form': form, 'g': group})
|
return render(request, 'manage/group_edit.html', {'form': form, 'g': group})
|
||||||
|
|
||||||
|
|
||||||
@staff_required
|
@staff_required
|
||||||
|
@ -88,25 +88,25 @@ def group_new(request):
|
||||||
return redirect('manage.groups')
|
return redirect('manage.groups')
|
||||||
else:
|
else:
|
||||||
form = GroupEditForm(instance=group)
|
form = GroupEditForm(instance=group)
|
||||||
return render(request, 'group_new.html', {'form': form})
|
return render(request, 'manage/group_new.html', {'form': form})
|
||||||
|
|
||||||
|
|
||||||
@staff_required
|
@staff_required
|
||||||
@permission_required('manage.event_request')
|
@permission_required('manage.event_request')
|
||||||
def event_request(request):
|
def event_request(request):
|
||||||
"""Event request page: create new events to be published."""
|
"""Event request page: create new events to be published."""
|
||||||
return render(request, 'event_request.html')
|
return render(request, 'manage/event_request.html')
|
||||||
|
|
||||||
|
|
||||||
@staff_required
|
@staff_required
|
||||||
@permission_required('manage.participant_edit')
|
@permission_required('manage.participant_edit')
|
||||||
def participant_edit(request):
|
def participant_edit(request):
|
||||||
"""Participant editor page: update biographical info."""
|
"""Participant editor page: update biographical info."""
|
||||||
return render(request, 'participant_edit.html')
|
return render(request, 'manage/participant_edit.html')
|
||||||
|
|
||||||
|
|
||||||
@staff_required
|
@staff_required
|
||||||
@permission_required('manage.produce_events')
|
@permission_required('manage.produce_events')
|
||||||
def event_edit(request):
|
def event_edit(request):
|
||||||
"""Event edit/production: change, approve, publish events."""
|
"""Event edit/production: change, approve, publish events."""
|
||||||
return render(request, 'event_edit.html')
|
return render(request, 'manage/event_edit.html')
|
||||||
|
|
|
@ -9,25 +9,6 @@ from funfactory.settings_base import *
|
||||||
# clone.
|
# clone.
|
||||||
PROJECT_MODULE = 'airmozilla'
|
PROJECT_MODULE = 'airmozilla'
|
||||||
|
|
||||||
# Bundles is a dictionary of two dictionaries, css and js, which list css files
|
|
||||||
# and js files that can be bundled together by the minify app.
|
|
||||||
MINIFY_BUNDLES = {
|
|
||||||
'css': {
|
|
||||||
'main_css': (
|
|
||||||
'css/main/main.css',
|
|
||||||
),
|
|
||||||
'manage_css': (
|
|
||||||
'css/manage/bootstrap.min.css',
|
|
||||||
'css/manage/manage.css',
|
|
||||||
)
|
|
||||||
},
|
|
||||||
'js': {
|
|
||||||
'main_js': (
|
|
||||||
'js/main/libs/jquery-1.7.2.min.js',
|
|
||||||
'js/main/libs/jquery.cookie.js',
|
|
||||||
),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Defines the views served for root URLs.
|
# Defines the views served for root URLs.
|
||||||
ROOT_URLCONF = '%s.urls' % PROJECT_MODULE
|
ROOT_URLCONF = '%s.urls' % PROJECT_MODULE
|
||||||
|
|
|
@ -38,15 +38,19 @@ MANAGERS = ADMINS
|
||||||
|
|
||||||
# Debugging displays nice error messages, but leaks memory. Set this to False
|
# Debugging displays nice error messages, but leaks memory. Set this to False
|
||||||
# on all server instances and True only for development.
|
# on all server instances and True only for development.
|
||||||
DEBUG = TEMPLATE_DEBUG = True
|
#DEBUG = TEMPLATE_DEBUG = True
|
||||||
|
|
||||||
# Is this a development instance? Set this to True on development/master
|
# Is this a development instance? Set this to True on development/master
|
||||||
# instances and False on stage/prod.
|
# instances and False on stage/prod.
|
||||||
DEV = True
|
#DEV = True
|
||||||
|
|
||||||
|
# If you intend to run on something like http://127.0.0.1:8000 then
|
||||||
|
# set this False so cookies can be set with HTTP
|
||||||
|
#SESSION_COOKIE_SECURE = False
|
||||||
|
|
||||||
# By default, BrowserID expects your app to use http://127.0.0.1:8000
|
# By default, BrowserID expects your app to use http://127.0.0.1:8000
|
||||||
# Uncomment the following line if you prefer to access your app via localhost
|
# Uncomment the following line if you prefer to access your app via localhost
|
||||||
# SITE_URL = 'http://localhost:8000'
|
#SITE_URL = 'http://localhost:8000'
|
||||||
|
|
||||||
# Playdoh ships with Bcrypt+HMAC by default because it's the most secure.
|
# Playdoh ships with Bcrypt+HMAC by default because it's the most secure.
|
||||||
# To use bcrypt, fill in a secret HMAC key. It cannot be blank.
|
# To use bcrypt, fill in a secret HMAC key. It cannot be blank.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls.defaults import patterns, include
|
from django.conf.urls.defaults import patterns, include
|
||||||
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||||
|
|
||||||
from funfactory.monkeypatches import patch
|
from funfactory.monkeypatches import patch
|
||||||
patch()
|
patch()
|
||||||
|
@ -12,9 +13,4 @@ urlpatterns = patterns('',
|
||||||
|
|
||||||
## In DEBUG mode, serve media files through Django.
|
## In DEBUG mode, serve media files through Django.
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
# Remove leading and trailing slashes so the regex matches.
|
urlpatterns += staticfiles_urlpatterns()
|
||||||
media_url = settings.MEDIA_URL.lstrip('/').rstrip('/')
|
|
||||||
urlpatterns += patterns('',
|
|
||||||
(r'^%s/(?P<path>.*)$' % media_url, 'django.views.static.serve',
|
|
||||||
{'document_root': settings.MEDIA_ROOT}),
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,96 +0,0 @@
|
||||||
/**
|
|
||||||
* Cookie plugin
|
|
||||||
*
|
|
||||||
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
|
||||||
* Dual licensed under the MIT and GPL licenses:
|
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
|
||||||
* http://www.gnu.org/licenses/gpl.html
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a cookie with the given name and value and other optional parameters.
|
|
||||||
*
|
|
||||||
* @example $.cookie('the_cookie', 'the_value');
|
|
||||||
* @desc Set the value of a cookie.
|
|
||||||
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
|
|
||||||
* @desc Create a cookie with all available options.
|
|
||||||
* @example $.cookie('the_cookie', 'the_value');
|
|
||||||
* @desc Create a session cookie.
|
|
||||||
* @example $.cookie('the_cookie', null);
|
|
||||||
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
|
||||||
* used when the cookie was set.
|
|
||||||
*
|
|
||||||
* @param String name The name of the cookie.
|
|
||||||
* @param String value The value of the cookie.
|
|
||||||
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
|
||||||
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
|
||||||
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
|
||||||
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
|
||||||
* when the the browser exits.
|
|
||||||
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
|
||||||
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
|
||||||
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
|
||||||
* require a secure protocol (like HTTPS).
|
|
||||||
* @type undefined
|
|
||||||
*
|
|
||||||
* @name $.cookie
|
|
||||||
* @cat Plugins/Cookie
|
|
||||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the value of a cookie with the given name.
|
|
||||||
*
|
|
||||||
* @example $.cookie('the_cookie');
|
|
||||||
* @desc Get the value of a cookie.
|
|
||||||
*
|
|
||||||
* @param String name The name of the cookie.
|
|
||||||
* @return The value of the cookie.
|
|
||||||
* @type String
|
|
||||||
*
|
|
||||||
* @name $.cookie
|
|
||||||
* @cat Plugins/Cookie
|
|
||||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
|
||||||
*/
|
|
||||||
jQuery.cookie = function(name, value, options) {
|
|
||||||
if (typeof value != 'undefined') { // name and value given, set cookie
|
|
||||||
options = options || {};
|
|
||||||
if (value === null) {
|
|
||||||
value = '';
|
|
||||||
options.expires = -1;
|
|
||||||
}
|
|
||||||
var expires = '';
|
|
||||||
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
|
||||||
var date;
|
|
||||||
if (typeof options.expires == 'number') {
|
|
||||||
date = new Date();
|
|
||||||
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
|
||||||
} else {
|
|
||||||
date = options.expires;
|
|
||||||
}
|
|
||||||
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
|
||||||
}
|
|
||||||
// CAUTION: Needed to parenthesize options.path and options.domain
|
|
||||||
// in the following expressions, otherwise they evaluate to undefined
|
|
||||||
// in the packed version for some reason...
|
|
||||||
var path = options.path ? '; path=' + (options.path) : '';
|
|
||||||
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
|
||||||
var secure = options.secure ? '; secure' : '';
|
|
||||||
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
|
||||||
} else { // only name given, get cookie
|
|
||||||
var cookieValue = null;
|
|
||||||
if (document.cookie && document.cookie != '') {
|
|
||||||
var cookies = document.cookie.split(';');
|
|
||||||
for (var i = 0; i < cookies.length; i++) {
|
|
||||||
var cookie = jQuery.trim(cookies[i]);
|
|
||||||
// Does this cookie string begin with the name we want?
|
|
||||||
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
|
||||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return cookieValue;
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -4,3 +4,4 @@
|
||||||
|
|
||||||
-r ../vendor/src/funfactory/funfactory/requirements/compiled.txt
|
-r ../vendor/src/funfactory/funfactory/requirements/compiled.txt
|
||||||
-r ../vendor/src/funfactory/funfactory/requirements/dev.txt
|
-r ../vendor/src/funfactory/funfactory/requirements/dev.txt
|
||||||
|
mock==0.8.0
|
||||||
|
|
2
vendor
2
vendor
|
@ -1 +1 @@
|
||||||
Subproject commit f7805f43f377958335789d657c6e6d8e4a46c78f
|
Subproject commit 1191311eae137f51b27c210b9857e4e302581f0d
|
Загрузка…
Ссылка в новой задаче