summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--equations/templates/equations/equation_detail.html14
-rw-r--r--equations/templates/equations/equation_list.html8
-rw-r--r--equations/templates/equations/symbol_detail.html15
-rw-r--r--equations/templates/equations/symbol_list.html24
-rw-r--r--equations/templates/equations/variable_detail.html25
-rw-r--r--equations/templates/equations/variable_list.html24
-rw-r--r--equations/views.py9
-rw-r--r--templates/go.html16
8 files changed, 117 insertions, 18 deletions
diff --git a/equations/templates/equations/equation_detail.html b/equations/templates/equations/equation_detail.html
index b4c3911..978b2e1 100644
--- a/equations/templates/equations/equation_detail.html
+++ b/equations/templates/equations/equation_detail.html
@@ -3,19 +3,25 @@
{% block title %}{{ object.name }}{% endblock %}
{% block content %}
-<div style="width: 100px; text-align:center;">
+<div style="width: 100%; text-align:center;">
<img src="{{ object.get_render_url }}" style="border: none;" /></div>
+<br />
<table width="100%">
{% if object.description %}
- <tr><td><b>Description:</b></td><td>{{ object.description }}</td></tr>
+ <tr><td width="25%"><b>Description:</b></td><td>{{ object.description }}
+ </td></tr>
+{% endif %}
+{% if object.reference %}
+ <tr><td><b>Reference:</b></td><td>
+ <a href="{{ object.reference }}">{{ object.reference }}</a></td></tr>
{% endif %}
{% if object.variables %}
<tr><td><b>Variables:</b></td><td>
- {% for variable in object.variables %}
+ {% for variable in object.variables.all %}
<a href="{{ variable.get_absolute_url }}">{{ variable.name }}</a><br />
{% endfor %}
{% endif %}
- <tr><td><b>Raw LaTeX:</b></td><td>{{ object.latex }}</td></tr>
+ <tr><td><b>Raw LaTeX:</b></td><td><pre>{{ object.latex }}</pre></td></tr>
{% if object.unicode %}
<tr><td><b>Unicode:</b></td><td>{{ object.unicode }}</td></tr>
{% endif %}
diff --git a/equations/templates/equations/equation_list.html b/equations/templates/equations/equation_list.html
index c7a9632..549c38f 100644
--- a/equations/templates/equations/equation_list.html
+++ b/equations/templates/equations/equation_list.html
@@ -4,16 +4,16 @@
{% block content %}
{% if object_list %}
-<table width="!00%">
+<table width="100%">
{% for item in object_list %}
- <tr style="height:50px;"><td style="width:45%;">
+ <tr style="height:60px;"><td style="width:50%;">
<a href="{{ item.get_absolute_url }}" class="imglink">
<img style="border: none;" src="{{ item.get_render_url }}" /></a>
- </td><td style="width: 55%"><a href="{{ item.get_absolute_url }}">
+ </td><td style="width: 50%"><a href="{{ item.get_absolute_url }}">
{{ item.name }}</a></td></tr>
{% endfor %}
</table>
-{% if not is_paginated %}<br />{% if not has_previous %}
+{% if is_paginated %}<br />{% if has_previous %}
<b><a href="./?page={{ previous }}" style="float:left;">&lt;PREV</a></b>
{% endif %}{% if has_next %}
<b><a href="./?page={{ next }}" style="float:right;">NEXT&gt;</a></b>
diff --git a/equations/templates/equations/symbol_detail.html b/equations/templates/equations/symbol_detail.html
new file mode 100644
index 0000000..85f59d8
--- /dev/null
+++ b/equations/templates/equations/symbol_detail.html
@@ -0,0 +1,15 @@
+{% extends "base.html" %}
+
+{% block title %}{{ object.name }}{% endblock %}
+
+{% block content %}
+<div style="width: 100%; text-align:center;">
+<img src="{{ object.get_render_url }}" style="border: none;" /></div>
+<br />
+<table width="100%">
+ <tr><td width="25%"><b>Raw LaTeX:</b></td><td><pre>{{ object.latex }}</pre></td></tr>
+{% if object.unicode %}
+ <tr><td><b>Unicode:</b></td><td>{{ object.unicode }}</td></tr>
+{% endif %}
+</table>
+{% endblock %}
diff --git a/equations/templates/equations/symbol_list.html b/equations/templates/equations/symbol_list.html
new file mode 100644
index 0000000..1983b3f
--- /dev/null
+++ b/equations/templates/equations/symbol_list.html
@@ -0,0 +1,24 @@
+{% extends "base.html" %}
+
+{% block title %}Symbol Time!{% endblock %}
+
+{% block content %}
+{% if object_list %}
+<table width="100%">
+ {% for item in object_list %}
+ <tr style="height:60px;"><td style="width:10%;padding-left:10%;">
+ <a href="{{ item.get_absolute_url }}" class="imglink">
+ <img style="border: none;" src="{{ item.get_render_url }}" /></a>
+ </td><td style="width: 70%"><a href="{{ item.get_absolute_url }}">
+ {{ item.name }}</a></td></tr>
+ {% endfor %}
+</table>
+{% if is_paginated %}<br />{% if has_previous %}
+<b><a href="./?page={{ previous }}" style="float:left;">&lt;PREV</a></b>
+{% endif %}{% if has_next %}
+<b><a href="./?page={{ next }}" style="float:right;">NEXT&gt;</a></b>
+{% endif %}{% endif %}
+{% else %}
+Fuck, where are they?
+{% endif %}
+{% endblock %}
diff --git a/equations/templates/equations/variable_detail.html b/equations/templates/equations/variable_detail.html
new file mode 100644
index 0000000..6488de2
--- /dev/null
+++ b/equations/templates/equations/variable_detail.html
@@ -0,0 +1,25 @@
+{% extends "base.html" %}
+
+{% block title %}{{ object.name }}{% endblock %}
+
+{% block content %}
+<div style="width: 100%; text-align:center;">
+<img src="{{ object.get_render_url }}" style="border: none;" /></div>
+<br />
+<table width="100%">
+{% if object.description %}
+ <tr><td width="25%"><b>Description:</b></td><td>{{ object.description }}</td></tr>
+{% endif %}
+{% if object.reference %}
+ <tr><td><b>Reference:</b></td><td>
+ <a href="{{ object.reference }}">{{ object.reference }}</a></td></tr>
+{% endif %}
+ <tr><td><b>Raw LaTeX:</b></td><td><pre>{{ object.latex }}</pre></td></tr>
+{% if object.unicode %}
+ <tr><td><b>Unicode:</b></td><td>{{ object.unicode }}</td></tr>
+{% endif %}
+ <tr><td><b>Symbol:</b></td><td>
+ <a href="{{ object.symbol.get_absolute_url }}">{{ object.symbol.name }}</a>
+ </td></tr>
+</table>
+{% endblock %}
diff --git a/equations/templates/equations/variable_list.html b/equations/templates/equations/variable_list.html
new file mode 100644
index 0000000..9ff7a64
--- /dev/null
+++ b/equations/templates/equations/variable_list.html
@@ -0,0 +1,24 @@
+{% extends "base.html" %}
+
+{% block title %}Variables; What a World!{% endblock %}
+
+{% block content %}
+{% if object_list %}
+<table width="100%">
+ {% for item in object_list %}
+ <tr style="height:60px;"><td style="width:10%;padding-left:10%;">
+ <a href="{{ item.get_absolute_url }}" class="imglink">
+ <img style="border: none;" src="{{ item.get_render_url }}" /></a>
+ </td><td style="width: 70%"><a href="{{ item.get_absolute_url }}">
+ {{ item.name }}</a></td></tr>
+ {% endfor %}
+</table>
+{% if is_paginated %}<br />{% if has_previous %}
+<b><a href="./?page={{ previous }}" style="float:left;">&lt;PREV</a></b>
+{% endif %}{% if has_next %}
+<b><a href="./?page={{ next }}" style="float:right;">NEXT&gt;</a></b>
+{% endif %}{% endif %}
+{% else %}
+Fuck, where are they?
+{% endif %}
+{% endblock %}
diff --git a/equations/views.py b/equations/views.py
index 8e2f6fa..9ef1081 100644
--- a/equations/views.py
+++ b/equations/views.py
@@ -12,19 +12,18 @@ def all_symbs(request):
def equs_by_vars(request, whichvars):
vars = whichvars.split(',')
- if len(vars) < 1:
+ if len(vars) < 1 or whichvars == '':
return HttpResponse('[]', mimetype="text/javascript")
- #if vars[-1] == '/':
- # vars = vars[:-1]
+ if vars[-1] == '/' or vars[-1] == '':
+ vars = vars[:-1]
returnables = Equation.objects.filter(variables=vars[0])
if len(vars) > 1:
for r in returnables:
for i in vars[1:]:
- if not i in r.variables:
+ if len(r.variables.filter(id=i)) == 0:
returnables = returnables.exclude(id=r.id)
if len(returnables) < 1:
break
data = serializers.serialize("json", returnables)
return HttpResponse(data, mimetype="text/javascript")
-
diff --git a/templates/go.html b/templates/go.html
index 5569cf2..98a2ddb 100644
--- a/templates/go.html
+++ b/templates/go.html
@@ -6,8 +6,9 @@
<script type="text/javascript">
var variables = []
var equations = []
+var equationsTMP = []
function get_variables() {
- $('status_bin').innerHTML= "Fetching..."
+ //$('status_bin').innerHTML= "Fetching..."
var initialVariablesRequest = new Ajax.Request(
"/json/all_vars/",
{ method: 'get',
@@ -16,7 +17,7 @@ function get_variables() {
function handle_variables(transport) {
json = transport.responseText.evalJSON();
- $('status_bin').innerHTML = "Recieved: \n" + json;
+ //$('status_bin').innerHTML = "Recieved: \n" + json;
$('variables_bin').innerHTML = '';
for(i=0; i<json.length; i++) {
variables[i] = json[i].fields;
@@ -43,17 +44,22 @@ function toggle_variable(vnum) {
whichvars += (i+1) + ","
}
}
+
+ //$('status_bin').innerHTML = "Requested: \n" +
+ "/json/equs_by_vars/" + whichvars + "/" + "<br />";
var freshEquationsRequest = new Ajax.Request(
- "/json/equs_by_vars/" + whichvars,
+ "/json/equs_by_vars/" + whichvars + "/",
{ method: 'get',
onSuccess: handle_equations});
}
function handle_equations(transport) {
+ //$('status_bin').innerHTML += "Recieved: \n" + transport.responseText;
json = transport.responseText.evalJSON();
- $('status_bin').innerHTML = "Recieved: \n" + json;
+ //$('status_bin').innerHTML += "<br />Recieved: \n" + json;
$('equations_bin').innerHTML = '<br />';
for(i=0; i<json.length; i++) {
equations[json[i].pk-1] = json[i].fields;
+ equationsTMP[i] = json[i].fields;
$('equations_bin').innerHTML += '<a style="text-decoration:none;' +
'border:none;" href="/equation/'+json[i].pk+'/">' +
'<img src="/static/' +
@@ -79,7 +85,7 @@ function handle_equations(transport) {
<div id="equations_bin" style="border: 2px solid black; width: 100%;">
(none yet, choose some variables!)
</div>
-<span style="visibility: hidden;">
+<span style="visibility: hidden; width=1px, height=1px;">
<b>Status: </b>
<div id="status_bin" style="border: 2px solid black; width: 100%;">
(nothing...)</div>