Register buttons.
This commit is contained in:
1 parent
12fafabcdd
commit
96bacb586d
2 files changed
+20
-2
No files matched your search
+3
-1
@@ -6,4 +6,6 @@ from django.template import RequestContext
|
||||
from models import *
|
||||
|
||||
def home(request):
|
||||
return render_to_response('home.html', locals())
|
||||
products = Product.objects.all()
|
||||
users = User.objects.all()
|
||||
return render_to_response('home.html', locals(), context_instance=RequestContext(request))
|
||||
+17
-1
@@ -4,5 +4,21 @@
|
||||
{%endblock%}
|
||||
|
||||
{%block content%}
|
||||
|
||||
<section id="register">
|
||||
<div id="user">
|
||||
Selg til:
|
||||
{% for user in users %}
|
||||
<button id="{{ user }}">{{ user }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div id="products">
|
||||
Vi selger:<br />
|
||||
{% for product in products %}
|
||||
<button id="{{ product.id }}">+ {{ product.name }}</button>
|
||||
<button id="{{ product.id }}">- {{ product.name }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div id="total">Totalt: <span class="total_text"></span></div>
|
||||
<button id="submit">Kjøp</button>
|
||||
</section>
|
||||
{%endblock%}
|
||||
Reference in new issue
Block a user