summaryrefslogtreecommitdiffstats
path: root/equations
diff options
context:
space:
mode:
Diffstat (limited to 'equations')
-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
7 files changed, 106 insertions, 13 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")
-