Permalink
Browse files

using django static handling instead of nexus media. version 0.3.0. F…

…ixed #70.
  • Loading branch information...
1 parent 19d91e7 commit 46c315acaff7b4d2b1b489a1f76103dec1b24b32 @chrisvxd chrisvxd committed Aug 21, 2012
View
3 .gitignore
@@ -3,4 +3,5 @@
*~
*conflicted copy*
*.sublime*
-*experiments.db
+*experiments.db
+.DS_Store
View
13 README.rst
@@ -11,6 +11,16 @@ If you don't know what AB testing is, check out `wikipedia <http://en.wikipedia.
.. image:: https://s3-eu-west-1.amazonaws.com/mixcloud-public/screenshot2.jpg
+Changelog
+---------
+
+0.3.0
+~~~~~
+
+- Added django permission support.
+- Started using django static instead of nexus:media.
+
+
Installation
------------
@@ -84,7 +94,8 @@ And add our middleware:
'experiments.middleware.ExperimentsMiddleware',
]
-We haven't configured our goals yet, we'll do that in a bit.
+We haven't configured our goals yet, we'll do that in a bit. Please ensure
+you have correctly configured your STATIC_URL setting.
*Note, more configuration options are detailed below.*
View
4 example_project/settings.py
@@ -23,6 +23,9 @@
EXPERIMENTS_REDIS_DB = 0
+# Media Settings
+STATIC_URL = '/static/'
+
# Other settings
# Django settings for example_project project.
NEXUS_MEDIA_PREFIX = '/nexus/media/'
@@ -133,6 +136,7 @@
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.humanize',
+ 'django.contrib.staticfiles',
'nexus',
'experiments',
'gargoyle',
View
3 experiments/media/css/experiments.css → ...ts/static/experiments/css/experiments.css
@@ -51,7 +51,6 @@
#container div.toolbar[data-sort=name] ul.sort li.name a,
#container div.toolbar[data-sort=start_date] ul.sort li.start_date a,
#container div.toolbar[data-sort=end_date] ul.sort li.end_date a{
-
color: #000;
font-weight: bold;
}
@@ -181,7 +180,6 @@
#container table.experiments td.actions button.edit span {
display: block;
- background: transparent url("../img/edit.png") no-repeat left 35%;
}
#container table.experiments td.actions button.delete,
@@ -192,7 +190,6 @@
#container table.experiments td.actions button.delete span {
display: block;
- background: transparent url("../img/delete.png") no-repeat left 35%;
}
#container table.empty {
View
0 experiments/media/img/button-bg.jpg → ...ents/static/experiments/img/button-bg.jpg
File renamed without changes
View
0 experiments/media/img/delete.png → ...riments/static/experiments/img/delete.png
File renamed without changes
View
0 experiments/media/img/edit.png → experiments/static/experiments/img/edit.png
File renamed without changes
View
0 experiments/media/js/experiments.js → ...ents/static/experiments/js/experiments.js
File renamed without changes.
View
0 experiments/media/js/jquery.cookie.js → ...ts/static/experiments/js/jquery.cookie.js
File renamed without changes.
View
0 experiments/media/js/nexus_experiments.js → ...tatic/experiments/js/nexus_experiments.js
File renamed without changes.
View
0 experiments/media/js/string_score.min.js → ...static/experiments/js/string_score.min.js
File renamed without changes.
View
21 experiments/templates/nexus/experiments/index.html
@@ -1,23 +1,34 @@
{% extends "nexus/module.html" %}
+{% load staticfiles %}
{% load experiment_helpers %}
{% block head %}
{{ block.super }}
- <link rel="stylesheet" href="{% url nexus:media 'experiments' 'css/experiments.css' %}">
+
+ <link rel="stylesheet" href="{% static 'experiments/css/experiments.css' %}">
+
+ <style>
+ #container table.experiments td.actions button.edit span {
+ background: transparent url("{% static 'experiments/img/edit.png' %}") no-repeat left 35%;
+ }
+
+ #container table.experiments td.actions button.delete span {
+ background: transparent url("{% static 'experiments/img/delete.png' %}") no-repeat left 35%;
+ }
+ </style>
+
<script>
var EXPERIMENT = {
addExperiment: "{% url experiments:add %}",
updateExperiment: "{% url experiments:update %}",
deleteExperiment: "{% url experiments:delete %}",
updateState: "{% url experiments:state %}",
-
- deleteImage: "{% url nexus:media 'experiments' 'img/delete.png' %}"
};
</script>
- <script src="{% url nexus:media 'experiments' 'js/string_score.min.js' %}"></script>
- <script src="{% url nexus:media 'experiments' 'js/nexus_experiments.js' %}"></script>
+ <script src="{% static 'experiments/js/string_score.min.js' %}"></script>
+ <script src="{% static 'experiments/js/nexus_experiments.js' %}"></script>
{% endblock %}
{% block content %}
View
8 experiments/templates/nexus/experiments/results.html
@@ -1,10 +1,12 @@
{% extends "nexus/module.html" %}
+{% load staticfiles %}
{% load humanize %}
{% load experiment_helpers %}
{% block head %}
{{ block.super }}
- <link rel="stylesheet" href="{% url nexus:media 'experiments' 'css/experiments.css' %}">
+
+ <link rel="stylesheet" href="{% static 'experiments/css/experiments.css' %}">
<script>
var EXPERIMENT = {
@@ -13,12 +15,10 @@
deleteExperiment: "{% url experiments:delete %}",
updateState: "{% url experiments:state %}",
- deleteImage: "{% url nexus:media 'experiments' 'img/delete.png' %}"
};
</script>
- <script src="{% url nexus:media 'experiments' 'js/nexus_experiments.js' %}"></script>
-
+ <script src="{% static 'experiments/js/nexus_experiments.js' %}"></script>
{% endblock %}
View
2 requirements.txt
@@ -1,5 +1,5 @@
redis>=2.4.9
-django>=1.3.0
+django>=1.4.0
nexus>=0.2.3
jsonfield>=0.9
gargoyle>=0.9.0
View
4 setup.py
@@ -26,7 +26,7 @@ def parse_dependency_links(file_name):
setup(name='django-experiments',
- version='0.2.3',
+ version='0.3.0',
description='Python Django AB Testing Framework',
author='Chris Villa',
author_email='chris@mixcloud.com',
@@ -37,4 +37,4 @@ def parse_dependency_links(file_name):
install_requires = parse_requirements('requirements.txt'),
dependency_links = parse_dependency_links('requirements.txt'),
long_description=open('README.rst').read(),
- )
+)

0 comments on commit 46c315a

Please sign in to comment.