Skip to content

Commit

Permalink
fix #188
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Aug 25, 2024
1 parent cac1faf commit b7b8a48
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0.8 on 2024-08-25 18:30

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('auctions', '0142_club_date_contacted_for_in_person_auctions'),
]

operations = [
migrations.AddField(
model_name='auction',
name='extra_promo_link',
field=models.URLField(blank=True, null=True),
),
migrations.AddField(
model_name='auction',
name='extra_promo_text',
field=models.CharField(blank=True, default='', max_length=50, null=True),
),
]
10 changes: 10 additions & 0 deletions auctions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ class Auction(models.Model):
tax.help_text = 'Added to invoices for all won lots'
advanced_lot_adding = models.BooleanField(default=False)
advanced_lot_adding.help_text = "Show lot number, quantity and description fields when bulk adding lots"
extra_promo_text = models.CharField(max_length=50, default="", blank=True, null=True)
extra_promo_link = models.URLField(blank=True, null=True)

def __str__(self):
result = self.title
Expand Down Expand Up @@ -553,6 +555,14 @@ def auction_type_as_str(self):
return "in person auction with lot delivery to additional locations"
return "unknown auction type"

@property
def template_promo_info(self):
if not self.extra_promo_text:
return ""
if self.extra_promo_link:
return mark_safe(f"<br><a class='magic' href='{self.extra_promo_link}'>{self.extra_promo_text}</a>")
return mark_safe(f"<br><span class='magic'>{self.extra_promo_text}</span>")

@property
def template_date_timestamp(self):
"""For use in all auctions list"""
Expand Down
11 changes: 11 additions & 0 deletions auctions/static/css/auction_site.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,14 @@ a.ad:hover {
.modal-backdrop {
z-index: 1040 !important;
}

.magic {
animation: magic_animation 1s linear infinite .5s;
}

@keyframes magic_animation {
70% {
text-shadow: 0 0 10px rgba(180, 157, 26, 0.907);
}

}
6 changes: 4 additions & 2 deletions auctions/templates/all_auctions.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ <h3>Auctions</h3>
<tr>
<td><a href='/auctions/{{last_auction_used.slug}}'>{{ last_auction_used.title }}</a><br class="d-md-none"><span class='ms-1 badge bg-light text-black'>Your last auction</span>
{{ last_auction_used.template_lot_link_first_column }}
</td>
{{ last_auction_used.template_promo_info }}
</td>
<td>
{{ last_auction_used.template_status }}
{{ last_auction_used.template_date_timestamp }}
Expand All @@ -38,7 +39,8 @@ <h3>Auctions</h3>
{% if not auction.promote_this_auction %}<span class='badge bg-dark'>Not promoted</span>{% endif %}
{% if not location_message and auction.number_of_locations %}<span class='badge bg-primary'>{{ auction.distance | floatformat:0 }} miles from you</span>{% endif %}
{{ auction.template_lot_link_first_column }}
</td>
{{ auction.template_promo_info }}
</td>
<td>
{{ auction.template_status }}
{{ auction.template_date_timestamp }}
Expand Down
9 changes: 0 additions & 9 deletions auctions/templates/promo.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,7 @@
}
}

.magic {
animation: magic_animation 1.5s linear infinite .5s;
}

@keyframes magic_animation {
50% {
text-shadow: 0 0 8px rgba(180, 157, 26, 0.907);
}

}


</style>
Expand Down

0 comments on commit b7b8a48

Please sign in to comment.