From 1d31ab8e3188e76527c3808ae6a6ef0ae7482518 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Sat, 14 Dec 2013 21:09:03 +0100 Subject: [PATCH 01/34] Add point recharge functionality (and add time to auction when bidding) --- subastasIS2_django/subastas/urls.py | 1 + subastasIS2_django/subastas/views.py | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/subastasIS2_django/subastas/urls.py b/subastasIS2_django/subastas/urls.py index 743b5c4..a518ffd 100644 --- a/subastasIS2_django/subastas/urls.py +++ b/subastasIS2_django/subastas/urls.py @@ -18,5 +18,6 @@ url(r'^auctions/(?P\d+)/$', views.auction, name='auction_detail'), url(r'^offers/$', login_required(views.ListOffersView.as_view()), name='offers'), url(r'^offers/(?P\d+)/$', views.offer, name='offer_detail'), + url(r'^recharge/$', views.recharge, name='recharge'), (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 2b627d0..198f629 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -1,3 +1,5 @@ +from datetime import timedelta + from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.models import User @@ -6,6 +8,7 @@ from django.http import HttpResponse, HttpResponseRedirect from django.views.generic import ListView, DetailView from django.utils import timezone + from subastas.forms import UserForm, AuctionUserForm, ItemForm, AuctionForm, OfferForm, BidForm, ActivationForm, SaleForm from subastas.models import Auction, Offer, AuctionUser @@ -162,6 +165,7 @@ def create_item(request): def auction(request, pk): auction = Auction.objects.get(pk=pk) recharge = False + error = '' if request.method == 'POST': bid_form = BidForm(request.POST, user=request.user, auction=auction) @@ -173,6 +177,7 @@ def auction(request, pk): bid.user.offer_points += 1 bid.user.save() bid.auction.winner = bid.user + bid.auction.end_date += timedelta(minutes=1) bid.auction.save() bid.save() @@ -188,7 +193,6 @@ def auction(request, pk): else: bid_form = BidForm() - error = '' ctx = { 'auction': auction, @@ -238,3 +242,16 @@ def offer(request, pk): } return render(request, 'subastas/offer_detail.html', ctx) + + +@login_required +def recharge(request): + if request.method == 'POST': + auction_user = AuctionUser.objects.get(user=request.user) + points = request.POST.get('points') + auction_user.auction_points += points + auction_user.save() + + return HttpResponseRedirect(reverse('recharge')) + + return render(request, 'subastas/recharge.html') From d415c1d09481c2f2ef9fe3d95f0b8e83b9e32431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sonia=20Mart=C3=ADnez=20Mart=C3=ADn?= Date: Sat, 14 Dec 2013 21:09:40 +0100 Subject: [PATCH 02/34] Added help page (v1) --- .../subastas/static/css/style.css | 41 +++++++++++ .../subastas/templates/subastas/base.html | 5 +- .../subastas/templates/subastas/help.html | 68 +++++++++++++++++++ 3 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 subastasIS2_django/subastas/templates/subastas/help.html diff --git a/subastasIS2_django/subastas/static/css/style.css b/subastasIS2_django/subastas/static/css/style.css index 1a1bc49..a89511c 100644 --- a/subastasIS2_django/subastas/static/css/style.css +++ b/subastasIS2_django/subastas/static/css/style.css @@ -359,10 +359,12 @@ footer width:100%; clear:both; display:block; + text-align: center; text-shadow:none; color:#bcbcbc; margin:0 auto; padding:50px 0 0; + height: 80px; } @@ -670,6 +672,45 @@ textarea#id_item-description { } +/* ///////////////////////////////////::: Ayuda ::://///////////////////////////////////// */ + +.top { + padding-top: 15px; + padding-bottom: 20px; + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; + color: rgba(64, 128, 128, 1); + font-weight:700; + font-style: normal; + font-size:16px; + line-height:21px; + text-shadow:none; +} + +.preg { + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; + font-size:18px; + color:#3b3b3b; + text-shadow:#fff 0 1px 0; + line-height:35px; + font-weight:400; +} + +.lpreg { + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; + font-size:18px; + color:#3b3b3b; + text-shadow:#fff 0 1px 0; + line-height:25px; + font-weight:400; + border:thin solid #e9e9e9; + border-width:0; + margin:0px 10px 20px; + display: block; + } + ul.lpreg { + list-style: square outside none; + } + /* ///////////////////////////////////::: Tablas ::://///////////////////////////////////// */ .list { diff --git a/subastasIS2_django/subastas/templates/subastas/base.html b/subastasIS2_django/subastas/templates/subastas/base.html index 7336fa6..5b965d4 100644 --- a/subastasIS2_django/subastas/templates/subastas/base.html +++ b/subastasIS2_django/subastas/templates/subastas/base.html @@ -10,6 +10,7 @@ +
@@ -53,8 +54,8 @@
{% block content %}{% endblock %}
- -
+
+

Copyright 2013 Ingeniería del Software II, Facultad de Informática, UPM

diff --git a/subastasIS2_django/subastas/templates/subastas/help.html b/subastasIS2_django/subastas/templates/subastas/help.html new file mode 100644 index 0000000..d3b969e --- /dev/null +++ b/subastasIS2_django/subastas/templates/subastas/help.html @@ -0,0 +1,68 @@ +{% extends "subastas/base.html" %} + +{% block title %}JDLS|Ayuda{% endblock %} + +{% block content %} + +
+
+

F.A.Q.

+

En esta página encontrarás respuesta a las preguntas más frecuentes que podrías plantearte al usar El Juego de la Subasta.

+
+ +
+

¿Qué es El Juego de la Subasta?

+

El Juego de la Subasta es un portal de adquisición de productos a través de la red. Usando nuestro sistema de puntos podrás participar en subastas y conseguir productos con las mejores ofertas.

+

Volver arriba

+
+
+

¿En qué consiste El Juego de la Subasta?

+

El Juego de la Subasta consiste en lo siguiente: o bien el adminsitrador o una serie de usuarios con permisos especiales pondrán objetos a subastar o con ofertas para que se compren. Gracias a los puntos de subasta podrás pujar en las mismas y ser el ganador de estos objetos. Además, con los puntos de oferta que obtengas podrás comprar los productos ofertados.

+

Volver arriba

+
+
+

¿Cómo me registro?

+

En la parte superior derecha de la web podrás encontrar el enlace que te lleva a la página de registro. Allí, introduce tus datos y se te enviará un correo para que confirmes tu cuenta. Cuando lo hagas, ya tendrás cuenta en El Juego de la Subasta.

+

Volver arriba

+
+
+

¿Cómo verifico mi cuenta?

+

Una vez te registres se enviará al correo que hayas facilitado durante el mismo un enlace para que entres y te identifiques en el sistema. Una vez hecho esto tu cuenta ya estará activa y podrás empezar a participar en El Juego de la Subasta.

+

Volver arriba

+
+
+

¿Puedo poner objetos a subastar?

+

Tanto para poder subtastar objetos como para crear ofertas debes tener una cuenta de usuario con permisos especiales. Ese tipo de usuarios se denominan usuarios internos.

+

Volver arriba

+
+
+

¿Puedo crear ofertas?

+

Tanto para poder subtastar objetos como para crear ofertas debes tener una cuenta de usuario con permisos especiales. Ese tipo de usuarios se denominan usuarios internos.

+

Volver arriba

+
+
+

¿Qué son los puntos?

+

Los puntos son el sistema de pago de El Juego de la Subasta. Hay dos tipos de puntos: de subasta (PS) y de oferta (PO). Como su propio nombre indica, los puntos de subasta se usan para obtener productos en subastas y los puntos de oferta para comprar productos en oferta.

+

Volver arriba

+
+
+

¿Cómo consigo puntos?

+

Los puntos de subasta (PS) tienes que comprarlos mientras que los de oferta (PO) sólo los obtendrás mediante tu participación en subastas. Por cada vez que pujes por un producto obtendrás un punto de oferta (y perderás uno de subasta). Para comprar puntos de subasta entra en la página de recarga de puntos que encontrarás o bien en tu perfil de usuario o bien a través del link situado en el banner superior de la web.

+

Volver arriba

+
+
+ +{% endblock %} From 6d30e6363ed48a8540e6ff8c81ce538a47b4dd3f Mon Sep 17 00:00:00 2001 From: Garinoth Date: Sat, 14 Dec 2013 21:16:43 +0100 Subject: [PATCH 03/34] Add help url and view --- subastasIS2_django/subastas/urls.py | 1 + subastasIS2_django/subastas/views.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/subastasIS2_django/subastas/urls.py b/subastasIS2_django/subastas/urls.py index a518ffd..6d11b0e 100644 --- a/subastasIS2_django/subastas/urls.py +++ b/subastasIS2_django/subastas/urls.py @@ -19,5 +19,6 @@ url(r'^offers/$', login_required(views.ListOffersView.as_view()), name='offers'), url(r'^offers/(?P\d+)/$', views.offer, name='offer_detail'), url(r'^recharge/$', views.recharge, name='recharge'), + url(r'^help/$', views.help, name='help'), (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 198f629..11de9f3 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -39,6 +39,10 @@ def index(request): return render(request, 'subastas/index.html') +def help(request): + return render(request, 'subastas/help.html') + + @login_required def test(request): context = {} From 30fcabea275287888de7487ce96c45b0310924a8 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Sat, 14 Dec 2013 21:31:29 +0100 Subject: [PATCH 04/34] Remove subastas tag from the urls --- subastasIS2_django/subastas/urls.py | 2 +- subastasIS2_django/subastasIS2_django/urls.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/subastasIS2_django/subastas/urls.py b/subastasIS2_django/subastas/urls.py index 6d11b0e..db303cd 100644 --- a/subastasIS2_django/subastas/urls.py +++ b/subastasIS2_django/subastas/urls.py @@ -7,6 +7,7 @@ urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^test/$', views.ListUsersView.as_view(), name='test'), + url(r'^help/$', views.help, name='help'), url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'subastas/login.html'}, name='login'), url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': 'index'}, name='logout'), url(r'^register/$', views.register_user, name='register'), @@ -19,6 +20,5 @@ url(r'^offers/$', login_required(views.ListOffersView.as_view()), name='offers'), url(r'^offers/(?P\d+)/$', views.offer, name='offer_detail'), url(r'^recharge/$', views.recharge, name='recharge'), - url(r'^help/$', views.help, name='help'), (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) diff --git a/subastasIS2_django/subastasIS2_django/urls.py b/subastasIS2_django/subastasIS2_django/urls.py index 2e19077..da7e894 100644 --- a/subastasIS2_django/subastasIS2_django/urls.py +++ b/subastasIS2_django/subastasIS2_django/urls.py @@ -5,8 +5,6 @@ admin.autodiscover() urlpatterns = patterns('', - # url(r'^$', 'subastasIS2_django.views.home', name='home'), - url(r'^$', RedirectView.as_view(url='/subastas/')), + url(r'^', include('subastas.urls')), url(r'^admin/', include(admin.site.urls)), - url(r'^subastas/', include('subastas.urls')), ) From e0c4538b49e14a8f2689931b64c19b5b4d2a1075 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Sat, 14 Dec 2013 21:38:59 +0100 Subject: [PATCH 05/34] Fix activation url to match heroku --- .../subastas/templates/subastas/activation_email.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subastasIS2_django/subastas/templates/subastas/activation_email.txt b/subastasIS2_django/subastas/templates/subastas/activation_email.txt index bae3454..4192834 100644 --- a/subastasIS2_django/subastas/templates/subastas/activation_email.txt +++ b/subastasIS2_django/subastas/templates/subastas/activation_email.txt @@ -1,4 +1,4 @@ Bienvenido a El Juego de la Subasta {{ username }}, Haga click en el siguiente link para activar su cuenta: -http://localhost:8000/subastas/activation/{{ activation_key }} \ No newline at end of file +http://juegodelasubasta.herokuapp.com/activation/{{ activation_key }} \ No newline at end of file From 4781759854127041dbd80c1dca83093d2c386b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sonia=20Mart=C3=ADnez=20Mart=C3=ADn?= Date: Mon, 16 Dec 2013 01:59:37 +0100 Subject: [PATCH 06/34] Added points in base template and help link --- subastasIS2_django/subastas/static/css/style.css | 8 ++++++++ subastasIS2_django/subastas/templates/subastas/base.html | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/subastasIS2_django/subastas/static/css/style.css b/subastasIS2_django/subastas/static/css/style.css index a89511c..600933d 100644 --- a/subastasIS2_django/subastas/static/css/style.css +++ b/subastasIS2_django/subastas/static/css/style.css @@ -326,6 +326,10 @@ nav.navegacion_principal ul li a:hover, #aitem a:hover width: 450px; } +.points { + font-size: 12px; +} + /* ::: Inicio ::: */ @@ -375,6 +379,10 @@ footer padding-left: 10px; } +#help { + margin: -20px; +} + .required { color: red; } diff --git a/subastasIS2_django/subastas/templates/subastas/base.html b/subastasIS2_django/subastas/templates/subastas/base.html index 5b965d4..a9df0a0 100644 --- a/subastasIS2_django/subastas/templates/subastas/base.html +++ b/subastasIS2_django/subastas/templates/subastas/base.html @@ -4,6 +4,7 @@ {% load staticfiles %} + {% block title %}JDLS{% endblock %} @@ -46,6 +47,11 @@ @@ -59,6 +65,9 @@

Copyright 2013 Ingeniería del Software II, Facultad de Informática, UPM

+
+ Ayuda +
From e528f97f77ea700067efde03d249861f1875b0e8 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Mon, 16 Dec 2013 10:28:47 +0100 Subject: [PATCH 07/34] Add basic search functionality (needs polish and finishing) --- .../django_simple_search/__init__.py | 0 .../django_simple_search/models.py | 1 + .../django_simple_search/tests.py | 117 ++++++++++++++++++ .../django_simple_search/utils.py | 49 ++++++++ .../django_simple_search/views.py | 1 + .../subastas/templates/subastas/base.html | 4 +- .../templates/subastas/search_results.html | 12 ++ subastasIS2_django/subastas/urls.py | 1 + subastasIS2_django/subastas/views.py | 24 +++- .../subastasIS2_django/settings.py | 1 + 10 files changed, 206 insertions(+), 4 deletions(-) create mode 100644 subastasIS2_django/django_simple_search/__init__.py create mode 100644 subastasIS2_django/django_simple_search/models.py create mode 100644 subastasIS2_django/django_simple_search/tests.py create mode 100644 subastasIS2_django/django_simple_search/utils.py create mode 100644 subastasIS2_django/django_simple_search/views.py create mode 100644 subastasIS2_django/subastas/templates/subastas/search_results.html diff --git a/subastasIS2_django/django_simple_search/__init__.py b/subastasIS2_django/django_simple_search/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/subastasIS2_django/django_simple_search/models.py b/subastasIS2_django/django_simple_search/models.py new file mode 100644 index 0000000..c93ebbe --- /dev/null +++ b/subastasIS2_django/django_simple_search/models.py @@ -0,0 +1 @@ +# this file has been intentionally left blank \ No newline at end of file diff --git a/subastasIS2_django/django_simple_search/tests.py b/subastasIS2_django/django_simple_search/tests.py new file mode 100644 index 0000000..3c82082 --- /dev/null +++ b/subastasIS2_django/django_simple_search/tests.py @@ -0,0 +1,117 @@ + +from django.db import models +from django.test import TestCase,TransactionTestCase +from utils import * + +class NormalizeTest(TestCase): + def test_normalize(self): + """ + tests to normalize the query + """ + self.assertEquals( + normalize_query(' some random words "with quotes " and spaces'), + ['some', 'random', 'words', 'with quotes', 'and', 'spaces'] + ) + + self.assertEquals( + normalize_query(' adsf add a & and a | "for good%measure"'), + ['adsf','add','a','&','and','a','|',"for good%measure"] + ) + + def test_empty_string(self, ): + """ + """ + self.assertEquals(normalize_query(""),[]) + +class BuildQueryTest(TestCase): + + def test_find_items_in_database(self, ): + """ + test to find the items based on fields + """ + + query = build_query("now is the time",['name','description']) + + self.assertEquals(len(query),4) + + self.assertEquals( + str(query), + "(AND: (OR: ('name__icontains', 'now'), ('description__icontains', 'now')), (OR: ('name__icontains', 'is'), ('description__icontains', 'is')), (OR: ('name__icontains', 'the'), ('description__icontains', 'the')), (OR: ('name__icontains', 'time'), ('description__icontains', 'time')))" + ) + + +class GenericSearchTest(TransactionTestCase): + """ + """ + + def setUp(self, ): + + self.entry=Entry.objects.get_or_create(name="Now", description="is the time")[0] + + Entry.objects.get_or_create(name="Item 2",description="do we have time?") + + self.freds = [ + Entry.objects.get_or_create(name="Is",description="fred flintstone")[0], + Entry.objects.get_or_create(name="barney rubble",description="fred's neighbor")[0], + ] + + + def test_generic_query(self, ): + """ + """ + + request = MockRequest({"q":"now is the time"}) + + result = generic_search(request,Entry,["name","description"]) + + self.assertEquals(list(result), + [self.entry,] + ) + + def test_multiple_records(self, ): + """ + """ + request = MockRequest({"q":"fred"}) + + + result = generic_search(request,Entry,["name","description"]) + + self.assertEquals(list(result), + self.freds + ) + + def test_empty_query_returns_all(self,): + """ + """ + + request = MockRequest({}) + + + result = generic_search(request,Entry,["name","description"]) + + self.assertEquals(set(result), + set(Entry.objects.all()) + ) + + + + + +class MockRequest(object): + + def __init__(self, get_params): + """ + """ + self.GET=get_params + + +class Entry(models.Model): + + name=models.CharField(max_length=50) + description=models.TextField() + + def __unicode__(self, ): + """ + """ + return self.name + diff --git a/subastasIS2_django/django_simple_search/utils.py b/subastasIS2_django/django_simple_search/utils.py new file mode 100644 index 0000000..fdb537f --- /dev/null +++ b/subastasIS2_django/django_simple_search/utils.py @@ -0,0 +1,49 @@ +import re + +from django.db.models import Q + +def normalize_query(query_string, + findterms=re.compile(r'"([^"]+)"|(\S+)').findall, + normspace=re.compile(r'\s{2,}').sub): + + return [normspace(' ', (t[0] or t[1]).strip()) for t in findterms(query_string)] + + +def build_query(query_string, search_fields): + ''' Returns a query, that is a combination of Q objects. That combination + aims to search keywords within a model by testing the given search fields. + + ''' + query = None # Query to search for every search term + terms = normalize_query(query_string) + for term in terms: + or_query = None # Query to search for a given term in each field + for field_name in search_fields: + q = Q(**{"%s__icontains" % field_name: term}) + + if or_query: + or_query = or_query |q + else: + or_query = q + + + if query: + query = query & or_query + else: + query = or_query + return query + +def generic_search(request,model,fields,query_param="q" ): + """ + """ + + query_string = request.GET.get(query_param,"").strip() + + if not query_string: + return model.objects.all() + + entry_query = build_query(query_string, fields) + + found_entries = model.objects.filter(entry_query) + + return found_entries diff --git a/subastasIS2_django/django_simple_search/views.py b/subastasIS2_django/django_simple_search/views.py new file mode 100644 index 0000000..60f00ef --- /dev/null +++ b/subastasIS2_django/django_simple_search/views.py @@ -0,0 +1 @@ +# Create your views here. diff --git a/subastasIS2_django/subastas/templates/subastas/base.html b/subastasIS2_django/subastas/templates/subastas/base.html index 5b965d4..82d2160 100644 --- a/subastasIS2_django/subastas/templates/subastas/base.html +++ b/subastasIS2_django/subastas/templates/subastas/base.html @@ -16,9 +16,9 @@
-
+ - +
diff --git a/subastasIS2_django/subastas/templates/subastas/search_results.html b/subastasIS2_django/subastas/templates/subastas/search_results.html new file mode 100644 index 0000000..5a3d9e0 --- /dev/null +++ b/subastasIS2_django/subastas/templates/subastas/search_results.html @@ -0,0 +1,12 @@ +{% extends "subastas/base.html" %} + +{% block title %}JDLS|Contacts{% endblock %} + +{% block content %} + +You searched for "{{ search_string }}" and the results are listed below. + + +
  • {{ objects }}}
  • +Cheers and enjoy! +{% endblock %} \ No newline at end of file diff --git a/subastasIS2_django/subastas/urls.py b/subastasIS2_django/subastas/urls.py index db303cd..aaf738d 100644 --- a/subastasIS2_django/subastas/urls.py +++ b/subastasIS2_django/subastas/urls.py @@ -8,6 +8,7 @@ url(r'^$', views.index, name='index'), url(r'^test/$', views.ListUsersView.as_view(), name='test'), url(r'^help/$', views.help, name='help'), + url(r'^search/$', views.search, name='search'), url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'subastas/login.html'}, name='login'), url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': 'index'}, name='logout'), url(r'^register/$', views.register_user, name='register'), diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 11de9f3..9702180 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -4,13 +4,15 @@ from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.models import User from django.core.urlresolvers import reverse -from django.shortcuts import render +from django.shortcuts import render, render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.views.generic import ListView, DetailView from django.utils import timezone from subastas.forms import UserForm, AuctionUserForm, ItemForm, AuctionForm, OfferForm, BidForm, ActivationForm, SaleForm -from subastas.models import Auction, Offer, AuctionUser +from subastas.models import Auction, Offer, AuctionUser, Item + +from django_simple_search.utils import generic_search class ListUsersView(ListView): @@ -259,3 +261,21 @@ def recharge(request): return HttpResponseRedirect(reverse('recharge')) return render(request, 'subastas/recharge.html') + + +@login_required +def search(request): + QUERY = "searchField" + MODEL_MAP = {Item: ["name"]} + + objects = [] + + for model, fields in MODEL_MAP.iteritems(): + objects += generic_search(request, model, fields, QUERY) + + # auction = Item.objects.select_related('auction').get(pk=objects[0].pk) + + return render_to_response("subastas/search_results.html", + {"objects": objects, + "search_string": request.GET.get(QUERY, ""), + }) diff --git a/subastasIS2_django/subastasIS2_django/settings.py b/subastasIS2_django/subastasIS2_django/settings.py index e15c06b..d3456a4 100644 --- a/subastasIS2_django/subastasIS2_django/settings.py +++ b/subastasIS2_django/subastasIS2_django/settings.py @@ -47,6 +47,7 @@ 'django.contrib.messages', 'django.contrib.staticfiles', 'subastas', + 'django_simple_search', ) MIDDLEWARE_CLASSES = ( From 255979318ab78ba0076a85cf149714da95b437ca Mon Sep 17 00:00:00 2001 From: Inmakia Date: Mon, 16 Dec 2013 11:40:12 +0100 Subject: [PATCH 08/34] Added some minor changes to the stylesheet and recharge first version template --- .../subastas/static/css/style.css | 6 ++-- .../subastas/templates/subastas/recharge.html | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 subastasIS2_django/subastas/templates/subastas/recharge.html diff --git a/subastasIS2_django/subastas/static/css/style.css b/subastasIS2_django/subastas/static/css/style.css index 600933d..71225d3 100644 --- a/subastasIS2_django/subastas/static/css/style.css +++ b/subastasIS2_django/subastas/static/css/style.css @@ -1,4 +1,4 @@ -html, body, div, span, h1, h2, h3, h4, h5, h6, p, img, strong, ul, li, article, footer, header, nav, section +fhtml, body, div, span, h1, h2, h3, h4, h5, h6, p, img, strong, ul, li, article, footer, header, nav, section { margin: 0; padding: 0; @@ -132,10 +132,12 @@ td { .button { padding: 5px; + padding-bottom: 0; + position: relative; + top: 12px; border: 0; border-radius: 20px; background: #BCBCBC; - margin-bottom: -15px; margin-left: 3px; margin-right: 3px; font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; diff --git a/subastasIS2_django/subastas/templates/subastas/recharge.html b/subastasIS2_django/subastas/templates/subastas/recharge.html new file mode 100644 index 0000000..6c81170 --- /dev/null +++ b/subastasIS2_django/subastas/templates/subastas/recharge.html @@ -0,0 +1,33 @@ +{% extends "subastas/base.html" %} + +{% block title %}JDLS|Recarga {% endblock %} + +{% block content %} +
    +

    Recarga de puntos

    +

    Selecciona el pack de puntos que quieres e introduce tu tarjeta de crédito para comprar los puntos de subasta seleccionados.

    +
    +
    + {% csrf_token %} + + {% for field in user_form.visible_fields %} +
    +
    + {% if field.errors %} + {% endif %} + + {% if field.label_tag == user_form.confirm_password.label_tag %} + + {% endif %} + {% endfor %} + {% for field in auction_user_form.visible_fields %} + {% if field.label_tag != auction_user_form.tos.label_tag %} +
    +
    + {% if field.errors %}{% endif %} + + {% endif %} + {% endfor %} +
    {{ field }}{% for err in field.errors %}{{ err }}{% endfor %}
    {{ field.field.help_text }}
    {{ field }}{% for err in field.errors %}{{ err }}{% endfor %}
    + +{% endblock %} \ No newline at end of file From f6bceefaf94806fc6755e34c6ee5966a5d8507e5 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Mon, 16 Dec 2013 12:12:05 +0100 Subject: [PATCH 09/34] Fix some details from merge to prepare for next stage --- .../subastas/templates/subastas/auction_detail.html | 2 +- subastasIS2_django/subastas/templates/subastas/base.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subastasIS2_django/subastas/templates/subastas/auction_detail.html b/subastasIS2_django/subastas/templates/subastas/auction_detail.html index 5b756aa..cbeb3b9 100644 --- a/subastasIS2_django/subastas/templates/subastas/auction_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/auction_detail.html @@ -10,7 +10,7 @@

    ¡Oops!

    {% if recharge %}

    No tienes suficientes puntos de subasta para pujar por este producto. Antes de continuar debes recargar tus puntos.

    - + {% else %}

    {{ error }}

    diff --git a/subastasIS2_django/subastas/templates/subastas/base.html b/subastasIS2_django/subastas/templates/subastas/base.html index 302b6e9..bc3219c 100644 --- a/subastasIS2_django/subastas/templates/subastas/base.html +++ b/subastasIS2_django/subastas/templates/subastas/base.html @@ -48,8 +48,8 @@ {% endif %} -{% if offer.end_date >= now %} - {% if offer.sold %} +{% if offer.sold %} +
    Este producto ha sido comprado por {{ offer.winner }} @@ -40,42 +40,60 @@

    ¡Oops!

    - {% else %} -
    -
    - -
    -
    -
    Días
    -
    Horas
    -
    Min
    -
    Seg
    -
    -
    + Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} + {% csrf_token %} +
    +

    {{ offer.item.name }}

    -
    -
    -
    - - {% endif %} + {% else %} + +
    - Esta oferta ha expirado + +
    +
    +
    Días
    +
    Horas
    +
    Min
    +
    Seg
    +
    +
    - -{% endif %} + Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} - {% csrf_token %} - + {% csrf_token %} +

    {{ offer.item.name }}

    +
    +{% endif %} + + +
    @@ -120,6 +138,14 @@

    {{ offer.item.name }}

    } function ended(){ + {% if offer.sold %} + $('#offersold').show(); + $('#offercronohide').hide(); + {% else %} + $('#offersold').hide(); + $('#offercronohide').show(); + {% endif %} + $('#offercronoshow').hide(); alert('Esta oferta ha expirado'); } @@ -133,6 +159,7 @@

    {{ offer.item.name }}

    digitWidth: 30, digitHeight: 43, image: "{% static 'images/digits2.png' %}", + timerEnd: ended }); diff --git a/subastasIS2_django/subastas/templates/subastas/search_results.html b/subastasIS2_django/subastas/templates/subastas/search_results.html index 7c225bb..75a8661 100644 --- a/subastasIS2_django/subastas/templates/subastas/search_results.html +++ b/subastasIS2_django/subastas/templates/subastas/search_results.html @@ -3,6 +3,7 @@ {% block title %}JDLS|Resultados de búsqueda{% endblock %} {% block content %} +{% if objects %}

    Resultados de la búsqueda

    A continuación se muestra la lista de los resultados a la búsqueda realizada: "{{ search_string }}"

    @@ -38,5 +39,11 @@

    Resultados de la búsqueda

    {% endfor %} +{% else %} +
    +

    Resultados de la búsqueda

    +

    No se ha encontrado ningún resultado para la búsqueda realizada: "{{ search_string }}"

    +
    +{% endif %} {% endblock %} \ No newline at end of file From d136898c8ba75d9fffc66617076d3d8380fdc199 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Wed, 18 Dec 2013 11:02:41 +0100 Subject: [PATCH 19/34] Add succesful polling version on auctions --- .../templates/subastas/auction_detail.html | 82 +++++++++++++++---- subastasIS2_django/subastas/urls.py | 1 + subastasIS2_django/subastas/views.py | 36 +++++++- 3 files changed, 101 insertions(+), 18 deletions(-) diff --git a/subastasIS2_django/subastas/templates/subastas/auction_detail.html b/subastasIS2_django/subastas/templates/subastas/auction_detail.html index ee96d89..276339e 100644 --- a/subastasIS2_django/subastas/templates/subastas/auction_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/auction_detail.html @@ -37,7 +37,7 @@

    ¡Oops!

    - Dueño actual: {{ auction.winner.user.username }} + Dueño actual: {{ auction.winner.user.username }} {% else %}
    @@ -84,9 +84,9 @@

    {{ auction.item.name }}

    } - function use_time_difference(){ - finish = new Date({{ auction.end_date.year }}, {{ auction.end_date.month }}, {{ auction.end_date.day }}, {{ auction.end_date.hour }}, {{ auction.end_date.minute }}, {{ auction.end_date.second }}); - dateCurrent = new Date({{ now.year }}, {{ now.month }}, {{ now.day }}, {{ now.hour }}, {{ now.minute }}, {{ now.second }}); + function use_time_difference(end_date, now){ + finish = new Date(end_date.year, end_date.month, end_date.day, end_date.hour, end_date.minute, end_date.second); + dateCurrent = new Date(now.year, now.month, now.day, now.hour, now.minute, now.second) if (finish > dateCurrent){ oDiff = get_time_difference(dateCurrent, finish); } @@ -100,17 +100,69 @@

    {{ auction.item.name }}

    time = days + ":" + hours + ":" + minutes + ":" + seconds; } - use_time_difference(); - {% load static %} - $('#counter').countdown({ - stepTime: 60, - format: 'dd:hh:mm:ss', - startTime: time, - digitImages: 6, - digitWidth: 30, - digitHeight: 43, - image: "{% static 'images/digits2.png' %}" - }); + + var startCounter = function( end_date, now ) { + use_time_difference(end_date, now); + {% load static %} + $('#counter').countdown({ + stepTime: 60, + format: 'dd:hh:mm:ss', + startTime: time, + digitImages: 6, + digitWidth: 30, + digitHeight: 43, + image: "{% static 'images/digits2.png' %}" + }); + } + + var restartCounter = function(end_date, now) { + $('#counter').html(''); + startCounter(end_date, now); + } + + var end_date = { + "year": {{ auction.end_date.year }}, + "month": {{ auction.end_date.month }}, + "day": {{ auction.end_date.day }}, + "hour": {{ auction.end_date.hour }}, + "minute": {{ auction.end_date.minute }}, + "second": {{ auction.end_date.second }}, + } + + var now = { + "year": {{ now.year }}, + "month": {{ now.month }}, + "day": {{ now.day }}, + "hour": {{ now.hour }}, + "minute": {{ now.minute }}, + "second": {{ now.second }}, + } + + startCounter(end_date, now); + var update = function(){ + $.getJSON("{% url 'poll_auction' %}", { "pk": "{{ auction.pk }}" }, function(a) { + $("#winner").html(a.winner); + time_change = false; + for (var k in a.end_date) { + if (a.end_date.hasOwnProperty(k)){ + if (a.end_date[k] != end_date[k]) { + time_change = true; + } + } + } + + if (time_change) { + end_date = a.end_date; + now = a.now; + restartCounter(end_date, now); + } + }); + } + + + + setInterval(update, 1000); + {% endblock %} diff --git a/subastasIS2_django/subastas/urls.py b/subastasIS2_django/subastas/urls.py index a796af0..a4c10a6 100644 --- a/subastasIS2_django/subastas/urls.py +++ b/subastasIS2_django/subastas/urls.py @@ -22,5 +22,6 @@ url(r'^offers/(?P\d+)/$', views.offer, name='offer_detail'), url(r'^recharge/$', views.recharge, name='recharge'), url(r'^success/$', views.success, name='success'), + url(r'^poll_auction/$', views.poll_auction, name='poll_auction'), (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 75b1193..08736ae 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -7,7 +7,7 @@ from django.shortcuts import render, render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.views.generic import ListView, DetailView -from django.utils import timezone +from django.utils import timezone, simplejson as json from subastas.forms import UserForm, AuctionUserForm, ItemForm, AuctionForm, OfferForm, BidForm, ActivationForm, SaleForm from subastas.models import Auction, Offer, AuctionUser, Item @@ -44,6 +44,7 @@ def index(request): def help(request): return render(request, 'subastas/help.html') + def success(request): return render(request, 'subastas/sale_successful.html') @@ -276,9 +277,38 @@ def search(request): for model, fields in MODEL_MAP.iteritems(): objects += generic_search(request, model, fields, QUERY) - # auction = Item.objects.select_related('auction').get(pk=objects[0].pk) - return render_to_response("subastas/search_results.html", {"objects": objects, "search_string": request.GET.get(QUERY, ""), }) + +@login_required +def poll_auction(request): + auction = Auction.objects.get(pk=request.GET["pk"]) + + end_date = { + "year": auction.end_date.year, + "month": auction.end_date.month, + "day": auction.end_date.day, + "hour": auction.end_date.hour, + "minute": auction.end_date.minute, + "second": auction.end_date.second, + } + + n = timezone.now() + now = { + "year": n.year, + "month": n.month, + "day": n.day, + "hour": n.hour, + "minute": n.minute, + "second": n.second, + } + + res = { "winner": auction.winner.user.username, + "winner_id": auction.winner.user.pk, + "end_date": end_date, + "now": now, + } + + return HttpResponse(json.dumps(res)) From a35efc6ab0570e4d71a7e4f8f0f523a66755b9cd Mon Sep 17 00:00:00 2001 From: Inmakia Date: Wed, 18 Dec 2013 13:14:33 +0100 Subject: [PATCH 20/34] Fixed some style issues --- .../subastas/static/css/style.css | 75 ++++++++++++------- .../templates/subastas/auction_detail.html | 2 +- .../templates/subastas/offer_detail.html | 2 +- .../subastas/templates/subastas/profile.html | 17 +++++ 4 files changed, 69 insertions(+), 27 deletions(-) create mode 100644 subastasIS2_django/subastas/templates/subastas/profile.html diff --git a/subastasIS2_django/subastas/static/css/style.css b/subastasIS2_django/subastas/static/css/style.css index 55c3455..4a37b2d 100644 --- a/subastasIS2_django/subastas/static/css/style.css +++ b/subastasIS2_django/subastas/static/css/style.css @@ -10,18 +10,27 @@ html, body, div, span, h1, h2, h3, h4, h5, h6, p, img, strong, ul, li, article, article, footer, header, nav, section { - display: block + display: block; } body { - font:13px/1.231 sans-serif; *font-size:small + font:13px/1.231 sans-serif; *font-size:small; } html { - background:#3b3b3b; - overflow-y: scroll + background:#f4f4f4; + overflow: scroll; +} + +html, body { + width: 100%; + height: 100%; + min-height: 100%; + height: auto !important; + + } article @@ -31,29 +40,29 @@ article a, a:hover, a:active { - outline: none + outline: none; } ul { - margin-left: 2em + margin-left: 2em; } nav ul, nav li { margin: 0; list-style:none; - list-style-image: none + list-style-image: none; } strong { - font-weight: 700 + font-weight: 700; } a:link { - -webkit-tap-highlight-color: #a7dbd8 + -webkit-tap-highlight-color: #a7dbd8; } body @@ -65,8 +74,6 @@ body line-height:21px; color:#424242; text-shadow:#fff 0 1px 0; - width: 100%; - height: 100%; } h1, h2, h3, h4, h5, h6 @@ -77,13 +84,13 @@ h1, h2, h3, h4, h5, h6 a, a:active, a:visited { color: #3299bb; - text-decoration:none + text-decoration:none; } a:hover { color: #424242; - text-decoration:underline + text-decoration:underline; } td { @@ -104,10 +111,10 @@ td { .fila { width: 100%; - max-width: 1800px; + max-width: 1950px; min-width: 755px; margin: 0 auto; - overflow: hidden + overflow: hidden; } .busqueda @@ -226,7 +233,6 @@ h2 body { background:#f4f4f4; - height:auto } a.logo_principal @@ -255,7 +261,7 @@ nav.navegacion_principal font-weight:400; border:thin solid #e9e9e9; border-width:0 0 0 1px; - margin:20px 10px 0; + margin:20px 20px 0; } nav.right @@ -337,7 +343,7 @@ nav.navegacion_principal ul li a:hover, #aitem a:hover float: right; text-shadow: none; color: #bcbcbc; - margin-right: 25px; + margin-right: 35px; margin-top: 5px; } @@ -370,19 +376,38 @@ nav.navegacion_principal ul li a:hover, #aitem a:hover /* ::: Footer ::: */ +html { + position: relative; + min-height: 100%; +} + +#page-wrap { + margin: 0 0 80px; +} + +#page-wrap:after { + width: 100%; + height: 80px; + display: block; + clear: both; +} footer { + padding:50px 0 0; + height: 80px; background:#424242; - width:100%; - clear:both; - display:block; text-align: center; - text-shadow:none; color:#bcbcbc; - margin:0 auto; - padding:50px 0 0; - height: 80px; + text-shadow:none; + overflow: hidden; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + max-width: 1920px; + min-width: 755px; + margin: 0 auto; } diff --git a/subastasIS2_django/subastas/templates/subastas/auction_detail.html b/subastasIS2_django/subastas/templates/subastas/auction_detail.html index 0aa18a8..ed82cfe 100644 --- a/subastasIS2_django/subastas/templates/subastas/auction_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/auction_detail.html @@ -65,7 +65,7 @@

    {{ auction.item.name }}

    - +

    Descripción: {{ auction.item.description }}

    Categoría: {{ auction.item.category }}

    diff --git a/subastasIS2_django/subastas/templates/subastas/offer_detail.html b/subastasIS2_django/subastas/templates/subastas/offer_detail.html index cda7cb8..5e10fad 100644 --- a/subastasIS2_django/subastas/templates/subastas/offer_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/offer_detail.html @@ -95,7 +95,7 @@

    {{ offer.item.name }}

    - +

    Descripción: {{ offer.item.description }}

    Categoría: {{ offer.item.category }}

    diff --git a/subastasIS2_django/subastas/templates/subastas/profile.html b/subastasIS2_django/subastas/templates/subastas/profile.html new file mode 100644 index 0000000..eb7d758 --- /dev/null +++ b/subastasIS2_django/subastas/templates/subastas/profile.html @@ -0,0 +1,17 @@ +{% extends "subastas/base.html" %} + +{% block title %}JDLS|Perfil {% endblock %} + +{% block content %} + +
    +

    Perfil de usuario

    +
    + +
      +
    • Descripción personal:
    • +
    • Intereses:
    • +
    • Productos que le gustaría adquirir:
    • +
    + +{% endblock %} \ No newline at end of file From c384cab8b433f5b123afbf583a104f63c2cb7ff7 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Wed, 18 Dec 2013 13:17:28 +0100 Subject: [PATCH 21/34] Try to fix offers first version --- .../templates/subastas/auction_detail.html | 3 +-- .../templates/subastas/offer_detail.html | 25 +++++++++++++++++++ subastasIS2_django/subastas/urls.py | 1 + subastasIS2_django/subastas/views.py | 16 ++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/subastasIS2_django/subastas/templates/subastas/auction_detail.html b/subastasIS2_django/subastas/templates/subastas/auction_detail.html index 276339e..c714b77 100644 --- a/subastasIS2_django/subastas/templates/subastas/auction_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/auction_detail.html @@ -142,6 +142,7 @@

    {{ auction.item.name }}

    var update = function(){ $.getJSON("{% url 'poll_auction' %}", { "pk": "{{ auction.pk }}" }, function(a) { $("#winner").html(a.winner); + time_change = false; for (var k in a.end_date) { if (a.end_date.hasOwnProperty(k)){ @@ -159,8 +160,6 @@

    {{ auction.item.name }}

    }); } - - setInterval(update, 1000); diff --git a/subastasIS2_django/subastas/templates/subastas/offer_detail.html b/subastasIS2_django/subastas/templates/subastas/offer_detail.html index 9b7f6cd..bf9d266 100644 --- a/subastasIS2_django/subastas/templates/subastas/offer_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/offer_detail.html @@ -29,6 +29,16 @@

    ¡Oops!

    {% endif %} + + {% if offer.end_date >= now %} {% if offer.sold %}
    @@ -134,6 +144,21 @@

    {{ offer.item.name }}

    digitHeight: 43, image: "{% static 'images/digits2.png' %}", }); + + run_once = true; + var update = function(){ + $.getJSON("{% url 'poll_offer' %}", { "pk": "{{ offer.pk }}" }, function(a) { + if (run_once){ + if ((a.sold == 'true') && (a.winner != {{ user.username }})) { + $("#sold").show(); + } + run_once = false; + } + }); + } + + setInterval(update, 1000); + {% endblock %} \ No newline at end of file diff --git a/subastasIS2_django/subastas/urls.py b/subastasIS2_django/subastas/urls.py index a4c10a6..72f09e5 100644 --- a/subastasIS2_django/subastas/urls.py +++ b/subastasIS2_django/subastas/urls.py @@ -23,5 +23,6 @@ url(r'^recharge/$', views.recharge, name='recharge'), url(r'^success/$', views.success, name='success'), url(r'^poll_auction/$', views.poll_auction, name='poll_auction'), + url(r'^poll_offer/$', views.poll_offer, name='poll_offer'), (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 08736ae..b5f4e35 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -312,3 +312,19 @@ def poll_auction(request): } return HttpResponse(json.dumps(res)) + + +@login_required +def poll_offer(request): + offer = Offer.objects.get(pk=request.GET["pk"]) + + sold = 'false' + if offer.sold: + sold = 'true' + + res = { "winner": offer.winner.user.username, + "winner_id": offer.winner.user.pk, + "sold": sold, + } + + return HttpResponse(json.dumps(res)) \ No newline at end of file From bfc66b2f5ed47945da388eeb54de15697f07f1a4 Mon Sep 17 00:00:00 2001 From: Inmakia Date: Wed, 18 Dec 2013 15:43:49 +0100 Subject: [PATCH 22/34] Profile unfinished template done --- .../subastas/static/css/style.css | 5 ++++ .../subastas/templates/subastas/profile.html | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/subastasIS2_django/subastas/static/css/style.css b/subastasIS2_django/subastas/static/css/style.css index 4a37b2d..7523b19 100644 --- a/subastasIS2_django/subastas/static/css/style.css +++ b/subastasIS2_django/subastas/static/css/style.css @@ -408,6 +408,7 @@ footer max-width: 1920px; min-width: 755px; margin: 0 auto; + overflow: hidden; } @@ -1212,4 +1213,8 @@ h2.error { #tosb { margin-top: 30px; +} + +#boffers { + width: 100px; } \ No newline at end of file diff --git a/subastasIS2_django/subastas/templates/subastas/profile.html b/subastasIS2_django/subastas/templates/subastas/profile.html index eb7d758..631a1c2 100644 --- a/subastasIS2_django/subastas/templates/subastas/profile.html +++ b/subastasIS2_django/subastas/templates/subastas/profile.html @@ -13,5 +13,30 @@

    Perfil de usuario

  • Intereses:
  • Productos que le gustaría adquirir:
  • + + {% csrf_token %} + +
    +
    + {% if field.errors %} + {% endif %} + + {% if field.label_tag == user_form.confirm_password.label_tag %} + + {% endif %} + {% endfor %} + {% for field in auction_user_form.visible_fields %} + {% if field.label_tag != auction_user_form.tos.label_tag %} +
    +
    + {% if field.errors %}{% endif %} + + {% endif %} +
    {{ field }}{% for err in field.errors %}{{ err }}{% endfor %}
    {{ field.field.help_text }}
    {{ field }}{% for err in field.errors %}{{ err }}{% endfor %}
    +

    {{ auction_user_form.tos }} Acepto los siguientes Términos y condiciones

    {% if auction_user_form.tos.errors %}{% for err in auction_user_form.tos.errors %}{{ err }}{% endfor %}{% endif %} +

    (*) Campos obligatorios

    + + + {% endblock %} \ No newline at end of file From 085f97d1ed8a1e0aa5fb7f905dbbc1a288165719 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Wed, 18 Dec 2013 20:52:38 +0100 Subject: [PATCH 23/34] Add user profiles --- subastasIS2_django/subastas/forms.py | 7 ++++++ subastasIS2_django/subastas/models.py | 3 +++ subastasIS2_django/subastas/urls.py | 1 + subastasIS2_django/subastas/views.py | 32 +++++++++++++++++++++++++++ 4 files changed, 43 insertions(+) diff --git a/subastasIS2_django/subastas/forms.py b/subastasIS2_django/subastas/forms.py index 349e54f..81cf17a 100644 --- a/subastasIS2_django/subastas/forms.py +++ b/subastasIS2_django/subastas/forms.py @@ -325,3 +325,10 @@ def clean(self): ) return self.cleaned_data + + +class UpdateAuctionUserForm(ModelForm): + class Meta: + model = AuctionUser + fields = ['description', + 'interests'] diff --git a/subastasIS2_django/subastas/models.py b/subastasIS2_django/subastas/models.py index 9d3eddf..220e811 100644 --- a/subastasIS2_django/subastas/models.py +++ b/subastasIS2_django/subastas/models.py @@ -23,6 +23,9 @@ class AuctionUser(models.Model): offer_points = models.PositiveIntegerField(default=0) image = models.ImageField(upload_to='profiles/', default='items/noDisponible.jpg', blank=True) + description = models.TextField(blank=True) + interests = models.TextField(blank=True) + activation_key = models.CharField(max_length=40, blank=True) def __unicode__(self): diff --git a/subastasIS2_django/subastas/urls.py b/subastasIS2_django/subastas/urls.py index 72f09e5..6919e37 100644 --- a/subastasIS2_django/subastas/urls.py +++ b/subastasIS2_django/subastas/urls.py @@ -20,6 +20,7 @@ url(r'^auctions/(?P\d+)/$', views.auction, name='auction_detail'), url(r'^offers/$', login_required(views.ListOffersView.as_view()), name='offers'), url(r'^offers/(?P\d+)/$', views.offer, name='offer_detail'), + url(r'^users/(?P\d+)/$', views.user, name='profile'), url(r'^recharge/$', views.recharge, name='recharge'), url(r'^success/$', views.success, name='success'), url(r'^poll_auction/$', views.poll_auction, name='poll_auction'), diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 105910c..5bd3432 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -254,6 +254,38 @@ def offer(request, pk): return render(request, 'subastas/offer_detail.html', ctx) +@login_required +def user(request, pk): + auction_user = AuctionUser.objects.get(pk=pk) + + if request.method == 'POST': + edit_form = SaleForm(request.POST, user=request.user) + if edit_form.is_valid(): + return HttpResponseRedirect(reverse('index')) + + else: + edit_form = UpdateAuctionUserForm() + + bids = Bid.objects.filter(user=auction_user) + auctions_bid = [] + for b in bids: + if not b.auction in auctions_bid: + auctions_bid.append(b.auction) + + auctions_won = Auction.objects.filter(winner=auction_user) + offers_won = Offer.objects.filter(winner=auction_user) + + ctx = { + 'auction_user': auction_user, + 'edit_form': edit_form, + 'auctions_bid': auctions_bid, + 'auctions_won': auctions_won, + 'offers_won': offers_won, + } + + return render(request, 'subastas/profile.html', ctx) + + @login_required def recharge(request): if request.method == 'POST': From ded0b6b32354b166689daf95745f941e7ad0c016 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Wed, 18 Dec 2013 21:18:21 +0100 Subject: [PATCH 24/34] Update forms (specially existing user error) --- subastasIS2_django/subastas/forms.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/subastasIS2_django/subastas/forms.py b/subastasIS2_django/subastas/forms.py index 81cf17a..2af656b 100644 --- a/subastasIS2_django/subastas/forms.py +++ b/subastasIS2_django/subastas/forms.py @@ -95,6 +95,18 @@ def clean(self): self._errors['confirm_password'] = [ "Las contraseñas deben coincidir"] + if 'username' in self.cleaned_data: + username = self.cleaned_data.get('username') + if User.objects.get(username=username): + self._errors['username'] = [ + "Este nombre de usuario ya existe"] + + if 'email' in self.cleaned_data: + email = self.cleaned_data.get('email') + if User.objects.get(email=email): + self._errors['email'] = [ + "Este correo electrónico ya existe"] + password = self.cleaned_data.get('password') regex = r'^(?=.*[a-zA-Z])(?=.*\d)(?=.*[-+_!@#$%^&*.,?=]).{6,}$' if password and not re.match(regex, password): From 1d729cf4883e30854e16835c9fd9a3d3a8d44fc2 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Wed, 18 Dec 2013 21:24:38 +0100 Subject: [PATCH 25/34] Fix import --- subastasIS2_django/subastas/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 5bd3432..3755238 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -9,7 +9,7 @@ from django.views.generic import ListView, DetailView from django.utils import timezone, simplejson as json -from subastas.forms import UserForm, AuctionUserForm, ItemForm, AuctionForm, OfferForm, BidForm, ActivationForm, SaleForm +from subastas.forms import UserForm, AuctionUserForm, ItemForm, AuctionForm, OfferForm, BidForm, ActivationForm, SaleForm, UpdateAuctionUserForm from subastas.models import Auction, Offer, AuctionUser, Item, Bid from django_simple_search.utils import generic_search From 00bdb757ac76e1235775a1fcbde4e538fbf3dddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sonia=20Mart=C3=ADnez=20Mart=C3=ADn?= Date: Thu, 19 Dec 2013 00:30:27 +0100 Subject: [PATCH 26/34] Profile and edit profile templates added --- .../subastas/media/items/noImagen.jpg | Bin 0 -> 20989 bytes subastasIS2_django/subastas/models.py | 2 +- .../subastas/static/css/style.css | 24 +++++++ .../subastas/templates/subastas/profile.html | 68 ++++++++++++------ 4 files changed, 71 insertions(+), 23 deletions(-) create mode 100644 subastasIS2_django/subastas/media/items/noImagen.jpg diff --git a/subastasIS2_django/subastas/media/items/noImagen.jpg b/subastasIS2_django/subastas/media/items/noImagen.jpg new file mode 100644 index 0000000000000000000000000000000000000000..39082a5d8f2332f55d4315a550bdb08314b85801 GIT binary patch literal 20989 zcmeHuc|4Tg_xLl5nZa1b7E+CU-*=IH8SB`I3NvGinK8zaQV2x~LyE|nh*Tizz_zn{s6aWA~0Z0fR00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{46PTyS9*d$d^ z*0$WXuvE=TJV?sT+q|W_qFs)`mnJM=guA&3Z&M(lzcmzX>pM_o6P4B=C}Ry35GDb< z^7>J+=nymK*c0d=jS>a-8*p=Kr}x!b(k;aL(|lIGp|Q3RrpIL6T -

    Perfil de usuario

    +

    Perfil de {{usuario}}

    -
      -
    • Descripción personal:
    • -
    • Intereses:
    • -
    • Productos que le gustaría adquirir:
    • -
    -
    +{% if auction_user.user != user %} +
    + + +
    +

    Descripción personal: {{ auction_user.description }}

    +

    Intereses: {{ auction_user.interests }}

    +
    +{% else %} + {% csrf_token %}
    -
    - {% if field.errors %} - {% endif %} + + + +
    +
    + - {% if field.label_tag == user_form.confirm_password.label_tag %} - - {% endif %} - {% endfor %} - {% for field in auction_user_form.visible_fields %} - {% if field.label_tag != auction_user_form.tos.label_tag %}
    -
    - {% if field.errors %}{% endif %} + + - {% endif %}
    {{ field }}{% for err in field.errors %}{{ err }}{% endfor %}{{ auction_user.description }}
    {{ auction_user.image }}
    {{ field.field.help_text }}
    {{ field }}{% for err in field.errors %}{{ err }}{% endfor %}{{ auction_user.interests }}
    -

    {{ auction_user_form.tos }} Acepto los siguientes Términos y condiciones

    {% if auction_user_form.tos.errors %}{% for err in auction_user_form.tos.errors %}{{ err }}{% endfor %}{% endif %} + +{% endif %} + +
    +

    Subastas en las que ha participado: +

      + {% for auction in auctions_bid %} +
    • {{ auction.item.name }}
    • + {% endfor %} +
    -

    (*) Campos obligatorios

    +

    Productos ganados en subastas: +

    - +

    Productos adquiridos por puntos acumulados: +

    +
    + {% csrf_token %} +
    + + {% endblock %} \ No newline at end of file From d29ce208a38db0d1b6901bbac97fce9424cbadc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sonia=20Mart=C3=ADnez=20Mart=C3=ADn?= Date: Thu, 19 Dec 2013 00:35:47 +0100 Subject: [PATCH 27/34] New image added por profiles withouth photo --- .../subastas/media/items/noImage.png | Bin 0 -> 3612 bytes subastasIS2_django/subastas/models.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 subastasIS2_django/subastas/media/items/noImage.png diff --git a/subastasIS2_django/subastas/media/items/noImage.png b/subastasIS2_django/subastas/media/items/noImage.png new file mode 100644 index 0000000000000000000000000000000000000000..2f6e1a196d2d6f49820533f4bec02448b77d8726 GIT binary patch literal 3612 zcmZvfXHXN$9>tL&NGFg`l>`tJLJ$ZdQWOlmC`}@v29PE#Ac;~1qJ$EV-u0qVBM^#6 zRWK+Jr1vTa0@4(ux0ieGyf1Iwhduw@o!Qx)*|T%@N4R66%fTwdN=HY>p|6K9qt!H8 zYiBu2Q&zly3#|wSXd?s6eeMTf9WgF+n$A9G7qGsUqpORVi=*=+zYZ5Q+Tvz?gr)^< zd^LCMwnYzb+XRm?BNG!J1Qs0;9nSTcMM6^JkooXiBv(Gqxd`Ey7-4X>aOL~0tpWXn zBkm8-?zQ!x#T@6>AFY4XZ6B7@mprD9j*d3+MA17@<ke+lo`>vg}iLbjGGixJ_1_lOQ@4O~9=jXmB zh~7Yu&|<)hoSdUib0oYC%oW7XZyXl(!QI>YYPnsL!c22W6{BjvQlh(?TYEA`(s?yp zZ|KSPiWQHHA)|HtHDt+?CubDl@aoH@3#9YIZu>K*`&)$}DxP?4)xgz^<1JZP*|d~( z*L&E^%!_H_gGWb=`+t^`Gcz;E!>?;=M>LMc#>R{rTI1gvkpxdg89lwclxW9PURzr$ zAd$MPuZD8Y?%D2HQ(_YJ+(cZp_YS&qRqx|)I7@n!m07m#q~C|ZRmEnB z>k>2S>QoH>jE`HFPE~TVI7cA47pEGq!$LXNA9kue+N5ak!7cjlx+{j;AWQoD&CJcs zos@*rYU=C9t7~fR^;gOFy14^SGr=G(I)H7{yY!vY7vj;E z^>uG^Q&UHcuoEa6-)|NY5^_Hv0RCZOfOYW%Jej8+WMpfb>+a!Exk0Tn=aF%&7*(UQ zvnsRcu%Vlq7S{SeCim&2u^hppk1PP5btmurzCS$<_VAE4HytvVO}MD~X!G^gR7*?C zg{h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M{AQdT}RN`$726-#4V~o+WojE!YcPuV|DUj!!u~p32H97HSvYpMF zxe}wRT9u~~pvUKUOw9ZP1FzaA{S`U4ic-i^jGDWr=pX>Iu(TXYSWyYGNky9Ya&d8? zj-&AXeTKhvk`mc#^``jqXKd}i^qkypIY~fX;oH@T`PLH2eBax1xUCd Date: Thu, 19 Dec 2013 00:40:11 +0100 Subject: [PATCH 28/34] Fix form --- subastasIS2_django/subastas/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 3755238..3c927b8 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -259,7 +259,7 @@ def user(request, pk): auction_user = AuctionUser.objects.get(pk=pk) if request.method == 'POST': - edit_form = SaleForm(request.POST, user=request.user) + edit_form = UpdateAuctionUserForm(request.POST, instance=auction_user) if edit_form.is_valid(): return HttpResponseRedirect(reverse('index')) From ea1a1d0a51fa3debd12db67ec842c4506a4ac5af Mon Sep 17 00:00:00 2001 From: Garinoth Date: Thu, 19 Dec 2013 11:22:23 +0100 Subject: [PATCH 29/34] Fix some minor bugs --- subastasIS2_django/subastas/forms.py | 4 ++-- .../subastas/media/items/noImagen.jpg | Bin 20989 -> 0 bytes .../media/{items => profiles}/noImage.png | Bin subastasIS2_django/subastas/models.py | 2 +- .../subastas/templates/subastas/profile.html | 4 ++-- 5 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 subastasIS2_django/subastas/media/items/noImagen.jpg rename subastasIS2_django/subastas/media/{items => profiles}/noImage.png (100%) diff --git a/subastasIS2_django/subastas/forms.py b/subastasIS2_django/subastas/forms.py index 2af656b..011a83c 100644 --- a/subastasIS2_django/subastas/forms.py +++ b/subastasIS2_django/subastas/forms.py @@ -97,13 +97,13 @@ def clean(self): if 'username' in self.cleaned_data: username = self.cleaned_data.get('username') - if User.objects.get(username=username): + if User.objects.filter(username=username): self._errors['username'] = [ "Este nombre de usuario ya existe"] if 'email' in self.cleaned_data: email = self.cleaned_data.get('email') - if User.objects.get(email=email): + if User.objects.filter(email=email): self._errors['email'] = [ "Este correo electrónico ya existe"] diff --git a/subastasIS2_django/subastas/media/items/noImagen.jpg b/subastasIS2_django/subastas/media/items/noImagen.jpg deleted file mode 100644 index 39082a5d8f2332f55d4315a550bdb08314b85801..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20989 zcmeHuc|4Tg_xLl5nZa1b7E+CU-*=IH8SB`I3NvGinK8zaQV2x~LyE|nh*Tizz_zn{s6aWA~0Z0fR00SWi_z!@H0&FZ800JOuf5M>$KtSOA2x z_JsiOA9X9hcR#@KEdc;zc~{@2L`nb&iw~yIDUrbxD%RXp2P@|pLMBpTBIN-MHFZq` zbqxb`eXN?Afrh?;wgv#eN+2ukE-wQ>3G}D@yb{M|_XD#2S3e*! zzxM+QS(O1%f&P@u7ri15umRtoMONO+_m>}|y>RB{+wd+2xc^k9|JAeSx0l=RSNp*0wa%0NGS(;-bK_({rBY`qL4YOJS?kd~h zvDj6@|MHC?P-%2fO+3i2NhC!QKsXtM!(!-ECVn1-1p>A+VJLHK1ZbdwAS}#;gH~WA z7S9T7!i0(8WFpAJ)R{^QCoQ# zM*;vG&BW75gkTU>17S4H&BYvq4Z#VA4*Cra_zk9$VnICtz??$eK??~Areoy@@>q3! zeLbuVDJG0Wrz_+A3ETZ?M65X_oa#^B0RSs~X4V4un6|}&M%Gc+*U?edPyx;VGyPlQ zPp*FtFvoU<1F;D?i19d<>&- z0b{@<@C|L==oV-Y zGy)n2O@0KEtM^gt&;5`TPNEP+cUOL2n0e1A&byO*dV+Sp@^M`3`7y) z4B{GM0PzIz5s5^KAQh2DNGGH}l8#J8<|Av7SCNCrXUNYePSggJ2FePx8AV1Vq4H3t zP*+fcsA<$9J1@I5y8*isJCS_{dnS7Ydkgy=_Gj#i92gE+4kHdXj!=$7j-woP9Gx8F z9Pc?fIVCvtIh{E}I1@OJa-QYv=A7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s23*`Gzv6F(?kbBIW^+;-fIGAtEaU=vv^Y-|!Ci9MUB zm!FbfosJfa9dwx%?(3APdSK1bbVmaV$MF?L)Ji(q)_5-ikN2i(y1U{6Hs8WL-dTL4aAHQe=vTLV zD`f3~z!d*I`7+x^1vMGAu+kcb5lAvdqsM!Fh!v(+%EP56{p^9gW#9CY`HF(u6uMAF z5s35Dc*(*8)z}0D$TX)ea65S*`^lLP+1`bvoX@)-nZ%hfnxCe3dzS{*8>e8G0Z)Yk zZD>9HLQPs*iC&4>{kwX4{c@xo&Nv%4!puu|b}t1-d#YupZF`l8tI{46PTyS9*d$d^ z*0$WXuvE=TJV?sT+q|W_qFs)`mnJM=guA&3Z&M(lzcmzX>pM_o6P4B=C}Ry35GDb< z^7>J+=nymK*c0d=jS>a-8*p=Kr}x!b(k;aL(|lIGp|Q3RrpIL6T -

    Perfil de {{usuario}}

    +

    Perfil de {{ auction_user.user.username }}

    {% if auction_user.user != user %} @@ -26,7 +26,7 @@

    Perfil de {{usuario}}

    - {{ auction_user.image }} +
    From 14ad9f6a2a65e0f6ebfc49324d7a9e17275bd545 Mon Sep 17 00:00:00 2001 From: Inmakia Date: Thu, 19 Dec 2013 11:56:16 +0100 Subject: [PATCH 30/34] BUg fixing in profiles --- subastasIS2_django/subastas/forms.py | 18 ++++++++++++++++++ .../subastas/static/css/style.css | 10 +++++----- .../subastas/templates/subastas/base.html | 2 +- .../subastas/templates/subastas/profile.html | 14 +++++++++----- subastasIS2_django/subastas/views.py | 6 ++++-- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/subastasIS2_django/subastas/forms.py b/subastasIS2_django/subastas/forms.py index 011a83c..cd8674c 100644 --- a/subastasIS2_django/subastas/forms.py +++ b/subastasIS2_django/subastas/forms.py @@ -340,7 +340,25 @@ def clean(self): class UpdateAuctionUserForm(ModelForm): + + description = CharField( + widget=Textarea, + max_length=140, + required=False, + ) + + interests = CharField( + widget=Textarea, + max_length=140, + required=False, + ) + + image = ImageField( + required=False, + ) + class Meta: model = AuctionUser fields = ['description', + 'image', 'interests'] diff --git a/subastasIS2_django/subastas/static/css/style.css b/subastasIS2_django/subastas/static/css/style.css index 63561ef..53162b7 100644 --- a/subastasIS2_django/subastas/static/css/style.css +++ b/subastasIS2_django/subastas/static/css/style.css @@ -730,22 +730,22 @@ textarea#id_item-description { /* //////////////////////////////::: Perfil :::////////////////////////////////////*/ -.imgauction { +.imguser, .formuser_pho { vertical-align: middle; - height: 300px; + height: 200px; width: 150px; - max-width: 300px; + max-width: 200px; max-height: 150px; border: solid 1px; margin: 10px; display: table-cell; } -#imageauction { +#imageuser, .formuser_pho { text-align: center; vertical-align: middle; max-width: 150px; - max-height: 300px; + max-height: 200px; } .listas { diff --git a/subastasIS2_django/subastas/templates/subastas/base.html b/subastasIS2_django/subastas/templates/subastas/base.html index 3ded3a7..ff7673c 100644 --- a/subastasIS2_django/subastas/templates/subastas/base.html +++ b/subastasIS2_django/subastas/templates/subastas/base.html @@ -26,7 +26,7 @@ {% if user.is_authenticated %}
    {% else %} -
    + {% csrf_token %}
    - +
    -
    - + +
    - +
    {{ auction_user.description }}{{ edit_form.description }}
    {{ edit_form.image }}
    {{ auction_user.interests }}{{ edit_form.interests }}
    @@ -39,9 +39,13 @@

    Perfil de {{ auction_user.user.username }}

    Subastas en las que ha participado:

      + {% if auctions_bid %} {% for auction in auctions_bid %}
    • {{ auction.item.name }}
    • {% endfor %} + {% else %} +

      EL usuario no ha participado en subastas

      + {% endif %}

    Productos ganados en subastas: diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 3c927b8..87bf0f5 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -259,9 +259,11 @@ def user(request, pk): auction_user = AuctionUser.objects.get(pk=pk) if request.method == 'POST': - edit_form = UpdateAuctionUserForm(request.POST, instance=auction_user) + edit_form = UpdateAuctionUserForm(request.POST, request.FILES, instance=auction_user) if edit_form.is_valid(): - return HttpResponseRedirect(reverse('index')) + edit_form.save() + + return HttpResponseRedirect(reverse('profile', kwargs={'pk': pk})) else: edit_form = UpdateAuctionUserForm() From 3fba80a5812f5253e5b6511b012706d91dbfc39f Mon Sep 17 00:00:00 2001 From: Garinoth Date: Thu, 19 Dec 2013 12:13:23 +0100 Subject: [PATCH 31/34] Fix initial form values --- subastasIS2_django/subastas/views.py | 35 +++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/subastasIS2_django/subastas/views.py b/subastasIS2_django/subastas/views.py index 87bf0f5..3e3f3bd 100644 --- a/subastasIS2_django/subastas/views.py +++ b/subastasIS2_django/subastas/views.py @@ -259,14 +259,22 @@ def user(request, pk): auction_user = AuctionUser.objects.get(pk=pk) if request.method == 'POST': - edit_form = UpdateAuctionUserForm(request.POST, request.FILES, instance=auction_user) + edit_form = UpdateAuctionUserForm(request.POST, request.FILES, + instance=auction_user, + initial={ + 'description': auction_user.description, + 'interests': auction_user.interests} + ) if edit_form.is_valid(): edit_form.save() return HttpResponseRedirect(reverse('profile', kwargs={'pk': pk})) else: - edit_form = UpdateAuctionUserForm() + edit_form = UpdateAuctionUserForm(initial={ + 'description': auction_user.description, + 'interests': auction_user.interests} + ) bids = Bid.objects.filter(user=auction_user) auctions_bid = [] @@ -316,6 +324,7 @@ def search(request): "search_string": request.GET.get(QUERY, ""), }) + @login_required def poll_auction(request): auction = Auction.objects.get(pk=request.GET["pk"]) @@ -340,12 +349,12 @@ def poll_auction(request): "second": n.second, } - res = { "winner": auction.winner.user.username, - "winner_id": auction.winner.user.pk, - "bids": bids, - "end_date": end_date, - "now": now, - } + res = {"winner": auction.winner.user.username, + "winner_id": auction.winner.user.pk, + "bids": bids, + "end_date": end_date, + "now": now, + } return HttpResponse(json.dumps(res)) @@ -358,9 +367,9 @@ def poll_offer(request): if offer.sold: sold = 'true' - res = { "winner": offer.winner.user.username, - "winner_id": offer.winner.user.pk, - "sold": sold, - } + res = {"winner": offer.winner.user.username, + "winner_id": offer.winner.user.pk, + "sold": sold, + } - return HttpResponse(json.dumps(res)) \ No newline at end of file + return HttpResponse(json.dumps(res)) From 04a041538b06c90438d7c50c9b2de67dc5309e5b Mon Sep 17 00:00:00 2001 From: Inmakia Date: Thu, 19 Dec 2013 13:50:19 +0100 Subject: [PATCH 32/34] Added correct styles to the user profiles --- .../subastas/static/css/style.css | 92 +++++++++++++++++-- .../subastas/templates/subastas/profile.html | 44 +++++---- 2 files changed, 112 insertions(+), 24 deletions(-) diff --git a/subastasIS2_django/subastas/static/css/style.css b/subastasIS2_django/subastas/static/css/style.css index 53162b7..3360964 100644 --- a/subastasIS2_django/subastas/static/css/style.css +++ b/subastasIS2_django/subastas/static/css/style.css @@ -297,10 +297,15 @@ nav.navegacion_principal ul li a:hover, #aitem a:hover text-decoration:none } -#list { +#list, .profile_list { margin-bottom: 20px; } +.profile_list li { + list-style:none; + list-style-image: none; +} + #aitem { font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; color: rgba(64, 128, 128, 1); @@ -408,6 +413,7 @@ footer max-width: 1920px; min-width: 755px; margin: 0 auto; + margin-top: 20px; overflow: hidden; } @@ -465,6 +471,8 @@ footer .text, #id_auction_user-address, #id_user-last_name, +#id_description, +#id_interests { width: 75%; min-width: 250px; @@ -584,7 +592,9 @@ textarea { #id_item-description, #id_item-category, #id_auction-base_price, -#id_offer-price +#id_offer-price, +#id_description, +#id_interests { display: block; height: 25px; @@ -637,7 +647,10 @@ select { #id_item-category:focus, #id_item-image:focus, #id_auction-base_price:focus, -#id_offer-price:focus { +#id_offer-price:focus, +#id_description:focus, +#id_interests:focus, +#id_image:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); @@ -666,7 +679,9 @@ textarea.form-control { } textarea#id_auction_user-address, -textarea#id_item-description { +textarea#id_item-description, +textarea#id_description, +textarea#id_interests { height: 38px; } @@ -705,7 +720,10 @@ textarea#id_item-description { .form-inline #id_item-category, .form-inline #id_item-image, .form-inline #id_auction-base_price, - .form-inline #id_offer-price + .form-inline #id_offer-price, + .form-inline #id_description, + .form-inline #id_interests, + .form-inline #id_image { display: inline-block; } @@ -748,10 +766,45 @@ textarea#id_item-description { max-height: 200px; } +.formuser_pho { + float: left; +} + .listas { clear: both; + padding-top: 30px; + padding-bottom: 30px; +} + +.end { + margin-bottom: 10px; +} + +.noitems { + margin-left: 40px; + width: 100%; + display: block; +} + +#id_image { + display: inline-block; + float:left; + vertical-align: middle; +} + +td.formuser { + width: 80%; } +td.picuser { + width: 20%; +} + +td#picuser { + width: 50%; + text-align: left; + border: solid 1px; +} /* ///////////////////////////////////::: Ayuda ::://///////////////////////////////////// */ @@ -922,19 +975,46 @@ input[type=number]::-webkit-outer-spin-button { top: -150px; } -.name { +.ptexto{ + display: inline-block; + width: 700px; + position: relative; + left: 160px; + top: -150px; +} + +.name { color: rgba(64, 128, 128, 0.8); font-weight: 700; font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; } +#auctions_bid, #auctions_won, #offers_won { + display: inline-block; + width: 100%; + padding-left: 15px; + margin-bottom: 5px; +} + +.user_description { + display: inline-block; + width: 350px; + padding-left: 35px; +} + .description { display: inline-block; width: 350px; padding-left: 15px; } +.user_category { + display: inline-block; + width: 300px; + padding-left: 35px; +} + .category { display: inline-block; width: 300px; diff --git a/subastasIS2_django/subastas/templates/subastas/profile.html b/subastasIS2_django/subastas/templates/subastas/profile.html index 93b6a74..edb22df 100644 --- a/subastasIS2_django/subastas/templates/subastas/profile.html +++ b/subastasIS2_django/subastas/templates/subastas/profile.html @@ -12,55 +12,63 @@

    Perfil de {{ auction_user.user.username }}

    -
    -

    Descripción personal: {{ auction_user.description }}

    -

    Intereses: {{ auction_user.interests }}

    +
    +

    Descripción personal: {{ auction_user.description }}

    +

    Intereses: {{ auction_user.interests }}

    {% else %} {% csrf_token %}
    -
    - + +
    -
    - + +
    -
    - + +
    {{ edit_form.description }}{{ edit_form.description }}
    {{ edit_form.image }}{{ edit_form.image }}
    {{ edit_form.interests }}{{ edit_form.interests }}
    - + {% endif %}
    -

    Subastas en las que ha participado: -

      +

      Subastas en las que ha participado: {% if auctions_bid %} +

        {% for auction in auctions_bid %}
      • {{ auction.item.name }}
      • {% endfor %} +
      {% else %} -

      EL usuario no ha participado en subastas

      +

      El usuario no ha participado en subastas

      {% endif %} -
    -

    Productos ganados en subastas: -

      +

      Productos ganados en subastas: + {% if auctions_bid %} +

      + {% else %} +

      El usuario no ha ganado ningún producto en una subasta

      + {% endif %} -

      Productos adquiridos por puntos acumulados: -

        +

        Productos adquiridos por puntos acumulados: + {% if offers_won %} +

        + {% else %} +

        El usuario no ha adquirido ningún producto por puntos acumulados

        + {% endif %}
    {% csrf_token %} From 1eba920ec3180fdc0f6bc035714feadbad333c96 Mon Sep 17 00:00:00 2001 From: Garinoth Date: Thu, 19 Dec 2013 13:56:13 +0100 Subject: [PATCH 33/34] Add links to profiles --- .../subastas/templates/subastas/auction_detail.html | 4 ++-- .../subastas/templates/subastas/auctions.html | 2 +- .../subastas/templates/subastas/offer_detail.html | 6 +++--- subastasIS2_django/subastas/templates/subastas/offers.html | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/subastasIS2_django/subastas/templates/subastas/auction_detail.html b/subastasIS2_django/subastas/templates/subastas/auction_detail.html index 6c8c005..f045b08 100644 --- a/subastasIS2_django/subastas/templates/subastas/auction_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/auction_detail.html @@ -37,7 +37,7 @@

    ¡Oops!

    - Dueño actual: {{ auction.winner.user.username }} + Dueño actual: {{ auction.item.owner.user.username }} {% csrf_token %}
    @@ -49,7 +49,7 @@

    {{ auction.item.name }}

    Esta subasta ha finalizado - Ganador: {{ auction.winner.user.username }} + Ganador: {{ auction.item.owner.user.username }} Pujas: X pujas
    diff --git a/subastasIS2_django/subastas/templates/subastas/auctions.html b/subastasIS2_django/subastas/templates/subastas/auctions.html index 82bc8fc..c55687e 100644 --- a/subastasIS2_django/subastas/templates/subastas/auctions.html +++ b/subastasIS2_django/subastas/templates/subastas/auctions.html @@ -18,7 +18,7 @@

    Últimas subastas

    {% for auction in auction_list %} {{ auction.item.name }} - {{ auction.winner.user.username }} + {{ auction.winner.user.username }} {{ auction.end_date }} {% endfor %} diff --git a/subastasIS2_django/subastas/templates/subastas/offer_detail.html b/subastasIS2_django/subastas/templates/subastas/offer_detail.html index 386d429..6fc5100 100644 --- a/subastasIS2_django/subastas/templates/subastas/offer_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/offer_detail.html @@ -52,7 +52,7 @@

    ¡Oops!

    - Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} + Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} {% csrf_token %}
    @@ -79,7 +79,7 @@

    {{ offer.item.name }}

    - Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} + Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} {% csrf_token %}
    @@ -98,7 +98,7 @@

    {{ offer.item.name }}

    - Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} + Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} {% csrf_token %}
    diff --git a/subastasIS2_django/subastas/templates/subastas/offers.html b/subastasIS2_django/subastas/templates/subastas/offers.html index 1584ac5..d71d7bf 100644 --- a/subastasIS2_django/subastas/templates/subastas/offers.html +++ b/subastasIS2_django/subastas/templates/subastas/offers.html @@ -20,7 +20,7 @@

    Últimas ofertas

    {% for offer in offer_list %} {{ offer.item.name }} - {{ offer.item.owner.user.username }} + {{ offer.item.owner.user.username }} {{ offer.price }} {{ offer.end_date }} From a86939a754ce07afdc482efc2191e95066f75aa0 Mon Sep 17 00:00:00 2001 From: Inmakia Date: Thu, 19 Dec 2013 14:14:40 +0100 Subject: [PATCH 34/34] Added notification pop-ups --- .../subastas/static/css/style.css | 10 +++++++++ .../templates/subastas/auction_detail.html | 15 ++++++++++++- .../templates/subastas/offer_detail.html | 22 ++++++++++++++----- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/subastasIS2_django/subastas/static/css/style.css b/subastasIS2_django/subastas/static/css/style.css index 3360964..5d1c9c5 100644 --- a/subastasIS2_django/subastas/static/css/style.css +++ b/subastasIS2_django/subastas/static/css/style.css @@ -949,6 +949,16 @@ input[type=number]::-webkit-outer-spin-button { font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; } +a.winner { + text-decoration: none; + color: red; +} + +a.winner:hover{ + text-decoration: underline; + color: #3299bb; +} + .imgauction { vertical-align: middle; height: 150px; diff --git a/subastasIS2_django/subastas/templates/subastas/auction_detail.html b/subastasIS2_django/subastas/templates/subastas/auction_detail.html index f045b08..00af19a 100644 --- a/subastasIS2_django/subastas/templates/subastas/auction_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/auction_detail.html @@ -19,6 +19,17 @@

    ¡Oops!

    {% endif %} + +
    @@ -179,7 +190,9 @@

    {{ auction.item.name }}

    function ended(){ $('#cronoshow').hide(); $('#cronohide').show(); - alert('La subasta ha acabado. El usuario ganador ha sido '+ winner +' con '+ bids +' pujas.'); + $('#awinner').html(winner); + $('#abids').html(bids); + $('#time_ended').show(); } diff --git a/subastasIS2_django/subastas/templates/subastas/offer_detail.html b/subastasIS2_django/subastas/templates/subastas/offer_detail.html index 6fc5100..68c40a2 100644 --- a/subastasIS2_django/subastas/templates/subastas/offer_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/offer_detail.html @@ -8,13 +8,25 @@

    Lo sentimos

    -

    EL producto ya ha sido adquirido.

    +

    El producto ya ha sido adquirido.

    + + + {% if valid %}
    @@ -52,7 +64,7 @@

    ¡Oops!

    - Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} + Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} {% csrf_token %}
    @@ -79,7 +91,7 @@

    {{ offer.item.name }}

    - Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} + Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} {% csrf_token %}
    @@ -98,7 +110,7 @@

    {{ offer.item.name }}

    - Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} + Dueño: {{ offer.item.owner.user.username }}Precio: {{ offer.price }} {% csrf_token %}
    @@ -158,7 +170,7 @@

    {{ offer.item.name }}

    $('#offercronohide').show(); {% endif %} $('#offercronoshow').hide(); - alert('Esta oferta ha expirado'); + $('#offer_ended').show(); } use_time_difference();