Browse files

Update templates to new url syntax

  • Loading branch information...
1 parent f9119b5 commit 704e350f9119f0bef47276273c10805b7ce14c0e @theospears theospears committed Jan 18, 2013
View
3 example_project/templates/goal.html
@@ -1,11 +1,12 @@
{% load experiments %}
+{% load url from future %}
<!DOCTYPE html>
<html>
<head>
<title>Goal Page</title>
</head>
<body>
{% experiment_goal "page_goal" %}
- <a href="{% url test_page %}">Back</a>
+ <a href="{% url 'test_page' %}">Back</a>
</body>
</html>
View
11 example_project/templates/test_page.html
@@ -1,11 +1,12 @@
{% load experiments %}
+{% load url from future %}
<!DOCTYPE html>
<html>
<head>
<title>Experiment Test Page</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script>
- <script src="{% url nexus:media 'experiments' 'js/jquery.cookie.js' %}"></script>
- <script src="{% url nexus:media 'experiments' 'js/experiments.js' %}"></script>
+ <script src="{% url 'nexus:media' 'experiments' 'js/jquery.cookie.js' %}"></script>
+ <script src="{% url 'nexus:media' 'experiments' 'js/experiments.js' %}"></script>
<script>
jQuery(document).ajaxSend(function(event, xhr, settings) {
@@ -51,16 +52,16 @@
{% csrf_token %}
{% experiment helloworld control %}
- <a href="{% url goal %}">Click Me (Control)</a>
+ <a href="{% url 'goal' %}">Click Me (Control)</a>
{% endexperiment %}
{% experiment helloworld test %}
- <a href="{% url goal %}">Don't Click Me (test)</a>
+ <a href="{% url 'goal' %}">Don't Click Me (test)</a>
{% endexperiment %}
<span onclick="experiments.goal('js_goal')">JS GOAL</span>
<span data-experiments-goal="cookie_goal">COOKIE GOAL</span>
{% include "experiments/confirm_human.html" %}
</body>
-</html>
+</html>
View
5 experiments/templates/nexus/experiments/dashboard.html
@@ -1,12 +1,13 @@
+{% load url from future %}
{% if not enabled_experiments %}
<p>There are no active experiments.</p>
{% else %}
<p>There are <b>{{ enabled_experiments_count }} active</b> experiments.</p>
<table class="experiment-list">
{% for experiment in enabled_experiments %}
<tr>
- <td><a href="{% url experiments:results experiment.name %}">{{experiment.name}}</a></td>
+ <td><a href="{% url 'experiments:results' experiment.name %}">{{experiment.name}}</a></td>
</tr>
{% endfor %}
</table>
-{% endif %}
+{% endif %}
View
25 experiments/templates/nexus/experiments/index.html
@@ -1,34 +1,35 @@
{% extends "nexus/module.html" %}
{% load experiment_helpers %}
+{% load url from future %}
{% block head %}
{{ block.super }}
- <link rel="stylesheet" href="{% url nexus:media 'experiments' 'css/experiments.css' %}">
+ <link rel="stylesheet" href="{% url 'nexus:media' 'experiments' 'css/experiments.css' %}">
<style>
#container table.experiments td.actions button.edit span {
- background: transparent url("{% url nexus:media 'experiments' 'img/edit.png' %}") no-repeat left 35%;
+ background: transparent url("{% url 'nexus:media' 'experiments' 'img/edit.png' %}") no-repeat left 35%;
}
#container table.experiments td.actions button.delete span {
- background: transparent url("{% url nexus:media 'experiments' 'img/delete.png' %}") no-repeat left 35%;
+ background: transparent url("{% url 'nexus:media' '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 %}",
+ addExperiment: "{% url 'experiments:add' %}",
+ updateExperiment: "{% url 'experiments:update' %}",
+ deleteExperiment: "{% url 'experiments:delete' %}",
+ updateState: "{% url 'experiments:state' %}",
};
nexus_experiments_all_goals = {{ all_goals|safe }};
</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="{% url 'nexus:media' 'experiments' 'js/string_score.min.js' %}"></script>
+ <script src="{% url 'nexus:media' 'experiments' 'js/nexus_experiments.js' %}"></script>
{% endblock %}
{% block content %}
@@ -64,7 +65,7 @@
<tr data-experiment-name="{{ experiment.name }}" data-experiment-switch="{{ experiment.switch_key }}" data-experiment-desc="{{ experiment.description }}" data-experiment-chi2-goals="{{ experiment.relevant_chi2_goals }}" data-experiment-mwu-goals="{{ experiment.relevant_mwu_goals }}" class="collapsed">
<td class="name">
<h4>{{ experiment.name }}
- <a href="{% url experiments:results experiment.name %}">(View Results)</a>
+ <a href="{% url 'experiments:results' experiment.name %}">(View Results)</a>
<small>
<span id = "{{ experiment.name }}_start_date"
{% if experiment.start_date %}
@@ -89,7 +90,7 @@
{% endif %}
{% if experiment.switch_key %}
- <p>Connected to Gargoyle switch <a href="{% url gargoyle:index %}#id_{{ experiment.switch_key }}">{{ experiment.switch_key }}</a>.</p>
+ <p>Connected to Gargoyle switch <a href="{% url 'gargoyle:index' %}#id_{{ experiment.switch_key }}">{{ experiment.switch_key }}</a>.</p>
{% endif %}
</div>
@@ -209,7 +210,7 @@
{{ /if }}
{{ if switch_key }}
- <p>Connected to Gargoyle switch <a href="{% endraw %}{% url gargoyle:index %}{% raw %}#id_${switch_key}">${switch_key}</a>.</p>
+ <p>Connected to Gargoyle switch <a href="{% endraw %}{% url 'gargoyle:index' %}{% raw %}#id_${switch_key}">${switch_key}</a>.</p>
{{ /if }}
</div>
</td>
View
17 experiments/templates/nexus/experiments/results.html
@@ -1,19 +1,20 @@
{% extends "nexus/module.html" %}
{% load humanize %}
{% load experiment_helpers %}
+{% load url from future %}
{% block head %}
{{ block.super }}
- <link rel="stylesheet" href="{% url nexus:media 'experiments' 'css/experiments.css' %}">
+ <link rel="stylesheet" href="{% url 'nexus:media' 'experiments' 'css/experiments.css' %}">
<script>
var EXPERIMENT = {
- addExperiment: "{% url experiments:add %}",
- updateExperiment: "{% url experiments:update %}",
- deleteExperiment: "{% url experiments:delete %}",
- updateState: "{% url experiments:state %}",
- setAlternative: "{% url experiments:set_alternative %}",
+ addExperiment: "{% url 'experiments:add' %}",
+ updateExperiment: "{% url 'experiments:update' %}",
+ deleteExperiment: "{% url 'experiments:delete' %}",
+ updateState: "{% url 'experiments:state' %}",
+ setAlternative: "{% url 'experiments:set_alternative' %}",
};
@@ -26,7 +27,7 @@
google.load('visualization', '1.0', {'packages':['corechart']});
</script>
- <script src="{% url nexus:media 'experiments' 'js/nexus_experiments.js' %}"></script>
+ <script src="{% url 'nexus:media' 'experiments' 'js/nexus_experiments.js' %}"></script>
{% endblock %}
@@ -54,7 +55,7 @@ <h2 class="experiment">{{ experiment.name }}</h2>
{% if experiment.switch_key %}
<div data-experiment-name="{{experiment.name}}" class="results header" style>
- Connected to Gargoyle switch <a href="{% url gargoyle:index %}#id_{{experiment.switch_key}}">{{experiment.switch_key}}</a>.
+ Connected to Gargoyle switch <a href="{% url 'gargoyle:index' %}#id_{{experiment.switch_key}}">{{experiment.switch_key}}</a>.
</div>
{% endif %}

0 comments on commit 704e350

Please sign in to comment.