From 7660cb4236584e4d69b492d45133532a0a4d4791 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Thu, 12 Jul 2007 01:40:54 -0400 Subject: works? --- equations/templates/equations/equation_detail.html | 14 ++++++++---- equations/templates/equations/equation_list.html | 8 +++---- equations/templates/equations/symbol_detail.html | 15 +++++++++++++ equations/templates/equations/symbol_list.html | 24 +++++++++++++++++++++ equations/templates/equations/variable_detail.html | 25 ++++++++++++++++++++++ equations/templates/equations/variable_list.html | 24 +++++++++++++++++++++ equations/views.py | 9 ++++---- templates/go.html | 16 +++++++++----- 8 files changed, 117 insertions(+), 18 deletions(-) create mode 100644 equations/templates/equations/symbol_detail.html create mode 100644 equations/templates/equations/symbol_list.html create mode 100644 equations/templates/equations/variable_detail.html create mode 100644 equations/templates/equations/variable_list.html 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 %} -
+
+
{% if object.description %} - + +{% endif %} +{% if object.reference %} + {% endif %} {% if object.variables %} + {% if object.unicode %} {% 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 %} -
Description:{{ object.description }}
Description:{{ object.description }} +
Reference: + {{ object.reference }}
Variables: - {% for variable in object.variables %} + {% for variable in object.variables.all %} {{ variable.name }}
{% endfor %} {% endif %} -
Raw LaTeX:{{ object.latex }}
Raw LaTeX:
{{ object.latex }}
Unicode:{{ object.unicode }}
+
{% for item in object_list %} - {% endfor %}
+
- + {{ item.name }}
-{% if not is_paginated %}
{% if not has_previous %} +{% if is_paginated %}
{% if has_previous %} <PREV {% endif %}{% if has_next %} NEXT> 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 %} +
+
+
+ + +{% if object.unicode %} + +{% endif %} +
Raw LaTeX:
{{ object.latex }}
Unicode:{{ object.unicode }}
+{% 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 %} + + {% for item in object_list %} + + {% endfor %} +
+ + + + {{ item.name }}
+{% if is_paginated %}
{% if has_previous %} +<PREV +{% endif %}{% if has_next %} +NEXT> +{% 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 %} +
+
+
+ +{% if object.description %} + +{% endif %} +{% if object.reference %} + +{% endif %} + +{% if object.unicode %} + +{% endif %} + +
Description:{{ object.description }}
Reference: + {{ object.reference }}
Raw LaTeX:
{{ object.latex }}
Unicode:{{ object.unicode }}
Symbol: + {{ object.symbol.name }} +
+{% 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 %} + + {% for item in object_list %} + + {% endfor %} +
+ + + + {{ item.name }}
+{% if is_paginated %}
{% if has_previous %} +<PREV +{% endif %}{% if has_next %} +NEXT> +{% 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 @@