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/forms.py b/subastasIS2_django/subastas/forms.py index 349e54f..cd8674c 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.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.filter(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): @@ -325,3 +337,28 @@ def clean(self): ) return self.cleaned_data + + +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/media/profiles/noImage.png b/subastasIS2_django/subastas/media/profiles/noImage.png new file mode 100644 index 0000000..2f6e1a1 Binary files /dev/null and b/subastasIS2_django/subastas/media/profiles/noImage.png differ diff --git a/subastasIS2_django/subastas/models.py b/subastasIS2_django/subastas/models.py index 9d3eddf..a131649 100644 --- a/subastasIS2_django/subastas/models.py +++ b/subastasIS2_django/subastas/models.py @@ -21,7 +21,10 @@ class AuctionUser(models.Model): phone_number = models.CharField(max_length=20, blank=True) auction_points = models.PositiveIntegerField(default=0) offer_points = models.PositiveIntegerField(default=0) - image = models.ImageField(upload_to='profiles/', default='items/noDisponible.jpg', blank=True) + image = models.ImageField(upload_to='profiles/', default='profiles/noImage.png', blank=True) + + description = models.TextField(blank=True) + interests = models.TextField(blank=True) activation_key = models.CharField(max_length=40, blank=True) diff --git a/subastasIS2_django/subastas/static/css/style.css b/subastasIS2_django/subastas/static/css/style.css index 1a1bc49..5d1c9c5 100644 --- a/subastasIS2_django/subastas/static/css/style.css +++ b/subastasIS2_django/subastas/static/css/style.css @@ -1,27 +1,36 @@ html, body, div, span, h1, h2, h3, h4, h5, h6, p, img, strong, ul, li, article, footer, header, nav, section { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; } 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,81 +40,81 @@ 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 + margin: 0; + list-style: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 { - font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; - font-weight:400; - font-style: normal; - font-size:15px; - line-height:21px; - color:#424242; - text-shadow:#fff 0 1px 0; + font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; + font-weight:400; + font-style: normal; + font-size:15px; + line-height:21px; + color:#424242; + text-shadow:#fff 0 1px 0; } h1, h2, h3, h4, h5, h6 { - font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif } a, a:active, a:visited { - color: #3299bb; - text-decoration:none + color: #3299bb; + text-decoration:none; } a:hover { - color: #424242; - text-decoration:underline + color: #424242; + text-decoration:underline; } td { - width: 300px; + width: 300px; } /* ::: Contenido ::: */ .cuerpo { - background:none; - display:block; - margin:0 auto; - clear:both; - padding:0 20px; + background:none; + display:block; + margin:0 auto; + clear:both; + padding:0 20px; } .fila { - width: 100%; - max-width: 1800px; - min-width: 755px; - margin: 0 auto; - overflow: hidden + width: 100%; + max-width: 1950px; + min-width: 755px; + margin: 0 auto; + overflow: hidden; } .busqueda @@ -114,6 +123,8 @@ td { max-width: 500px; margin: 15px; float: left; + position: relative; + top: -10px; } .buscar @@ -123,7 +134,7 @@ td { padding: 5px; padding-left: 15px; padding-right: 15px; - color: #D8D8D8; + color: #8B8888; border: 0; border-radius: 20px; box-shadow: 3px 3px 5px #848484; @@ -132,185 +143,191 @@ td { .button { padding: 5px; - 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; - font-weight:700; + padding-bottom: 0; + position: relative; + top: 12px; + border: 0; + border-radius: 20px; + background: #BCBCBC; + margin-left: 3px; + margin-right: 3px; + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; + font-weight:700; } .button.body { - margin: 10px; - padding: 7px; - padding-left: 15px; - padding-right: 15px; + margin: 10px; + padding: 7px; + padding-left: 15px; + padding-right: 15px; } .button:hover { - background-color: rgba(64, 128, 128, 0.8); + background-color: rgba(64, 128, 128, 0.8); } .primera_columna, .segunda_columna { - margin-right: 3.8%; - float: left; - min-height: 1px; + margin-right: 3.8%; + float: left; + min-height: 1px; } .fila .primera_columna { - width: 48% + width: 48% } .fila .segunda_columna { - width: 22.05% + width: 22.05% } .ultima_columna { - margin-right: 0 + margin-right: 0 } .right { - float:right + float:right } .left { - float:left + float:left } img { - max-width: 100%; - height: auto; + max-width: 100%; + height: auto; } .centrado { - margin:0 auto 50px; - position:relative + margin:0 auto 50px; + position:relative } p { - margin:0 0 30px; + margin:0 0 30px; } h2 { - font-size:21px; - font-weight:700; - color:#3b3b3b; - margin:0 0 30px; + font-size:21px; + font-weight:700; + color:#3b3b3b; + margin:0 0 30px; } .centrado h3 { - margin:0 0 10px; + margin:0 0 10px; } /* ::: Principal ::: */ body { - background:#f4f4f4; - height:auto + background:#f4f4f4; } a.logo_principal { - width:252px; - height:95px; - float:left; - background:transparent url(../../static/images/logo.png) no-repeat 0 0; - cursor:pointer;border:thin solid #424242; - border-width:0 1px 0 0; - text-indent:-9999px; - line-height:0;font-size:0; - text-decoration:none; - margin:9px 20px 9px; - padding:0 30px 0 30px; + width:252px; + height:95px; + float:left; + background:transparent url(../../static/images/logo.png) no-repeat 0 0; + cursor:pointer;border:thin solid #424242; + border-width:0 1px 0 0; + text-indent:-9999px; + line-height:0;font-size:0; + text-decoration:none; + margin:9px 20px 9px; + padding:0 30px 0 30px; } nav.navegacion_principal { - height:42px; - 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; - border:thin solid #e9e9e9; - border-width:0 0 0 1px; - margin:20px 10px 0; + height:42px; + 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; + border:thin solid #e9e9e9; + border-width:0 0 0 1px; + margin:20px 20px 0; } nav.right { - float:right; - border:none; + float:right; + border:none; } nav.navegacion_principal ul li { - clear:right; - float:left; - margin:0 0 0 30px; + clear:right; + float:left; + margin:0 0 0 30px; } nav.right ul li { - clear:right; - float:left; - margin:0 0 0 10px; + clear:right; + float:left; + margin:0 0 0 10px; } nav.navegacion_principal ul li a { - text-decoration:none; - color:#3b3b3b; + text-decoration:none; + color:#3b3b3b; } nav.navegacion_principal ul li a:hover, #aitem a:hover { - color:#bcbcbc; - text-decoration:none + color:#bcbcbc; + text-decoration:none } -#list { - margin-bottom: 20px; +#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); - margin-top: 50px; - margin-right: 30px; - font-weight:700; - font-style: normal; - font-size:16px; - line-height:21px; - text-shadow:none; + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; + color: rgba(64, 128, 128, 1); + margin-top: 30px; + margin-right: -230px; + font-weight:700; + font-style: normal; + font-size:16px; + line-height:21px; + text-shadow:none; } #imagen_principal { - height:450px; - background:#f90; - width:100%; - position:relative; - float:left; - z-index:0; - border:thin solid #0f0f0f; - border-width:0 0 1px; + height:450px; + background:#f90; + width:100%; + position:relative; + float:left; + z-index:0; + border:thin solid #0f0f0f; + border-width:0 0 1px; } #logo { @@ -318,76 +335,119 @@ nav.navegacion_principal ul li a:hover, #aitem a:hover } #content { - padding: 50px; + padding: 50px; } .ptos { - display: inline-block; - width: 450px; + display: inline-block; + width: 450px; } +.points { + font-size: 13px; + float: right; + text-shadow: none; + color: #bcbcbc; + margin-right: 35px; + margin-top: 5px; +} + +.recharge a:hover { + color: #bcbcbc; +} /* ::: Inicio ::: */ .index { - display: inline-block; + display: inline-block; } .index_title { - margin-bottom: 10px; + margin-bottom: 10px; } .index_description { - margin: 10px; + margin: 10px; } .inicio { - margin: 30px; + margin: 30px; } #welcome { - width: 80%; - float: left; + width: 80%; + float: left; } /* ::: 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 { - background:#424242; - width:100%; - clear:both; - display:block; - text-shadow:none; - color:#bcbcbc; - margin:0 auto; - padding:50px 0 0; + padding:50px 0 0; + height: 80px; + background:#424242; + text-align: center; + color:#bcbcbc; + text-shadow:none; + overflow: hidden; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + max-width: 1920px; + min-width: 755px; + margin: 0 auto; + margin-top: 20px; + overflow: hidden; } /* ::: Formularios ::: */ .help { - font-size: 12px; - padding-left: 10px; + font-size: 13px; + padding-left: 10px; +} + +.help a:hover { + color: #bcbcbc; +} + +#help { + margin: -20px; } .required { - color: red; + color: red; } #key { - margin: 10px; - font-size: 12px; + margin: 10px; + font-size: 12px; } .sstext, #id_auction_user-postal_code, #id_auction_user-phone_number { - width: 30%; - min-width: 75px; - max-width: 100px; + width: 30%; + min-width: 75px; + max-width: 100px; } .stext, @@ -403,34 +463,36 @@ footer #id_user-confirm_password, #id_email #id_item-name { - width: 30%; - min-width: 150px; - max-width: 250px; + width: 30%; + min-width: 150px; + max-width: 250px; } .text, #id_auction_user-address, #id_user-last_name, +#id_description, +#id_interests { - width: 75%; - min-width: 250px; - max-width: 500px; + width: 75%; + min-width: 250px; + max-width: 500px; } textarea { - resize: none; + resize: none; } .registro { - margin: 50px; + margin: 50px; } .fregistro { - padding-left: 100px; + padding-left: 100px; } .freg { - padding: 6px; + padding: 6px; } .form-horizontal .control-label, @@ -530,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; @@ -549,12 +613,12 @@ textarea { } select { - border-radius: 7px; - border: 1px solid #cccccc; - height: 25px; - line-height: 1.428571429; - color: #555555; - padding: 1px 3px; + border-radius: 7px; + border: 1px solid #cccccc; + height: 25px; + line-height: 1.428571429; + color: #555555; + padding: 1px 3px; } @@ -583,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); @@ -612,8 +679,10 @@ textarea.form-control { } textarea#id_auction_user-address, -textarea#id_item-description { - height: 38px; +textarea#id_item-description, +textarea#id_description, +textarea#id_interests { + height: 38px; } .form-control-static { @@ -651,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; } @@ -669,159 +741,336 @@ textarea#id_item-description { } } +.radiopoints { + margin-left: 50px; + margin-right: 5px; +} + +/* //////////////////////////////::: Perfil :::////////////////////////////////////*/ + +.imguser, .formuser_pho { + vertical-align: middle; + height: 200px; + width: 150px; + max-width: 200px; + max-height: 150px; + border: solid 1px; + margin: 10px; + display: table-cell; +} + +#imageuser, .formuser_pho { + text-align: center; + vertical-align: middle; + max-width: 150px; + 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 ::://///////////////////////////////////// */ + +.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; + font-weight: 700; + line-height:35px; +} + +.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; +} + +.inputCard { + display: inline-block; + width: 29px; +} + +#creditCard1, #expireMM { + margin-left: 10px; +} + +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +.cc { + margin-top: 35px; + margin-left: 45px; +} + +#expiration { + margin-left: 30px; +} + +.links { + display: inline-block; +} /* ///////////////////////////////////::: Tablas ::://///////////////////////////////////// */ .list { - height: 20px; - font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; + height: 20px; + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; } .list_head, .list_body { - width: 250px; - border-right: 1px solid; - text-align: center; + width: 250px; + border-right: 1px solid; + text-align: center; } .list_head { - height: 30px; + height: 30px; } .list_body { - font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; - font-weight: 400; + font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; + font-weight: 400; } .no_border { - border-right: none; + border-right: none; } +.imageresults { + width: 150px; +} /* /////////////////////////////////////::: Pujas ::://////////////////////////////////////*/ .top_section { - display: inline-block; - width: 330px; - max-width: 330px; - min-width: 330px; - float: right; + display: inline-block; + width: 330px; + max-width: 330px; + min-width: 330px; + float: right; } .bid { - height: 30px; - width: 150px; - text-align: center; - font-size: 18px; - background-color: rgba(64, 128, 128, 0.8); - margin-right: 0; + height: 30px; + width: 150px; + text-align: center; + font-size: 18px; + background-color: rgba(64, 128, 128, 0.8); + margin-right: 0; } .bid:hover { - background-color: rgba(10, 65, 65, 0.8); - color: white; + background-color: rgba(10, 65, 65, 0.8); + color: white; } .bid:disabled { - background-color: rgba(136, 180, 180, 0.8); /*#72C7C7;*/ - color: #424242; + background-color: rgba(181, 204, 204, 0.8); /*#72C7C7;*/ + color: #AAA4A4; } #preowner { - color: black; - font-weight: 400; + color: black; + font-weight: 400; } .owner { - display: inline-block; - clear: right; - padding-right: 15px; - color: red; - font-weight: 700; - font-size: 18px; - font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; + display: inline-block; + clear: right; + padding-right: 15px; + margin-top: 15px; + color: red; + font-weight: 700; + font-size: 18px; + 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; - width: 150px; - border: solid 1px; - margin: 10px; - display: table-cell; + vertical-align: middle; + height: 150px; + width: 150px; + max-width: 150px; + max-height: 150px; + border: solid 1px; + margin: 10px; + display: table-cell; } #imageauction { - text-align: center; - vertical-align: middle; + text-align: center; + vertical-align: middle; + max-width: 150px; + max-height: 150px; } .texto { - display: inline-block; - width: 200px; - position: relative; - left: 160px; - top: -150px; + display: inline-block; + width: 200px; + position: relative; + left: 160px; + top: -150px; +} + +.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; +.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; + display: inline-block; + width: 350px; + padding-left: 15px; +} + +.user_category { + display: inline-block; + width: 300px; + padding-left: 35px; } .category { - display: inline-block; - width: 300px; - padding-left: 15px; + display: inline-block; + width: 300px; + padding-left: 15px; } .auctiontitle { - padding-top: 30px; - display: inline-block; + padding-top: 30px; + display: inline-block; } .actualbid { - padding-right: 15px; - font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; - font-size: 18px; - color: black; + padding-right: 15px; + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; + font-size: 18px; + color: black; + margin-top: 15px; +} +.bold { + font-weight: 700; } - .bold { - font-weight: 700; - } /* /////////////////////////////////::: Cronómetro :::///////////////////////////////////// */ .crono { - font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; - display: inline-block; - margin-right: -10px; - } + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; + display: inline-block; + margin-right: -10px; +} .cntSeparator { -color: #000000; -font-size: 21px; -margin: 10px 5px; + color: #000000; + font-size: 21px; + margin: 10px 5px; } .desc { -margin: 7px 3px; + margin: 7px 3px; } .desc div { -color: #000000; -float: left; -text-align: right; -font-size: 16px; -margin-right: 35px; -width: 50px; + color: #000000; + float: left; + text-align: right; + font-size: 16px; + margin-right: 35px; + width: 50px; } .minseg { @@ -831,242 +1080,255 @@ width: 50px; #seg { margin-left: -4px; } + +.msg { + color: red; + margin-right: 15px; + font-size: 20px; + font-weight: 700; + font-family:Rockwell, 'GeoSlb712MdBTMedium',"Courier Bold", Courier, Georgia, Times, "Times New Roman", serif; +} + /* /////////////////////////////////////::: Errores ::://///////////////////////////////// */ .errorlist { - border: 4px; - border-color: red; + border: 4px; + border-color: red; } h2.error { - margin-bottom: 0; + margin-bottom: 0; } .error { - padding: 15px; + padding: 15px; } .ultimo { - margin-bottom: 10px; + margin-bottom: 10px; } .field_error { - color: red; + color: red; } .error_msg{ - color: red; - margin-left: -70px; + color: red; + margin-left: -70px; } /* /////////////////////////////////////::: Pop-ups :::////////////////////////////////// */ .overlay { - background-color: rgba(0,0,0,0.6); - bottom: 0; - cursor: default; - left: 0; - opacity: 0; - position: fixed; - right: 0; - top: 0; - visibility: hidden; - z-index: 1; - - -webkit-transition: opacity .5s; - -moz-transition: opacity .5s; - -ms-transition: opacity .5s; - -o-transition: opacity .5s; - transition: opacity .5s; + background-color: rgba(0,0,0,0.6); + bottom: 0; + cursor: default; + left: 0; + opacity: 0; + position: fixed; + right: 0; + top: 0; + visibility: hidden; + z-index: 1; + + -webkit-transition: opacity .5s; + -moz-transition: opacity .5s; + -ms-transition: opacity .5s; + -o-transition: opacity .5s; + transition: opacity .5s; } .overlay:target { - visibility: visible; - opacity: 1; + visibility: visible; + opacity: 1; } .logoverlay { - background-color: rgba(0,0,0,0.6); - bottom: 0; - cursor: default; - left: 0; - opacity: 1; - position: fixed; - right: 0; - top: 0; - z-index: 1; - - -webkit-transition: opacity .5s; - -moz-transition: opacity .5s; - -ms-transition: opacity .5s; - -o-transition: opacity .5s; - transition: opacity .5s; + background-color: rgba(0,0,0,0.6); + bottom: 0; + cursor: default; + left: 0; + opacity: 1; + position: fixed; + right: 0; + top: 0; + z-index: 1; + + -webkit-transition: opacity .5s; + -moz-transition: opacity .5s; + -ms-transition: opacity .5s; + -o-transition: opacity .5s; + transition: opacity .5s; } .logoverlay:target { - visibility: visible; - opacity: 1; + visibility: visible; + opacity: 1; } .popup { - background-color: #fff; - border: 3px solid #fff; - display: inline-block; - left: 50%; - opacity: 0; - padding: 30px; - position: fixed; - text-align: justify; - top: 50%; - visibility: hidden; - z-index: 10; - - -webkit-transform: translate(-50%, -50%); - -moz-transform: translate(-50%, -50%); - -ms-transform: translate(-50%, -50%); - -o-transform: translate(-50%, -50%); - transform: translate(-50%, -50%); - - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - -ms-border-radius: 10px; - -o-border-radius: 10px; - border-radius: 10px; - - -webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - -moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - -ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - -o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - - -webkit-transition: opacity .5s, top .5s; - -moz-transition: opacity .5s, top .5s; - -ms-transition: opacity .5s, top .5s; - -o-transition: opacity .5s, top .5s; - transition: opacity .5s, top .5s; + background-color: #fff; + border: 3px solid #fff; + display: inline-block; + left: 50%; + opacity: 0; + padding: 30px; + position: fixed; + text-align: justify; + top: 50%; + visibility: hidden; + z-index: 10; + + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + + -webkit-transition: opacity .5s, top .5s; + -moz-transition: opacity .5s, top .5s; + -ms-transition: opacity .5s, top .5s; + -o-transition: opacity .5s, top .5s; + transition: opacity .5s, top .5s; } .logpopup { - background-color: #fff; - border: 3px solid #fff; - display: inline-block; - left: 50%; - opacity: 1; - padding: 15px; - position: fixed; - text-align: justify; - top: 50%; - z-index: 10; - - -webkit-transform: translate(-50%, -50%); - -moz-transform: translate(-50%, -50%); - -ms-transform: translate(-50%, -50%); - -o-transform: translate(-50%, -50%); - transform: translate(-50%, -50%); - - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - -ms-border-radius: 10px; - -o-border-radius: 10px; - border-radius: 10px; - - -webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - -moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - -ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - -o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; - - -webkit-transition: opacity .5s, top .5s; - -moz-transition: opacity .5s, top .5s; - -ms-transition: opacity .5s, top .5s; - -o-transition: opacity .5s, top .5s; - transition: opacity .5s, top .5s; + background-color: #fff; + border: 3px solid #fff; + display: inline-block; + left: 50%; + opacity: 1; + padding: 15px; + position: fixed; + text-align: justify; + top: 50%; + z-index: 10; + + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + + -webkit-transition: opacity .5s, top .5s; + -moz-transition: opacity .5s, top .5s; + -ms-transition: opacity .5s, top .5s; + -o-transition: opacity .5s, top .5s; + transition: opacity .5s, top .5s; } .overlay:target+.popup { - top: 50%; - opacity: 1; - visibility: visible; + top: 50%; + opacity: 1; + visibility: visible; } .logoverlay:target+.logpopup { - top: 50%; - opacity: 1; - visibility: visible; + top: 50%; + opacity: 1; + visibility: visible; } .button.close { - line-height: 15px; - position: relative; - text-align: center; - text-decoration: none; - padding: 5px; - border: 0; - border-radius: 20px; - background: #BCBCBC; - margin-left: 10px; - margin-right: 10px; - margin-top: 10px; - width: 80px; + line-height: 15px; + position: relative; + text-align: center; + text-decoration: none; + padding: 5px; + border: 0; + border-radius: 20px; + background: #BCBCBC; + margin-left: 10px; + margin-right: 10px; + margin-top: 10px; + width: 80px; } .close { - background-color: rgba(0, 0, 0, 0.8); - height: 30px; - line-height: 30px; - position: fixed; - right: 0; - text-align: center; - text-decoration: none; - top: -15px; - width: 30px; - z-index: 4; - - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - -ms-border-radius: 15px; - -o-border-radius: 15px; - border-radius: 15px; + background-color: rgba(0, 0, 0, 0.8); + height: 30px; + line-height: 30px; + position: fixed; + right: 0; + text-align: center; + text-decoration: none; + top: -15px; + width: 30px; + z-index: 4; + + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + -ms-border-radius: 15px; + -o-border-radius: 15px; + border-radius: 15px; } .close:before { - color: rgba(255, 255, 255, 0.9); - content: "X"; - font-size: 22px; - text-shadow: 0 -1px rgba(0, 0, 0, 0.9); + color: rgba(255, 255, 255, 0.9); + content: "X"; + font-size: 22px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.9); } .close:hover { - background-color: rgba(64, 128, 128, 0.8); + background-color: rgba(64, 128, 128, 0.8); } .popup p, .popup div { - margin-bottom: 10px; + margin-bottom: 10px; } .popup label { - display: inline-block; - text-align: left; - width: 120px; + display: inline-block; + text-align: left; + width: 120px; } .popup input[type="text"], .popup input[type="password"] { - border: 1px solid; - border-color: #999 #ccc #ccc; - margin: 0; - padding: 2px; + border: 1px solid; + border-color: #999 #ccc #ccc; + margin: 0; + padding: 2px; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - -ms-border-radius: 2px; - -o-border-radius: 2px; - border-radius: 2px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; } .popup input[type="text"]:hover, .popup input[type="password"]:hover { - border-color: #555 #888 #888; + border-color: #555 #888 #888; } #tospu { - width: 80%; - height: 80%; - overflow: auto; + width: 80%; + height: 80%; + overflow: auto; } #tosb { - margin-top: 30px; + margin-top: 30px; +} + +#boffers { + width: 100px; } \ No newline at end of file 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 diff --git a/subastasIS2_django/subastas/templates/subastas/auction_detail.html b/subastasIS2_django/subastas/templates/subastas/auction_detail.html index 5b756aa..00af19a 100644 --- a/subastasIS2_django/subastas/templates/subastas/auction_detail.html +++ b/subastasIS2_django/subastas/templates/subastas/auction_detail.html @@ -4,53 +4,86 @@ {% block content %} {% if bid_form.errors %} - -
No tienes suficientes puntos de subasta para pujar por este producto. Antes de continuar debes recargar tus puntos.
- - +No tienes suficientes puntos de subasta para pujar por este producto. Antes de continuar debes recargar tus puntos.
+ + {% else %} -{{ error }}
- - +{{ error }}
+ + {% endif %} -